/* ============================================================
   voice.champsland.com — worker voice, «صوتك يوصل» (inc 1, 2026-10-22)
   The mock-up's look (docs/brainstorm/worker-voice/canvas/), phone first,
   Egyptian Arabic, big type, one tap per choice, 60 px targets.
   No inline styles anywhere: the page's Content-Security-Policy
   (nginx-voice.conf.example) allows only this file.
   The font is our own copy (stage.sh puts it in fonts/): a page a worker
   opens to complain should not hand their IP to a font CDN on the way in.
   ============================================================ */
@font-face {
  font-family: 'Cairo'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(fonts/cairo-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(fonts/cairo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #F6F7F4; --card: #FFFFFF; --ink: #17201C; --muted: #5E6B65;
  --line: #D8DED9; --dash: #B9C4BE; --soft: #EEF1EE;
  --accent: #0F6E63; --accent-dark: #0A5047; --accent-bg: #DDEFEB;
  --warn: #B42318; --warn-bg: #FDECEA; --warn-line: #F3B9B2;
  --amber: #7A4B00; --amber-bg: #FFF3DC;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Cairo', 'Noto Sans Arabic', system-ui, sans-serif; font-size: 17px; line-height: 1.55; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
p { margin: 0; }
h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 800; }
h1:focus { outline: none; }
h2 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 800; }
main { display: block; max-width: 480px; margin: 0 auto; padding-bottom: 32px; }
main:focus { outline: none; }
.pad { padding: 0 20px; }
.sec { padding: 16px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.lead { font-size: 17px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); line-height: 1.6; }
.en { font-size: 12px; color: var(--muted); direction: ltr; text-align: right; }
.divider { margin: 18px 20px 0; border-top: 2px dashed var(--dash); }
.label { font-size: 15px; font-weight: 700; color: var(--muted); }
.ico { display: inline-flex; align-items: center; justify-content: center; }
.ico svg { display: block; }

/* ── The bar ─────────────────────────────────────────────────── */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 4px; max-width: 480px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 12px; letter-spacing: .14em; direction: ltr; color: var(--muted); }
.secret { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 700; }

/* ── The top row of every inner screen: back + read aloud ───── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 20px 0; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 16px; }
.speak { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); color: var(--accent); font-weight: 700; font-size: 15px; }
.speak[aria-pressed="true"] { background: var(--accent-bg); }
.speak.big { min-height: 60px; border: 0; border-radius: 30px; background: var(--accent); color: #fff; font-size: 19px; justify-content: center; gap: 12px; }
.speak.big[aria-pressed="true"] { background: var(--accent-dark); }

/* ── The three pictograms ───────────────────────────────────── */
.picto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 16px 20px 0; }
.picto div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; font-weight: 700; text-align: center; }

