/* CW Continuity — "Beacon" theme (owner-approved 19-Nov). Night navy + signal amber; amber always means
   "emergency state". No external fonts or CDNs: the portal must work with nothing but the customer's own AWS. */
:root {
  --night:#0a1430; --night-2:#0f1b3d; --signal:#ffb020; --signal-ink:#0a1430; --blue:#2f6bff; --blue-dk:#1d4fd6;
  --ink:#101828; --ink-2:#344054; --muted:#475467; --faint:#667085; --line:#eaecf0; --line-2:#d0d5dd;
  --soft:#f5f8ff; --bg:#ffffff; --ok:#067647; --ok-bg:#ecfdf3; --err:#b42318; --err-bg:#fef3f2; --warn:#b4580f;
  --radius:12px; --display:"Segoe UI Variable Display","Segoe UI",system-ui,-apple-system,sans-serif;
  font-family: "Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,sans-serif; color: var(--ink);
}
[hidden] { display: none !important; }            /* author display rules must never beat the hidden attribute */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2 { font-family: var(--display); letter-spacing: -.02em; }
a { color: var(--blue); } a:hover { color: var(--blue-dk); }
button { font: inherit; cursor: pointer; border-radius: 10px; min-height: 44px; padding: 0 18px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--night); color: #fff; border: 0; }
button.primary .arrow { stroke: var(--signal); }
button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
button.signal { background: var(--signal); color: var(--signal-ink); border: 0; }
button.link { background: none; border: 0; color: var(--blue); padding: 0 8px; }
button.small { min-height: 36px; font-size: 13px; padding: 0 12px; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label .sub { font-weight: 400; color: var(--faint); }
input, textarea, select { font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius); }
input, select { height: 52px; padding: 0 16px; } textarea { padding: 12px 16px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(47,107,255,.3); border-color: var(--blue); }
input.code { font-family: Consolas, ui-monospace, monospace; font-size: 26px; letter-spacing: .4em; text-align: center; height: 60px; }
.error { color: var(--err); font-size: 14px; margin: 0; min-height: 0; }
.error:not(:empty) { background: var(--err-bg); border-radius: 10px; padding: 10px 14px; margin-top: 16px; }

