/* ------------------------------------------------------------------ *
   demo-popup.css
   The Perev popup, ported (near verbatim) from the extension's
   content/popup.css so the site mockups are the *real* component.
   The only changes: `#rr-popup` → `.rr-popup`, fixed-positioning /
   entrance-animation removed, and the theme variables driven by the
   site's html[data-theme] instead of the extension's .rr-theme-* class.
 * ------------------------------------------------------------------ */

.rr-popup {
  box-sizing: border-box;
  margin: 0;

  --rr-bg: #faf8f4;
  --rr-accent: #b5232c;
  --rr-text: #1e1c1a;
  --rr-muted: #6e6864;
  --rr-border: #b8afa8;
  --rr-word: #1e1c1a;
  --rr-shadow: 0px 0.5px 0.5px rgba(0,0,0,0.08), 0px 2px 3px rgba(0,0,0,0.08), 0px 6px 16px rgba(0,0,0,0.10);

  background: var(--rr-bg);
  color: var(--rr-text);
  border: 1px solid var(--rr-border);
  border-radius: 8px;
  box-shadow: var(--rr-shadow);

  padding: 10px 12px 10px 14px;
  min-width: 180px;
  max-width: 340px;
  width: max-content;

  font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  direction: ltr;
}

html[data-theme='light'] .rr-popup {
  --rr-bg: #faf8f4;
  --rr-accent: #b5232c;
  --rr-text: #1e1c1a;
  --rr-muted: #6e6864;
  --rr-border: #b8afa8;
  --rr-word: #1e1c1a;
  --rr-shadow: 0px 0.5px 0.5px rgba(0,0,0,0.08), 0px 2px 3px rgba(0,0,0,0.08), 0px 6px 16px rgba(0,0,0,0.10);
}

html[data-theme='dark'] .rr-popup {
  --rr-bg: #1e1c1f;
  --rr-accent: #d4956a;
  --rr-text: #e6e1de;
  --rr-muted: #9e9895;
  --rr-border: #5a5460;
  --rr-word: #f0ebe8;
  --rr-shadow: 0px 0.5px 0.5px rgba(0,0,0,0.30), 0px 2px 3px rgba(0,0,0,0.25), 0px 6px 20px rgba(0,0,0,0.40);
}

.rr-popup .rr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  min-width: 0;
}

.rr-popup .rr-head-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.rr-popup .rr-speak {
  flex-shrink: 0;
  margin: 0;
  padding: 0 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0.85;
  border-radius: 4px;
}
.rr-popup .rr-speak:hover { opacity: 1; background: rgba(127, 127, 127, 0.12); }

.rr-popup .rr-word {
  font-size: 20px;
  font-weight: 600;
  color: var(--rr-word);
  letter-spacing: 0.02em;
  margin: 0;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.rr-popup .rr-stressed { color: var(--rr-accent); }

.rr-popup .rr-translit {
  font-size: 13px;
  color: var(--rr-accent);
  font-style: italic;
  margin-bottom: 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.rr-popup .rr-head-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  margin-left: auto;
}

.rr-popup .rr-copy {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--rr-muted);
  padding: 3px 4px;
  border-radius: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  transition: opacity 0.1s, background 0.1s;
}
.rr-popup .rr-copy:hover { opacity: 1; background: rgba(127, 127, 127, 0.12); }

.rr-popup .rr-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.rr-popup .rr-pos {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--rr-muted);
  border: 1px solid var(--rr-border);
  border-radius: 4px;
  padding: 1px 6px;
  max-width: 100%;
  box-sizing: border-box;
}

.rr-popup .rr-freq {
  font-size: 10px;
  color: var(--rr-muted);
  letter-spacing: 0.3px;
  opacity: 0.75;
}

