/* FluentCrow design system P0 (design package 2026-10-06).
   Loaded after app.css: maps the existing variables to the new roles and restyles the shell,
   landing, onboarding, Today, library, reader and account dialog. New elements use the fc- prefix. */

:root {
  --fc-navy: #073669; --fc-text: #123352; --fc-muted: #66717c; --fc-bg: #faf9f6; --fc-card: #fff; --fc-soft: #f1ede5;
  --fc-line: #e4dfd5; --fc-accent: #e4572e; --fc-accent-soft: #fceee7; --fc-action: #c44925; --fc-accent-text: #ad3b1b;
  --fc-on-accent: #fff; --fc-green: #18705f; --fc-green-soft: #e7f3ed; --fc-blue-soft: #e9f0f7; --fc-rose: #b83b34;
  --fc-shadow: 0 20px 70px #1633530a; --fc-radius: 20px;
  --fc-serif: Georgia, 'Times New Roman', serif; --fc-sans: 'Segoe UI', Arial, sans-serif;
  --fc-featured: #073669; --fc-featured-text: #fff; --fc-featured-muted: #bcd0e1;
  /* existing variables used by app.css */
  --ink: var(--fc-text); --muted: var(--fc-muted); --paper: var(--fc-bg); --white: var(--fc-card); --sky: var(--fc-soft);
  --line: var(--fc-line); --surface: var(--fc-card); --surface-soft: var(--fc-soft); --focus-ring: var(--fc-accent);
}
html[data-theme="dark"] {
  --fc-navy: #a8c9ef; --fc-text: #e6edf6; --fc-muted: #a8b6c7; --fc-bg: #101b29; --fc-card: #18283a; --fc-soft: #213144;
  --fc-line: #34475d; --fc-accent: #ff9876; --fc-accent-soft: #3d2b28; --fc-action: #ff9876; --fc-accent-text: #ff9876;
  --fc-on-accent: #231910; --fc-green: #80d3b6; --fc-green-soft: #203d39; --fc-blue-soft: #243b55; --fc-rose: #ffaba6;
  --fc-shadow: 0 20px 70px #0002; --fc-featured: #1b3a5e; --fc-featured-text: #f3f7fb; --fc-featured-muted: #b9cbe0;
  --ink: var(--fc-text); --muted: var(--fc-muted); --paper: var(--fc-bg); --white: var(--fc-card); --sky: var(--fc-soft); --line: var(--fc-line);
}

/* ---------- base ---------- */
body { background: var(--fc-bg); color: var(--fc-text); font: 15px/1.55 var(--fc-sans); -webkit-font-smoothing: antialiased; }
html[data-theme="dark"] body { background: var(--fc-bg); color: var(--fc-text); }
main h1, .fc-page h1, dialog h2 { font-family: var(--fc-serif); font-weight: 400; letter-spacing: -.03em; color: var(--fc-text); }
main h2 { font-family: var(--fc-serif); font-weight: 400; letter-spacing: -.02em; }
html[data-theme="dark"] main h1, html[data-theme="dark"] main h2 { color: var(--fc-text); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--fc-accent); outline-offset: 4px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.fc-muted { color: var(--fc-muted); }
.fc-small { font-size: 13px; }
.fc-gap { margin-top: 24px; } .fc-gap-sm { margin-top: 12px; }
.fc-row { display: flex; align-items: center; gap: 12px; }
.fc-row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.fc-stack { display: grid; gap: 12px; }
.fc-grid { display: grid; gap: 20px; } .fc-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fc-fullwidth { width: 100%; }
.fc-eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; color: var(--fc-muted); margin-bottom: 16px; }
svg { flex-shrink: 0; }
.fc-icon-button svg, .fc-top svg, .fc-page svg, .fc-landing svg, .fc-start svg, dialog.fc-dialog svg, .fc-bottom-nav svg, .fc-text-button svg, .fc-book-card svg, .fc-continue svg, .button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ---------- buttons ---------- */
.button, a.button, label.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 11px 21px; border-radius: 12px; font: 650 15px/1.3 var(--fc-sans); background: var(--fc-action); color: var(--fc-on-accent); border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: box-shadow .18s, transform .18s, background .18s; box-shadow: none; }
.button:hover { box-shadow: 0 6px 18px #e4572e22; filter: brightness(.98); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary, .button.ghost, html[data-theme="dark"] .button.ghost, html[data-theme="dark"] .button.secondary { background: transparent; color: var(--fc-text); border-color: var(--fc-line); }
.button.secondary:hover, .button.ghost:hover { background: var(--fc-soft); box-shadow: none; }
.fc-text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; color: var(--fc-navy); font: 600 15px/1.3 var(--fc-sans); text-decoration: none; cursor: pointer; }
.fc-text-button:hover { background: var(--fc-soft); }
.fc-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--fc-text); cursor: pointer; }
.fc-icon-button:hover { background: var(--fc-soft); }
.fc-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 7px; font-size: 11px; font-weight: 650; background: var(--fc-soft); color: var(--fc-muted); white-space: nowrap; }
.fc-badge-good { background: var(--fc-green-soft); color: var(--fc-green); }
.fc-lang-code { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: var(--fc-blue-soft); color: var(--fc-navy); border-radius: 11px; font-size: 12px; font-weight: 750; letter-spacing: .03em; flex-shrink: 0; }
.fc-lang-code-large { width: 46px; height: 46px; }
.fc-progress { height: 5px; border-radius: 8px; background: var(--fc-soft); overflow: hidden; }
.fc-progress span { display: block; height: 100%; background: var(--fc-green); border-radius: 8px; }
.fc-card { background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: var(--fc-radius); padding: 26px; }

