/* The client's marketing team. Calm and clear: paper white, one deep sea colour for actions,
   ochre only for "waits for you". System serif for titles, system sans for text. */
:root {
  color-scheme: light dark;
  --bg: #f4f5f2; --card: #ffffff; --side: #f9faf8; --ink: #1b1f22; --soft: #5b6469;
  --line: #e1e4e0; --sea: #0f4c5c; --sea-ink: #ffffff; --sea-bg: #e3eef0;
  --wait: #7a5300; --wait-bg: #fbf0d7; --ok: #2f6b4f; --ok-bg: #e3f1e8;
  --bad: #9b3434; --bad-bg: #fbe9e9; --focus: #1b78a0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131719; --card: #1b2023; --side: #171b1e; --ink: #e7ebe9; --soft: #a2acb0;
    --line: #2b3236; --sea: #7cc4d1; --sea-ink: #0c2228; --sea-bg: #173238;
    --wait: #f0c46c; --wait-bg: #3a2e14; --ok: #8fd1ad; --ok-bg: #18352a;
    --bad: #f0a3a3; --bad-bg: #3a1d1d; --focus: #9fd6e2;
  }
}
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--sea); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(28px, 3.4vw, 38px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: .4em 0; }
.soft { color: var(--soft); }
.small { font-size: 14px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 9; background: var(--card); padding: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .92em; overflow-wrap: anywhere; }