/* ── Tiles: the three kinds, the six topics ─────────────────── */
.tiles { display: flex; flex-direction: column; gap: 12px; padding: 0 20px; }
.tile { display: flex; align-items: center; gap: 14px; min-height: 96px; padding: 0 16px; width: 100%; text-align: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; color: var(--ink); }
.tile:active, .tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.tile .ring { width: 60px; height: 60px; border-radius: 30px; background: var(--accent-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile[aria-pressed="true"] .ring { background: #fff; }
.tile .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .big { font-size: 24px; font-weight: 800; line-height: 1.2; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 20px; }
.grid2 .tile { flex-direction: column; justify-content: center; text-align: center; gap: 8px; min-height: 124px; padding: 12px 8px; }
.grid2 .tile .ring { width: 52px; height: 52px; }
.grid2 .tile .big { font-size: 18px; }
.grid2 .tile .en { text-align: center; }

/* ── Choices: urgent or not; the floor chips ────────────────── */
.choice { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 10px 16px; text-align: start;
  background: var(--card); border: 2px solid var(--line); border-radius: 16px; color: var(--ink); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.choice.urgent[aria-pressed="true"] { border-color: var(--warn); background: var(--warn-bg); }
.choice .tx { display: flex; flex-direction: column; gap: 2px; }
.choice .big { font-size: 20px; font-weight: 800; }
.choice .sub { font-size: 14px; color: var(--muted); }
.choice.urgent .big { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 0 18px; border: 2px solid var(--line); border-radius: 24px; background: var(--card); font-weight: 700; font-size: 16px; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-dark); }

/* ── Say it: the doors, the text, the warnings ──────────────── */
.doors { display: flex; flex-direction: column; gap: 10px; }
.door { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 8px 16px; text-align: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); }
.door[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.door .ring { width: 48px; height: 48px; border-radius: 24px; background: var(--accent-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.door[aria-pressed="true"] .ring { background: #fff; }
.door .tx { display: flex; flex-direction: column; gap: 1px; }
.door .big { font-size: 19px; font-weight: 800; }
.door .sub { font-size: 13.5px; color: var(--muted); }
textarea { width: 100%; min-height: 160px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); font-size: 18px; line-height: 1.6; resize: vertical; }
textarea:focus { border-color: var(--accent); outline: none; }
.count { font-size: 13px; color: var(--muted); text-align: end; }
.warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--warn-line); border-radius: 14px; background: var(--warn-bg); color: #5E1A12; font-size: 14.5px; line-height: 1.6; }
.warn .ico { flex-shrink: 0; margin-top: 2px; }
.amber { padding: 12px 14px; border-radius: 14px; background: var(--amber-bg); color: var(--amber); font-size: 14px; line-height: 1.6; }

/* ── Confirm: the summary chips and the words, large ────────── */
.sum { display: flex; flex-wrap: wrap; gap: 6px; }
.sum span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 16px; background: var(--soft); font-size: 14px; font-weight: 700; color: var(--muted); }
.sum span.u { background: var(--warn-bg); color: var(--warn); }
.words { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); font-size: 21px; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; }
.words.empty { color: var(--muted); font-size: 18px; text-align: center; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; padding: 0 20px; border: 0; border-radius: 30px; background: var(--accent); color: #fff; font-size: 19px; font-weight: 800; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.alt { background: var(--card); color: var(--accent); border: 2px solid var(--accent); }
.btn.quiet { background: var(--soft); color: var(--ink); }
.btn.go { font-size: 22px; min-height: 66px; }
.err { display: none; padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: 15px; }
.err.on { display: block; }
.link { background: none; border: 0; padding: 8px 0; color: var(--accent); font-weight: 700; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; }

/* ── Sent: the code ─────────────────────────────────────────── */
.sentHead { text-align: center; padding-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sentHead .ring { width: 84px; height: 84px; border-radius: 42px; background: var(--accent-bg); display: flex; align-items: center; justify-content: center; }
.codeCard { padding: 20px; border: 2px solid var(--accent); border-radius: 20px; background: var(--card); text-align: center; display: flex; flex-direction: column; gap: 6px; }
.code { font-size: 48px; font-weight: 800; letter-spacing: .08em; direction: ltr; font-variant-numeric: tabular-nums; color: var(--accent-dark); line-height: 1.2; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 8px 16px; text-align: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); }
.toggle .tx { display: flex; flex-direction: column; gap: 1px; }
.toggle .big { font-size: 17px; font-weight: 800; }
.toggle .sub { font-size: 13.5px; color: var(--muted); }
.sw { width: 52px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex-shrink: 0; transition: background .15s; }
.sw::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; transition: transform .15s; }
.toggle[aria-pressed="true"] .sw { background: var(--accent); }
.toggle[aria-pressed="true"] .sw::after { transform: translateX(-22px); }

/* ── The reply ──────────────────────────────────────────────── */
input.codeIn { width: 100%; min-height: 64px; padding: 0 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); font-size: 30px; font-weight: 800; letter-spacing: .1em; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; }
input.codeIn:focus { border-color: var(--accent); outline: none; }
.replyCard { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.replyHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.replyHead .week { font-size: 14px; color: var(--muted); font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 36px; padding: 0 14px; border-radius: 18px; font-weight: 800; font-size: 15px; }
.status.received { background: var(--soft); color: var(--muted); }
.status.reading { background: var(--amber-bg); color: var(--amber); }
.status.done { background: var(--accent-bg); color: var(--accent-dark); }
.status.cannot { background: var(--warn-bg); color: var(--warn); }
.replyText { font-size: 20px; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.legend i.received { background: var(--dash); } .legend i.reading { background: #D99A1E; } .legend i.done { background: var(--accent); } .legend i.cannot { background: var(--warn); }