/* ---------- header ---------- */
.fc-top { position: sticky; top: 0; z-index: 40; background: var(--fc-bg); border-bottom: 1px solid var(--fc-line); box-shadow: none; backdrop-filter: none; }
html[data-theme="dark"] .fc-top { background: var(--fc-bg); border-color: var(--fc-line); }
.fc-top .top-inner { height: 80px; display: flex; align-items: center; gap: 22px; max-width: 1224px; margin: 0 auto; padding: 0 36px; }
.fc-top .brand { width: 150px; flex-shrink: 0; display: flex; }
.fc-top .brand-logo { width: 100%; height: auto; display: block; }
html[data-theme="dark"] .fc-top .brand-logo { filter: brightness(0) invert(.94); }
.fc-lang-switcher { position: relative; }
.fc-lang-pill { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 0; border-radius: 12px; cursor: pointer; font-size: 13px; white-space: nowrap; color: var(--fc-text); }
.fc-lang-pill::-webkit-details-marker { display: none; }
.fc-lang-pill .fc-chevron { width: 18px; height: 18px; }
.fc-lang-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: 320px; background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: 18px; padding: 8px; box-shadow: 0 20px 60px #0733561c; display: grid; gap: 2px; }
.fc-lang-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--fc-text); text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.fc-lang-option:hover { background: var(--fc-soft); }
.fc-lang-option .fc-lang-copy { display: grid; flex: 1; }
.fc-lang-option strong { font-size: 14px; } .fc-lang-option small { font-size: 12px; color: var(--fc-muted); }
.fc-lang-option:not(.is-current) .fc-lang-code { background: var(--fc-soft); color: var(--fc-muted); }
.fc-nav { display: flex; gap: 4px; margin: 0 auto; }
.fc-top .fc-nav button { display: flex; align-items: center; border: 0; border-radius: 10px; padding: 12px 15px; background: transparent; color: var(--fc-muted); font: 600 15px/1.2 var(--fc-sans); cursor: pointer; }
.fc-top .fc-nav button:hover { color: var(--fc-text); background: var(--fc-soft); }
.fc-top .fc-nav button.active { background: var(--fc-blue-soft); color: var(--fc-navy); box-shadow: none; }
.fc-top .fc-nav button { box-shadow: none; min-height: 44px; }
.fc-top .top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.fc-top .account-menu-trigger { width: 40px; height: 40px; border-radius: 50%; background: var(--fc-navy); color: var(--fc-bg); border: 0; }
.fc-top .account-menu-trigger svg { stroke: currentColor; }
html:not(.fc-authenticated) .fc-top .account-menu-wrap { display: none; }
html.fc-authenticated .fc-login-button { display: none; }
.fc-top .account-menu { background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: 16px; box-shadow: 0 20px 60px #0733561c; }
body.fc-is-landing .fc-lang-switcher, body.fc-is-landing .fc-nav { display: none; }
body.fc-is-landing .fc-top .top-inner { justify-content: space-between; }
body.fc-focus .fc-top, body.fc-focus .fc-bottom-nav { display: none; }
.site-breadcrumbs { max-width: 1224px; margin: 0 auto; padding: 18px 36px 0; font-size: 12px; color: var(--fc-muted); }
body.fc-is-landing .site-breadcrumbs, body.fc-focus .site-breadcrumbs, body.fc-no-crumbs .site-breadcrumbs { display: none !important; }
main.shell { max-width: 1224px; padding-left: 36px; padding-right: 36px; }
.fc-bottom-nav { display: none; }

/* ---------- landing ---------- */
.fc-landing { padding-bottom: 0; }
.fc-hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 72px; padding: 64px 0 50px; align-items: center; }
.fc-hero h1 { font: 400 clamp(40px, 4.9vw, 69px)/1.08 var(--fc-serif); letter-spacing: -.045em; max-width: 660px; margin: 0 0 22px; color: var(--fc-text); }
.fc-hero h1 em { color: var(--fc-accent); font-style: normal; }
html[data-theme="dark"] .fc-hero h1 em { color: var(--fc-accent); }
.fc-subtitle { font-size: 16px; max-width: 480px; line-height: 1.7; margin: 0 0 28px; color: var(--fc-muted); }
.fc-choose-title { display: block; font-size: 13px; color: var(--fc-text); }
.fc-language-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.fc-language-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 132px; padding: 14px; border: 1px solid var(--fc-line); border-radius: 14px; background: var(--fc-card); color: var(--fc-text); text-align: left; text-decoration: none; font: inherit; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.fc-language-card .fc-lang-row { display: flex; align-items: center; gap: 8px; }
.fc-language-card strong { font-size: 14px; }
.fc-language-card small { font-size: 11px; color: var(--fc-muted); }
.fc-language-card.is-available { border-color: var(--fc-accent); box-shadow: 0 4px 20px #e4572e0b; }
.fc-language-card.is-available .fc-lang-code { background: var(--fc-accent-soft); color: var(--fc-accent-text); }
.fc-language-card.is-available:hover { transform: translateY(-3px); box-shadow: 0 10px 26px #e4572e16; }
.fc-language-card.is-soon { background: transparent; }
.fc-language-card.is-soon .fc-lang-code { background: var(--fc-soft); color: var(--fc-muted); }
.fc-language-card.is-soon strong { color: var(--fc-muted); }
.fc-language-card.is-soon:hover { background: var(--fc-card); }
.fc-card-arrow { position: absolute; right: 12px; bottom: 13px; color: var(--fc-accent-text); }
.fc-try-reading { margin-top: 8px; padding-left: 10px; }
.fc-demo-scene { position: relative; background: #073669; border-radius: 28px; padding: 36px 26px 26px; min-height: 480px; color: #fff; box-shadow: 0 24px 60px #0736691a; }
.fc-demo-scene::before { content: 'Czytaj.'; position: absolute; right: 20px; top: 20px; font: italic 66px var(--fc-serif); color: #ffffff15; pointer-events: none; }
.fc-demo-eyebrow { color: #c5d5e5; position: relative; }
.fc-demo-paper { position: relative; background: #faf9f6; color: #173552; border-radius: 16px; padding: 29px 26px; box-shadow: 0 12px 30px #0001; min-height: 225px; }
.fc-demo-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #7c8791; margin-bottom: 16px; }
.fc-demo-copy { font: 24px/1.9 var(--fc-serif); margin: 0; color: #173552; }
.fc-token { display: inline; padding: 1px 0; border: 0; background: transparent; color: inherit; font: inherit; border-radius: 4px; cursor: pointer; }
.fc-token:hover, .fc-token.selected { background: #fbe1ce; color: #173552; }
.fc-demo-word { margin-top: 12px; background: #fff; color: #173552; padding: 18px; border-radius: 13px; }
.fc-demo-word p { color: #536372; margin: 4px 0 0; }
.fc-demo-word .fc-word-title { font: 27px var(--fc-serif); }
.fc-demo-word .button { font-size: 13px; min-height: 40px; padding: 7px 12px; background: #c44925; color: #fff; }
.fc-demo-caption { display: flex; gap: 11px; align-items: center; color: #b9cee3; font-size: 12px; margin-top: 24px; }
.fc-landing-section { padding: 54px 0; border-top: 1px solid var(--fc-line); }
.fc-landing-section h2 { font: 400 32px/1.2 var(--fc-serif); margin: 0; color: var(--fc-text); }
.fc-section-title { margin-bottom: 22px; }
.fc-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.fc-step-art { height: 140px; border-radius: 16px; background: var(--fc-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 22px; overflow: hidden; }
.fc-mini-paper { width: 80%; background: var(--fc-card); padding: 22px; border-radius: 12px; box-shadow: var(--fc-shadow); font: 20px var(--fc-serif); color: var(--fc-text); }
.fc-mini-word { color: var(--fc-accent); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.fc-mini-list { font-size: 15px; line-height: 2; }
.fc-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--fc-green-soft); color: var(--fc-green); padding: 10px 22px; border-radius: 30px; font-weight: 600; }
.fc-steps h3 { font: 400 26px var(--fc-serif); margin: 0 0 10px; color: var(--fc-text); }
.fc-steps p { font-size: 14px; color: var(--fc-muted); margin: 0; }
.fc-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 20px; }
.fc-level { background: var(--fc-soft); border-radius: 10px; padding: 11px; text-align: center; font-size: 12px; color: var(--fc-muted); }
.fc-level strong { display: block; margin-bottom: 4px; color: var(--fc-text); }
.fc-level.done { background: var(--fc-green-soft); color: var(--fc-green); }
.fc-level.done strong { color: var(--fc-green); }
.fc-level.current { background: var(--fc-blue-soft); color: var(--fc-navy); outline: 1px solid var(--fc-navy); }
.fc-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 26px 0 42px; border-top: 1px solid var(--fc-line); color: var(--fc-muted); font-size: 12px; }
.fc-footer nav { display: flex; flex-wrap: wrap; gap: 4px; }
.fc-footer .fc-text-button { font-size: 13px; }

/* ---------- pages, Today ---------- */
.fc-page { padding-top: 48px; padding-bottom: 92px; }
.fc-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.fc-title h1 { font: 400 clamp(36px, 4.2vw, 58px)/1.08 var(--fc-serif); letter-spacing: -.045em; margin: 0; }
.fc-title p { margin: 12px 0 0; color: var(--fc-muted); }
.fc-goal { margin-bottom: 26px; font-size: 13px; display: grid; gap: 8px; }
.fc-goal .fc-progress { max-width: 100%; }
.fc-action-card { position: relative; padding: 30px; border-radius: 22px; background: var(--fc-card); border: 1px solid var(--fc-line); color: var(--fc-text); }
.fc-action-card h3 { font: 400 26px var(--fc-serif); margin: 12px 0; }
.fc-action-card p { margin: 0 0 14px; color: var(--fc-muted); }
.fc-action-card p.fc-gap { margin-top: 24px; }
.fc-featured { background: var(--fc-featured); color: var(--fc-featured-text); border: none; overflow: hidden; }
.fc-featured .fc-eyebrow, .fc-featured p { color: var(--fc-featured-muted); }
.fc-featured h2 { font: 400 40px/1.15 var(--fc-serif); max-width: 520px; position: relative; color: var(--fc-featured-text); margin: 0; }
.fc-featured .button { margin-top: 22px; position: relative; }
.fc-featured .fc-progress { background: #ffffff20; margin-top: 25px; max-width: 450px; }
.fc-featured .fc-progress span { background: #b5a886; }
.fc-cover-glyph { position: absolute; right: 42px; top: 22px; font: 155px var(--fc-serif); color: #ffffff0b; transform: rotate(-12deg); pointer-events: none; }
.fc-section { margin-top: 48px; }
.fc-section h2 { font: 400 32px/1.2 var(--fc-serif); margin: 0; }
.fc-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fc-metric { padding: 22px 0; }
.fc-metric strong { font: 400 38px var(--fc-serif); display: block; color: var(--fc-text); }
.fc-metric span { font-size: 12px; color: var(--fc-muted); }
.fc-account-strip { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 34px 0 0; background: var(--fc-soft); padding: 22px 26px; border-radius: 18px; }
.fc-account-strip h3 { margin: 0; font-size: 18px; }
.fc-account-strip p { font-size: 13px; max-width: 630px; margin-bottom: 0; color: var(--fc-muted); }

/* ---------- onboarding ---------- */
.fc-focusbar { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--fc-line); padding: 0 32px; position: sticky; top: 0; z-index: 15; background: var(--fc-bg); }
.fc-focus-title { font-size: 14px; font-weight: 650; }
#start.tabs.active { margin: 0 -36px; }
.fc-onboard { max-width: 620px; margin: 58px auto 80px; padding: 0 28px; }
.fc-onboard-step { margin-top: 24px; }
.fc-onboard h1 { font: 400 43px/1.08 var(--fc-serif); letter-spacing: -.045em; margin: 24px 0 14px; }
.fc-onboard p { color: var(--fc-muted); }
.fc-choices { margin: 30px 0; display: grid; gap: 12px; }
.fc-choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 17px 20px; text-align: left; border: 1px solid var(--fc-line); border-radius: 14px; background: var(--fc-card); color: var(--fc-text); min-height: 62px; font: inherit; cursor: pointer; }
.fc-choice:hover, .fc-choice[aria-pressed="true"] { border-color: var(--fc-navy); background: var(--fc-blue-soft); }
.fc-choice b { font-size: 14px; } .fc-choice small { display: block; color: var(--fc-muted); }
.fc-level-code { font-size: 20px; font-family: var(--fc-serif); min-width: 38px; }
.fc-onboard .fc-card h2 { font: 400 28px/1.2 var(--fc-serif); margin-bottom: 0; }

/* ---------- library ---------- */
.fc-library .fc-title { margin-bottom: 26px; }
.fc-search { width: 270px; position: relative; display: block; }
.fc-search input { width: 100%; padding: 12px 38px 12px 15px; border: 1px solid var(--fc-line); border-radius: 12px; background: var(--fc-card); color: var(--fc-text); min-height: 46px; font: inherit; }
.fc-search svg { position: absolute; right: 12px; top: 12px; color: var(--fc-muted); pointer-events: none; }
.fc-filter-row { display: flex; gap: 8px; align-items: center; margin-bottom: 28px; min-width: 0; }
.fc-chips { display: flex; gap: 7px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.fc-chip { white-space: nowrap; min-height: 44px; padding: 9px 15px; border-radius: 30px; background: transparent; border: 1px solid var(--fc-line); color: var(--fc-text); font: 13px var(--fc-sans); cursor: pointer; }
.fc-chip.active { background: var(--fc-navy); color: var(--fc-bg); border-color: var(--fc-navy); }
.fc-continue { margin-bottom: 36px; }
.fc-continue h3 { font-size: 17px; margin: 0; }
.fc-continue-list { display: grid; gap: 10px; margin-top: 14px; }
.fc-continue-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px; border: 1px solid var(--fc-line); border-radius: 20px; background: var(--fc-card); color: var(--fc-text); text-decoration: none; }
.fc-continue-item strong { display: block; font: 400 25px var(--fc-serif); }
.fc-continue-item small { display: block; margin-top: 8px; color: var(--fc-muted); font-size: 12px; }
.fc-continue-item:hover { box-shadow: var(--fc-shadow); }
.fc-library h2, .fc-landing-books + h2 { font: 400 32px/1.2 var(--fc-serif); margin: 0; }
.fc-book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.fc-book-card { display: flex; flex-direction: column; border: 1px solid var(--fc-line); background: var(--fc-card); border-radius: 17px; overflow: hidden; min-width: 0; transition: transform .2s, box-shadow .2s; }
.fc-book-card:hover { transform: translateY(-3px); box-shadow: var(--fc-shadow); }
.fc-cover { height: 138px; background: var(--cover, #e4e7de); padding: 20px; position: relative; display: flex; align-items: flex-end; justify-content: space-between; color: #173552; }
.fc-initials { font: 50px/1 var(--fc-serif); letter-spacing: -.04em; opacity: .6; }
.fc-cover-code { position: absolute; left: 20px; top: 16px; font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.fc-cover-info { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; color: #173552; }
.fc-cover-info:hover { background: #ffffff66; }
.fc-book-body { display: block; padding: 19px 20px 21px; color: var(--fc-text); text-decoration: none; flex: 1; }
.fc-book-body h3 { font: 400 23px/1.2 var(--fc-serif); margin: 10px 0 5px; }
.fc-book-body p { margin: 0; color: var(--fc-muted); }
.fc-book-meta { margin: 11px 0; font-size: 12px; color: var(--fc-muted); }
.fc-book-card .fc-progress { margin-top: 8px; }
.fc-book-remove { margin: 0 12px 12px; align-self: flex-start; font-size: 13px; color: var(--fc-rose); }
.fc-empty { grid-column: 1 / -1; text-align: center; padding: 56px 22px; max-width: 520px; margin: auto; }
.fc-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; background: var(--fc-soft); border-radius: 20px; margin: 0 auto 20px; }
.fc-empty h3 { font: 400 26px var(--fc-serif); margin: 0; }
.fc-empty p { margin: 14px 0 24px; color: var(--fc-muted); }
#libraryNotice:empty { display: none; }

/* ---------- dialogs ---------- */
dialog.fc-dialog { position: fixed; border: 0; background: var(--fc-card); color: var(--fc-text); width: calc(100% - 32px); max-width: 470px; max-height: 92dvh; overflow: auto; border-radius: 24px; padding: 34px; box-shadow: 0 30px 100px #0003; }
dialog.fc-dialog::backdrop { background: #091b3266; backdrop-filter: blur(3px); }
dialog.fc-dialog h2 { font: 400 32px/1.15 var(--fc-serif); margin: 14px 0 12px; padding-right: 32px; }
dialog.fc-dialog p { color: var(--fc-muted); font-size: 14px; }
.fc-dialog-close { position: absolute; top: 12px; right: 12px; }
.fc-dialog-actions { display: grid; gap: 10px; margin-top: 22px; }
.fc-dialog-actions:empty { display: none; }
.fc-dialog-actions .button { width: 100%; }
.fc-sheet-handle { display: none; }
.fc-info-body p { margin: 10px 0; }
.fc-info-body a { color: var(--fc-navy); }
.fc-info-body .fc-choices { margin: 18px 0; }
.fc-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); z-index: 100; background: #073669; color: #fff; border-radius: 13px; padding: 12px 16px; display: flex; align-items: center; gap: 16px; box-shadow: 0 8px 30px #0002; font-size: 13px; }
.fc-toast button { background: transparent; border: 0; color: #ffc7a9; font-weight: 700; min-height: 36px; cursor: pointer; font: inherit; font-weight: 700; }

/* account dialog in auth mode (login / save progress) — same URL, compact window */
#readerSettingsDialog { border: 0; border-radius: 24px; background: var(--fc-card); color: var(--fc-text); box-shadow: 0 30px 100px #0003; }
#readerSettingsDialog::backdrop { background: #091b3266; backdrop-filter: blur(3px); }
#readerSettingsDialog.fc-auth-mode { max-width: 470px; width: calc(100% - 32px); padding: 34px; }
#readerSettingsDialog.fc-auth-mode .settings-panel-nav, #readerSettingsDialog.fc-auth-mode [data-settings-panel]:not([data-settings-panel="profile"]), #readerSettingsDialog.fc-auth-mode .settings-owner-tools, #readerSettingsDialog.fc-auth-mode form > .button[type="submit"], #readerSettingsDialog.fc-auth-mode #accountBadge, #readerSettingsDialog.fc-auth-mode #accountTitle { display: none !important; }
#readerSettingsDialog.fc-auth-mode .settings-heading h2 { font: 400 32px/1.15 var(--fc-serif); margin: 0; }
#readerSettingsDialog.fc-auth-mode .account-settings { border: 0; padding: 0; background: transparent; box-shadow: none; margin: 0; }
#readerSettingsDialog .field input, #readerSettingsDialog .field select { min-height: 48px; padding: 12px 14px; background: var(--fc-bg); border: 1px solid var(--fc-line); border-radius: 10px; color: var(--fc-text); }
#readerSettingsDialog.fc-auth-mode .button-row .button, #readerSettingsDialog.fc-auth-mode #accountRegister, #readerSettingsDialog.fc-auth-mode #accountSendRecovery, #readerSettingsDialog.fc-auth-mode #accountResetPassword, #readerSettingsDialog.fc-auth-mode #accountConfirmEmail { width: 100%; }

/* ---------- reader (focus mode) ---------- */
body.fc-reading main.shell { max-width: none; padding: 0; }
body.fc-reading #reader .book-toolbar { position: sticky; top: 0; z-index: 30; height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 32px; margin: 0; border-bottom: 1px solid var(--fc-line); background: var(--fc-bg); }
body.fc-reading #reader .reader-back-button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--fc-text); display: inline-flex; align-items: center; justify-content: center; }
body.fc-reading #reader .reader-back-button:hover { background: var(--fc-soft); }
body.fc-reading #reader .reader-back-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.fc-reader-title { font-size: 14px; font-weight: 650; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-reader-percent { font-size: 12px; color: var(--fc-muted); }
body.fc-reading #reader .book-audio { max-width: 260px; height: 36px; }
body.fc-reading .reader-layout { max-width: 1130px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 680px) 320px; gap: 66px; padding: 50px 30px 130px; }
body.fc-reading .reader-panel-toggle-rail, body.fc-reading .reader-side-toggle-row, body.fc-reading #readerAudioPreparation:empty { display: none; }
body.fc-reading .reader-paper { background: transparent; border: 0; box-shadow: none; padding: 0; }
body.fc-reading .reader-paper .eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fc-muted); margin-bottom: 14px; }
body.fc-reading #readerTitle { font: 400 40px/1.15 var(--fc-serif); margin: 0 0 22px; letter-spacing: -.03em; color: var(--fc-text); }
body.fc-reading .reader-text { font-family: var(--fc-serif); line-height: 1.9; color: var(--fc-text); }
body.fc-reading .reader-text .token { border-radius: 4px; }
body.fc-reading .reader-text .token:hover { background: var(--fc-accent-soft); }
body.fc-reading #readerNotice { font-size: 12px; color: var(--fc-muted); background: transparent; border: 0; border-left: 2px solid var(--fc-accent); border-radius: 0; padding: 0 0 0 14px; margin: 24px 0; }
body.fc-reading #reader { padding-top: 0; margin-top: 0; }
html:has(#localOwnerSettings[hidden]) #readerAudioPreparation { display: none; }
body.fc-reading .reader-layout .reader-side { position: sticky; top: 96px; align-self: start; max-height: calc(100dvh - 120px); overflow: auto; background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: 20px; padding: 22px; box-shadow: none; }
body.fc-reading #wordEmpty h3 { font: 400 24px var(--fc-serif); margin: 0 0 8px; }
body.fc-reading #wordEmpty p { color: var(--fc-muted); font-size: 14px; margin: 0; }
body.fc-reading #wordPanel .pronunciation-term { font: 400 35px/1.1 var(--fc-serif); letter-spacing: -.025em; color: var(--fc-text); }
body.fc-reading #wordPanel .ipa { font-size: 13px; color: var(--fc-muted); margin: 6px 0 16px; }
body.fc-reading #wordPanel .pronunciation-meaning { font-size: 20px; color: var(--fc-navy); margin-bottom: 5px; }
body.fc-reading #wordPanel .quote { font: 17px/1.6 var(--fc-serif); color: var(--fc-text); background: var(--fc-soft); border: 0; border-radius: 12px; padding: 12px 14px; }
body.fc-reading #wordPanel .tiny { font-size: 11px; color: var(--fc-muted); }
.fc-sheet-close { display: none; }

/* ---------- responsive: tablet ---------- */
@media (min-width: 768px) and (max-width: 1099px) {
  .fc-top .top-inner { gap: 10px; padding: 0 24px; }
  .fc-top .brand { width: 132px; }
  .fc-lang-pill .fc-lang-name { display: none; }
  .fc-top .fc-nav button { padding: 12px 10px; font-size: 14px; }
  main.shell { padding-left: 26px; padding-right: 26px; }
  #start.tabs.active { margin: 0 -26px; }
  .fc-hero { gap: 30px; grid-template-columns: 1.1fr .9fr; }
  .fc-hero h1 { font-size: 48px; }
  .fc-demo-scene { padding: 24px 18px; min-height: 465px; }
  .fc-demo-paper { padding: 22px 18px; }
  .fc-demo-copy { font-size: 21px; }
  .fc-language-card { padding: 10px; min-height: 133px; }
  .fc-book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* reader: side panel only from 1100px, otherwise the word opens as a bottom sheet */
@media (max-width: 1099px) {
  body.fc-reading .reader-layout { display: block; max-width: 760px; padding: 36px 36px 130px; }
  body.fc-reading .reader-layout .reader-side, body.fc-reading .reader-layout:not(.sidebar-collapsed) .reader-side { display: block; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50; max-height: 40dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 30px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 35px #0002; transform: translateY(105%); transition: transform .2s; visibility: hidden; }
  body.fc-reading .reader-layout .reader-side:has(#wordPanel:not(.hidden)) { transform: none; visibility: visible; }
  body.fc-reading .reader-side::before { content: ''; display: block; width: 34px; height: 4px; background: var(--fc-line); margin: -8px auto 12px; border-radius: 5px; }
  body.fc-reading .reader-side .fc-sheet-close { display: inline-flex; position: absolute; top: 10px; right: 12px; }
  body.fc-reading #wordPanel .pronunciation-term { font-size: 27px; }
  body.fc-reading #wordPanel .ipa { margin: 2px 0 8px; font-size: 12px; }
  body.fc-reading #wordPanel .pronunciation-meaning { font-size: 19px; }
  body.fc-reading #wordEmpty { display: none; }
}

/* ---------- responsive: phone ---------- */
@media (max-width: 767px) {
  body { font-size: 14px; }
  .fc-top .top-inner { height: 67px; gap: 12px; padding: 0 18px; }
  .fc-top .brand { width: 129px; }
  .fc-nav { display: none; }
  .fc-lang-pill .fc-lang-name { display: none; }
  .fc-lang-pill .fc-lang-code { width: 31px; height: 31px; border-radius: 9px; font-size: 10px; }
  .fc-lang-menu { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; }
  .fc-top .top-actions { gap: 2px; }
  .fc-login-button { font-size: 13px; padding: 6px 9px; }
  main.shell { padding-left: 22px; padding-right: 22px; padding-bottom: 90px; }
  body.fc-focus main.shell, body.fc-is-landing main.shell { padding-bottom: 0; }
  #start.tabs.active { margin: 0 -22px; }
  .fc-bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: var(--fc-card); border-top: 1px solid var(--fc-line); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around; }
  body.fc-is-landing .fc-bottom-nav { display: none; }
  .fc-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-height: 48px; padding: 4px; color: var(--fc-muted); font-size: 10px; text-decoration: none; position: relative; }
  .fc-bottom-nav a svg { width: 26px; height: 22px; padding: 0 2px; }
  .fc-bottom-nav a.active { color: var(--fc-navy); font-weight: 700; }
  .fc-bottom-nav a.active svg { background: var(--fc-blue-soft); border-radius: 7px; }
  .fc-nav-count { position: absolute; top: 0; right: 22%; font-size: 9px; background: var(--fc-accent); color: var(--fc-on-accent); border-radius: 8px; padding: 0 5px; }
  .site-breadcrumbs { display: none; }
  .fc-page { padding-top: 32px; padding-bottom: 40px; }
  .fc-title { display: block; margin-bottom: 24px; }
  .fc-title h1 { font-size: 37px; }
  .fc-title p { font-size: 13px; }
  .fc-search { width: 100%; margin-top: 20px; }
  .fc-g2 { grid-template-columns: 1fr; }
  .fc-hero { display: flex; flex-direction: column; gap: 30px; padding: 30px 0 38px; align-items: stretch; }
  .fc-hero h1 { font-size: 40px; line-height: 1.09; margin-bottom: 13px; }
  .fc-hero .fc-eyebrow { font-size: 10px; margin-bottom: 12px; }
  .fc-subtitle { font-size: 13px; margin-bottom: 18px; line-height: 1.65; }
  .fc-language-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fc-language-card { padding: 11px 13px; min-height: 99px; gap: 4px; }
  .fc-language-card .fc-lang-code { width: 28px; height: 28px; border-radius: 8px; font-size: 10px; }
  .fc-language-card strong { font-size: 13px; }
  .fc-language-card small { font-size: 10px; }
  .fc-language-card .fc-badge { padding: 2px 6px; font-size: 9px; }
  .fc-try-reading { font-size: 13px; padding-left: 0; }
  .fc-demo-scene { min-height: 375px; padding: 25px 21px; border-radius: 21px; }
  .fc-demo-scene::before { font-size: 58px; }
  .fc-demo-paper { padding: 24px 20px; min-height: 175px; }
  .fc-demo-copy { font-size: 23px; }
  .fc-demo-word .fc-row-between { flex-wrap: wrap; }
  .fc-landing-section { padding: 36px 0; }
  .fc-landing-section h2, .fc-section h2, .fc-library h2 { font-size: 26px; }
  .fc-steps { grid-template-columns: 1fr; gap: 30px; }
  .fc-step-art { height: 125px; }
  .fc-book-grid { grid-template-columns: 1fr; }
  .fc-landing-books .fc-book-card { flex-direction: row; }
  .fc-landing-books .fc-cover { width: 95px; height: auto; min-height: 158px; flex-shrink: 0; padding: 15px; }
  .fc-landing-books .fc-initials { font-size: 36px; }
  .fc-landing-books .fc-cover-code { left: 12px; }
  .fc-landing-books .fc-cover-info { width: 30px; height: 30px; right: 4px; }
  .fc-landing-books .fc-book-body { padding: 15px; }
  .fc-cover { height: 150px; }
  .fc-book-body h3 { font-size: 25px; }
  .fc-filter-row { gap: 4px; }
  .fc-filter-row .book-upload span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fc-chip { padding: 9px 13px; font-size: 12px; }
  .fc-continue-item { padding: 18px 20px; }
  .fc-continue-item strong { font-size: 22px; }
  .fc-featured h2 { font-size: 32px; }
  .fc-action-card { padding: 25px; }
  .fc-cover-glyph { font-size: 130px; right: 10px; top: 50px; }
  .fc-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
  .fc-metric { padding: 14px 0; } .fc-metric strong { font-size: 32px; } .fc-metric span { font-size: 11px; }
  .fc-account-strip { display: block; padding: 20px; }
  .fc-account-strip .fc-stack { margin-top: 16px; }
  .fc-levels { gap: 5px; } .fc-level { padding: 9px 4px; font-size: 11px; }
  .fc-focusbar { height: 65px; padding: 0 16px; }
  .fc-onboard { margin: 30px auto 80px; padding: 0 24px; }
  .fc-onboard h1 { font-size: 35px; }
  .fc-choices { gap: 10px; margin: 24px 0; }
  .fc-choice { padding: 15px; font-size: 13px; }
  .fc-footer { font-size: 11px; }
  dialog.fc-dialog { padding: 28px 24px; border-radius: 22px; }
  dialog.fc-dialog h2 { font-size: 29px; }
  dialog.fc-sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 90dvh; border-radius: 22px 22px 0 0; padding: 24px; }
  dialog.fc-sheet .fc-sheet-handle { display: block; width: 34px; height: 4px; background: var(--fc-line); margin: -9px auto 20px; border-radius: 5px; }
  #readerSettingsDialog.fc-auth-mode { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 65px 26px 30px; }
  .fc-toast { bottom: 83px; font-size: 12px; width: max-content; }
  body.fc-focus .fc-toast { bottom: 24px; }
  body.fc-reading #reader .book-toolbar { height: 65px; padding: 0 16px; }
  body.fc-reading .reader-layout { padding: 29px 24px 110px; }
  body.fc-reading #readerTitle { font-size: 35px; }
  body.fc-reading .reader-layout .reader-side, body.fc-reading .reader-layout:not(.sidebar-collapsed) .reader-side { padding: 19px 24px calc(14px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 767px) {
  body.fc-reading #reader .book-toolbar { flex-wrap: wrap; height: auto; min-height: 65px; row-gap: 0; }
  body.fc-reading #reader .book-toolbar .book-audio:not(.hidden) { order: 5; flex: 1 0 100%; max-width: none; margin: 0 0 10px; }
}
/* word card actions */
.fc-word-actions { display: grid; gap: 4px; margin: 14px 0 6px; }
.fc-word-actions .button { width: 100%; }
.fc-word-actions .fc-text-button { width: 100%; font-size: 13px; }
body.fc-reading #wordPanel #saveWord { display: none; }
body.fc-reading #wordPanel .pronunciation-term-row { padding-right: 0; }
body.fc-reading #reader .reader-back-button { box-shadow: none !important; }
@media (max-width: 1099px) {
  body.fc-reading #wordPanel > .pronunciation-term-row:first-child { padding-right: 48px; }
  .fc-word-actions { grid-template-columns: 1fr auto; align-items: center; }
  .fc-word-actions .fc-text-button { width: auto; }
}
/* Словарь is a top-level section now: no "← Обучение" back button there */
#exerciseDictionaryView .exercise-subhead > .button.ghost[data-exercise-home] { display: none; }
#exerciseDictionaryView .exercise-subhead h2, #exerciseHomeView h1 { font: 400 clamp(36px, 4.2vw, 58px)/1.08 var(--fc-serif); letter-spacing: -.045em; }
@media (min-width: 768px) and (max-width: 1099px) {
  .fc-language-card .fc-lang-code { width: 30px; height: 30px; border-radius: 9px; font-size: 10px; }
  .fc-language-card .fc-lang-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .fc-language-card strong { font-size: 13px; }
}
