/* Plan Notes: the look. A dark phone screen in the CEO colours: ink, gold and cream, DM Sans. One big gold Record button, a box for the words, and the notes below.
   Every text colour is chosen so it is 4.5 to 1 or better on what is behind it (the test measures the real screens, so a dimmed note is a different colour, never a fade).
   Buttons and switches are at least 48 px tall. Nothing is wider than the phone. */
:root {
  --ink: #1A1408; --ink2: #2A2110; --ink3: #3A3020; --well: #100B03;
  --gold: #D4AF37; --gold-lt: #F0DCA0; --cream: #FAF7F0; --soft: #D2C7AA; --faint: #B9AC8A; --edge: #9A8650;
  --wait-bg: #3A2E0E; --wait: #F0DCA0;
  --done-bg: #12301F; --done: #A8E0BE;
  --ask-bg: #4A1F18; --ask: #FFC9BF;
  --gone-bg: #2A2110; --gone: #B9AC8A;
  --unsent-bg: #1B2B44; --unsent: #B9D3FF;
  --bad: #FFB4A8; --ok: #A8E0BE;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 18px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--ink); color: var(--cream); font: 16px/1.5 'DM Sans', system-ui, -apple-system, sans-serif; -webkit-text-size-adjust: 100%; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; background: none; border: 0; }
button:disabled { cursor: default; }
button:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { min-height: 100dvh; max-width: 560px; margin: 0 auto; }
header.top { display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-top)) 16px 10px; min-height: 64px; border-bottom: 1px solid var(--ink3); }
header.top .mark { border-radius: 9px; flex: none; }
header.top h1 { flex: 1; min-width: 0; font-size: 22px; line-height: 1.2; font-weight: 700; color: var(--cream); letter-spacing: .01em; }
.lock { min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--edge); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--cream); }
.lock svg { width: 18px; height: 18px; }
.lock:active { background: var(--ink3); }

/* the shared sign-in screen (manda-pin.js, copied unchanged) draws its small "MANDA OS" line in a gold that is 3.6 to 1 on the cream card; this page darkens it to 6.5 to 1 */
#gate .mgate .mgate-card .mgate-kick { color: #6B530F; }

main#view { padding: 16px 16px calc(32px + var(--safe-bottom)); }
.card { background: var(--ink2); border: 1px solid var(--ink3); border-radius: var(--radius); padding: 18px 16px 16px; }

/* editing and replying banner */
.mode { background: var(--ink); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; color: var(--cream); }
.mode b { display: block; font-size: 15px; margin-bottom: 4px; }
.mode .q, .mode .was { color: var(--soft); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.mode .q { margin-top: 4px; }
.mode .was { margin-top: 4px; }
.mode .q span, .mode .was span { color: var(--gold-lt); font-weight: 700; }
.mode button { margin-top: 10px; }

/* the big Record button */
.recwrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 6px 0 18px; }
.rec { width: 152px; height: 152px; border-radius: 50%; background: var(--gold); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 18px; box-shadow: 0 0 0 6px rgba(212, 175, 55, .22), 0 10px 26px rgba(0, 0, 0, .45); position: relative; }
.rec svg { width: 50px; height: 50px; }
.rec:active { transform: scale(.97); }
.rec:disabled { background: var(--ink3); color: var(--faint); box-shadow: none; }
.rec.listening { background: var(--cream); color: var(--ink); animation: pulse 1.6s ease-out infinite; }
.rec.listening svg { color: #B3372B; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, .75), 0 10px 26px rgba(0, 0, 0, .45); } 70% { box-shadow: 0 0 0 26px rgba(212, 175, 55, 0), 0 10px 26px rgba(0, 0, 0, .45); } 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0), 0 10px 26px rgba(0, 0, 0, .45); } }
@media (prefers-reduced-motion: reduce) { .rec.listening { animation: none; box-shadow: 0 0 0 10px rgba(212, 175, 55, .55), 0 10px 26px rgba(0, 0, 0, .45); } .rec:active { transform: none; } }
.recstate { font-size: 15px; color: var(--soft); text-align: center; min-height: 22px; overflow-wrap: anywhere; }

/* the words */
.lbl { display: block; font-size: 14px; font-weight: 700; color: var(--gold-lt); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
textarea#note { display: block; width: 100%; min-height: 150px; resize: vertical; background: var(--well); color: var(--cream); border: 2px solid var(--edge); border-radius: 14px; padding: 12px 14px; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
textarea#note::placeholder { color: var(--faint); opacity: 1; }
textarea#note:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(212, 175, 55, .35); }
.meta { min-height: 22px; text-align: right; padding-top: 4px; }
.count { font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; }
.count.near { color: var(--ask); font-weight: 700; }

.actions { display: flex; gap: 10px; margin-top: 4px; }
.btn { min-height: 52px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--edge); background: var(--ink3); color: var(--cream); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.btn:active:not(:disabled) { filter: brightness(1.15); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); flex: 1; }
.btn:disabled { background: var(--ink2); border-color: var(--ink3); color: var(--faint); }
.btn.gold:disabled { background: var(--ink3); border-color: var(--ink3); color: var(--faint); }
.btn.small { min-height: 48px; padding: 0 16px; font-size: 15px; }
.btn.danger { background: var(--ask-bg); border-color: #C9604F; color: var(--ask); }

.msg { margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.msg.ok { background: var(--done-bg); color: var(--ok); }
.msg.bad { background: var(--ask-bg); color: var(--bad); }
.msg.info { background: var(--unsent-bg); color: var(--unsent); }

.fine { margin-top: 12px; font-size: 13.5px; line-height: 1.45; color: var(--soft); }
.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-top: 10px; font-weight: 600; color: var(--cream); }
.switch { width: 60px; height: 48px; flex: none; display: flex; align-items: center; justify-content: flex-start; padding: 0 4px; position: relative; }
.switch .knob { display: block; width: 52px; height: 30px; border-radius: 15px; background: var(--ink3); border: 2px solid var(--edge); position: relative; transition: background .15s; }
.switch .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); transition: transform .15s; }
.switch[aria-checked="true"] .knob { background: var(--gold); border-color: var(--gold); }
.switch[aria-checked="true"] .knob::after { transform: translateX(22px); background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .switch .knob, .switch .knob::after { transition: none; } }

