/* Français Facile — design system
   1 tokens · 2 base · 3 layout · 4 header/footer · 5 components · 6 page-specific · 7 responsive */

/* 1 ── tokens */
:root {
  --blue: #1b3a8c; --blue-d: #12276a; --red: #d62839; --navy: #14213d;
  --bg: #f4f6fb; --surface: #fff; --line: #dfe3ee; --ink: #1d2433; --muted: #5d667a; --tint: #eaeffb;
  --ok: #1f8a4c; --bad: #c2303d; --radius: 14px; --shadow: 0 1px 2px rgba(20,33,61,.06);
  --serif: 'Playfair Display', 'Noto Serif Georgian', Georgia, serif;
  --sans: 'Inter', 'Noto Sans Georgian', system-ui, sans-serif;
  --header-h: 56px;
}
[data-theme="dark"] {
  --bg: #0e1528; --surface: #172041; --line: #29345a; --ink: #e8ebf5; --muted: #a3adc5; --tint: #1f2a52;
  --blue: #7ea2ff; --blue-d: #a5bdff; --navy: #e8ebf5; --shadow: none;
}

/* 2 ── base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 60px); -webkit-text-size-adjust: 100%; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.65; }
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 700; color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
.fr { font-family: var(--serif); font-style: italic; font-weight: 600; }
h3 { font-size: 1.35rem; } h4 { font-size: 1.05rem; margin-top: 1.5rem; }
p { margin: 0 0 1em; max-width: 68ch; } a { color: var(--blue); } img { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #f5a524; outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); font-weight: 400; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* 3 ── layout */
.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section__head { margin-bottom: 1.75rem; }
.section__head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.section__head p { color: var(--muted); margin: 0; }
.grid { display: grid; gap: .75rem; }
.grid--tiles { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stack { display: grid; gap: .6rem; }
.tricolor { height: 5px; background: linear-gradient(90deg, #1b3a8c 33.3%, #fff 33.3% 66.6%, #d62839 66.6%); }

/* 4 ── header / footer */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--header-h); }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; color: var(--navy); text-decoration: none; white-space: nowrap; }
.brand b { color: var(--red); }
.nav { display: flex; gap: 1.1rem; }
.nav__link { position: relative; font-size: .88rem; font-weight: 500; color: var(--muted); text-decoration: none; padding: .35rem 0; }
.nav__link:hover, .nav__link.is-current { color: var(--blue); }
.nav__link.is-current::after { content: ''; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--red); }
.tools { display: flex; align-items: center; gap: .5rem; }
.xp-chip { font-size: .85rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; background: var(--tint); color: var(--blue); white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); }
.burger { display: none; }
.anchorbar { border-top: 1px solid var(--line); background: var(--surface); }
.anchors { display: flex; gap: .4rem; overflow-x: auto; padding: .45rem 0; scrollbar-width: none; }
.anchors a { font-size: .85rem; padding: .25rem .8rem; border-radius: 999px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.anchors a:hover { background: var(--tint); }
.anchors a.is-active { background: var(--blue); color: #fff; }
[data-theme="dark"] .anchors a.is-active { color: #0e1528; }
.pagenav { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem 0 3rem; }
.pn { display: grid; gap: .1rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; min-width: 180px; }
.pn small { color: var(--muted); } .pn--next { text-align: right; margin-left: auto; } .pn:hover { border-color: var(--blue); }
.site-footer { background: var(--navy); color: #cfd6ea; margin-top: 2rem; }
[data-theme="dark"] .site-footer { background: #0a1020; }
.site-footer .container { padding: 2.5rem 0 1.5rem; }
.site-footer .brand { color: #fff; } .site-footer a { color: #cfd6ea; text-decoration: none; } .site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .95rem; margin: 0 0 .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .9rem; }
.footer__grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr repeat(4, 1fr); }
.footer__legal { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1rem; margin: 2rem 0 0; font-size: .85rem; opacity: .7; max-width: none; }
.to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.2); z-index: 40; }
[data-theme="dark"] .to-top { color: #0e1528; }
.toasts { position: fixed; top: calc(var(--header-h) + 1rem); right: 1rem; display: grid; gap: .5rem; z-index: 80; }
.toast { padding: .7rem 1rem; border-radius: 10px; color: #fff; background: var(--blue-d); box-shadow: 0 6px 18px rgba(0,0,0,.2); animation: in .25s ease; }
.toast--error { background: var(--bad); } .toast--success { background: var(--ok); }
@keyframes in { from { transform: translateX(30px); opacity: 0; } }

/* 5 ── components */
.card, .row, .tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 1.5rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; }
.row > div, .word > div { min-width: 0; overflow-wrap: anywhere; }
.row strong, .word strong { display: block; color: var(--navy); } .row span, .word span { color: var(--muted); font-size: .9rem; }
.row .muted { display: inline; } .who { display: block; font-style: normal; font-size: .75rem; font-weight: 600; color: var(--red); }
.word { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; box-shadow: var(--shadow); } .word > div { flex: 1; min-width: 0; } .word__emoji { font-size: 1.8rem; }
.tab { flex: none; min-height: 44px; padding: .45rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; font-weight: 500; transition: background .15s, color .15s; }
.tab:hover:not(:disabled) { background: var(--tint); } .tab:disabled { opacity: .4; cursor: default; }
.tab small { display: block; font-size: .7rem; opacity: .75; font-weight: 400; }
.tab.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
[data-theme="dark"] .tab.is-active { color: #0e1528; }
.tabs, [role="tablist"], .pager { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.pager { justify-content: center; margin: 1.5rem 0 0; }
.speak { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--blue); background: transparent; color: var(--blue); transition: background .15s, color .15s; }
.speak:hover { background: var(--blue); color: #fff; } .speak--lg { width: auto; height: auto; padding: .7rem 1.4rem; border-radius: 999px; font-weight: 600; }
[data-theme="dark"] .speak:hover { color: #0e1528; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.6rem; border-radius: 999px; border: 2px solid var(--blue); background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--blue-d); } .btn--ghost { background: transparent; color: var(--blue); } .btn--ghost:hover { background: var(--tint); }
[data-theme="dark"] .btn:not(.btn--ghost) { color: #0e1528; }
.tile { padding: .9rem .5rem; text-align: center; transition: border-color .15s, background .15s; }
.tile:hover { border-color: var(--blue); background: var(--tint); }
.tile__big { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--blue); } .tile__big small { color: var(--muted); font-size: 1.15rem; font-weight: 400; }
.tile small { display: block; color: var(--muted); font-size: .8rem; } .tile__emoji { font-size: 2rem; display: block; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1rem 0 0; }
.chip { display: inline-block; padding: .25rem .8rem; border-radius: 999px; background: var(--tint); color: var(--blue); font-size: .85rem; }
.detail { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; margin-top: 1.5rem; }
.detail__big { font-family: var(--serif); font-size: clamp(4rem, 12vw, 7rem); font-weight: 700; color: var(--blue); line-height: 1; }
.callout { border-left: 4px solid var(--blue); background: var(--surface); padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; } .callout h4 { margin: 0 0 .3rem; } .callout p { margin: 0; color: var(--muted); font-size: .95rem; }
.callout--red { border-color: var(--red); } .callout li { color: var(--muted); font-size: .95rem; }
.tips { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .4rem; color: var(--muted); } .tips i { color: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 2rem; grid-column: 1 / -1; }
.search { width: 100%; max-width: 320px; min-height: 44px; font-size: 16px; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }

/* 6 ── page-specific */
.hero { background: var(--blue); color: #fff; padding: 4.5rem 0 4rem; position: relative; overflow: hidden; }
[data-theme="dark"] .hero { background: #14225a; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 6vw, 4.2rem); margin-bottom: .4em; max-width: 14ch; }
.hero p { color: rgba(255,255,255,.88); font-size: 1.15rem; }
.hero__word { font-family: var(--serif); font-size: clamp(5rem, 20vw, 13rem); line-height: .9; font-weight: 700; color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.35); border: 0; background: none; padding: 0; text-align: left; display: block; margin-bottom: 1.5rem; }
.hero__word:hover { -webkit-text-stroke-color: #fff; }
.hero__actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.8rem; }
.hero .btn { background: #fff; color: var(--blue); border-color: #fff; } .hero .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.page-hero { background: var(--blue); color: #fff; padding: 3rem 0 2.5rem; }
[data-theme="dark"] .page-hero { background: #14225a; }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 6vw, 3rem); margin-bottom: .3em; }
.page-hero h1 .fr, .section__head h2 .fr { display: block; font-size: .55em; opacity: .8; margin-top: .2rem; } .page-hero p { margin: 0; color: rgba(255,255,255,.85); font-size: 1.05rem; }
.path-card { position: relative; display: grid; gap: .3rem; align-content: start; padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.path-card:hover { border-color: var(--blue); } .path-card > i { color: var(--blue); font-size: 1.4rem; } .path-card h3 { margin: .3rem 0 0; font-size: 1.15rem; } .path-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.path-card__no { position: absolute; top: 1rem; right: 1.1rem; font-family: var(--serif); color: var(--line); font-size: 2rem; font-weight: 700; }
.badge { justify-self: start; font-size: .75rem; color: var(--ok); font-weight: 600; margin-top: .4rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; } .stat strong { display: block; font-family: var(--serif); font-size: 2rem; color: var(--blue); }
.bar-track { height: 8px; border-radius: 99px; background: var(--tint); overflow: hidden; margin-top: .6rem; } .bar-fill { height: 100%; width: 0; background: var(--red); transition: width .4s ease; }
.level-head { display: flex; align-items: center; gap: 1.2rem; } .level-head h3 { margin: 0; } .level-head p { margin: 0; color: var(--muted); }
.level-head__code { font-family: var(--serif); font-size: 3rem; font-weight: 700; color: var(--blue); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.range { display: flex; align-items: center; gap: .8rem; max-width: 420px; margin: 1.5rem auto 0; } .range input { flex: 1; accent-color: var(--blue); }
.player { text-align: center; max-width: 640px; margin: 1.5rem auto 0; } .player .hero__actions { justify-content: center; }
.quiz__top { display: flex; justify-content: space-between; font-weight: 600; } .quiz__q { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); color: var(--navy); margin: 1.25rem 0; text-align: center; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; margin-top: 1.25rem; }
.option { text-align: left; padding: 1rem 1.2rem; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); font-weight: 500; transition: border-color .15s, background .15s; }
.option:hover:not(:disabled) { border-color: var(--blue); background: var(--tint); }
.option.is-right { border-color: var(--ok); background: rgba(31,138,76,.12); } .option.is-wrong { border-color: var(--bad); background: rgba(194,48,61,.12); }
.feedback { text-align: center; min-height: 1.8em; margin: 1rem 0 0; font-weight: 600; max-width: none; }
.center { text-align: center; } .emoji-xl { font-size: 4rem; line-height: 1.2; }

/* 7 ── responsive */
@media (max-width: 1080px) {
  .burger { display: grid; place-items: center; }
  .nav { position: absolute; inset: var(--header-h) 0 auto; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; display: none; }
  .nav.is-open { display: flex; } .nav__link { padding: .7rem 0; font-size: 1rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .xp-chip { display: none; } .footer__grid { grid-template-columns: 1fr; } .section { padding: 2.5rem 0; } .pn { min-width: 0; flex: 1; } }

/* 8 ── mobile-first pass */
.sheet__close { display: none; }
.to-top { right: 1rem; left: auto; bottom: calc(1rem + env(safe-area-inset-bottom)); width: 44px; height: 44px; }
@media (max-width: 720px) {
  .section { padding: 2.25rem 0; } .card { padding: 1.1rem; } .hero { padding: 2.5rem 0 2.25rem; } .page-hero { padding: 1.75rem 0 1.5rem; }
  .hero__actions .btn { flex: 1 1 100%; justify-content: center; }
  [role="tablist"] { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; margin-inline: -1rem; padding: .15rem 1rem .5rem; scrollbar-width: none; }
  [role="tablist"]::-webkit-scrollbar, .anchors::-webkit-scrollbar { display: none; }
  .tab { scroll-snap-align: center; }
  .toolbar { flex-direction: column; align-items: stretch; } .search { max-width: none; }
  .options { grid-template-columns: 1fr; } .option { min-height: 56px; }
  .nav__link { padding: .85rem 0; border-bottom: 1px solid var(--line); } .nav__link.is-current::after { display: none; }
  .nav { box-shadow: 0 12px 24px rgba(0,0,0,.12); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; }
  .sheet { position: fixed; inset: auto 0 0; z-index: 45; margin: 0; border-radius: 18px 18px 0 0; border-bottom: 0; flex-wrap: nowrap; gap: 1rem; padding: 1rem 3.5rem calc(1rem + env(safe-area-inset-bottom)) 1.1rem; box-shadow: 0 -10px 30px rgba(0,0,0,.18); }
  .sheet .detail__big { font-size: 3.6rem; } .sheet h3 { font-size: 1.15rem; margin-bottom: .2rem; } .sheet p { margin-bottom: .4rem; font-size: .9rem; }
  .sheet .hero__actions { gap: .5rem; } .sheet .speak--lg { padding: .55rem 1rem; font-size: .9rem; }
  .sheet__close { display: grid; place-items: center; position: absolute; top: .5rem; right: .5rem; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; }
  body:has(.sheet:not([hidden])) main { padding-bottom: 210px; } body:has(.sheet:not([hidden])) .to-top { display: none; }
  .pagenav { flex-direction: column-reverse; } .pn, .pn--next { text-align: left; margin: 0; }
}
@media (max-width: 380px) { .brand { font-size: 1.1rem; } .tile__big { font-size: 1.4rem; } }

/* 9 ── orientation: grouped menu, breadcrumbs, read bar, mobile tab bar */
.readbar { height: 3px; background: transparent; } .readbar i { display: block; height: 100%; width: 0; background: var(--red); }
.nav { align-items: center; gap: .25rem; }
.nav__link { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border: 0; border-radius: 10px; background: none; font: inherit; font-size: .92rem; font-weight: 500; color: var(--muted); text-decoration: none; cursor: pointer; }
.nav__link::after { display: none; } .nav__link:hover { background: var(--tint); color: var(--blue); }
.nav__link.is-current, .nav__group.is-current > .nav__toggle { background: var(--tint); color: var(--blue); }
.nav__toggle i { font-size: .65rem; transition: transform .2s; } .nav__group.is-open .nav__toggle i { transform: rotate(180deg); }
.nav__group { position: relative; }
.nav__menu { display: none; position: absolute; top: 100%; left: 0; min-width: 300px; padding: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(0,0,0,.14); z-index: 60; }
@media (hover: hover) { .nav__group:hover .nav__menu { display: block; } }
.nav__group.is-open .nav__menu { display: block; }
.nav__menu a { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; border-radius: 10px; text-decoration: none; color: var(--ink); }
.nav__menu a:hover, .nav__menu a.is-current { background: var(--tint); } .nav__menu a i { width: 1.3rem; text-align: center; color: var(--blue); }
.nav__menu small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; } .nav__menu strong { font-size: .95rem; }
.crumbs { display: flex; align-items: center; gap: .55rem; margin-bottom: .9rem; font-size: .85rem; color: rgba(255,255,255,.8); }
.crumbs a { color: #fff; text-decoration: none; opacity: .85; } .crumbs i { font-size: .6rem; opacity: .6; }
.crumbs b { margin-left: auto; padding: .1rem .7rem; border-radius: 999px; background: rgba(255,255,255,.16); font-weight: 600; color: #fff; }
.tabbar { display: none; }
.section:nth-of-type(even) { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.group { margin-bottom: 2.25rem; } .group-title { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; font-size: 1.15rem; } .group-title small { color: var(--muted); font-weight: 400; font-size: .85rem; }

/* flashcards */
.deck-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; } .deck-bar .chips { margin: 0; }
.fc { perspective: 1200px; max-width: 520px; margin: 0 auto; }
.fc__card { position: relative; min-height: 320px; transform-style: preserve-3d; transition: transform .45s ease; cursor: pointer; }
.fc__card.is-flipped { transform: rotateY(180deg); }
.fc__face { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .6rem; padding: 1.5rem; text-align: center; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(20,33,61,.1); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fc__face--back { transform: rotateY(180deg); background: var(--tint); }
.fc__emoji { font-size: 3rem; line-height: 1; } .fc__word { font-family: var(--serif); font-size: clamp(1.9rem, 8vw, 2.7rem); font-weight: 700; color: var(--navy); overflow-wrap: anywhere; } .fc__word--ka { font-family: var(--sans); font-size: clamp(1.6rem, 7vw, 2.2rem); }
.fc__hint { color: var(--muted); font-size: .82rem; }
.fc__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; max-width: 520px; margin: 1rem auto 0; opacity: .45; pointer-events: none; transition: opacity .2s; } .fc__actions.is-ready { opacity: 1; pointer-events: auto; }
.fc__actions .btn { justify-content: center; min-height: 52px; }
.btn--again { background: transparent; color: var(--red); border-color: var(--red); } .btn--again:hover { background: rgba(214,40,57,.08); }
.btn--know { background: var(--ok); border-color: var(--ok); } .btn--know:hover { background: #17703c; }
.swipe-tip { text-align: center; color: var(--muted); font-size: .85rem; margin: .75rem 0 0; max-width: none; }

@media (max-width: 1080px) {
  .nav { align-items: stretch; } .nav__group { width: 100%; }
  .nav__toggle { width: 100%; justify-content: flex-start; pointer-events: none; padding: .9rem 0 .25rem; background: none !important; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) !important; } .nav__toggle i { display: none; }
  .nav__menu { display: grid !important; position: static; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; }
  .nav > .nav__link { padding: .85rem 0; border-radius: 0; border-bottom: 1px solid var(--line); background: none !important; }
}
@media (max-width: 720px) {
  :root { --bar-h: 62px; }
  .burger { display: none; } body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; inset: auto 0 0; z-index: 48; display: grid; grid-template-columns: repeat(6, 1fr); height: calc(var(--bar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: grid; place-items: center; align-content: center; gap: 3px; min-height: var(--bar-h); border: 0; background: none; color: var(--muted); font-size: .66rem; text-decoration: none; white-space: nowrap; }
  .tabbar i { font-size: 1.2rem; } .tabbar .is-current { color: var(--blue); font-weight: 700; }
  .nav { position: fixed; inset: auto 0 calc(var(--bar-h) + env(safe-area-inset-bottom)) 0; z-index: 47; max-height: 72dvh; padding: .25rem 1.25rem 1rem; border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); box-shadow: 0 -12px 30px rgba(0,0,0,.18); }
  .to-top { bottom: calc(var(--bar-h) + 1rem + env(safe-area-inset-bottom)); }
  .sheet { inset: auto 0 calc(var(--bar-h) + env(safe-area-inset-bottom)) 0; padding-bottom: 1rem; }
  .crumbs b { margin-left: auto; } .fc__card { min-height: 280px; }
}

/* 10 ── speaking (სასაუბრო) */
.sp { display: grid; gap: .55rem; align-content: start; }
.sp__meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sp__group { font-size: .78rem; font-weight: 600; color: var(--muted); }
.sp__badge { font-size: .72rem; font-weight: 700; padding: .12rem .6rem; border-radius: 999px; background: var(--tint); color: var(--blue); }
.sp__badge--clause { background: rgba(214,40,57,.1); color: var(--red); }
.sp__badge--nom { background: rgba(31,138,76,.12); color: var(--ok); }
[data-theme="dark"] .sp__badge--clause { color: #ff8b97; } [data-theme="dark"] .sp__badge--nom { color: #5fd391; }
.sp__main { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sp__fr { margin: 0; font-size: clamp(1.3rem, 3.2vw, 1.7rem); color: var(--blue); overflow-wrap: anywhere; }
.sp__tr { margin: 0; font-style: italic; color: var(--red); font-size: .92rem; max-width: none; }
[data-theme="dark"] .sp__tr { color: #ff8b97; }
.sp__ka { margin: 0; color: var(--ink); max-width: none; }
.sp .callout { margin: .25rem 0; } .sp .callout h4 { margin-top: 0; font-size: .9rem; }
.sp__examples { margin-top: .25rem; }
.sp .row span { display: block; }
.sp .row .who { color: var(--ok); text-transform: uppercase; letter-spacing: .04em; }
.sp-build { align-items: start; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; color: var(--navy); display: flex; align-items: baseline; gap: .5rem; }
.field label b { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--blue); color: #fff; font-size: .8rem; flex: none; }
[data-theme="dark"] .field label b { color: #0e1528; }
.field__hint { margin: 0; color: var(--muted); font-size: .85rem; max-width: none; }
.input { width: 100%; min-height: 46px; padding: .6rem .9rem; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
.sp__result { display: grid; gap: .6rem; border: 2px solid var(--blue); } .sp__result[hidden] { display: none; }
.sp__result .sp__fr { font-size: clamp(1.4rem, 3.6vw, 1.9rem); }

/* 11 ── app-like feel: no sideways scroll, no bounce, swipe-ready */
html { overflow-x: hidden; overscroll-behavior: none; background: var(--bg); -webkit-tap-highlight-color: transparent; }
body { overflow-x: clip; max-width: 100%; overscroll-behavior: none; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
main, section, .container, .card { min-width: 0; max-width: 100%; }
img, svg, video, canvas, iframe, table { max-width: 100%; }
pre, code { overflow-wrap: anywhere; white-space: pre-wrap; }
input, textarea, [contenteditable], p, h1, h2, h3, h4, .row, .word { -webkit-user-select: text; user-select: text; }
.toasts { max-width: calc(100vw - 2rem); }
/* horizontally scrollable strips must still pan sideways */
[role="tablist"], .anchors { touch-action: pan-x; overscroll-behavior-x: contain; }
/* page transition for swipe navigation */
@keyframes ff-in-next { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes ff-in-prev { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
main.ff-in-next { animation: ff-in-next .22s ease-out; }
main.ff-in-prev { animation: ff-in-prev .22s ease-out; }
main.ff-out-next { transition: transform .14s ease-in, opacity .14s ease-in; transform: translateX(-32px); opacity: 0; }
main.ff-out-prev { transition: transform .14s ease-in, opacity .14s ease-in; transform: translateX(32px); opacity: 0; }

/* 12 ── floating detail sheet (letters / numbers) on phones */
@keyframes ff-sheet-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) {
  .sheet { inset: auto 12px calc(var(--bar-h) + env(safe-area-inset-bottom) + 14px) 12px; border: 1px solid var(--line); border-radius: 18px; padding: .8rem 3rem .8rem 1rem; box-shadow: 0 12px 32px rgba(0,0,0,.4); animation: ff-sheet-up .18s ease-out; }
  .sheet .detail__big { font-size: 3.2rem; }
  body:has(.sheet:not([hidden])) main { padding-bottom: 280px; }
}

/* the floating sheet owns its touches: the browser must not scroll the page from it, so horizontal swipes reach swipe.js */
.sheet { touch-action: none; overscroll-behavior: contain; }
.sheet button, .sheet a { touch-action: manipulation; }

/* selected letter / number tile (follows swipes in the detail sheet) */
.tile.is-selected { background: var(--tint); border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