/* ---------- sign-in ---------- */
.auth { display: flex; min-height: 100vh; }
.beacon { position: relative; overflow: hidden; width: 44%; max-width: 620px; background: var(--night); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.logo { position: relative; display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 19px; }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--signal); color: var(--signal-ink); display: inline-flex; align-items: center; justify-content: center; }
.pitch { position: relative; display: flex; flex-direction: column; gap: 22px; }
.pitch h1 { margin: 0; font-size: clamp(32px, 3.6vw, 50px); line-height: 1.06; font-weight: 700; }
.pitch h1 span { color: var(--signal); }
.pitch p { margin: 0; color: #b7c0d6; font-size: 16px; line-height: 1.6; max-width: 420px; }
.fine { position: relative; margin: 0; font-size: 12px; color: #8792ad; }
.statuscard { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px 18px; width: fit-content; }
.statuscard div { display: flex; flex-direction: column; gap: 2px; } .statuscard strong { font-size: 13px; } .statuscard span { font-size: 12px; color: #b7c0d6; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,176,32,.6); } 70% { box-shadow: 0 0 0 12px rgba(255,176,32,0); } 100% { box-shadow: 0 0 0 0 rgba(255,176,32,0); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
.rings { position: absolute; right: -180px; bottom: -180px; width: 560px; height: 560px; }
.rings i, .rings b { position: absolute; border-radius: 50%; }
.rings i { border: 1px solid rgba(255,176,32,.14); } .rings i:nth-child(1) { inset: 0; } .rings i:nth-child(2) { inset: 70px; border-color: rgba(255,176,32,.2); }
.rings i:nth-child(3) { inset: 140px; border-color: rgba(255,176,32,.28); } .rings i:nth-child(4) { inset: 210px; border-color: rgba(255,176,32,.4); }
.rings b { inset: 268px; background: var(--signal); opacity: .9; }
.authpane { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.authbox { width: 100%; max-width: 420px; }
.step { display: flex; flex-direction: column; gap: 18px; }
.step h2 { margin: 0; font-size: 32px; font-weight: 700; }
.eyebrow { margin: 0 0 -10px; font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: .08em; text-transform: uppercase; }
.lead { margin: -8px 0 8px; font-size: 15px; color: var(--muted); line-height: 1.5; }
.note { margin: 8px 0 0; padding: 14px 16px; background: var(--soft); border-radius: var(--radius); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.hint { margin: -8px 0 0; font-size: 13px; color: var(--faint); }
.steps { list-style: none; margin: 0 0 28px; padding: 0; display: flex; gap: 16px; counter-reset: s; flex-wrap: wrap; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); font-weight: 500; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: #eaecf0; color: var(--faint); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.steps li.done::before { content: "✓"; } .steps li.cur { color: var(--ink); font-weight: 600; } .steps li.cur::before { background: var(--night); color: var(--signal); }
.rules { list-style: none; margin: -6px 0 0; padding: 12px 14px; background: #f9fafb; border-radius: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; font-size: 13px; color: var(--faint); }
.rules li::before { content: "○"; display: inline-block; width: 18px; } .rules li.ok { color: var(--ok); } .rules li.ok::before { content: "✓"; font-weight: 700; }
.qrrow { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr { padding: 10px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 3px rgba(16,24,40,.08); line-height: 0; background: #fff; }
.qr svg { width: 160px; height: 160px; stroke: none; }
.manual { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); flex: 1; min-width: 180px; }
.manual strong { color: var(--ink); }
.manual code { font-family: Consolas, ui-monospace, monospace; font-size: 13px; background: #f2f4f7; border-radius: 8px; padding: 8px 10px; line-height: 1.6; word-break: break-all; }
.manual button { align-self: flex-start; }

/* ---------- mailbox ---------- */
.shell { display: flex; height: 100vh; }
.rail { width: 72px; background: var(--night); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0; flex-shrink: 0; }
.rail .mark { width: 40px; height: 40px; margin-bottom: 14px; }
.rail a { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #8792ad; }
.rail a.on { background: rgba(255,176,32,.14); color: var(--signal); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.banner { min-height: 44px; background: var(--signal); color: var(--signal-ink); display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.banner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal-ink); }
.banner span { font-weight: 500; }
.banner.standby { background: #f2f4f7; color: var(--ink-2); } .banner.standby::before { background: var(--faint); }
.top { height: 60px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 17px; } .grow { flex: 1; }
#who { font-size: 14px; color: var(--ink-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--night); color: var(--signal); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.panes { flex: 1; display: flex; min-height: 0; }
.side { width: 230px; padding: 16px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; overflow: auto; flex-shrink: 0; }
.side > button.primary { min-height: 48px; margin-bottom: 12px; } .side > button svg { stroke: var(--signal); }
.mbsel { padding: 0 4px 8px; font-size: 12px; color: var(--faint); } .mbsel select { height: 40px; font-size: 13px; padding: 0 8px; border-radius: 10px; }
.folders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.folders a { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 14px; }
.folders a.active { background: #eef3ff; font-weight: 600; }
.admin { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; } .admin .label { font-size: 12px; font-weight: 600; color: var(--faint); padding: 0 4px; }
.list { width: 380px; border-right: 1px solid var(--line); overflow: auto; flex-shrink: 0; }
.list ul { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #f2f4f7; cursor: pointer; }
.list li:hover { background: #f9fafb; } .list li.sel { background: var(--soft); box-shadow: inset 3px 0 0 var(--blue); }
.list li .av { width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list li .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list li .r1 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; } .list li .r1 time { font-size: 12px; color: var(--faint); white-space: nowrap; }
.list li .who, .list li .subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li .subj { font-size: 13px; } .list li.unseen .who, .list li.unseen .subj { font-weight: 700; }
.empty { color: var(--faint); padding: 24px; margin: 0; }
.read { flex: 1; padding: 28px 36px; overflow: auto; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.read h2 { margin: 0; font-size: 26px; }
.read .from { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.read .from strong { display: block; font-size: 14px; color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; background: #f2f4f7; color: var(--ink-2); }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.wait { background: #fffaeb; color: #93370d; } .chip.bad { background: var(--err-bg); color: var(--err); }
.read pre { white-space: pre-wrap; font-family: inherit; font-size: 15px; line-height: 1.7; color: var(--ink-2); margin: 8px 0 0; }
.ledger { border-top: 1px solid var(--line); padding-top: 14px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.ledger div { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

/* ---------- admin: external mail ---------- */
.rail a { position: relative; }
.badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--signal); color: var(--signal-ink); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.adminview { flex: 1; overflow: auto; padding: 28px 36px; display: flex; flex-direction: column; gap: 20px; }
.adminhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; } .adminhead h2 { margin: 0 0 12px; font-size: 26px; }
.domgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.domcard { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.domcard h3 { margin: 0; font-family: var(--display); font-size: 18px; } .domcard .co { font-size: 13px; color: var(--faint); }
.dir { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #f2f4f7; font-size: 14px; }
.dir .what { font-weight: 600; } .dir .hint2 { font-size: 12px; color: var(--faint); grid-column: 2 / 4; margin-top: -6px; }
.apprcard { border: 1px solid #fedf89; background: #fffaeb; border-radius: 14px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.apprcard strong { display: block; margin-bottom: 2px; }
/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: 16px; padding: 28px 32px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(16,24,40,.3); }
dialog::backdrop { background: rgba(10,20,48,.5); }
dialog form { display: flex; flex-direction: column; gap: 14px; } dialog h2 { margin: 0; font-size: 22px; }
.row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.dlghead { display: flex; align-items: center; gap: 12px; }
.warnicon { width: 38px; height: 38px; border-radius: 50%; background: #fdf0e6; color: var(--warn); display: inline-flex; align-items: center; justify-content: center; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .auth { flex-direction: column; } .beacon { width: 100%; max-width: none; padding: 28px 24px 36px; gap: 20px; }
  .beacon .fine, .pitch p { display: none; } .pitch h1 { font-size: 32px; } .rings { right: -200px; top: -160px; bottom: auto; }
  .authpane { padding: 28px 20px 40px; border-radius: 24px 24px 0 0; margin-top: -20px; background: #fff; position: relative; align-items: flex-start; }
  .shell { flex-direction: column; height: auto; min-height: 100vh; } .rail { display: none; }
  .panes { flex-direction: column; } .side, .list { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .read { padding: 20px; } #who { display: none; }
}

.msg-actions{display:flex;gap:8px;margin:4px 0 14px}
.msg-actions button{padding:6px 14px;font-size:14px}

/* ---------- composer: option A, written in the reading pane (Outlook on the web) ---------- */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.composer { flex: 1; min-width: 0; display: flex; }
.composer form { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cz-bar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.cz-bar h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.cz-bar .error { margin: 0; font-size: 13px; flex: 1; }
.cz-bar svg { width: 17px; height: 17px; }
.cz-bar #send { min-height: 40px; }
.cz-discard { margin-left: auto; background: none; border: 0; color: var(--err); min-height: 40px; padding: 0 10px; }
.cz-discard:hover { background: var(--err-bg); }
.cz-field { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 0 24px; border-bottom: 1px solid var(--line); min-height: 48px; font-size: 14px; font-weight: 400; color: var(--faint); }
.cz-field > span { width: 44px; flex-shrink: 0; }
.cz-field input { flex: 1; border: 0; height: 46px; padding: 0; font-size: 15px; border-radius: 0; background: transparent; min-width: 0; }
.cz-field input:focus { outline: 0; }
.cz-field:focus-within { box-shadow: inset 3px 0 0 var(--blue); }
.cz-from output { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-link { background: none; border: 0; color: var(--blue); min-height: 32px; padding: 0 6px; font-size: 14px; font-weight: 600; }
.cz-subject { min-height: 54px; } .cz-subject input { font-size: 18px; font-weight: 600; color: var(--ink); }
.cz-subject input::placeholder { font-weight: 400; color: var(--faint); }
.cz-body { flex: 1; display: flex; padding: 0; gap: 0; min-height: 260px; }
.cz-body textarea { flex: 1; border: 0; border-radius: 0; resize: none; padding: 18px 24px; font-size: 15px; line-height: 1.6; }
.cz-body textarea:focus { outline: 0; }
@media (max-width: 860px) {           /* phone: full-screen composer (option D) */
  .composer { position: fixed; inset: 0; z-index: 40; background: #fff; }
  .cz-bar { padding: 8px 12px; } .cz-field { padding: 0 16px; } .cz-body textarea { padding: 16px; font-size: 16px; }
}

@keyframes freshIn { from { background: #fff4e0; } to { background: transparent; } }
#items li.fresh { animation: freshIn 4s ease-out; }

.mailframe { flex-shrink: 0; width: 100%; border: 0; min-height: 120px; display: block; background: #fff; }
.imgbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #f5f8ff; border: 1px solid #dbe6ff; border-radius: 10px; padding: 8px 14px; font-size: 13px; color: var(--ink-2); }
.imgbar .link { min-height: 32px; }

.exportbox { margin-top: 18px; padding: 0 4px; display: flex; flex-direction: column; gap: 6px; }
.exportbox button { justify-content: flex-start; } .exportbox svg { width: 16px; height: 16px; }
.exportbox .sub { margin: 0; font-size: 12px; color: var(--faint); }
