@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Serif:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --ink: #142238;
  --paper: #FFFFFF;
  --paper-raised: #EEF4FB;
  --aegean: #0D5EAF;
  --aegean-light: #DCEAF9;
  --ochre: #B8862F;
  --ochre-light: #F1E4C6;
  --terracotta: #A8503A;
  --terracotta-light: #F0DED8;
  --line: #D2E1EF;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  max-width: 100vw;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* fâșie decorativă, ecou discret al steagului grecesc — sus de tot, pe toată lățimea */
.flag-stripe {
  height: 10px;
  width: 100%;
  background: repeating-linear-gradient(
    to bottom,
    var(--aegean) 0, var(--aegean) 10%,
    #ffffff 10%, #ffffff 20%
  );
}

.greek { font-family: 'Noto Serif', serif; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
button:disabled { cursor: not-allowed; }

#app { width: 100%; max-width: 100vw; overflow-x: hidden; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; box-sizing: border-box; }
@media (max-width: 540px) { .wrap { padding: 16px 14px 48px; } }

/* ---------- top bar ---------- */
.topbar { margin-bottom: 28px; }
.topbar-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.app-title { font-size: 2rem; font-weight: 700; color: var(--aegean); margin: 0; letter-spacing: 0.015em; }
.streak-badge { font-size: 0.8rem; font-weight: 700; background: var(--ochre-light); color: var(--ochre); padding: 5px 12px; border-radius: 99px; margin-right: auto; margin-left: 14px; white-space: nowrap; }
.app-sub { font-size: 0.85rem; opacity: 0.65; margin: 4px 0 0; }

.nav-btn { font-size: 0.82rem; font-weight: 600; color: var(--aegean); opacity: 0.9; padding: 6px 2px; }
.nav-btn:hover { opacity: 1; }
.nav-btn-sub { font-size: 0.72rem; font-weight: 600; opacity: 0.55; color: var(--ink); padding: 6px 2px; }
.nav-btn-sub:hover { opacity: 1; color: var(--aegean); }
.hidden-file-input { display: none; }

.menu-toggle { font-size: 1.1rem; width: 38px; height: 38px; border-radius: 10px; background: var(--paper-raised); border: 1px solid var(--line); color: var(--aegean); flex-shrink: 0; }
.menu-toggle:hover { background: var(--aegean-light); }
.primary-actions { margin-top: 10px; }

.menu-panel { margin-top: 14px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-raised); display: flex; flex-direction: column; gap: 4px; }
.menu-group { padding: 6px 4px; }
.menu-group:not(:last-child) { border-bottom: 1px solid var(--line); }
.menu-group-title { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.45; padding: 4px 10px; margin: 0; }
.menu-item { display: block; width: 100%; text-align: left; font-size: 0.88rem; font-weight: 500; color: var(--ink); padding: 10px 10px; border-radius: 8px; }
.menu-item:hover { background: var(--aegean-light); color: var(--aegean); }
.menu-item-danger { color: var(--terracotta); opacity: 0.75; font-size: 0.8rem; }
.menu-item-danger:hover { background: var(--terracotta-light); }

.account-area { display: flex; align-items: center; gap: 10px; }
.account-name { font-size: 0.78rem; font-weight: 600; color: var(--ink); opacity: 0.75; }
.google-btn-slot { min-height: 32px; display: flex; align-items: center; }
.account-hint { font-size: 0.7rem; opacity: 0.45; font-style: italic; }
.logout-btn { font-size: 0.72rem; font-weight: 600; color: var(--terracotta); background: var(--terracotta-light); padding: 6px 12px; border-radius: 99px; white-space: nowrap; }
.logout-btn:hover { opacity: 0.85; }

