:root {
  --paper: #FDFDFB;
  --ink: #1F2328;
  --muted: #6A6F76;
  --line: #E4E4DF;
  --accent: #2F5D8A;
  --bar-h: 56px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); }

/* ——— Sign-in ——— */
body.login { display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card h1 { font-size: 22px; margin: 12px 0 4px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.login-card form { text-align: left; display: grid; gap: 12px; }
.login-card label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.login-card input { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.login-card .err { min-height: 18px; margin: 0; font-size: 13px; color: #A3312A; }
.login-card button { font: inherit; font-size: 15px; padding: 11px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
.login-card .alt { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.login-card a { color: var(--accent); }
.login-card details.pw { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); text-align: left; }
.login-card details.pw summary { font-size: 13px; color: var(--muted); cursor: pointer; text-align: center; margin-bottom: 12px; }

/* ——— App shell: fixed bar, fixed stage — nothing jumps when tabs change ——— */
body.app { display: grid; grid-template-rows: var(--bar-h) 1fr; overflow: hidden; }
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); height: var(--bar-h); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.tabs { display: flex; gap: 4px; background: #F1F1EC; padding: 4px; border-radius: 10px; }
.tab { font: inherit; font-size: 14px; width: 132px; white-space: nowrap; padding: 7px 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.who { justify-self: end; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.link { font: inherit; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }
.stage { overflow: auto; padding: 32px; }
.pane { max-width: 760px; margin: 0 auto; }
.pane h2 { margin: 0 0 8px; font-size: 24px; }
.pane p { color: var(--muted); line-height: 1.5; }
/* A pane that hosts a whole app (MailMinder): wide, full height, the app framed below its heading. */
.pane.wide { max-width: 1400px; height: 100%; display: flex; flex-direction: column; }
.pane.wide[hidden] { display: none; }
.pane.wide > p { margin: 0 0 16px; }
.app-frame { flex: 1; width: 100%; min-height: 560px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pane .soon { margin-top: 32px; padding: 24px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }

@media (max-width: 640px) {
  .bar { grid-template-columns: 1fr auto; grid-template-rows: var(--bar-h) 48px; height: auto; padding: 0 12px; }
  body.app { grid-template-rows: auto 1fr; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; margin-bottom: 8px; }
  .tab { width: 100px; }
  .brand span { font-size: 15px; }
  .stage { padding: 20px 16px; }
}

/* ——— MailMinder: the disguised mail copy (stage 3) ——— */
.mail-status { font-size: 13px; margin: 20px 0 12px; }
.mail-status.warn { color: #8A5A00; }
.mail-list { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.mail-item + .mail-item { border-top: 1px solid var(--line); }
.mail-head { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 180px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; padding: 10px 14px; cursor: pointer; }
.mail-head:hover, .mail-head:focus-visible { background: #F6F6F2; }
.mail-from { grid-row: 1 / 3; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.mail-subject { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.mail-meta { font-size: 12px; color: var(--muted); }
.unread .mail-from, .unread .mail-subject { font-weight: 600; }
.mail-body { padding: 4px 14px 16px; border-top: 1px dashed var(--line); background: #FBFBF8; }
.mail-addr { font-size: 12px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.mail-text { font: inherit; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; color: var(--ink); }

@media (max-width: 640px) {
  .mail-head { grid-template-columns: 1fr; }
  .mail-from { grid-row: auto; }
}

/* ——— Mitra tab (item 2, 10-19): Mitra's own screens, four columns wide, so this pane takes the whole width. ——— */
.pane.wide.full { max-width: none; }

/* ——— Item 5: the first-open window. Centered at first, then docked at the bottom while Mitra talks, so the
   screens it describes show behind it. Fixed sizes: nothing resizes as the lines change. ——— */
.intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(253, 253, 251, .88); backdrop-filter: blur(3px); }
.intro[hidden] { display: none; }
.intro-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(31, 35, 40, .14); }
.intro-start { width: min(440px, calc(100% - 32px)); padding: 32px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.intro-start h2 { margin: 6px 0 0; font-size: 24px; }
.intro-start p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.intro-go { font: inherit; font-size: 16px; font-weight: 600; width: 100%; padding: 13px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; }
.intro-start .link { font-size: 13px; }
.intro.docked { background: transparent; backdrop-filter: none; pointer-events: none; align-items: end; padding-bottom: 24px; }
.intro-dock { pointer-events: auto; position: relative; width: min(680px, calc(100% - 32px)); height: 178px; padding: 20px 24px; }
.intro-card[hidden] { display: none; }
.intro-cap { margin: 0; padding-right: 44px; height: 104px; overflow: hidden; font-size: 17px; line-height: 1.55; color: var(--ink); }
.intro-bar { height: 4px; border-radius: 2px; background: #EEEEE9; overflow: hidden; margin-top: 12px; }
.intro-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.intro-x { position: absolute; top: 12px; right: 16px; font-size: 13px; }
.intro-ask { margin: 0 0 12px; padding-right: 44px; font-weight: 600; }
.intro-tries { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.intro-tries button { font: inherit; text-align: left; display: grid; gap: 3px; padding: 10px 12px; height: 92px; align-content: start; border: 1px solid var(--line); border-radius: 10px; background: #FBFBF8; color: var(--ink); cursor: pointer; }
.intro-tries button:hover { border-color: var(--accent); }
.intro-tries b { font-size: 14px; font-weight: 600; }
.intro-tries span { font-size: 12px; color: var(--muted); }
.who #introOpen { font-size: 13px; }
@media (max-width: 640px) {
  .intro-dock { height: auto; }
  .intro-cap { height: auto; min-height: 104px; font-size: 16px; }
  .intro-tries { grid-template-columns: 1fr 1fr; }
  .intro-tries button { height: 72px; }
}
