/* Adherence hub. Tokens follow adherence-branding/design-system (style guide v3):
   ink and one blue; green means done, amber means blocked; hairlines, no shadows. */
@font-face { font-family: "Schibsted Grotesk"; src: url(/static/fonts/schibsted-grotesk-400-900-latin.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/static/fonts/schibsted-grotesk-400-900-latin-ext.woff2) format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/static/fonts/schibsted-grotesk-400-900-u010d.woff2) format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+010D; }
@font-face { font-family: "IBM Plex Mono"; src: url(/static/fonts/ibm-plex-mono-400-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/static/fonts/ibm-plex-mono-500-latin.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #15171c; --blue: #1f5ed6; --blue-wash: #eaf0fc; --grey: #5b626d; --grey-3: #8d939c;
  --hair: #e7eaee; --shell: #f5f7f9; --ground: #ffffff;
  --live: #2e8465; --live-wash: #e8f3ee; --ship: #c08a35; --ship-wash: #f8f0e3;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --rail: 232px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; line-height: 1.15; }
h1 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 780; letter-spacing: -.036em; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.muted { color: var(--grey); }
.faint { color: var(--grey-3); }
.hidden { display: none !important; }

/* Wordmark: the full stop is the brand's blue. */
.wordmark { font-weight: 700; letter-spacing: -.03em; font-size: 21px; color: var(--ink); white-space: nowrap; }
.wordmark i { font-style: normal; color: var(--blue); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail { background: var(--shell); border-right: 1px solid var(--hair); padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.rail .brand { padding: 0 10px; display: flex; align-items: baseline; gap: 8px; }
.rail .brand span { color: var(--grey); font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.nav a:hover { text-decoration: none; background: #eceff3; }
.nav a.on { background: var(--ground); color: var(--blue); box-shadow: inset 0 0 0 1px var(--hair); }
.nav .count { font-family: var(--mono); font-size: 12px; color: var(--grey-3); }
.rail .me { margin-top: auto; padding: 10px; border-top: 1px solid var(--hair); display: flex; flex-direction: column; gap: 2px; }
.rail .me b { font-weight: 650; }
.rail .me a { font-size: 14px; }

main { min-width: 0; padding: 34px clamp(20px, 3.4vw, 44px) 80px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.head p { margin-top: 6px; color: var(--grey); max-width: 62ch; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hair); background: var(--ground); padding: 7px 13px; border-radius: 999px; font-weight: 550; font-size: 15px; cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease); white-space: nowrap; }
.btn:hover { border-color: #cfd4da; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2d35; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--grey); padding-inline: 8px; }
.btn.ghost:hover { color: var(--ink); }
.btn.danger:hover { color: #9b2c1f; border-color: #e6c7c2; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=date], input[type=search], select, textarea {
  border: 1px solid var(--hair); background: var(--ground); border-radius: 8px; padding: 8px 11px; width: 100%; outline: none; transition: border-color .15s var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: var(--mono); font-size: 13px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--grey); }
label.field > span { font-weight: 550; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--hair); background: var(--ground); border-radius: 999px; padding: 4px 11px; font-size: 14px; cursor: pointer; color: var(--grey); }
.chip.on { color: var(--ink); border-color: var(--ink); font-weight: 550; }

.tag { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--shell); color: var(--grey); white-space: nowrap; }
.tag.done { background: var(--live-wash); color: var(--live); }
.tag.blocked { background: var(--ship-wash); color: #8a6020; }
.tag.agent { background: var(--blue-wash); color: var(--blue); }

/* ---------------------------------------------------------------- overview */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section + .section { margin-top: 36px; }
.list { border-top: 1px solid var(--hair); }
.list > * { border-bottom: 1px solid var(--hair); }
.item { display: flex; gap: 12px; align-items: baseline; padding: 11px 2px; cursor: pointer; }
.item:hover .t { color: var(--blue); }
.item .t { flex: 1; min-width: 0; font-weight: 500; }
.item .meta { color: var(--grey-3); white-space: nowrap; }
.empty { color: var(--grey-3); padding: 14px 2px; }
.stat-line { display: flex; gap: 28px; flex-wrap: wrap; margin: 4px 0 30px; color: var(--grey); }
.stat-line b { color: var(--ink); font-weight: 700; font-size: 22px; letter-spacing: -.02em; margin-right: 6px; }

/* ---------------------------------------------------------------- board */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .add { flex: 1 1 320px; display: flex; gap: 8px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--shell); border-radius: 12px; padding: 10px; min-height: 160px; transition: background .15s var(--ease); }
.col.drop { background: var(--blue-wash); }
.col > h3 { display: flex; justify-content: space-between; padding: 4px 6px 10px; font-size: 15px; }
.col > h3 .mono { color: var(--grey-3); }
.col.done > h3 { color: var(--live); }
.col.blocked > h3 { color: #8a6020; }
.card { background: var(--ground); border: 1px solid var(--hair); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.card:hover { border-color: #cfd4da; }
.card.dragging { opacity: .45; }
.card .t { font-weight: 550; line-height: 1.35; }
.card .m { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--grey); }
.col.done .card .t { color: var(--grey); }

/* ---------------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(21, 23, 28, .18); z-index: 20; animation: fade .18s var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--ground); border-left: 1px solid var(--hair); z-index: 21; display: flex; flex-direction: column; animation: slide .22s var(--ease); }
.drawer header { padding: 18px 22px; border-bottom: 1px solid var(--hair); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer .body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.drawer footer { padding: 14px 22px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

/* ---------------------------------------------------------------- plan */
.timeline { position: relative; }
.month { margin-bottom: 22px; }
.month > h3 { color: var(--grey); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.ms { display: grid; grid-template-columns: 70px 16px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.ms .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); align-self: center; }
.ms.done .dot { background: var(--live); border-color: var(--live); }
.ms.past:not(.done) .dot { border-color: var(--ship); }
.ms .t { font-weight: 550; }
.ms.done .t { color: var(--grey); }
.ms:hover .t { color: var(--blue); }
.bar { height: 4px; background: var(--hair); border-radius: 2px; width: 70px; overflow: hidden; align-self: center; }
.bar i { display: block; height: 100%; background: var(--live); }

/* ---------------------------------------------------------------- prose */
.prose { max-width: 72ch; }
.prose > * + * { margin-top: .8em; }
.prose h1 { font-size: 26px; } .prose h2 { font-size: 20px; margin-top: 1.4em; } .prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .25em; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--shell); padding: 1px 5px; border-radius: 5px; }
.prose pre { background: var(--shell); padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid var(--hair); padding: 7px 8px; text-align: left; vertical-align: top; }
.prose blockquote { margin: 0; padding-left: 14px; border-left: 2px solid var(--hair); color: var(--grey); }
.prose img { max-width: 100%; }

/* ---------------------------------------------------------------- tables (artifacts, files) */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 550; color: var(--grey); font-size: 14px; padding: 8px 10px; border-bottom: 1px solid var(--hair); }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--hair); vertical-align: baseline; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td:first-child { color: var(--blue); }
table.t td.n { white-space: nowrap; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; margin-bottom: 14px; color: var(--grey); }
.crumbs a { font-weight: 550; }
.icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px; color: var(--grey-3); flex: none; }