/* ---------- ecran de login (obligatoriu, la pornire) ---------- */
.login-gate { max-width: 380px; margin: 12vh auto 0; text-align: center; }
.login-gate .app-title { font-size: 2.4rem; }
.login-sub { font-size: 0.9rem; opacity: 0.65; line-height: 1.6; margin: 14px 0 30px; }
.login-btn-slot { display: flex; justify-content: center; }
.login-diag { margin-top: 30px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; text-align: left; }
.login-diag-row { font-size: 0.72rem; opacity: 0.55; margin: 4px 0; font-family: monospace; }

@media (max-width: 640px) {
  .topbar-row { gap: 8px 14px; }
  .streak-badge { margin-left: 0; order: 3; }
}

.progress-track { margin-top: 14px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: var(--ochre); border-radius: 99px; transition: width .4s; }
.progress-label { font-size: 0.72rem; opacity: 0.55; margin-top: 6px; }

/* ---------- layout ---------- */
.layout { display: flex; gap: 32px; align-items: flex-start; }
@media (max-width: 760px) { .layout { flex-direction: column; } }

/* ---------- lesson path ---------- */
.path { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.path-scroll { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.path-level-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.path-level-name { font-size: 0.8rem; font-weight: 700; color: var(--aegean); }
.path-level-link { font-size: 0.68rem; opacity: 0.5; white-space: nowrap; }
.path-level-link:hover { opacity: 0.9; }
@media (max-width: 760px) {
  .path { width: 100%; }
  .path-scroll { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; padding-bottom: 6px; }
}

.path-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 9px; border-radius: 10px; flex-shrink: 0; }
.path-item.active { background: var(--aegean-light); }
.path-badge { width: 27px; height: 27px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 600; flex-shrink: 0; background: var(--paper-raised); border: 1px solid var(--line); box-shadow: inset 0 0 0 2px var(--paper); }
.path-item.active .path-badge { background: var(--aegean); color: #fff; border: none; }
.path-badge.done { background: var(--ochre); color: #fff; border: none; }
.path-label { font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.path-item.active .path-label { font-weight: 600; }
.path-item.recap { opacity: 0.9; }
.path-item.recap .path-badge { background: var(--terracotta-light); border-color: var(--terracotta); color: var(--terracotta); }
.path-item.recap.active .path-badge { background: var(--terracotta); color: #fff; }
.path-item.recap .path-badge.done,
.path-item.recap.active .path-badge.done { background: var(--ochre); color: #fff; border: none; }
.path-item.levelexam .path-badge { background: var(--aegean); color: #fff; border: none; font-size: 0.85rem; }
.path-item.levelexam.active .path-badge { background: var(--ochre); }
.path-item.levelexam .path-badge.done { background: var(--ochre); }
.path-item.levelexam .path-label { font-weight: 600; }

/* ---------- content ---------- */
.content { flex: 1; min-width: 0; width: 100%; max-width: 100%; overflow-wrap: break-word; }
.lesson-header { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.lesson-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.lesson-sub { font-size: 0.85rem; opacity: 0.6; margin: 4px 0 0; }
.lesson-time { font-size: 0.75rem; font-weight: 600; color: var(--ochre); margin: 8px 0 0; }

.tabs { display: flex; gap: 20px; margin-top: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-right: 20px; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 500; opacity: 0.55; padding-bottom: 8px; border-bottom: 2px solid transparent; white-space: nowrap; flex-shrink: 0; }
.tab-btn.active { font-weight: 600; color: var(--aegean); opacity: 1; border-bottom-color: var(--aegean); }

.pane { margin-top: 20px; width: 100%; max-width: 100%; box-sizing: border-box; }

/* ---------- lesson sections ---------- */
.section-block { margin-bottom: 22px; width: 100%; max-width: 100%; box-sizing: border-box; }
.section-heading { font-size: 1rem; font-weight: 600; color: var(--aegean); margin: 0 0 6px; }
.section-body { font-size: 0.9rem; line-height: 1.7; max-width: 62ch; margin: 0; text-align: justify; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 760px) { .section-body { max-width: 100%; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.mini-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .03em; opacity: 0.5; font-weight: 600; margin-bottom: 8px; }
.alpha-row { display: flex; align-items: baseline; gap: 8px; font-size: 0.88rem; margin-bottom: 5px; }
.alpha-letter { width: 56px; flex-shrink: 0; font-weight: 600; }
.alpha-meta { opacity: 0.75; }

.vocab-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 8px; }
.vocab-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 0.88rem; }
.vocab-row:nth-child(even) { background: var(--paper-raised); }
.vocab-row:not(:first-child) { border-top: 1px solid var(--line); }
.vocab-gr { font-weight: 600; flex: 1.1; }
.vocab-pron { opacity: 0.55; font-style: italic; flex: 1; }
.vocab-ro { flex: 1; }
.speak-btn { width: 26px; height: 26px; border-radius: 99px; display: flex; align-items: center; justify-content: center; background: var(--aegean-light); color: var(--aegean); flex-shrink: 0; }
.speak-btn:hover { background: var(--aegean); color: #fff; }

.drill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 0; }
.drill-word { font-weight: 600; font-size: 0.95rem; }
.mic-btn { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--ochre-light); color: var(--ochre); white-space: nowrap; }
.mic-btn.listening { background: var(--terracotta); color: #fff; }
.drill-feedback { font-size: 0.78rem; font-weight: 600; }
.drill-feedback.good { color: var(--ochre); }
.drill-feedback.bad { color: var(--terracotta); }

/* ---------- flashcards ---------- */
.box-row { display: flex; gap: 6px; margin-bottom: 20px; }
.box-cell { flex: 1; text-align: center; }
.box-count { font-size: 0.78rem; font-weight: 700; margin-bottom: 4px; }
.box-bar { height: 4px; border-radius: 99px; background: var(--line); }
.box-bar.top { background: var(--ochre); }
.box-caption { font-size: 0.62rem; opacity: 0.5; margin-top: 4px; }

.flip-card { width: 100%; border-radius: 16px; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--paper-raised); border: 1px solid var(--line); text-align: center; }
.flip-front { font-size: 1.9rem; font-weight: 700; color: var(--aegean); }
.flip-pron { font-size: 0.85rem; opacity: 0.55; font-style: italic; }
.flip-back { font-size: 1.3rem; font-weight: 600; }
.flip-hint { font-size: 0.72rem; opacity: 0.4; margin-top: 8px; }

.card-actions { display: flex; gap: 12px; margin-top: 16px; }
.card-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; border-radius: 10px; font-size: 0.85rem; font-weight: 600; }
.card-btn.no { background: var(--terracotta-light); color: var(--terracotta); }
.card-btn.yes { background: var(--ochre-light); color: var(--ochre); }

.deck-progress { text-align: center; font-size: 0.75rem; opacity: 0.45; margin-top: 12px; }
.deck-empty { text-align: center; padding: 56px 0; }
.deck-empty p { font-size: 0.9rem; opacity: 0.6; }

/* ---------- quiz ---------- */
.q-block { margin-bottom: 22px; }
.q-text { font-size: 0.9rem; font-weight: 500; margin-bottom: 8px; }
.q-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 600px) { .q-options { grid-template-columns: 1fr; } }
.q-opt { text-align: left; font-size: 0.86rem; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-raised); }
.q-opt.selected { border-color: var(--aegean); background: var(--aegean-light); }

.submit-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 600; color: #fff; background: var(--aegean); padding: 11px 22px; border-radius: 99px; }
.submit-btn:disabled { opacity: 0.4; }

.result-box { border-radius: 14px; padding: 26px; text-align: center; margin-bottom: 20px; }
.result-box.pass { background: var(--ochre-light); }
.result-box.fail { background: var(--terracotta-light); }
.result-score { font-size: 1.9rem; font-weight: 700; }
.result-msg { font-size: 0.85rem; opacity: 0.75; margin-top: 4px; }
.result-detail { font-size: 0.85rem; margin-bottom: 8px; }
.result-detail .ok { color: var(--ochre); }
.result-detail .no { color: var(--terracotta); }
.retry-btn { font-size: 0.85rem; font-weight: 600; color: #fff; background: var(--aegean); padding: 9px 18px; border-radius: 99px; margin-top: 6px; }
.saved-note { font-size: 0.75rem; color: var(--ochre); font-weight: 600; margin-bottom: 14px; }

/* ---------- dialogue ---------- */
.dlg-title { font-size: 0.8rem; opacity: 0.5; margin-bottom: 16px; }
.dlg-line { background: var(--paper-raised); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.dlg-speaker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .03em; opacity: 0.5; font-weight: 600; margin-bottom: 6px; }
.dlg-gr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dlg-gr { font-size: 1.15rem; font-weight: 600; }
.dlg-ro { font-size: 0.85rem; opacity: 0.6; margin-top: 4px; }

.dlg-choices { display: flex; flex-direction: column; gap: 10px; }
.dlg-choice { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--paper-raised); }
.dlg-choice-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dlg-choice-gr { font-weight: 600; font-size: 0.95rem; }
.dlg-choice-ro { font-size: 0.78rem; opacity: 0.55; margin-top: 2px; }
.dlg-choice-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.pick-btn { font-size: 0.78rem; font-weight: 600; color: #fff; background: var(--aegean); padding: 7px 14px; border-radius: 99px; }
.dlg-end { text-align: center; padding: 30px 0; }
.dlg-end p { font-size: 0.85rem; opacity: 0.6; margin-bottom: 12px; }
.restart-btn { font-size: 0.82rem; font-weight: 600; color: var(--aegean); }

.support-note { font-size: 0.7rem; opacity: 0.45; margin-top: 6px; }

/* ---------- flashcards page ---------- */
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.page-sub { font-size: 0.85rem; opacity: 0.6; margin: 0 0 20px; }
.back-link { font-size: 0.8rem; font-weight: 600; color: var(--aegean); margin-bottom: 18px; display: inline-block; }

.loading { text-align: center; padding: 80px 0; font-size: 0.85rem; opacity: 0.55; }

/* ---------- motiv grecesc (meandru) ---------- */
.greek-key-divider { margin: 4px 0 22px; line-height: 0; }
.greek-key-divider svg { display: block; }

/* ---------- dicționar ---------- */
.dict-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.dict-search { flex: 1; min-width: 200px; font-size: 0.9rem; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink); }
.dict-search:focus { outline: 2px solid var(--aegean); outline-offset: 1px; }
.dict-select { font-size: 0.85rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink); }
.dict-counter { font-size: 0.78rem; opacity: 0.55; margin: 10px 0 16px; }
.dict-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dict-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: 0.88rem; }
.dict-row:nth-child(even) { background: var(--paper-raised); }
.dict-row:not(:first-child) { border-top: 1px solid var(--line); }
.dict-row.learned { background: var(--ochre-light); }
.dict-gr-block { flex: 1.3; display: flex; flex-direction: column; }
.dict-gr { font-weight: 600; }
.dict-pron { font-size: 0.72rem; opacity: 0.5; font-style: italic; }
.dict-ro { flex: 1.3; }
.dict-cat { flex: 1; font-size: 0.72rem; opacity: 0.45; }
.dict-check { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--ochre); cursor: pointer; }
.dict-empty { text-align: center; padding: 40px 0; font-size: 0.85rem; opacity: 0.55; }