.rr-popup .rr-level {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.4;
}
.rr-popup .rr-level-a1 { background: #d4edda; color: #1a6632; }
.rr-popup .rr-level-a2 { background: #c8e6c9; color: #2e7d32; }
.rr-popup .rr-level-b1 { background: #fff3cd; color: #856404; }
.rr-popup .rr-level-b2 { background: #ffe0b2; color: #7a3a00; }
.rr-popup .rr-level-c1 { background: #ffd0cc; color: #8b1a0a; }
.rr-popup .rr-level-c2 { background: #f8bbd0; color: #7b0028; }

html[data-theme='dark'] .rr-popup .rr-level-a1 { background: #1b3a22; color: #6fcf89; }
html[data-theme='dark'] .rr-popup .rr-level-a2 { background: #1a3520; color: #66bb6a; }
html[data-theme='dark'] .rr-popup .rr-level-b1 { background: #3a2e00; color: #ffd54f; }
html[data-theme='dark'] .rr-popup .rr-level-b2 { background: #3a1e00; color: #ffb74d; }
html[data-theme='dark'] .rr-popup .rr-level-c1 { background: #3a100a; color: #ff8a80; }
html[data-theme='dark'] .rr-popup .rr-level-c2 { background: #380018; color: #f48fb1; }

.rr-popup .rr-aspect {
  font-size: 11.5px;
  color: var(--rr-muted);
  margin-bottom: 6px;
}
.rr-popup .rr-pair-link {
  color: var(--rr-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rr-popup .rr-pair-link:hover { opacity: 0.8; }

/* Tabs */
.rr-popup .rr-tabs {
  display: flex;
  margin: 8px -14px 0 -14px;
  border-bottom: 1px solid var(--rr-border);
}
.rr-popup .rr-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--rr-muted);
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  padding: 5px 14px 6px;
  margin-bottom: -1px;
  line-height: 1;
  transition: color 0.12s, border-color 0.12s;
}
.rr-popup .rr-tab:hover { color: var(--rr-text); }
.rr-popup .rr-tab.rr-tab-active {
  color: var(--rr-text);
  border-bottom-color: var(--rr-accent);
  font-weight: 600;
}

/* Panels */
.rr-popup .rr-panel { padding-top: 8px; }
.rr-popup .rr-panel-hidden { display: none; }

/* Forms tables */
.rr-popup .rr-fs { margin-bottom: 10px; }
.rr-popup .rr-conj-grid { display: flex; gap: 10px; margin-bottom: 6px; }
.rr-popup .rr-conj-grid .rr-fs { flex: 1; min-width: 0; margin-bottom: 0; }
.rr-popup .rr-conj-grid .rr-ft { width: 100%; }
.rr-popup .rr-conj-extras { border-top: 1px solid var(--rr-border); padding-top: 6px; margin-top: 2px; }
.rr-popup .rr-fsh {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--rr-muted);
  margin-bottom: 3px;
}
.rr-popup .rr-ft {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.55;
}
.rr-popup .rr-ft td,
.rr-popup .rr-ft th { padding: 0 4px; text-align: left; }
.rr-popup .rr-ft th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--rr-muted);
  font-weight: normal;
  border-bottom: 1px solid var(--rr-border);
  padding-bottom: 3px;
}
.rr-popup .rr-fc {
  color: var(--rr-muted);
  font-size: 11px;
  white-space: nowrap;
  width: 22%;
  padding-right: 6px;
}
.rr-popup .rr-fta .rr-fc { width: auto; }
.rr-popup .rr-fm { font-size: 12px; margin-top: 5px; color: var(--rr-text); }

.rr-popup .rr-grammar {
  font-size: 11px;
  line-height: 1.35;
  color: var(--rr-muted);
  margin: 0 0 8px 0;
  opacity: 0.92;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.rr-popup .rr-defs {
  font-size: 13.5px;
  color: var(--rr-text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.rr-popup .rr-sep { color: var(--rr-muted); margin-right: 3px; }

.rr-popup .rr-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--rr-border);
  font-size: 11px;
  line-height: 1.4;
}
.rr-popup .rr-links-label { width: 100%; color: var(--rr-muted); margin-bottom: 1px; }
.rr-popup .rr-links a {
  color: var(--rr-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.rr-popup .rr-links a:hover { opacity: 0.8; }

/* Tooltip caret (popup sits below the word → arrow points up).
   A rotated square straddling the top border, so its two visible edges
   carry the exact same 1px border as the rest of the popup contour. */
.rr-popup.rr-below { position: relative; }
.rr-popup.rr-below::after {
  content: '';
  position: absolute;
  top: -6px;
  left: var(--rr-arrow-x, 50%);
  width: 11px;
  height: 11px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--rr-bg);
  border-left: 1px solid var(--rr-border);
  border-top: 1px solid var(--rr-border);
  pointer-events: none;
}

/* ------------------------------------------------------------------ *
   Stage + feature-row layout (site chrome around the real popup)
 * ------------------------------------------------------------------ */

.demo-stage {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 30px 28px 36px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--surface), var(--bg));
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.demo-sentence {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
  margin-bottom: 9px;
}

.rr-demo-highlight {
  border-radius: 2px;
  padding: 0 1px;
  background: rgba(181, 35, 44, 0.10);
  box-shadow: 0 0 0 1px rgba(181, 35, 44, 0.22);
}
html[data-theme='dark'] .rr-demo-highlight {
  background: rgba(212, 149, 106, 0.22);
  box-shadow: 0 0 0 1px rgba(212, 149, 106, 0.18);
}

.feature-rows {
  display: flex;
  flex-direction: column;
  gap: 84px;
}
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.feature-row:nth-child(even) .feature-row__demo { order: -1; }

.feature-row__text .eyebrow { margin-bottom: 12px; }
.feature-row__text h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.feature-row__text p {
  color: var(--muted);
  font-size: 17px;
  max-width: 42ch;
}
.feature-row__text em { color: var(--text); font-style: italic; }

@media (max-width: 860px) {
  .feature-row { grid-template-columns: 1fr; gap: 28px; }
  .feature-row:nth-child(even) .feature-row__demo { order: 0; }
  .feature-rows { gap: 60px; }
}