/* the notes */
.notes { margin-top: 26px; }
.notes h2 { font-size: 20px; font-weight: 700; color: var(--cream); margin-bottom: 12px; }
.note { background: var(--ink2); border: 1px solid var(--ink3); border-radius: 16px; padding: 14px; margin-bottom: 12px; min-width: 0; }
.note .when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13.5px; color: var(--soft); margin-bottom: 8px; }
.note .words { font-size: 16.5px; color: var(--cream); white-space: pre-wrap; overflow-wrap: anywhere; }
.note .line { margin-top: 8px; font-size: 14.5px; color: var(--soft); overflow-wrap: anywhere; }
.note .line b { color: var(--gold-lt); font-weight: 700; }
.note .question { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ask-bg); color: var(--ask); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.note .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.note .sure { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--ink); border: 1px solid var(--edge); }
.note .sure p { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--cream); }
.note .sure .acts { margin-top: 0; }
.note.gone { background: var(--ink); }
.note.gone .words { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--edge); }
.note.unsent { border-color: #3E5F92; }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.chip.wait { background: var(--wait-bg); color: var(--wait); }
.chip.done { background: var(--done-bg); color: var(--done); }
.chip.ask { background: var(--ask-bg); color: var(--ask); }
.chip.gone { background: var(--gone-bg); color: var(--gone); border: 1px solid var(--ink3); }
.chip.unsent { background: var(--unsent-bg); color: var(--unsent); }
.plain { font-size: 15.5px; color: var(--soft); padding: 6px 2px 12px; overflow-wrap: anywhere; }
.plain.bad { color: var(--bad); }
.toggle { min-height: 48px; padding: 0 4px; font-weight: 700; font-size: 15px; color: var(--gold-lt); text-decoration: underline; text-underline-offset: 3px; }

/* the one notice before the first time he speaks */
.sheetbg { position: fixed; inset: 0; z-index: 800; background: rgba(0, 0, 0, .72); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.sheet { width: 100%; max-width: 520px; background: var(--ink2); border: 1px solid var(--edge); border-radius: 22px; padding: 22px 20px 18px; margin-bottom: calc(8px + var(--safe-bottom)); }
.sheet h2 { font-size: 20px; margin-bottom: 8px; color: var(--cream); }
.sheet p { font-size: 16px; color: var(--soft); margin-bottom: 16px; }
.sheet .actions { flex-direction: column; }
.sheet .btn { width: 100%; }