/* ---------- greșeli ---------- */
.mistake-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--paper-raised); }
.mistake-q { font-size: 0.88rem; font-weight: 500; margin: 0 0 4px; }
.mistake-yours { font-size: 0.78rem; color: var(--terracotta); margin: 0; }
.mistake-correct { font-size: 0.78rem; color: var(--ochre); margin: 0; }
.mistake-clear { font-size: 0.78rem; font-weight: 600; color: #fff; background: var(--aegean); padding: 8px 14px; border-radius: 99px; flex-shrink: 0; white-space: nowrap; }

/* ---------- cuprins ---------- */
.toc-level { margin-bottom: 26px; }
.toc-level-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.toc-level-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.toc-level-status { font-size: 0.68rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .02em; }
.toc-level-status.live { background: var(--ochre-light); color: var(--ochre); }
.toc-level-status.soon { background: var(--line); color: var(--ink); opacity: 0.6; }
.toc-empty { font-size: 0.85rem; opacity: 0.55; }
.toc-chapter-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.toc-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 16px; font-size: 0.88rem; }
.toc-row:nth-child(even) { background: var(--paper-raised); }
.toc-row:not(:first-child) { border-top: 1px solid var(--line); }
.toc-row.special { background: var(--aegean-light); }
.toc-num { width: 26px; height: 26px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; background: var(--paper); border: 1px solid var(--line); flex-shrink: 0; box-shadow: inset 0 0 0 2px var(--paper-raised); }
.toc-row.done .toc-num { background: var(--ochre); color: #fff; border: none; }
.toc-chapter-title { display: block; font-weight: 600; }
.toc-chapter-sub { display: block; font-size: 0.75rem; opacity: 0.55; margin-top: 1px; }

/* ---------- tastatură greacă ---------- */
.greek-keyboard { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-raised); margin-top: 8px; }
.kb-key { font-family: 'Noto Serif', serif; font-size: 0.92rem; min-width: 32px; padding: 6px 8px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); }
.kb-key:hover { background: var(--aegean-light); }
.kb-space { font-family: 'Inter', sans-serif; font-size: 0.7rem; min-width: 60px; }
.kb-back { font-family: 'Inter', sans-serif; }

