/* MANDA CEO Workstation: the look. Ink, gold and cream; rounded cards; a rail on a tablet or computer and a bar along the bottom on a phone.
   Text colours are chosen so small text is 4.5 to 1 or better on its background (the test measures the pairs). */
:root {
  --ink: #1A1408; --ink2: #2A2110; --ink3: #3A3020;
  --gold: #D4AF37; --gold-lt: #F0DCA0; --gold-dk: #7A5E0A; --gold-bg: #FDF8E9;
  --page: #FAF7F0; --card: #FFFFFF; --line: #E4DCC8; --text: #1A1408; --soft: #6B5F46;
  --red: #B3372B; --red-bg: #FBEDEA; --green: #1F6B42; --green-bg: #E9F4EC; --amber: #8A5A00; --amber-bg: #FFF5DB;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --rail: 92px; --bar: 64px; --radius: 20px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--ink); color: var(--text); font: 15px/1.5 'DM Sans', system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; background: none; border: 0; }
a { color: var(--gold-dk); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, summary: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; }

/* the app: a rail beside the page (computer and tablet), a bar under it (phone) */
.ws { display: grid; grid-template-columns: var(--rail) 1fr; grid-template-rows: 1fr; height: 100dvh; background: var(--page); }
.nav { background: var(--ink); color: var(--gold-lt); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: calc(14px + var(--safe-top)) 8px 14px; }
.nav .mark { width: 44px; height: 44px; margin-bottom: 10px; }
.nav button.item { width: 76px; min-height: 64px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--gold-lt); font-size: 12px; font-weight: 600; position: relative; }
.nav button.item svg { width: 24px; height: 24px; }
.nav button.item[aria-current="page"] { background: var(--gold); color: var(--ink); }
.nav button.item:hover:not([aria-current="page"]) { background: var(--ink3); }
.nav .dot { position: absolute; top: 6px; right: 12px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nav .grow { flex: 1; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
header.top { background: var(--page); display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 20px 10px; border-bottom: 1px solid var(--line); min-height: 64px; }
header.top h1 { flex: 1; font: 700 22px/1.2 'Playfair Display', Georgia, serif; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chipbtn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.chipbtn:hover { border-color: var(--gold); }
.chipbtn svg { width: 18px; height: 18px; }
main#view { flex: 1; overflow-y: auto; padding: 18px 20px calc(28px + var(--safe-bottom)); min-height: 0; }
main#view.flush { padding: 0; overflow: hidden; }
.wrap { max-width: 1120px; margin: 0 auto; }

@media (max-width: 759px) {
  .ws { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .nav { grid-row: 2; flex-direction: row; justify-content: space-around; align-items: stretch; padding: 6px 6px calc(6px + var(--safe-bottom)); gap: 2px; border-top: 1px solid var(--ink3); }
  .nav .mark, .nav .grow { display: none; }
  .nav button.item { width: auto; flex: 1; min-height: 52px; border-radius: 16px; font-size: 11.5px; }
  .nav .dot { right: calc(50% - 26px); top: 3px; }
  .main { grid-row: 1; }
  header.top { padding: calc(8px + var(--safe-top)) 14px 8px; }
  header.top h1 { font-size: 20px; }
  main#view { padding: 14px 14px 22px; }
}

/* cards, chips, buttons */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card + .card { margin-top: 12px; }
.card h2 { font: 700 17px/1.3 'Playfair Display', Georgia, serif; color: var(--ink); margin-bottom: 8px; }
.eyebrow { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); font-weight: 700; }
.soft { color: var(--soft); }
.chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; background: var(--gold-bg); color: var(--gold-dk); border: 1px solid var(--gold-lt); }
.chip.good { background: var(--green-bg); color: var(--green); border-color: #cfe6d6; }
.chip.bad { background: var(--red-bg); color: var(--red); border-color: #f2c9c3; }
.chip.warn { background: var(--amber-bg); color: var(--amber); border-color: #f0dca0; }
.btn { border-radius: 14px; border: 1px solid var(--line); background: var(--card); min-height: 48px; padding: 0 18px; font-weight: 600; color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.big { width: 100%; min-height: 52px; font-size: 16px; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.banner { border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; background: var(--gold-bg); border: 1px solid var(--gold-lt); color: var(--ink); }
.banner b { display: block; margin-bottom: 2px; }
.banner.bad { background: var(--red-bg); border-color: #f2c9c3; }
.empty { text-align: center; color: var(--soft); padding: 34px 16px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Home */
.hello { font: 700 26px/1.2 'Playfair Display', Georgia, serif; color: var(--ink); }
.hello small { display: block; font: 500 14px/1.4 'DM Sans', system-ui, sans-serif; color: var(--soft); margin-top: 2px; }
.widgets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
@media (max-width: 899px) { .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-align: left; display: block; width: 100%; }
.widget:hover { border-color: var(--gold); }
.widget .num { font: 700 30px/1.1 'Playfair Display', Georgia, serif; color: var(--ink); margin: 4px 0 2px; }
.widget .sub { font-size: 13px; color: var(--soft); }
.chartcard { padding: 16px 18px 12px; }
.chartbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pill { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--page); font-weight: 600; font-size: 14px; color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--gold-lt); }
.chartbar .gap { flex: 1; }
.chartHead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 4px 0 6px; }
.chartHead .big { font: 700 28px/1.1 'Playfair Display', Georgia, serif; color: var(--ink); }
.chartHead .readout { font-size: 14px; color: var(--soft); min-height: 21px; }
svg.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .lbl { fill: #5B4F38; font: 12px 'DM Sans', system-ui, sans-serif; }
svg.chart .line { fill: none; stroke: var(--gold-dk); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .area { fill: rgba(212, 175, 55, .18); stroke: none; }
svg.chart .dot { fill: var(--card); stroke: var(--gold-dk); stroke-width: 2.5; }
svg.chart .focus { fill: var(--ink); stroke: var(--gold); stroke-width: 3; }
.chartnote { font-size: 13px; color: var(--soft); margin-top: 4px; }
.trend { font-weight: 700; font-size: 14px; }
.trend.good { color: var(--green); } .trend.bad { color: var(--red); } .trend.flat { color: var(--soft); }

/* Inbox */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--gold-lt); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.wsec { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); font-weight: 700; margin: 18px 0 8px; }
.wsum { background: var(--gold-bg); border: 1px solid var(--gold-lt); border-radius: 16px; padding: 12px 16px; font-weight: 600; margin-bottom: 4px; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.wcard.yours { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-lt); }
.wcard.on { border-color: var(--green); background: var(--green-bg); }
.wmain { display: block; }
.wtitle { display: block; width: 100%; text-align: left; font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.35; }
.wnum { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 13px; background: var(--ink); color: var(--gold-lt); font-size: 13px; margin-right: 8px; }
.wdetail, .wwhat, .wundo, .wstat { color: var(--soft); font-size: 14px; margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wpick { margin-top: 8px; font-size: 14px; overflow-wrap: anywhere; }
.wpick b { display: block; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-dk); }
.wopts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wopt { min-height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--page); padding: 6px 14px; font-weight: 600; text-align: left; }
.wopt[aria-pressed="true"] { background: var(--ink); color: var(--gold-lt); border-color: var(--ink); }
.wopt .rec { display: block; font-size: 11.5px; color: var(--gold-dk); }
.wopt[aria-pressed="true"] .rec { color: var(--gold-lt); }
.wtick { margin-top: 10px; min-height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--page); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.wtick[aria-checked="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.wmove { margin: 8px 0; font-size: 14.5px; overflow-wrap: anywhere; }
.wmove b { display: block; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-dk); }
.wmoves { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.wflag { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--red); }
.sendbar { position: sticky; bottom: 0; background: var(--page); padding: 10px 0 4px; }
.sheetbg { position: fixed; inset: 0; background: rgba(26, 20, 8, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 30; }
.sheet { background: var(--card); width: min(560px, 100%); border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + var(--safe-bottom)); max-height: 86dvh; overflow-y: auto; }
@media (min-width: 760px) { .sheetbg { align-items: center; } .sheet { border-radius: 24px; } }
.sheet h2 { font: 700 20px/1.3 'Playfair Display', Georgia, serif; margin-bottom: 8px; }
.sheet ul { margin: 0 0 12px 18px; } .sheet li { margin-bottom: 6px; } .sheet li b { display: block; }
.sheet .actions { display: grid; gap: 8px; margin-top: 12px; }
.ack { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14px; }
.ack input { width: 22px; height: 22px; margin-top: 2px; }
.rq { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.rq .biz { font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-dk); font-weight: 700; }
.rq .ttl { font-weight: 700; font-size: 16px; margin: 2px 0; }
.rq .meta { color: var(--soft); font-size: 13.5px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; font-size: 14.5px; }
.facts dt { color: var(--soft); } .facts dd { overflow-wrap: anywhere; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--page); border-radius: 14px; padding: 12px 14px; margin: 10px 0; font-size: 14.5px; }
.prep { background: var(--gold-bg); border: 1px solid var(--gold-lt); border-radius: 16px; padding: 14px 16px; margin: 12px 0; }
.prep h3, .prep h4 { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-dk); margin: 8px 0 2px; }
.rcard { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 20px; margin-bottom: 10px; position: relative; }
.rcard.unread { border-color: var(--gold); }
.rcard .dotu { position: absolute; left: 8px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-dk); }
.rcard .kind { font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-dk); font-weight: 700; }
.rcard .ttl { font-weight: 700; font-size: 16px; margin: 2px 0; }
.rcard .sum { color: var(--soft); font-size: 14px; margin-bottom: 4px; }
.rcard .meta { color: var(--soft); font-size: 13px; }
.reportbox { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 12px; }
.reportbox iframe { width: 100%; border: 0; display: block; min-height: 160px; }
.reportbox .loading { padding: 24px; color: var(--soft); text-align: center; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--gold-bg); border: 1px solid var(--gold-lt); text-decoration: none; font-weight: 600; color: var(--ink); }
.player { position: sticky; bottom: 0; background: var(--ink); color: var(--gold-lt); border-radius: 18px; padding: 10px 14px; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.player .t { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .cap { font-size: 13.5px; color: var(--gold-lt); max-height: 3.2em; overflow: hidden; }
.player .bar { height: 5px; background: var(--ink3); border-radius: 3px; overflow: hidden; } .player .bar i { display: block; height: 100%; background: var(--gold); width: 0; }
.player .ctl { display: flex; gap: 8px; flex-wrap: wrap; }
.player .ctl button { min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--ink3); color: var(--gold-lt); font-weight: 600; }

/* Profiles */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pcard { display: flex; gap: 12px; align-items: center; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; width: 100%; }
.pcard:hover { border-color: var(--gold); }
.face { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); background: var(--gold-bg); flex: none; }
.face.big { width: 92px; height: 92px; }
.face.ini { display: flex; align-items: center; justify-content: center; font: 700 26px 'Playfair Display', Georgia, serif; color: var(--ink); }
.pcard .n { font-weight: 700; display: block; } .pcard .r { color: var(--soft); font-size: 13.5px; display: block; } .pcard .m { color: var(--soft); font-size: 13px; display: block; margin-top: 2px; }
.phead { display: flex; gap: 16px; align-items: center; margin: 8px 0 14px; }
.phead .n { font: 700 24px/1.2 'Playfair Display', Georgia, serif; } .phead .r { color: var(--soft); }
.pbar { margin: 10px 0; } .pbar .h { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; } .pbar .t { height: 8px; background: var(--page); border-radius: 4px; overflow: hidden; margin-top: 4px; } .pbar .f { height: 100%; }
.leaf { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 8px; background: var(--page); } .leaf b { display: block; } .leaf span { color: var(--soft); font-size: 13.5px; }

/* Boardroom */
.frame { width: 100%; height: 100%; border: 0; display: block; background: var(--ink); }

/* toast, loading */
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-bottom)); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 40; max-width: min(92vw, 520px); font-size: 14.5px; box-shadow: 0 8px 30px #0006; }
@media (min-width: 760px) { #toast { bottom: 28px; } }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--gold-dk); border-radius: 50%; animation: sp 0.9s linear infinite; margin: 30px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
