/* Fala 1.4 — la plaque de rue et le programme quotidien. */
@font-face {
  font-family: "Caladea";
  src: url('./fonts/caladea-bold-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --display: "Caladea", Georgia, serif;
  --paper: #f2f5f7;
  --tile: #ffffff;
  --ink: #192b39;
  --cobalt: #174a8c;
  --cobalt-strong: #103767;
  --muted: #475c70;
  --line: #758a9c;
  --track: #758a9c;
  --wash: #e4edf5;
  --success: #23614e;
  --success-wash: #e9f3ee;
  --retry: #625326;
  --retry-wash: #f3f0e3;
  --error: #3d4351;
  --error-wash: #eceef2;
  --radius: 4px;
  --round: 50%;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a { transition: transform .12s, opacity .12s; }
button:not(:disabled):active { transform: translateY(1px); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
button:disabled { cursor: default; }
button span { min-width: 0; overflow-wrap: anywhere; }
svg { width: 24px; height: 24px; fill: none; flex-shrink: 0; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.app-shell {
  max-width: 600px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(108px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand img { width: 38px; height: 38px; }
.brand h1 { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1; letter-spacing: -.6px; margin: 0; color: var(--cobalt); }
.brand p { font-size: 12px; line-height: 1.4; margin: 4px 0 0; color: var(--muted); }
.install-button { min-width: 44px; min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 10px 0 10px 8px; border: 0; border-radius: var(--radius); background: none; color: var(--cobalt); font-size: 12px; font-weight: 600; }
.install-button svg { width: 18px; height: 20px; }
.section-heading h2 { font: 600 22px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.4px; margin: 0; }
.section-intro { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.progress-block { margin: 18px 0 22px; }
.progress-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 9px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.progress-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress-caption strong { color: var(--cobalt); font-weight: 700; font-size: 14px; }
.study-plan { margin: -8px 0 18px; }
.study-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 12px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.study-heading strong { color: var(--cobalt); font-size: 15px; }
.study-counts { display: flex; flex-wrap: wrap; gap: 5px 20px; margin-top: 8px; color: var(--ink); font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.study-plan p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
progress { display: block; width: 100%; height: 4px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 0; overflow: hidden; background: var(--track); }
progress::-webkit-progress-bar { background: var(--track); }
progress::-webkit-progress-value { background: var(--cobalt-strong); }
progress::-moz-progress-bar { background: var(--cobalt-strong); }
.phrase-card { position: relative; background: var(--tile); color: var(--cobalt); min-width: 0; }
.phrase-card::before, .complete-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border: 24px solid transparent;
  border-image: url('./art/plaque-frame.svg') 48 / 24px / 0 stretch;
}
.card-content { display: flex; flex-direction: column; min-height: 300px; padding: 28px 26px 24px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 1.5; }
.topic { font-size: 13px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.card-index-group { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.card-index { white-space: nowrap; font-variant-numeric: tabular-nums; }
.review-label { color: var(--ink); font-size: 12px; border-bottom: 2px solid var(--cobalt); }
.phrase-body { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 29px 0 25px; }
.phrase-body h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(31px, 9.8vw, 42px); line-height: 1.12; letter-spacing: -.4px; overflow-wrap: anywhere; text-wrap: balance; }
.phrase-body h3.long { font-size: clamp(29px, 9vw, 38px); }
.phrase-body h3:focus { outline: none; }
.translation { margin: 17px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.card-footer { min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-language { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1.5; }
.phrase-card[data-tone=neutral] { background: var(--tile); }
.phrase-card[data-tone=success] { background: var(--tile); }
.phrase-card[data-tone=success]::before { border-image-source: url('./art/plaque-success.svg'); animation: seal-ink .32s ease-out; }
.phrase-card[data-tone=failure] { background: var(--retry-wash); }
.phrase-card[data-tone=error] { background: var(--error-wash); }
.feedback { display: flex; align-items: flex-start; gap: 12px; margin: 19px 0 18px; min-height: 58px; }
.feedback > div:last-child { min-width: 0; flex: 1; }
.feedback-symbol { display: flex; align-items: center; justify-content: center; width: 27px; height: 28px; flex-shrink: 0; color: var(--cobalt); }
.feedback-symbol svg { width: 23px; height: 23px; }
.feedback p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
#feedback-title { font-size: 15px; font-weight: 650; }
#feedback-detail { font-size: 13px; color: var(--muted); margin-top: 4px; }
.feedback[data-tone=neutral] { color: var(--ink); }
.feedback[data-tone=success], .feedback[data-tone=failure], .feedback[data-tone=error] { border: 0; }

.feedback[data-tone=success] .feedback-symbol, .feedback[data-tone=success] #feedback-title { color: var(--success); }

.feedback[data-tone=failure] .feedback-symbol, .feedback[data-tone=failure] #feedback-title { color: var(--retry); }

.feedback[data-tone=error] .feedback-symbol, .feedback[data-tone=error] #feedback-title { color: var(--error); }
.transcript-box { border-top: 1px solid var(--line); padding: 12px 0 0; margin-bottom: 18px; }
.transcript-box span { font-size: 12px; color: var(--muted); }
.transcript-box p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.practice-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 10px; }
.button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-width: 0; min-height: 56px; padding: 14px 12px; border: 2px solid transparent; border-radius: var(--radius); font-size: 16px; line-height: 1.4; font-weight: 650; }
.button svg { width: 22px; height: 22px; }
.button.primary, .button.next { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.15px; }
.primary, .button.next.is-promoted { background: var(--cobalt); border-color: var(--cobalt); color: var(--tile); }
.secondary, .button.listen, .button.is-demoted { background: transparent; color: var(--cobalt); border-color: var(--cobalt); }
.button.listen { font-size: 14px; }
.button.listen.is-playing { background: var(--wash); }
.button.next { grid-column: 1 / -1; min-height: 56px; background: none; color: var(--cobalt); }
.button.next svg { width: 19px; height: 19px; }
.button.next.is-promoted { min-height: 56px; }
.button.is-recording { background: var(--ink); border-color: var(--ink); color: var(--tile); }
.button.is-busy { background: transparent; color: var(--ink); border: 2px dashed var(--muted); }
.button:disabled { color: #43586b; background: #dfe6ec; border-color: #677d8e; }
.button.next:disabled { background: transparent; border-color: transparent; }
#reload-cards { margin-top: 12px; }
.model-note, .meaning-note { color: var(--muted); font-size: 12px; line-height: 1.55; text-align: left; margin: 16px 0 0; }
.meaning-note { margin-top: 10px; }
.recording-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 12px; margin-bottom: 16px; border-radius: var(--radius); background: var(--ink); color: var(--tile); font-size: 13px; line-height: 1.4; }
.recording-dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: var(--round); background: var(--tile); animation: pulse 1.2s ease-in-out infinite; }
.level-track { height: 5px; min-width: 12px; flex: 1; background: #7d91a3; }
.level-track div { width: 0; height: 100%; background: var(--tile); }
.recording-duration { display: flex; flex-shrink: 0; align-items: baseline; gap: 4px; }
.duration-label { font-size: 12px; }
#recording-time { min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.download-box { margin-bottom: 18px; }
.download-box progress { height: 6px; margin-bottom: 10px; }
.download-box span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.back-link { display: block; min-height: 44px; padding: 8px 0 16px; margin: -8px 0 6px; font-size: 13px; line-height: 1.5; text-align: left; color: var(--cobalt); background: none; border: 0; }
.tab-bar { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 600px; display: flex; padding: 0 max(18px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(18px, env(safe-area-inset-left)); background: var(--tile); border-top: 1px solid var(--line); }
.tab { display: flex; flex: 1; min-width: 0; min-height: 64px; align-items: center; justify-content: center; gap: 9px; padding: 13px 6px; border: 0; border-top: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 13px; line-height: 1.4; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--cobalt); border-top-color: var(--cobalt); font-weight: 700; }
.tab:not(:disabled):active { transform: none; }
.history-heading { margin-top: 5px; }
.history-heading h2 { font-size: 26px; }
.history-list { margin: 24px 0 0; padding: 0; list-style: none; }
.history-card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 98px; padding: 21px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; text-align: left; }
.history-check { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; color: var(--success); border: 1.5px solid currentColor; border-radius: var(--round); transform: rotate(-7deg); }
.history-check svg { width: 18px; height: 18px; }
.history-words { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.history-words strong { display: block; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -.2px; color: var(--cobalt); }
.history-words small { display: block; font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 7px; }
.history-card > svg { width: 16px; height: 16px; color: var(--cobalt); }
.empty-history { padding: 42px 8px 24px; }
.empty-mark { display: block; width: 56px; height: 56px; color: var(--cobalt); margin-bottom: 24px; }
.empty-history h3, .complete-panel h3 { margin: 0 0 16px; font: 700 33px/1.12 var(--display); color: var(--cobalt); }
.empty-history p, .complete-panel p { margin: 0 0 24px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.empty-history .button { max-width: 310px; }
.complete-panel { position: relative; text-align: center; padding: 38px 26px; margin-top: 20px; background: var(--tile); }
.complete-panel::before { border-image-source: url('./art/plaque-success.svg'); }
.complete-panel h3 { font-size: 42px; }
.complete-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; color: var(--success); border: 3px solid currentColor; border-radius: var(--round); margin: 0 auto 25px; transform: rotate(-7deg); }
.complete-icon svg { width: 36px; height: 36px; }
.notice { padding: 12px 0 12px 12px; margin: 0 0 18px; border-left: 5px double var(--ink); background: var(--tile); color: var(--ink); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.noscript { position: fixed; z-index: 99; inset: 10%; padding: 25px; overflow: auto; background: var(--tile); color: var(--ink); font-size: 16px; }
.dialog-close { position: absolute; right: 8px; top: 8px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; color: var(--cobalt); border-radius: var(--radius); }
dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 0; color: var(--ink); background: var(--tile); border: 0; border-top: 4px solid var(--cobalt); border-radius: var(--radius); }
dialog::backdrop { background: #192b39b3; }
dialog form { padding: 28px 24px 24px; }
.install-icon { width: 60px; height: 60px; }
dialog h2 { font: 700 31px/1.12 var(--display); color: var(--cobalt); margin: 24px 0 14px; }
dialog p, dialog li { font-size: 14px; line-height: 1.6; color: var(--muted); }
dialog ol { margin: 20px 0; padding-left: 23px; }
dialog li { padding-left: 5px; margin: 12px 0; }
dialog li::marker { color: var(--cobalt); font-weight: 700; }
dialog strong { color: var(--ink); }
dialog .inline-icon { width: 17px; height: 17px; vertical-align: middle; color: var(--cobalt); }
dialog .dialog-footnote { margin: 24px 0; font-size: 12px; }
@keyframes seal-ink { from { opacity: .2; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
@media (hover: hover) {
  .primary:not(:disabled):not(.is-busy):not(.is-recording):not(.is-demoted):hover, .button.next.is-promoted:hover { background: var(--cobalt-strong); border-color: var(--cobalt-strong); }
  .secondary:not(:disabled):hover, .button.listen:not(:disabled):hover, .button.is-demoted:not(:disabled):hover, .history-card:hover { background: var(--wash); }
  .install-button:hover, .button.next:not(.is-promoted):not(:disabled):hover, .tab:not(.active):hover { text-decoration: underline; text-underline-offset: 4px; }
}
@media (min-width: 600px) {
  .app-shell { padding: calc(30px + env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left)); }
  .app-header { margin-bottom: 38px; }
  .phrase-body h3 { font-size: 46px; }
  .phrase-body h3.long { font-size: 40px; }
  .card-content { min-height: 332px; padding: 30px 34px 26px; }
  .tab-bar { padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); }
}
@media (max-width: 359px) {
  .app-shell { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .app-header { gap: 10px; }
  .brand { gap: 7px; }
  .brand img { width: 32px; height: 32px; }
  .brand h1 { font-size: 31px; }
  .install-button { width: 44px; padding: 10px; justify-content: center; }
  .install-button span { display: none; }
  .card-content { padding-inline: 23px; }
  .card-top { gap: 9px; }
  .card-language { gap: 5px; }
  .button { gap: 7px; padding-inline: 9px; font-size: 15px; }
  .button.listen { font-size: 14px; }
  .history-card { gap: 10px; }
  .history-words strong { font-size: 23px; }
}
@media (max-height: 740px) and (max-width: 599px) {
  .app-header { margin-bottom: 23px; }
  .progress-block { margin-top: 14px; margin-bottom: 17px; }
  .card-content { min-height: 268px; padding-top: 24px; padding-bottom: 22px; }
  .phrase-body { padding-block: 22px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .app-shell { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .tab { min-height: 49px; padding-block: 8px; }
}
@media (prefers-contrast: more) {
  :root { --cobalt: #103767; --muted: #253b4e; --line: #344d62; --track: #758a9c; --cobalt-strong: #092446; --success: #174737; --retry: #493c13; }
  .history-card { border-bottom-width: 2px; }
  .transcript-box { border-top-width: 2px; }
  .tab.active { border-top-width: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:not(:disabled):active { transform: none; }
}

.version-note { margin: 16px 0 8px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5; }