/* Layout */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
#nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
#nav-toggle:checked ~ .shell { grid-template-columns: 0 minmax(0, 1fr); }
#nav-toggle:checked ~ .shell .side { visibility: hidden; padding: 0; border: 0; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--sea); color: var(--sea-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.brand b { font-size: 15px; line-height: 1.25; }
.side a.nav { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 15px; min-height: 40px; }
.side a.nav:hover { background: var(--line); }
.side a.nav.on { background: var(--sea-bg); color: var(--sea); font-weight: 600; }
.side .sep { height: 1px; background: var(--line); margin: 10px 4px; }
.side .foot { margin-top: auto; padding: 10px 8px 0; font-size: 13px; color: var(--soft); display: grid; gap: 6px; }
.count { background: var(--wait-bg); color: var(--wait); border-radius: 20px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 36px); border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 3; }
.top .grow { flex: 1; }
.iconbtn { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; font-size: 14px; padding: 0 10px; position: relative; }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--wait); }
main { padding: clamp(18px, 3vw, 36px); max-width: 1220px; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.lead { color: var(--soft); max-width: 68ch; margin-top: 6px; }
.banner { background: var(--sea-bg); color: var(--sea); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-bottom: 16px; }
.notice { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.warnbox { background: var(--wait-bg); color: var(--wait); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.warnbox ul { margin: 6px 0 0; padding-left: 1.2em; }

/* Building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; padding: 10px 16px; font: 600 15px/1.2 var(--sans); background: var(--sea); color: var(--sea-ink); min-height: 44px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--sea); border: 1px solid var(--line); }
.btn.quiet { background: transparent; color: var(--soft); border: 0; padding-inline: 8px; }
.btn.small { min-height: 38px; padding: 7px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 4px; }
.help { font-size: 13px; color: var(--soft); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], select, textarea { width: 100%; font: 16px/1.4 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 110px; resize: vertical; }
textarea.code { font: 14px/1.6 var(--mono); min-height: 60vh; }
.field { margin-bottom: 14px; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choices label { font-weight: 500; display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; cursor: pointer; margin: 0; }
.chip { display: inline-block; font-size: 12.5px; border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; color: var(--soft); background: var(--card); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; border-radius: 20px; padding: 2px 9px; }
.pill.ready { background: var(--wait-bg); color: var(--wait); }
.pill.held, .pill.failed { background: var(--bad-bg); color: var(--bad); }
.pill.approved, .pill.drafted, .pill.done { background: var(--ok-bg); color: var(--ok); }
.pill.working, .pill.revising, .pill.running, .pill.queued, .pill.waiting { background: var(--sea-bg); color: var(--sea); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--soft); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; }
details summary { cursor: pointer; color: var(--sea); }

/* Today */
.needs { background: var(--wait-bg); border-radius: var(--r); padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.needs h2 { font-size: 22px; color: var(--ink); }
.needs.more { background: var(--card); border: 1px solid var(--line); padding: 14px 18px; }
.needs.more h2 { font-size: 17px; }
.calm { background: var(--ok-bg); color: var(--ok); border-radius: var(--r); padding: 18px 22px; }
.section-title { margin: 28px 0 12px; font-size: 20px; }

/* Team */
.agent { display: grid; gap: 8px; text-decoration: none; color: var(--ink); }
a.agent:hover { border-color: var(--sea); }
.who { display: flex; gap: 12px; align-items: center; }
.face { width: 44px; height: 44px; border-radius: 50%; background: var(--sea-bg); color: var(--sea); display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.face.big { width: 72px; height: 72px; font-size: 22px; }
.who b { display: block; }
.who .role { font-size: 13px; color: var(--soft); }
.now { font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; transform: translateY(-1px); }
.dot.working { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.dot.waiting { background: var(--wait); }
.trace { list-style: none; margin: 8px 0 0; padding: 0 0 0 4px; border-left: 2px solid var(--line); }
.trace li { padding: 7px 0 7px 16px; position: relative; font-size: 14.5px; }
.trace li::before { content: ""; position: absolute; left: -7px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--card); }
.trace li.started::before { background: var(--sea); box-shadow: 0 0 0 4px var(--sea-bg); }
.trace li.waiting::before { background: var(--wait); }
.trace li.failed::before { background: var(--bad); }
.trace b { font-weight: 600; }
.trace time { color: var(--soft); font-size: 12.5px; margin-left: 6px; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* Approvals */
.posts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.post.ready { border-color: var(--wait); }
.post .shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 2px; background: var(--line); }
.post .shots img { width: 100%; display: block; aspect-ratio: 4/5; object-fit: cover; background: var(--side); }
.post .noimg { aspect-ratio: 4/5; display: grid; place-items: center; background: var(--side); color: var(--soft); font-size: 14px; padding: 20px; text-align: center; }
.post .body { padding: 14px; display: grid; gap: 10px; font-size: 14.5px; }
.post .cap { white-space: pre-line; }
.post .ar { direction: rtl; text-align: right; font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", sans-serif; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.flag { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.prose { max-width: 72ch; }
.prose h2 { font-size: 21px; margin: 22px 0 8px; } .prose h3 { font-size: 18px; margin: 18px 0 6px; }
.prose table { margin: 10px 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 120px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13px; }
.swatch i { display: block; height: 64px; }
.swatch div { padding: 6px 8px; }
.hist { font-size: 14px; }
.hist li { margin: 4px 0; }

/* Ask */
.chat { display: grid; gap: 10px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 15px; }
.msg .txt { white-space: pre-line; }
.msg.me { justify-self: end; background: var(--sea); color: var(--sea-ink); border-bottom-right-radius: 4px; }
.msg.them { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .meta { display: block; font-size: 12px; opacity: .75; margin-top: 4px; }
.agents-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.agents-tabs a { flex: none; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 6px 12px; font-size: 14px; }
.agents-tabs a.on { background: var(--sea); color: var(--sea-ink); border-color: var(--sea); }

/* Brand book */
.book { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.files { max-height: 75vh; overflow-y: auto; font-size: 14px; padding: 8px; }
.files a { display: block; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.files a.on { background: var(--sea-bg); color: var(--sea); font-weight: 600; }

/* Results */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kpi .v { font-family: var(--serif); font-size: clamp(28px, 3vw, 36px); line-height: 1.1; }
.kpi .c { font-size: 14px; }
.kpi .c.up { color: var(--ok); } .kpi .c.down { color: var(--bad); }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--sea); }

/* Sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth .brand { padding: 0 0 18px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 5; transform: translateX(-100%); transition: transform .2s; }
  #nav-toggle:checked ~ .shell { grid-template-columns: minmax(0, 1fr); }
  #nav-toggle:checked ~ .shell .side { transform: none; visibility: visible; padding: 18px 12px; border-right: 1px solid var(--line); }
  .split, .book { grid-template-columns: minmax(0, 1fr); }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.gap-top { margin-top: 14px; }
.gap-bottom { margin-bottom: 16px; }
form.inline { display: inline; }
.choices-inline { font-weight: 500; display: flex; gap: 8px; align-items: center; }
progress { width: 100%; min-width: 90px; height: 8px; accent-color: var(--sea); }
@media (max-width: 860px) { .top .grow .soft { display: none; } }

/* Content calendar */
.cal { padding: 0; overflow-x: auto; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); }
.cal-head div { font-size: 12.5px; color: var(--soft); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 92px; padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cal-cell:last-child { border-right: 0; }
.cal-cell.empty { background: var(--side); }
.cal-day { font-size: 12.5px; color: var(--soft); }
.cal-post { font-size: 12.5px; line-height: 1.3; text-decoration: none; color: var(--ink); background: var(--sea-bg); border-radius: 6px; padding: 3px 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-post.ready { background: var(--wait-bg); color: var(--wait); }
.cal-post.approved, .cal-post.drafted { background: var(--ok-bg); color: var(--ok); }
.cal-post.held { background: var(--bad-bg); color: var(--bad); }
.post .shots video { width: 100%; display: block; aspect-ratio: 9/16; object-fit: cover; background: #000; }
.post:target { outline: 3px solid var(--sea); }
.board-shots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.board-shots figure { margin: 0; }
.board-shots img { width: 100%; border-radius: 10px; display: block; }
