/*
  Ticketing UI. Direction: docs/UI.md
  Design read: dense internal work tool for ~20 engineers, open all day.
  Dials: ENERGY 1 / RHYTHM 1 / MOTION 1.
*/

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-2199, U+2212, U+2215;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Neutrals carry the whole interface; color is reserved for state. */
  --bg: #ffffff;
  --side: #f5f5f3;
  --hover: #f6f6f4;
  --press: #ececea;
  --ink: #17191e;
  --ink-2: #4c515b;
  --ink-3: #61666f;
  --line: #e8e8e5;
  --line-2: #d4d4d0;

  /* The one accent: actions, focus, and "in progress". */
  --accent: #0e6e63;
  --accent-hover: #0b5a51;
  --accent-ink: #0a564e;
  --accent-soft: #e4f1ee;

  /* State colors, used only for status and warnings. */
  --wait: #b26b00;
  --wait-ink: #7a4900;
  --wait-soft: #fdf3e1;
  --danger: #b42318;
  --danger-soft: #fdecea;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
h2 { font-size: 14px; font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::placeholder { color: #6b6f78; opacity: 1; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }
.mt { margin-top: 12px; }

/* ===== Shell ===== */
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--r); z-index: 50; }
.skip:focus { top: 8px; color: #fff; }

/* Top bar: brand, sections, then the actions you reach for (new request, inbox, you). */
.top { position: sticky; top: 0; z-index: 40; background: var(--side); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 20px; max-width: 1280px; margin: 0 auto; padding: 0 32px; min-height: 56px; }
.brand { display: block; font-weight: 800; font-size: 15px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; line-height: 1.2; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); letter-spacing: 0; }
.menu { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.nav a, .nav-inbox, .me {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: var(--r);
  color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.nav a:hover, .nav-inbox:hover, .me:hover { background: var(--press); color: var(--ink); }
.nav a[aria-current="page"], .nav-inbox[aria-current="page"], .me[aria-current="page"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.top-end { display: flex; align-items: center; gap: 4px; }
.top-end .btn { margin-right: 8px; }
.me { font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 34px; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.count[hidden] { display: none; }
.top #menu-btn, .top .top-inbox { display: none; }
.content { min-width: 0; }
/* The full bar needs about 1060px; below that the sections move into the Menu panel. */
@media (max-width: 1100px) {
  .top-in { gap: 8px; min-height: 52px; flex-wrap: wrap; }
  .top .brand { margin-right: auto; }
  .top .brand small { display: none; }
  .top #menu-btn, .top .top-inbox { display: inline-flex; }
  .nav-inbox { display: none; }
  .menu { display: grid; gap: 8px; flex: 1 1 100%; padding: 4px 0 12px; }
  .js .menu:not(.open) { display: none; }
  .nav { display: grid; gap: 1px; }
  .top-end { display: grid; gap: 1px; border-top: 1px solid var(--line); padding-top: 8px; }
  .top-end .btn { margin: 0 0 6px; }
  .nav a, .nav-inbox, .me { min-height: 44px; font-size: 15px; line-height: 44px; max-width: none; }
  .nav-inbox { justify-content: space-between; }
}
.page { max-width: 1280px; margin: 0 auto; padding: 22px 32px 64px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.head p { color: var(--ink-3); margin-top: 2px; }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--ink); }

/* ===== Flash ===== */
.flash { margin: 16px 0 0; padding: 9px 12px; border-radius: var(--r); font-weight: 600; border: 1px solid; }
.flash.ok { background: var(--accent-soft); border-color: #c3e0d9; color: var(--accent-ink); }
.flash.error { background: var(--danger-soft); border-color: #f3c7c1; color: #8a1a11; }

/* ===== Sections: separated by rules, not boxes ===== */
.sec { padding: 18px 0 6px; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: 0; }
.sec-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.sec-h h2 { font-size: 13.5px; }
.sec-h .n { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.sec-h .act { margin-left: auto; font-size: 13px; }
.none { color: var(--ink-3); padding: 6px 0 14px; }
.none b { color: var(--ink-2); font-weight: 600; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 36px; align-items: start; }
.cols > * { min-width: 0; }
.aside { border-left: 1px solid var(--line); padding-left: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; }
.split > * { min-width: 0; }

/* ===== Status dial: fill shows how far a ticket has moved ===== */
.dial {
  --c: var(--ink-3);
  display: inline-block; flex: none; width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid var(--c); vertical-align: -2px; position: relative;
}
.dial.todo { --c: var(--ink-3); }
.dial.in_progress { --c: var(--accent); background: conic-gradient(var(--c) 0 50%, transparent 0); }
.dial.waiting { --c: var(--wait); background: radial-gradient(circle, var(--c) 0 2.5px, transparent 3px); }
.dial.done { --c: var(--accent); background: var(--c); }
.dial.done::after { content: ""; position: absolute; left: 3.2px; top: 1px; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.dial.cancelled { --c: var(--ink-3); background: linear-gradient(135deg, transparent 44%, var(--c) 44% 56%, transparent 56%); }
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--ink-2); }
.status.waiting { color: var(--wait-ink); font-weight: 600; }

.prio { font-weight: 700; font-size: 12px; white-space: nowrap; }
.prio.high { color: var(--wait-ink); }
.prio.urgent { color: var(--danger); }
.code { font: 600 12.5px/1 var(--mono); color: var(--ink-2); white-space: nowrap; }

/* ===== Ticket list ===== */
.list { list-style: none; margin: 0; padding: 0; }
.list-head, .t {
  display: grid; align-items: center; gap: 0 14px;
  grid-template-columns: 118px 84px minmax(0, 1fr) 112px 128px 62px;
}
.list-head { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 0 8px 6px; border-bottom: 1px solid var(--line); }
.list-head span:last-child { text-align: right; }
.t { min-height: 40px; padding: 4px 8px; border-bottom: 1px solid var(--line); position: relative; }
.list .t:last-child { border-bottom: 0; }
.t:hover { background: var(--hover); }
.t-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.t-title a { color: var(--ink); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-title a::after { content: ""; position: absolute; inset: 0; }
.t-title a:hover { color: var(--accent-ink); }
.t-title a:focus-visible { outline: none; }
.t:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 3px; }
.t-cell { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-cell.unassigned { color: var(--ink-3); }
.t-age { color: var(--ink-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.t-sub { display: none; }
/* Narrow columns (My work): two lines per ticket so the title keeps its room. */
.cols .t { grid-template-columns: 112px 78px minmax(0, 1fr) 56px; grid-template-areas: "st code title age" "st code sub age"; align-items: baseline; padding: 7px 8px; }
.cols .t > .status { grid-area: st; }
.cols .t > .code { grid-area: code; }
.cols .t > .t-title { grid-area: title; }
.cols .t > .t-age { grid-area: age; }
.cols .t > .t-team, .cols .t > .t-who { display: none; }
.cols .t > .t-sub { display: block; grid-area: sub; color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Buttons & inputs ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.sec-btn { background: var(--bg); color: var(--ink); border-color: var(--line-2); }
.btn.sec-btn:hover { background: var(--hover); color: var(--ink); }
.btn.danger { background: var(--bg); color: var(--danger); border-color: #e9bdb7; }
.btn.danger:hover { background: var(--danger-soft); color: #8a1a11; }
.btn.ghost { background: none; border-color: transparent; color: var(--ink-2); padding: 0 8px; }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.block { width: 100%; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* A button row never sits flush against the field above it. */
.field + .btns, .field + .btn, textarea + .btns, textarea + .btn { margin-top: 4px; }
.row-form + .row-form { margin-top: 8px; }

/* ===== Comment composer =====
   Without JS the form shows inline. With JS a one-line "Write a comment…" opens it in a modal. */
.compose-open { display: none; width: 100%; text-align: left; font: inherit; color: var(--ink-3); background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); min-height: 40px; padding: 0 12px; cursor: text; }
.compose-open:hover { border-color: #b9b9b4; color: var(--ink-2); }
.compose-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.js .compose-open { display: block; }
.compose-form { display: grid; gap: 8px; }
.compose-title { font-weight: 600; font-size: 13px; }
.js .compose-form .compose-title { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.compose-btns { display: flex; gap: 8px; margin-left: auto; }
.js .compose [data-compose-cancel] { display: inline-flex; }
[data-compose-cancel] { display: none; }
.cdlg { width: min(600px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 10px; padding: 0; color: var(--ink); box-shadow: 0 16px 40px rgba(23, 25, 30, .18); }
.cdlg::backdrop { background: rgba(23, 25, 30, .35); }
.cdlg .compose-form { padding: 18px 20px 0; gap: 12px; }
.cdlg textarea { min-height: 150px; }
.cdlg .compose-foot { margin: 4px -20px 0; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--side); border-radius: 0 0 10px 10px; }
.cdlg .kbd-hint { font-size: 12px; color: var(--ink-3); }

.field { display: grid; gap: 5px; margin-bottom: 14px; align-content: start; }
.field > label, .lbl { font-weight: 600; font-size: 13px; color: var(--ink); }
.req { color: var(--danger); }
.help { font-size: 12.5px; color: var(--ink-3); }
.err { font-size: 12.5px; color: var(--danger); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px 10px; min-height: 36px;
}
textarea { min-height: 84px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b9b9b4; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
[aria-invalid=true] { border-color: var(--danger) !important; }
.check { display: inline-flex; gap: 8px; align-items: center; min-height: 34px; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.narrow { max-width: 620px; }
.row-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-form > input[type=text], .row-form > select { flex: 1 1 180px; width: auto; }
.warn-note { background: var(--wait-soft); color: var(--wait-ink); border-radius: var(--r); padding: 9px 12px; font-size: 13px; }

/* ===== Date picker ===== */
.dp { position: relative; display: inline-block; width: 100%; max-width: 240px; }
.dp-btn {
  width: 100%; min-height: 36px; padding: 6px 10px 6px 34px; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r);
  position: relative;
}
.dp-btn::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 13px; height: 12px; margin-top: -6px;
  border: 1.5px solid var(--ink-3); border-top-width: 3px; border-radius: 2px;
}
.dp-btn:hover { border-color: #b9b9b4; }
.dp-btn.empty { color: #6b6f78; }
.dp-btn[aria-expanded="true"] { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.dp-pop {
  position: fixed; top: 0; left: 0; z-index: 80; width: 292px; padding: 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(23, 25, 30, .16), 0 2px 6px rgba(23, 25, 30, .06);
}
.dp-pop[hidden] { display: none; }
/* Phones: a sheet from the bottom of the screen, with the page dimmed behind it. */
.dp-pop.sheet {
  top: auto; left: 0; right: 0; bottom: 0; width: auto; border: 0; border-radius: 14px 14px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 0 0 100vmax rgba(23, 25, 30, .35);
  max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
}
.dp-pop.sheet .dp-quick button { flex: 1; min-height: 44px; }
.dp-pop.sheet .dp-quick .dp-clear { flex: 0 0 auto; }
.dp-pop.sheet .dp-nav button { width: 44px; min-height: 44px; }
.dp-sheet-h { display: none; }
.dp-pop.sheet .dp-sheet-h { display: block; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.dp-quick button, .dp-nav button {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2);
  background: var(--side); border: 1px solid var(--line); border-radius: 5px; min-height: 28px; padding: 0 8px;
}
.dp-quick button:hover, .dp-nav button:hover { background: var(--press); color: var(--ink); }
.dp-quick .dp-clear { margin-left: auto; background: none; border-color: transparent; color: var(--danger); }
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-nav b { font-size: 13.5px; }
.dp-nav button { width: 30px; padding: 0; font-size: 15px; line-height: 1; }
.dp-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dp-grid th { font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 2px 0 4px; text-align: center; border: 0; }
.dp-grid td { padding: 1px; text-align: center; border: 0; }
.dp-day {
  width: 100%; height: 32px; border: 0; border-radius: 5px; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink);
}
.dp-day:hover { background: var(--press); }
.dp-day.out { color: #6b7079; }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--ink-3); font-weight: 700; }
.dp-day[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 700; }
.dp-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

/* ===== Auth ===== */
.auth { min-height: 100vh; background: var(--side); display: grid; place-items: center; padding: 32px 16px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box .brand { padding: 0 0 18px; font-size: 17px; }
.auth-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.auth-card h1 { font-size: 18px; margin-bottom: 4px; }
.auth-card > p { color: var(--ink-3); margin-bottom: 18px; }
.auth-foot { margin-top: 14px; color: var(--ink-3); font-size: 13px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ===== Home: to-do ===== */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 6px 0; }
.task form { margin: 0; }
.tick {
  width: 18px; height: 18px; margin-top: 1px; border-radius: 4px; border: 1.5px solid var(--line-2); background: var(--bg);
  cursor: pointer; padding: 0; position: relative;
}
.tick:hover { border-color: var(--accent); }
.task.done .tick { background: var(--accent); border-color: var(--accent); }
.task.done .tick::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.task.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-title { overflow-wrap: anywhere; }
.task-meta { display: block; font-size: 12.5px; color: var(--ink-3); }
.task-meta .late { color: var(--danger); font-weight: 600; }
.task .x { opacity: 0; }
.task:hover .x, .task .x:focus-visible { opacity: 1; }
.group { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin: 10px 0 0; }
.group:first-child { margin-top: 0; }
.add-task { display: grid; gap: 6px; margin: 12px 0 14px; }
.add-task .btns { justify-content: space-between; flex-wrap: nowrap; }
.add-task .dp { max-width: 190px; }

/* ===== Filters ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.filters select, .filters input { width: auto; min-width: 140px; }
.filters input[type=search] { min-width: 200px; flex: 1 1 200px; max-width: 320px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); max-width: 100%; overflow-x: auto; }
.seg a { padding: 0 12px; min-height: 32px; display: inline-flex; align-items: center; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; }
.seg a + a { border-left: 1px solid var(--line-2); }
.seg a:hover { background: var(--hover); color: var(--ink); }
.seg a[aria-current="true"] { background: var(--ink); color: #fff; }

/* ===== New request ===== */
.types { list-style: none; margin: 0; padding: 0; }
.types li { border-bottom: 1px solid var(--line); }
.types li:last-child { border-bottom: 0; }
.types a { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 16px; padding: 10px 8px; text-decoration: none; color: var(--ink); }
.types a:hover { background: var(--hover); }
.types b { font-weight: 600; }
.types span { color: var(--ink-3); }

/* ===== Ticket detail ===== */
.t-head h1 { font-size: 21px; overflow-wrap: anywhere; }
.props { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0; margin: 0; }
.props dt, .props dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.props dt { color: var(--ink-3); }
.props dd { overflow-wrap: anywhere; }
.props dt:last-of-type, .props dd:last-of-type { border-bottom: 0; }
.fields { display: grid; grid-template-columns: minmax(130px, 28%) minmax(0, 1fr); margin: 0; }
.fields dt, .fields dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.fields dt { color: var(--ink-3); padding-right: 14px; }
.fields dd { white-space: pre-line; overflow-wrap: anywhere; }
.fields dt:last-of-type, .fields dd:last-of-type { border-bottom: 0; }
.acts { display: grid; gap: 6px; margin-bottom: 14px; }
.acts details { border: 1px solid var(--line); border-radius: var(--r); }
.acts details[open] { padding-bottom: 10px; }
.acts summary {
  list-style: none; cursor: pointer; min-height: 34px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  font-weight: 600; border-radius: var(--r);
}
.acts summary::-webkit-details-marker { display: none; }
.acts summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-top: -3px; }
.acts details[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.acts summary:hover { background: var(--hover); }
.acts details.danger summary { color: var(--danger); }
.acts details form { padding: 6px 12px 0; }
.acts details .field { margin-bottom: 8px; }
.acts .note { color: var(--ink-3); }

.feed { list-style: none; margin: 0; padding: 0; }
.ev { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; padding: 5px 0; font-size: 13.5px; }
.ev time { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev .who { font-weight: 600; }
.ev.event { color: var(--ink-2); }
.ev.comment { padding: 10px 0; }
.ev .body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.ev.internal .body { background: var(--wait-soft); border-radius: var(--r); padding: 8px 10px; }
.tag { font-size: 11.5px; font-weight: 700; color: var(--wait-ink); margin-left: 6px; }
.day-sep { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 0 2px; }

/* ===== Daily report ===== */
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.items li:last-child { border-bottom: 0; }
.src { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.items form { margin: 0; }
.blockers-field > label { color: var(--wait-ink); }
.sent { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-ink); font-weight: 600; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; margin: 0 0 0 -8px; border-radius: var(--r); text-decoration: none; color: var(--ink); }
.hist a:hover { background: var(--hover); }
.hist a[aria-current="page"] { background: var(--press); font-weight: 600; }
.hist .flag { color: var(--wait-ink); font-weight: 600; font-size: 12.5px; }
.hist .meta { color: var(--ink-3); font-size: 12.5px; }

/* ===== Monitor ===== */
.blk { list-style: none; margin: 0; padding: 0; }
.blk li { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 4px 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.blk li:last-child { border-bottom: 0; }
.blk .who b { display: block; font-weight: 600; }
.blk .who span { color: var(--ink-3); font-size: 12.5px; }
.blk p { white-space: pre-wrap; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 0 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.zero { color: #6b7079; }
.table-wrap { overflow-x: auto; position: relative; }
.bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--side); min-width: 70px; margin-top: 7px; }
.bar i { flex: 0 1 0; min-width: 0; }
.b-todo { background: #a9adb3; }
.b-prog { background: var(--accent); }
.b-wait { background: var(--wait); }
.names { color: var(--ink-2); padding: 2px 0 14px; }

/* ===== Monitor ===== */
/* Today at a glance: one row of figures split by rules, no boxes. */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.kpis a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 14px 0; color: var(--ink-2); text-decoration: none; border-radius: 3px; }
.kpis a + a { border-left: 1px solid var(--line); padding-left: 16px; }
.kpis a:hover { background: var(--hover); }
.kpis b { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpis b i { font-style: normal; font-weight: 600; font-size: 15px; color: var(--ink-3); }
.kpis span { font-size: 13px; font-weight: 600; }
.kpis small { font-size: 12.5px; color: var(--ink-3); }
.kpis a.hot b { color: var(--wait-ink); }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.kv dd { color: var(--ink-2); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.teams .bar-col { width: 28%; }
.teams .bar { margin-top: 6px; min-width: 120px; }
.teams .strong { font-weight: 700; color: var(--ink); }
.teams .strong.zero { font-weight: 400; color: #6b7079; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
/* Side-by-side sections share one bottom rule and a divider, whatever their height. */
.split.ruled { border-bottom: 1px solid var(--line); }
.split.ruled:last-child { border-bottom: 0; }
.split.ruled > .sec { border-bottom: 0; }
.split.ruled > .sec + .sec { border-left: 1px solid var(--line); padding-left: 18px; margin-left: -18px; }
.rep { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rep:last-child { border-bottom: 0; }
.rep h3 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.rep h3 span { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.rep ul { margin: 6px 0 0; padding-left: 18px; }
.rep .line { margin-top: 6px; }
.rep .line b { font-weight: 600; }
.rep .blocker { margin-top: 6px; background: var(--wait-soft); color: var(--wait-ink); border-radius: var(--r); padding: 7px 10px; white-space: pre-wrap; }

/* ===== Task board ===== */
/* Fixed columns (To do, Doing, Done). Cards stay flat: one border, no shadow, like the rest of the app. */
.board-help { margin: 12px 0 0; }
.narrow-only { display: none; }
.board-pick { display: flex; align-items: center; gap: 8px; }
.board-pick label { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.board-pick select { width: auto; min-width: 180px; }
.js .board-pick button { display: none; }
.board { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
.col { background: var(--side); border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px 8px; }
.col-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 0 4px 8px; }
.col-h .n { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.col-h small { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-height: 8px; }
.card { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px 9px; }
.card:hover { border-color: var(--line-2); }
.card:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.card.overdue { border-left: 3px solid var(--danger); padding-left: 8px; }
.card-title { display: block; color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.card-title:hover { color: var(--accent-ink); }
.card-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.card-meta .code { font-size: 12px; }
.due.late { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--wait-ink); font-weight: 600; }
.chk.all { color: var(--accent-ink); font-weight: 600; }
.lbls { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.lbl { display: inline-block; font-size: 11.5px; font-weight: 600; line-height: 18px; padding: 0 7px; border-radius: 4px; }
/* Six label tones, each dark text on a light tint (all above 4.5:1). */
.lbl.t0 { background: #e4f1ee; color: #0a564e; }
.lbl.t1 { background: #e6eefb; color: #1d4a8c; }
.lbl.t2 { background: #f3e8fb; color: #642b8a; }
.lbl.t3 { background: #fdf3e1; color: #7a4900; }
.lbl.t4 { background: #fdecea; color: #8a1a11; }
.lbl.t5 { background: #ececea; color: #3c4048; }
.col-empty { color: var(--ink-3); font-size: 13px; padding: 6px 4px 4px; }
.quick-add { display: flex; gap: 6px; margin-top: 8px; }
.quick-add input { flex: 1; min-width: 0; background: transparent; border-color: transparent; min-height: 34px; }
.quick-add input:hover { background: var(--bg); border-color: var(--line); }
.quick-add input:focus { background: var(--bg); border-color: var(--line-2); }
.quick-add .btn { display: none; min-height: 34px; }
.quick-add:focus-within .btn, html:not(.js) .quick-add .btn { display: inline-flex; }
.js .tboard .card { cursor: grab; user-select: none; -webkit-user-select: none; }
.js .tboard .card a { -webkit-user-drag: none; }
.card.lifted { opacity: .35; }
.card.ghost { position: fixed; z-index: 60; pointer-events: none; box-shadow: 0 10px 24px rgba(23, 25, 30, .16); transform: rotate(1.5deg); }
.card.slot { background: transparent; border: 1px dashed var(--line-2); list-style: none; }
.board.dragging .col-empty { display: none; }
.board.dragging .col.over { border-color: var(--accent); background: var(--accent-soft); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; max-width: calc(100vw - 32px); background: var(--ink); color: #fff; border-radius: var(--r); padding: 10px 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(23, 25, 30, .2); }
.toast.error { background: var(--danger); }

/* Task detail: a page of its own, or the same content in a dialog over the board. */
.task-dlg { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 10px; padding: 0; color: var(--ink); }
.task-dlg::backdrop { background: rgba(23, 25, 30, .35); }
.task-dlg .task-view { padding: 18px 20px 20px; }
.task-dlg .dlg-loading { padding: 24px; color: var(--ink-3); }
.tv-head { display: flex; align-items: center; gap: 12px; }
.tv-head .crumb { margin: 0; }
.tv-close { margin-left: auto; }
.tv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 0 24px; margin-top: 8px; align-items: start; }
.tv-title { font-size: 18px; font-weight: 700; border-color: transparent; margin: 0 0 12px; }
.tv-title:hover { border-color: var(--line); }
.tv-title:focus { border-color: var(--line-2); }
.tv-side { border-left: 1px solid var(--line); padding-left: 20px; }
.tv-side .field { margin-bottom: 12px; }
.tv-side .dp { max-width: none; }
.tv-meta { margin-top: 10px; }
.help.late { color: var(--danger); font-weight: 600; }
.mt-s { margin-top: 6px; }
.tv-sec { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.progress { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--side); margin: 0 0 8px; }
.progress i { flex: 0 1 0; background: var(--accent); }
.progress i.rest { background: transparent; }
.chklist { list-style: none; margin: 0 0 8px; padding: 0; }
.chklist li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 0; }
.chklist form { margin: 0; }
.chklist .tick { position: relative; display: block; width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line-2); background: var(--bg); cursor: pointer; padding: 0; }
.chklist li.done .tick { background: var(--accent); border-color: var(--accent); }
.chklist li.done .tick::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.chklist li.done .chk-body { text-decoration: line-through; color: var(--ink-3); }
.chklist .x { opacity: 0; padding: 0 8px; min-height: 28px; color: var(--ink-3); }
.chklist li:hover .x, .chklist .x:focus-visible { opacity: 1; }
.tcomments { list-style: none; margin: 0 0 10px; padding: 0; }
.tcomments li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.tcomments .who { font-size: 13px; }
.tcomments .who b { font-weight: 600; }
.tcomments .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.tv-delete { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.tv-delete .btn { padding-left: 0; }
@media (max-width: 860px) {
  .board { grid-template-columns: repeat(3, 84vw); overflow-x: auto; scroll-snap-type: x mandatory; margin-right: -14px; padding: 0 14px 8px 0; }
  .col { scroll-snap-align: start; }
  .js .tboard .card { cursor: default; }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .board-pick { width: 100%; }
  .board-pick select { flex: 1; }
  .tv-grid { grid-template-columns: minmax(0, 1fr); }
  .tv-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .chklist .x { opacity: 1; }
  .cdlg .kbd-hint { display: none; }
  .compose-btns { margin-left: 0; width: 100%; }
  .compose-btns .btn { flex: 1; min-height: 44px; }
  .task-dlg { max-height: calc(100vh - 16px); }
}

/* ===== Inbox ===== */
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li { border-bottom: 1px solid var(--line); }
.inbox li:last-child { border-bottom: 0; }
.inbox button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; min-height: 40px; padding: 8px;
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
}
.inbox button:hover { background: var(--hover); }
.inbox button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.inbox .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: center; }
.inbox .read .dot { background: transparent; }
.inbox .read .msg { color: var(--ink-3); }
.inbox .unread .msg { font-weight: 600; }
.inbox time { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

/* ===== Admin ===== */
.subnav { display: flex; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.subnav a { padding: 0 10px; min-height: 30px; display: inline-flex; align-items: center; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.subnav a:hover { background: var(--hover); color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--press); color: var(--ink); }
.users { list-style: none; margin: 0; padding: 0; }
.u { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 84px; gap: 6px 16px; padding: 10px 8px; border-bottom: 1px solid var(--line); align-items: start; }
.users .u:last-child { border-bottom: 0; }
.u.pending { background: #fffbf3; }
.u .name b { font-weight: 600; }
.u .name span { display: block; color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.u .teams { color: var(--ink-2); }
.u .st { font-size: 12.5px; font-weight: 600; text-align: right; }
.u .st.pending { color: var(--wait-ink); }
.u .st.active { color: var(--accent-ink); }
.u .st.disabled, .u .st.rejected { color: var(--ink-3); }
.u .ops { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.u details summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; min-height: 30px; display: inline-flex; align-items: center; }
.u details[open] { flex-basis: 100%; }
.u details .row-form { margin: 4px 0 6px; }

/* ===== Mobile ===== */
@media (max-width: 860px) {
  .page { padding: 16px 14px 48px; }
  .top-in { padding: 0 12px; }
  .cols, .split { grid-template-columns: minmax(0, 1fr); }
  .aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .btn, .btn.ghost { min-height: 44px; }
  .list-head { display: none; }
  .t { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "st code age" "title title title" "team team who"; gap: 2px 10px; padding: 10px 4px; }
  .t > .status { grid-area: st; }
  .t > .code { grid-area: code; }
  .t > .t-age { grid-area: age; }
  .t > .t-title { grid-area: title; }
  .t > .t-title { display: block; }
  .t > .t-title a { white-space: normal; }
  .t > .t-title .prio { margin-right: 6px; }
  .cols .t { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "st code age" "title title title" "sub sub sub"; }
  .t > .t-team { grid-area: team; font-size: 13px; }
  .t > .t-who { grid-area: who; font-size: 13px; text-align: right; }
  .types a { grid-template-columns: minmax(0, 1fr); }
  .fields, .props { grid-template-columns: minmax(0, 1fr); }
  .fields dt, .props dt { border-bottom: 0; padding-bottom: 0; }
  .fields dd, .props dd { padding-top: 2px; }
  .blk li { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis a, .kpis a + a { padding: 12px 12px 12px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .kpis a:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
  .kpis a:last-child { border-bottom: 0; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .teams .bar-col { display: none; }
  .teams th .sw { display: none; }
  .teams th { white-space: normal; vertical-align: bottom; }
  .teams th, .teams td { padding-left: 5px; padding-right: 5px; }
  .teams th:first-child, .teams td:first-child { padding-left: 0; }
  .teams th:last-child, .teams td:last-child { padding-right: 0; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .split.ruled > .sec + .sec { border-left: 0; padding-left: 0; margin-left: 0; border-top: 1px solid var(--line); }
  .u { grid-template-columns: minmax(0, 1fr) auto; }
  .u .teams { grid-column: 1 / -1; grid-row: 2; }
  .tick { width: 22px; height: 22px; }
  .task { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .task .x { opacity: 1; }
  .dp-btn { min-height: 44px; }
  .dp-day { height: 44px; }
  .dp-quick button { min-height: 44px; }
  .dp-nav button { width: 44px; min-height: 44px; }
  /* Tap targets: fields and small controls reach 44px on touch screens. */
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select { min-height: 44px; }
  .compose-open { min-height: 44px; }
  .tick, .chklist .tick { position: relative; }
  .tick::before, .chklist .tick::before { content: ""; position: absolute; inset: -12px; }
  .sec-h .act, .card-title { padding: 12px 0; margin: -12px 0; }
  .seg a, .subnav a { min-height: 40px; }
  .filters select, .filters input { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .t, .dp-day, .tick { transition: background-color .1s ease, border-color .1s ease, color .1s ease; }
}

/* ===== Schedule ===== */
.sched { list-style: none; margin: 0; padding: 0; }
.sched li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sched li:last-child { border-bottom: 0; }
.sched b { font-weight: 600; }
.sched .muted { display: block; font-size: 12.5px; }
.sched .when { text-align: right; white-space: nowrap; }
.sched form { margin: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pair .dp { max-width: none; }
.away { font-size: 12px; font-weight: 600; color: var(--wait-ink); margin-left: 4px; }
@media (max-width: 860px) {
  .sched li { grid-template-columns: minmax(0, 1fr) auto; }
  .sched .when { grid-column: 1; grid-row: 2; text-align: left; }
  .sched form { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .pair { grid-template-columns: minmax(0, 1fr); }
}

/* ===== Admin: organization and request types ===== */
.private { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.archived { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.row-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; margin-bottom: 10px; }
.row-acts details { flex: 0 1 auto; }
.row-acts details[open] { flex: 1 1 100%; }
table.org tr.off td { color: var(--ink-3); }
table.org td { vertical-align: middle; }
.actions-cell { text-align: right; width: 1%; white-space: nowrap; }
.actions-cell details { display: inline-block; text-align: left; }
.actions-cell summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; list-style: none; }
.actions-cell summary::-webkit-details-marker { display: none; }
.actions-cell details[open] .edit-pop { display: grid; gap: 8px; padding: 10px 0 4px; min-width: 300px; }
.group-h { font-size: 13.5px; margin: 14px 0 4px; }
.group-h:first-child { margin-top: 0; }
.type-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 16px; align-items: baseline; padding: 9px 8px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.type-row:hover { background: var(--hover); color: var(--ink); }
.type-row b { font-weight: 600; margin-right: 8px; }
.type-row .muted { font-size: 13px; }
.type-row.off { color: var(--ink-3); }
.builder { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line); }
/* One row per field; the less used settings fold away under "More". */
.fb { border-bottom: 1px solid var(--line); padding: 8px 0; background: var(--bg); }
.fb-head { display: grid; grid-template-columns: 24px 22px minmax(0, 1fr) 130px 104px 140px auto; gap: 8px; align-items: center; }
.fb-n { font: 600 12.5px var(--mono); color: var(--ink-3); text-align: center; }
.fb-drag { display: none; width: 24px; height: 34px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: grab; touch-action: none; }
.fb-drag span { display: block; width: 10px; height: 14px; margin: 0 auto; background: radial-gradient(circle, var(--ink-3) 1.3px, transparent 1.6px) 0 0 / 5px 4.67px; }
.fb-drag:hover { background: var(--press); }
.js .fb-drag { display: block; }
.js .fb-head { grid-template-columns: 24px 22px minmax(0, 1fr) 130px 104px 140px auto; }
html:not(.js) .fb-head { grid-template-columns: 0 22px minmax(0, 1fr) 130px 104px auto; }
html:not(.js) .fb-toggle { display: none; }
.js .nojs { display: none; }
.fb-toggle { padding: 0 8px; white-space: nowrap; justify-self: start; }
.fb-toggle::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 8px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.fb-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }
.fb-sum { color: var(--ink-3); font-weight: 500; margin-left: 6px; }
.fb-sum:empty { display: none; }
.fb-ops { display: flex; gap: 2px; }
.fb-ops .btn { padding: 0 8px; }
.fb-ops .fb-del { color: var(--ink-3) !important; }
.fb-ops .fb-del:hover, .fb-ops .fb-del:focus-visible { color: var(--danger) !important; background: var(--danger-soft); }
.fb-ops .btn:disabled { opacity: .35; cursor: default; }
.fb.dragging { position: relative; z-index: 5; box-shadow: 0 6px 18px rgba(23, 25, 30, .12); border-radius: var(--r); }
.fb.dragging .fb-drag { cursor: grabbing; }
.fb.added { background: var(--accent-soft); }
.savebar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
.savebar .btn:last-child { margin-left: auto; }
.savebar-state { color: var(--wait-ink); font-weight: 600; font-size: 13px; }
.danger-text { color: var(--danger) !important; }
.fb-more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 8px 0 4px 62px; }
.js .fb-more:not(.open) { display: none; }
.fb-more .field { margin-bottom: 0; }
.fb-opt { grid-column: 1 / -1; }
.fb-opt textarea { min-height: 80px; }
/* Show only the inputs that apply to the chosen field type. */
@supports selector(:has(*)) {
  .fb:not(:has(select[name=type] option[value=select]:checked)) .fb-opt { display: none; }
  .fb:has(select[name=type] option[value=bool]:checked) .fb-ph,
  .fb:has(select[name=type] option[value=date]:checked) .fb-ph,
  .fb:has(select[name=type] option[value=select]:checked) .fb-ph { display: none; }
}
@media (max-width: 860px) {
  .fb-head, .js .fb-head, html:not(.js) .fb-head { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); }
  .fb-n { display: none; }
  .fb-head > input { grid-column: 2 / -1; }
  .fb-head > select { grid-column: auto; }
  .fb-head > select[name=type] { grid-column: 2; }
  .fb-toggle { grid-column: 2; justify-self: start; }
  .fb-ops { grid-column: 3; justify-content: flex-end; }
  .fb-more { grid-template-columns: minmax(0, 1fr); margin-left: 32px; }
  .type-row { grid-template-columns: minmax(0, 1fr) auto; }
  .type-row > span:nth-child(2) { grid-column: 1; grid-row: 2; }
  .actions-cell details[open] .edit-pop { min-width: 0; }
  /* Phones: keep team, code and Edit; the counts live on desktop. */
  table.org th:nth-child(3), table.org td:nth-child(3),
  table.org th:nth-child(4), table.org td:nth-child(4),
  table.org th:nth-child(5), table.org td:nth-child(5) { display: none; }
  table.org td.actions-cell { width: auto; }
  .subnav { overflow-x: auto; }
  .subnav a { white-space: nowrap; }
}

/* A form being sent in the background */
form[aria-busy="true"] button[type=submit] { opacity: .6; cursor: progress; }