/* ---------- conversație live ---------- */
.live-hint { font-size: 0.8rem; opacity: 0.6; margin: 10px 0 16px; }
.live-mic-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.mic-btn-big { font-size: 0.92rem; font-weight: 700; padding: 13px 26px; border-radius: 99px; background: var(--aegean); color: #fff; }
.mic-btn-big.listening { background: var(--terracotta); }

/* ---------- conversație AI ---------- */
.ai-chat-log { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; max-height: 420px; overflow-y: auto; }
.ai-bubble { display: flex; align-items: flex-start; gap: 8px; max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 0.9rem; }
.ai-bubble.bot { align-self: flex-start; background: var(--aegean-light); }
.ai-bubble.user { align-self: flex-end; background: var(--ochre-light); flex-direction: row-reverse; }
.ai-bubble-gr { font-weight: 600; margin: 0; }
.ai-bubble-ro { font-size: 0.78rem; opacity: 0.6; margin: 2px 0 0; }

/* ---------- setări ---------- */
.settings-card { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 20px; background: var(--paper-raised); }
.settings-field { margin: 14px 0; }
.settings-label { display: block; font-size: 0.78rem; font-weight: 600; opacity: 0.65; margin-bottom: 5px; }
.settings-note { font-size: 0.75rem; opacity: 0.55; line-height: 1.5; margin-top: 10px; }
.settings-mode-note { font-size: 0.78rem; font-weight: 600; color: var(--aegean); background: var(--aegean-light); padding: 8px 12px; border-radius: 8px; margin: 4px 0 14px; }
.field-hidden { display: none; }
.settings-range-row { display: flex; align-items: center; gap: 12px; }
.settings-range { flex: 1; accent-color: var(--aegean); }
.settings-range-label { font-size: 0.8rem; font-weight: 600; min-width: 34px; }

.diag-results { margin: 16px 0; }
.diag-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.diag-row:first-child { border-top: none; }
.diag-icon { width: 20px; height: 20px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.diag-row.ok .diag-icon { background: var(--ochre-light); color: var(--ochre); }
.diag-row.warn .diag-icon { background: #F4E7C9; color: #8A6512; }
.diag-row.error .diag-icon { background: var(--terracotta-light); color: var(--terracotta); }
.diag-label { font-size: 0.85rem; font-weight: 600; margin: 0; }
.diag-detail { font-size: 0.78rem; opacity: 0.65; margin: 2px 0 0; }
.diag-log { width: 100%; font-family: monospace; font-size: 0.78rem; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); resize: vertical; }

/* ==========================================================
   RESPONSIVE MOBIL — telefoane, inclusiv ecrane mari (S25 Ultra etc.)
   ========================================================== */
@media (max-width: 540px) {
  .app-title { font-size: 1.6rem; }
  .page-title, .lesson-title { font-size: 1.25rem; }
  .settings-card { padding: 16px; }

  /* rânduri cu mai multe coloane de text — se așează pe două linii, nu se înghesuie */
  .vocab-row, .dict-row {
    flex-wrap: wrap;
    row-gap: 3px;
  }
  .vocab-pron, .vocab-ro, .dict-ro, .dict-cat {
    flex-basis: 100%;
    margin-left: 36px; /* aliniat sub textul grecesc, după butonul de redare */
  }
  .vocab-gr, .dict-gr-block { flex-basis: auto; }

  .mistake-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .mistake-clear { width: 100%; text-align: center; }

  .dlg-choice-actions { flex-wrap: wrap; row-gap: 8px; }

  .live-mic-row { flex-wrap: wrap; }
  .live-mic-row .dict-search { flex-basis: 100%; order: 3; }

  .ai-bubble { max-width: 90%; }

  /* ținte de atins suficient de mari pe ecran tactil */
  .q-opt { padding: 12px 14px; }
  .dict-check { width: 22px; height: 22px; }
  .card-btn { padding: 13px; }
  .toc-row, .dict-row, .vocab-row { padding-top: 12px; padding-bottom: 12px; }

  /* input-urile la minimum 16px, ca să nu declanșeze zoom automat pe mobil */
  .dict-search, .dict-select, .diag-log { font-size: 16px; }
}

/* ---------- notițe ---------- */
.notes-textarea { display: block; width: 100%; max-width: 100%; box-sizing: border-box; font-family: inherit; font-size: 0.92rem; line-height: 1.6; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink); resize: vertical; }
.notes-textarea:focus { outline: 2px solid var(--aegean); outline-offset: 1px; }
.notes-footer { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.notes-status { font-size: 0.75rem; opacity: 0.5; }
.notes-view { box-sizing: border-box; width: 100%; max-width: 100%; background: var(--paper-raised); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-wrap: anywhere; word-break: break-word; }
.notes-view-line { font-size: 0.92rem; line-height: 1.7; margin: 0 0 6px; overflow-wrap: anywhere; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.notes-view-line:last-child { margin-bottom: 0; }
.notes-empty { font-size: 0.85rem; opacity: 0.5; font-style: italic; }

@media (max-width: 540px) {
  .notes-textarea, .notes-view { padding: 12px; font-size: 0.88rem; }
  .notes-footer { flex-direction: column; align-items: stretch; }
  .notes-footer .pick-btn, .notes-footer .nav-btn-sub { width: 100%; text-align: center; padding: 10px 12px; }
  .notes-status { text-align: center; }
}

/* ---------- export PDF (print) ---------- */
#print-notes-container { display: none; }
@media print {
  body > *:not(#print-notes-container) { display: none !important; }
  #print-notes-container { display: block !important; font-family: 'Inter', sans-serif; color: #000; padding: 20px; }
  #print-notes-container h1 { font-family: 'Noto Serif', serif; color: #0D5EAF; }
  #print-notes-container h2 { font-size: 1.05rem; margin-top: 22px; border-bottom: 1px solid #ccc; padding-bottom: 4px; }
}