.viewer { display: flex; flex-direction: column; height: calc(100vh - 34px - 40px); min-height: 480px; }
.viewer .vhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; }
.viewer iframe { flex: 1; width: 100%; border: 1px solid var(--hair); border-radius: 12px; background: #fff; }
.viewer .md { flex: 1; overflow: auto; border-top: 1px solid var(--hair); padding-top: 18px; }

/* ---------------------------------------------------------------- ledger */
.ledger { border-top: 1px solid var(--hair); }
.entry { display: grid; grid-template-columns: 116px 1fr auto; gap: 14px; padding: 10px 2px; border-bottom: 1px solid var(--hair); align-items: baseline; }
.entry .time { color: var(--grey-3); }
.entry .who { font-weight: 650; }
.entry .who.agent { color: var(--blue); }
.entry .what { min-width: 0; }
.entry .verb { color: var(--grey); }
.entry .slack { font-size: 12px; color: var(--grey-3); }
.day { padding: 18px 2px 6px; color: var(--grey); font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--hair); }

/* ---------------------------------------------------------------- settings */
.panel { border: 1px solid var(--hair); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.panel + .panel { margin-top: 18px; }
.pad { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 18px; background: var(--shell); border-radius: 10px; padding: 16px 18px; }
.pad div { font-family: var(--mono); font-size: 16px; letter-spacing: .04em; }
.pad div span { color: var(--grey-3); margin-right: 10px; font-size: 13px; }
.secret { font-family: var(--mono); font-size: 13px; background: var(--shell); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; }
.note { font-size: 14px; color: var(--grey); }

/* ---------------------------------------------------------------- sign in */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login .side { background: var(--shell); border-right: 1px solid var(--hair); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.login .form { padding: 40px clamp(24px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; gap: 18px; max-width: 520px; }
.login input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .08em; padding: 12px 14px; text-transform: uppercase; }
.login .error { color: #9b2c1f; min-height: 1.5em; font-size: 15px; }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); z-index: 40; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- phones */
.menu-btn { display: none; }
.mobile-only { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--hair); }
  .rail .nav, .rail .me { display: none; }
  .rail.open { flex-direction: column; align-items: stretch; }
  .rail.open .nav, .rail.open .me { display: flex; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .rail.open .menu-btn { position: absolute; right: 16px; top: 10px; }
  main { padding: 24px 16px 60px; }
  .grid2 { grid-template-columns: 1fr; gap: 30px; }
  .board { grid-template-columns: 1fr; overflow: visible; }
  .entry { grid-template-columns: 1fr; gap: 2px; }
  .ms { grid-template-columns: 56px 14px 1fr; }
  .ms .bar { display: none; }
  .login { grid-template-columns: 1fr; }
  .login .side { display: none; }
  .mobile-only { display: block; }
  table.t .hide-sm { display: none; }
  .viewer { height: auto; }
  .viewer iframe { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .rail, .head .actions, .no-print { display: none !important; }
  .shell { display: block; }
  .pad { background: none; border: 1px solid #999; }
}
.vhead .row > *, .head .actions > * { flex: 0 0 auto; }
.grid2 > .section + .section { margin-top: 0; }

/* Tick boxes: a round box; a ticked todo is struck through. */
.tick { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #b9bfc7; background: var(--ground); cursor: pointer; padding: 0; position: relative; top: 3px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.tick:hover { border-color: var(--live); }
.tick.on { background: var(--live); border-color: var(--live); }
.tick.on::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.struck .t { text-decoration: line-through; text-decoration-color: var(--grey-3); color: var(--grey); }
.card .ct { display: flex; gap: 9px; align-items: flex-start; }
.card .ct .tick { top: 1px; }
.card .m { padding-left: 27px; }
