/* kenner GTM control center. Tokens from website/kenner design guide.md (paper, ink, one blue). */
:root {
  --paper: #FDFDFD;
  --ink: #161616;
  --muted: #5F5F5F;
  --line: #E7E7E7;
  --line-strong: #D0D0D0;
  --tint: #F4F4F4;
  --blue: #3F4FE0;
  --blue-tint: #E9EBFD;
  --good: #1F7A48;
  --good-bg: #E6F6EC;
  --wait: #7A4F00;
  --wait-bg: #FFF4DC;
  --bad: #A8271D;
  --bad-bg: #FCECEA;
  --font: "Host Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar: 56px;
  --col: 860px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--blue-tint); color: var(--ink); }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }

.top {
  height: var(--bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.mark { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.operator { color: var(--muted); font-size: 14px; }

main { max-width: var(--col); margin: 0 auto; padding: 0 24px 96px; }

/* plan head: stays in reach while reading 40 touches */
.head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 -24px;
  padding: 20px 24px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.head h1 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
.head .counts { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.head .grow { flex: 1; min-width: 0; }
.status { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status.bad { color: var(--bad); }

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--tint); }
.btn:active { transform: scale(.98); }
.btn[disabled] { cursor: default; color: var(--muted); background: var(--tint); border-color: var(--line); transform: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); padding: 9px 16px; font-variant-numeric: tabular-nums; }
.btn.primary:hover { background: #2B2B2B; }
.btn.primary.confirm { background: var(--blue); border-color: var(--blue); }
.btn.primary[disabled] { background: var(--tint); border-color: var(--line); color: var(--muted); }
.btn.quiet { border-color: transparent; color: var(--muted); padding: 5px 8px; }
.btn.quiet:hover { color: var(--ink); background: var(--tint); }

.notice {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.wait { background: var(--wait-bg); color: var(--wait); }

.group { margin-top: 40px; }
.group > h2 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.group > h2 span { font-variant-numeric: tabular-nums; font-weight: 400; }

.touch {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 128px;
  gap: 4px 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.who { min-width: 0; }
.side { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.who .name { font-weight: 500; }
.who .sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.body { min-width: 0; }
.ctx { margin: 0 0 8px; color: var(--muted); font-size: 14px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; }
.ctx dt { color: var(--muted); }
.ctx dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }

.text, .subject {
  display: block;
  width: 100%;
  max-width: 68ch;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--tint);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  caret-color: var(--blue);
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.subject { margin-bottom: 6px; font-weight: 500; }
textarea.text:hover, input.subject:hover { border-color: var(--line-strong); }
textarea.text:focus, input.subject:focus { outline: none; background: var(--paper); border-color: var(--blue); }
.text::placeholder { color: var(--muted); }
div.text, div.subject { background: none; padding-left: 0; padding-right: 0; }
.foot { margin-top: 4px; min-height: 20px; display: flex; gap: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.foot .over { color: var(--bad); font-weight: 500; }

.touch.compact { padding: 10px 0; align-items: center; grid-template-columns: 220px minmax(0, 1fr) auto; }
.touch.compact .who { grid-column: 1 / 3; }
.touch.compact .name { margin-right: 12px; }

.touch.skipped .name, .touch.skipped .text, .touch.skipped .subject, .touch.skipped .ctx dd { color: var(--muted); }
.touch.skipped .text, .touch.skipped .subject { text-decoration: line-through; text-decoration-color: var(--line-strong); }

.chip { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 500; line-height: 1.4; max-width: 260px; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.wait { background: var(--wait-bg); color: var(--wait); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.off { background: var(--tint); color: var(--muted); }

.empty { margin: 72px 0 0; }
.empty h1 { margin: 0 0 4px; font-size: 22px; font-weight: 500; letter-spacing: -.015em; }
.empty p { margin: 0; color: var(--muted); }

details.earlier { margin-top: 56px; border-top: 1px solid var(--line); }
details.earlier + details.earlier { margin-top: 0; }
details.earlier > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 0;
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  font-weight: 500;
}
details.earlier > summary::-webkit-details-marker { display: none; }
details.earlier > summary span { color: var(--muted); font-weight: 400; font-size: 14px; text-align: right; }
details.earlier > summary:hover { color: var(--blue); }
details.earlier[open] { padding-bottom: 24px; }
details.earlier .group:first-of-type { margin-top: 8px; }

.skeleton { margin-top: 32px; display: grid; gap: 16px; }
.skeleton i { height: 56px; border-radius: 8px; background: var(--tint); animation: pulse 1.4s ease-in-out infinite; }
.skeleton i:first-child { height: 28px; width: 40%; }
@keyframes pulse { 50% { opacity: .5; } }

@media (max-width: 720px) {
  .top { padding: 0 16px; }
  main { padding: 0 16px 72px; }
  .head { margin: 0 -16px; padding: 14px 16px 12px; flex-wrap: wrap; gap: 8px 12px; }
  .head .grow { flex-basis: 100%; }
  .head .status { flex: 1; }
  .touch, .touch.compact { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .touch .body { grid-column: 1 / -1; grid-row: 2; }
  .touch.compact .who { grid-column: 1; }
  .touch.compact .sub { display: block; }
  .text, .subject { font-size: 16px; }
  .btn { padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- shell ---------- */
.top { gap: 24px; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease); }
.nav a:hover { color: var(--ink); background: var(--tint); }
.nav a.on { color: var(--ink); background: var(--tint); }
.operator { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

.section-head { display: flex; align-items: baseline; gap: 10px; margin: 64px 0 8px; }
.section-head h1 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.015em; }
.quiet-line { margin: 12px 0 0; color: var(--muted); }
.icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; flex: none; }
.notice.stack { display: block; }
.notice.stack div { margin-top: 4px; }

/* ---------- folds (to-do groups, reports, details) ---------- */
details.fold { border-top: 1px solid var(--line); }
details.fold > summary { list-style: none; cursor: pointer; padding: 12px 0; font-weight: 500; display: flex; gap: 8px; align-items: baseline; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "Show"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 14px; }
details.fold[open] > summary::after { content: "Hide"; }
details.fold > summary span { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
details.fold > summary:hover::after { color: var(--ink); }
details.fold[open] { padding-bottom: 8px; }

/* ---------- to-dos ---------- */
.todo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.todo-title { font-weight: 500; overflow-wrap: anywhere; }
.todo-body { margin-top: 2px; color: var(--ink); font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.todo-body.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.todo .more { margin: 2px 0 0 -8px; }
.todo-side { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.due.late { color: var(--bad); font-weight: 500; }

/* ---------- tables, lines ---------- */
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .num { text-align: right; padding-right: 0; padding-left: 12px; }
.table td.late { color: var(--bad); font-weight: 500; }
.line { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.line .chip { flex: none; }
.line .name { font-weight: 500; }
.line .sub { color: var(--muted); font-size: 14px; }
.text.plain { background: none; padding-left: 0; padding-right: 0; }
.report { margin: 0 0 8px; font: inherit; font-size: 14px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- setup ---------- */
.tabs { display: flex; gap: 4px; margin: 8px 0 0 -10px; flex-wrap: wrap; }
.tabs button { appearance: none; border: 0; background: none; padding: 5px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--ink); background: var(--tint); }
.tabs button.on { color: var(--ink); background: var(--tint); }
.field { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 4px 24px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.field .label { font-weight: 500; padding-top: 6px; }
.field .control { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; min-width: 0; }
.hint { margin: 0; color: var(--muted); font-size: 14px; flex-basis: 100%; }
.hint:empty { display: none; }
.unit { color: var(--muted); font-size: 14px; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { appearance: none; border: 1px solid var(--line-strong); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.pick:hover { background: var(--tint); }
.pick.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.plays-pick { margin-top: 24px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
input[type="text"], input[type="number"], input[type="password"], select {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; caret-color: var(--blue);
}
input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, select:focus { outline: none; border-color: var(--blue); }
input:disabled, select:disabled { background: var(--tint); color: var(--muted); border-color: var(--line); }
.num-in { width: 88px; font-variant-numeric: tabular-nums; }
.inline { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; padding: 5px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); }
.tags:focus-within { border-color: var(--blue); }
.tags input { flex: 1; min-width: 140px; border: 0; padding: 3px 6px; background: none; }
.tags input:focus { outline: none; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 10px; background: var(--tint); border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }
.tag button { appearance: none; border: 0; background: none; padding: 5px; border-radius: 4px; color: var(--muted); cursor: pointer; display: inline-flex; }
.tag button:hover { color: var(--ink); background: var(--line); }
.queries { display: grid; gap: 12px; padding-top: 8px; }
.query-title { font-weight: 500; font-size: 14px; }
.query pre { margin: 4px 0 0; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.jump { display: flex; gap: 12px; align-items: center; margin-top: 20px; color: var(--muted); font-size: 14px; }
.jump select { max-width: 100%; min-width: 0; }
.doc-h { margin: 40px 0 8px; font-weight: 500; letter-spacing: -.01em; scroll-margin-top: 120px; }
.doc-h.l1 { font-size: 22px; margin-top: 32px; }
.doc-h.l2 { font-size: 19px; }
.doc-h.l3 { font-size: 16px; margin-top: 28px; }
textarea.text.frame, textarea.text.prose { max-width: none; margin-top: 8px; }
textarea.text.prose { background: none; color: var(--muted); padding-left: 0; padding-right: 0; }
textarea.text.prose:hover, textarea.text.prose:focus { padding-left: 10px; padding-right: 10px; color: var(--ink); }
.step { padding: 14px 0; border-top: 1px solid var(--line); }
.step-top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; margin-bottom: 8px; }
.step-top label { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.step-top input[type="text"] { width: 140px; }
.step-top .btn { margin-left: auto; }
.step .text { max-width: none; }
.btn.add { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; }

/* ---------- login ---------- */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.loginbox { width: 100%; max-width: 320px; display: grid; gap: 8px; }
.loginbox .mark { font-size: 22px; margin-bottom: 16px; }
.loginbox label { font-size: 14px; color: var(--muted); }
.loginbox input { padding: 10px 12px; font-size: 16px; }
.loginbox .status { min-height: 21px; margin: 0; white-space: normal; }
.loginbox .btn { justify-self: start; }

@media (max-width: 720px) {
  .top { gap: 12px; }
  .section-head { margin-top: 48px; }
  .todo { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .field { grid-template-columns: minmax(0, 1fr); }
  .field .label { padding-top: 0; }
  .step-top .btn { margin-left: 0; }
  input[type="text"], input[type="number"], select { font-size: 16px; }
}
@media (max-width: 720px) {
  .operator > span:not(.chip) { display: none; }
  .head h1, .section-head h1 { font-size: 19px; }
}
