/* ------------------------------------------------------------------ *
 * Cuez brand, light ground.
 * White page, black type, one accent colour per viewport used as solid
 * blocks and fills. Type never sits in the accent colour, so cyan and
 * yellow stay as readable as magenta.
 * ------------------------------------------------------------------ */

:root {
  --accent: #ff00ff;
  --on-accent: #000000;
  --ink: #000000;
  --paper: #ffffff;
  --line: rgba(0, 0, 0, 0.16);
  --line-soft: rgba(0, 0, 0, 0.07);
  --muted: rgba(0, 0, 0, 0.55);
  --wash: rgba(0, 0, 0, 0.025);
  --grid: 48px;
  --font: 'Space Grotesk', ui-sans-serif, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(to right, var(--line-soft) 0 0.5px, transparent 0.5px var(--grid)),
    repeating-linear-gradient(to bottom, var(--line-soft) 0 0.5px, transparent 0.5px var(--grid));
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 80%);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 96px;
}
.wrap.narrow { max-width: 640px; }

/* The top bar is sticky, so anchors need room. */
[id] { scroll-margin-top: 90px; }

/* ---------------- keyboard and screen readers ---------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  text-decoration: none;
  border: 1px solid var(--ink);
}
.skip:focus { left: 12px; top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn:focus-visible, .tab:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ---------------- never let content break the layout ---------------- */

body { overflow-wrap: anywhere; word-break: normal; }
td, th, dd, .name, .mono, .comment p, .body p, .body li { overflow-wrap: anywhere; }
td.first { max-width: 42ch; }
.mono { overflow-wrap: anywhere; }
img, video { max-width: 100%; height: auto; }
pre { max-width: 100%; overflow-x: auto; }

/* ---------------- type ---------------- */

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 38px; line-height: 1.1; }
h2 { font-size: 21px; line-height: 1.2; }
h3 { font-size: 15px; line-height: 1.3; }
p { margin: 0 0 12px; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 700;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--accent);
  display: inline-block;
  flex: none;
}
.sub { font-size: 18px; font-weight: 300; color: var(--muted); margin-top: 10px; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 0.5px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.logo {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}
.logo:hover { background: none; color: var(--ink); }
.logo .dot { width: 10px; height: 10px; background: var(--accent); display: inline-block; flex: none; }
.logo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-pick .logo-preview { display: flex; align-items: center; justify-content: center;
  width: 96px; height: 40px; flex: none; background: var(--ink); padding: 0 8px; }
.logo-pick .logo-preview img { max-height: 28px; max-width: 80px; width: auto; object-fit: contain; }
.logo-pick input[type=file] { flex: 1 1 220px; min-width: 0; }
.logo .brandmark { height: 28px; max-width: 140px; width: auto; object-fit: contain; flex: none; display: block; }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a, .nav button {
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 0;
  font-family: var(--font);
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: none;
}
.nav a:hover, .nav button:hover { color: var(--ink); background: var(--accent); }
.nav a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------------- header block ---------------- */

.head {
  padding: 52px 0 26px;
  border-bottom: 0.5px solid var(--line);
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.head .grow { flex: 1 1 340px; }
.head-actions { display: flex; gap: 10px; padding-top: 8px; }

/* ---------------- panels ---------------- */

.panel {
  border: 0.5px solid var(--line);
  padding: 22px;
  margin-bottom: 20px;
  background: var(--paper);
}
.panel > h2 { margin-bottom: 4px; }
.panel-note { color: var(--muted); font-size: 13px; margin-bottom: 18px; max-width: 74ch; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------------- forms ---------------- */

label.field { display: block; margin-bottom: 16px; }
label.field > span.lbl,
span.lbl {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 700;
}
label.field > span.hint { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }

input[type=text], input[type=password], input[type=number], input[type=url],
input[type=email], input[type=tel], input[type=date], input[type=datetime-local],
select, textarea {
  width: 100%;
  background: var(--paper);
  border: 0.5px solid var(--line);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 300;
  padding: 11px 13px;
  border-radius: 0;
  outline: none;
}
select:not([multiple]) {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
input::placeholder, textarea::placeholder { color: rgba(0, 0, 0, 0.3); }

input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: 14px; }
.check label { cursor: pointer; }

input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px; height: 17px;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  flex: none;
  margin: 2px 0 0;
  position: relative;
}
input[type=checkbox]:checked { background: var(--accent); border-color: var(--ink); }
input[type=checkbox]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 4px; height: 9px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 11px 20px;
  min-height: 44px;
  border: 1px solid var(--ink);
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  border-radius: 0;
  text-decoration: none;
}
.btn:hover { filter: brightness(0.94); text-decoration: none; color: var(--on-accent); }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: var(--paper); filter: none; }
.btn.danger { background: var(--paper); border-color: var(--line); color: var(--muted); }
.btn.danger:hover { border-color: #ff0000; color: #ff0000; background: var(--paper); }
/* Destructive and irreversible, so it looks it. */
.btn.delete { background: #ff0000; border-color: var(--ink); color: var(--paper); }
.btn.delete:hover { background: #d90000; color: var(--paper); filter: none; }
.btn.sm { padding: 7px 13px; font-size: 12px; min-height: 36px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------- tables ---------------- */

.table-wrap { overflow-x: auto; border: 0.5px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 13px 16px;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
  background: var(--wash);
}
td { padding: 13px 16px; border-bottom: 0.5px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--wash); }
td.first { font-weight: 700; }

.tag {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 500;
  margin: 0 5px 4px 0;
  white-space: nowrap;
}
.tag.plain { background: none; color: var(--ink); border: 0.5px solid var(--line); }
.tag.done { background: none; color: var(--muted); border: 0.5px solid var(--line); }

/* Status, priority and every other select carry the colour they were given in
   Notion. An option with no colour set lands on c-default. */
.tag[class*="c-"] { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.tag.c-gray { background: rgba(0, 0, 0, 0.08); color: rgba(0, 0, 0, 0.66); }
.tag.c-brown { background: #ece0d8; color: #5a3418; }
.tag.c-orange { background: #ffe4c7; color: #7a3d00; }
.tag.c-yellow { background: #fdf0bf; color: #6b4d00; }
.tag.c-green { background: #d3f0dd; color: #10552a; }
.tag.c-blue { background: #d8e6ff; color: #123a72; }
.tag.c-purple { background: #e8dbfa; color: #4a2382; }
.tag.c-pink { background: #fbdaea; color: #7c1e4d; }
.tag.c-red { background: #ffd9d5; color: #8a1a10; }

/* On the black record band the chips keep their tint, so they still read. */
.recordhead .tag[class*="c-"] { border: 0; }
.bool { font-weight: 700; }
.empty-cell { color: rgba(0, 0, 0, 0.25); }

/* ---------------- cards ---------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  border: 0.5px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
  /* The whole card is one link to the dashboard's settings. */
  text-decoration: none;
  color: var(--ink);
}
.card:hover, .card:focus-visible {
  border-color: var(--ink);
  background: var(--wash);
  color: var(--ink);
  text-decoration: none;
}
.card:hover .swatch { height: 6px; }
.card .swatch { width: 100%; height: 4px; background: var(--accent); }

.card h3 { font-size: 18px; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .row { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }

.pill {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 0.5px solid var(--line);
  padding: 3px 9px;
  color: var(--muted);
  font-weight: 700;
}
.pill.on { color: var(--on-accent); background: var(--accent); border-color: var(--ink); }
.pill.off { color: rgba(0, 0, 0, 0.35); }

/* ---------------- notices ---------------- */

.notice {
  border: 0.5px solid var(--line);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  background: var(--wash);
}
.notice.bad { border-left-color: #ff0000; }
.notice.bad strong { color: #ff0000; }

/* ---------------- filter builder ---------------- */

.group { border: 0.5px solid var(--line); padding: 16px; margin-bottom: 14px; background: var(--wash); }
.group-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.cond {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(130px, 1fr) minmax(140px, 1.4fr) auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
@media (max-width: 760px) { .cond { grid-template-columns: 1fr; } }
.cond select, .cond input { padding: 8px 10px; font-size: 13px; background: var(--paper); }
.iconbtn {
  background: var(--paper); border: 0.5px solid var(--line); color: var(--muted);
  width: 32px; height: 32px; cursor: pointer; font-size: 15px; line-height: 1; font-family: var(--font);
}
.iconbtn:hover { border-color: var(--ink); color: var(--ink); }

.conj-toggle { display: inline-flex; border: 1px solid var(--ink); }
.conj-toggle button {
  background: var(--paper); border: 0; color: var(--muted); font-family: var(--font); font-weight: 700;
  font-size: 11px; letter-spacing: 0.12em; padding: 6px 13px; cursor: pointer;
}
.conj-toggle button.on { background: var(--accent); color: var(--on-accent); }

/* ---------------- property picker ---------------- */

.props { border: 0.5px solid var(--line); }
.prop-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--line-soft);
  background: var(--paper);
}
.prop-row:last-child { border-bottom: 0; }
.prop-row .name { font-weight: 700; font-size: 14px; }
.prop-row .type { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.prop-row .toggle { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.drag-handle {
  color: rgba(0, 0, 0, 0.3);
  font-size: 13px;
  cursor: grab;
  border: 0;
  background: none;
  padding: 4px 2px;
  line-height: 1;
}
.drag-handle:hover { color: rgba(0, 0, 0, 0.6); }
.drag-handle:focus-visible { outline: 2px solid var(--accent, #FF00FF); outline-offset: 2px; }
.prop-row[draggable='true'] .drag-handle { cursor: grabbing; }
.prop-row.dragging { opacity: 0.45; }

/* ---------------- centered auth ---------------- */

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}
.auth-box { width: 100%; max-width: 390px; }
.auth-box .accent-bar { height: 5px; background: var(--accent); margin-bottom: 26px; width: 64px; }

/* ---------------- footer ---------------- */

.foot-refresh { display: inline-flex; align-items: center; gap: 10px; }

/* While the next record is on its way, only the pane fades: the rail stays
   solid so the row you just clicked does not flicker under the cursor. */
[aria-busy="true"] .recpane { opacity: 0.55; transition: opacity 120ms ease; }

.foot {
  border-top: 0.5px solid var(--line);
  margin-top: 44px;
  padding-top: 18px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stack { display: flex; flex-direction: column; gap: 6px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.loading { color: var(--muted); font-size: 13px; }

/* ---------------- tabs ---------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 20px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border: 0.5px solid var(--line);
  border-bottom: 0;
  margin-right: -0.5px;
  background: var(--wash);
}
.tab:hover { color: var(--ink); background: var(--paper); }
.tab.on { background: var(--accent); color: var(--on-accent); border-color: var(--ink); }
.tab-count {
  font-size: 11px;
  font-weight: 700;
  border: 0.5px solid currentColor;
  padding: 0 6px;
  line-height: 16px;
}

/* ---------------- search ---------------- */

.searchbar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.searchbar input[type=text] { flex: 1 1 260px; }

th .sortlink {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: inherit;
}
th .sortlink:hover { background: var(--accent); color: var(--on-accent); }
th .sortlink.on { color: var(--ink); }
th .arrow { font-size: 12px; }

/* ---------------- record detail ---------------- */

.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.body p { margin: 0 0 12px; }
.body ul, .body ol { margin: 0 0 14px; padding-left: 22px; }
.body li { margin-bottom: 5px; }
.body blockquote {
  margin: 0 0 14px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.body .callout { border: 0.5px solid var(--line); padding: 12px 14px; margin-bottom: 14px; background: var(--wash); }
.body hr { border: 0; border-top: 0.5px solid var(--line); margin: 18px 0; }
.body figure { margin: 0 0 14px; }
.body figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.body img { max-width: 100%; border: 0.5px solid var(--line); }
.body .code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--wash);
  border: 0.5px solid var(--line);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 14px;
}
.body .todo { display: flex; align-items: center; gap: 9px; }
.body .todo .box { width: 14px; height: 14px; border: 1px solid var(--ink); flex: none; }
.body .todo .box.on { background: var(--accent); }

.proplist { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; }
.proplist dt {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-top: 14px;
}
.proplist dt:first-child { margin-top: 0; }
.proplist dd { margin: 5px 0 0; font-size: 14px; }

.comment {
  border-top: 0.5px solid var(--line-soft);
  padding: 14px 0 2px;
}
.comment:first-of-type { border-top: 0; padding-top: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.comment-head strong { font-size: 14px; }
.comment p { margin: 0; white-space: pre-wrap; }

/* ---------------- file inputs ---------------- */

input[type=file] {
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  border: 0.5px dashed var(--line);
  padding: 14px;
  background: var(--wash);
  cursor: pointer;
}
/* ------------------------------------------------------------------ *
 * Phones. The record table turns into cards, one per record, because a
 * six column table in a gallery on a phone is unreadable.
 * ------------------------------------------------------------------ */

@media (max-width: 760px) {
  h1 { font-size: 30px; }
  .logo { font-size: 15px; line-height: 1.15; }
  .nav { white-space: nowrap; }
  .nav-add { display: none; }   /* the big button below does this job */
  .sub { font-size: 16px; }
  .wrap { padding: 0 16px 64px; }
  .topbar-inner { padding: 12px 16px; gap: 12px; }
  .nav { gap: 14px; }
  .head { padding: 32px 0 20px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; justify-content: center; }
  .panel { padding: 18px 16px; }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex: none; }

  .searchbar input[type=text] { flex: 1 1 100%; }

  .table-wrap { border: 0; overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }

  tbody tr {
    border: 0.5px solid var(--line);
    margin-bottom: 12px;
    padding: 4px 0;
    background: var(--paper);
  }
  tbody tr:hover td { background: none; }

  td {
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 8px 14px;
    border-bottom: 0;
  }
  td::before {
    content: attr(data-label);
    flex: 0 0 34%;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
  }
  td.first {
    display: block;
    border-bottom: 0.5px solid var(--line-soft);
    padding: 12px 14px;
    font-size: 16px;
  }

  /* On a card the state stripe runs across the top instead of down the side. */
  td.stripe { display: block; width: 100%; height: 4px; padding: 0; }
  td.stripe::before { display: none; }
  td.first::before { display: none; }

  /* Details first on a phone, then the write-up, then the thread. */
  .detail-grid { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .detail-grid > div { display: contents; }
  .p-details { order: 1; }
  .p-description { order: 2; }
  .p-comments { order: 3; }
  .p-attach { order: 4; }
  .proplist dd { font-size: 15px; }
  .cond { grid-template-columns: 1fr; }
}

input[type=file]::file-selector-button {
  font-family: var(--font);
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--ink);
  background: var(--accent);
  color: var(--on-accent);
  padding: 7px 13px;
  margin-right: 12px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * Client pages, second pass. Same ink, paper and accent, bolder
 * blocks: a solid black masthead, the tabs, toolbar and table welded
 * into one hairline slab, a black band on the record, and the comment
 * thread as a timeline. Nothing here touches the backoffice, which
 * keeps the quieter white bar.
 * ------------------------------------------------------------------ */

.topbar.dark {
  background: var(--ink);
  border-bottom: 0;
  backdrop-filter: none;
}
.topbar.dark .topbar-inner { padding: 0 24px; height: 64px; }
.topbar.dark .logo, .topbar.dark .logo:hover { color: var(--paper); }
.topbar.dark .nav a, .topbar.dark .nav button, .topbar.dark .nav .small { color: rgba(255, 255, 255, 0.62); }
.topbar.dark .nav a:hover, .topbar.dark .nav button:hover { background: var(--accent); color: var(--on-accent); }

/* The client page leads with the headline, so it gets the bigger type. */
.head.hero { border-bottom: 0; margin-bottom: 20px; align-items: flex-end; }
.head.hero h1 { font-size: 48px; line-height: 1.05; }
.head.hero .sub { text-wrap: pretty; }
@media (max-width: 760px) { .head.hero h1 { font-size: 30px; } }

/* ---- one slab: tabs, toolbar, table ---- */

.tabs.seg { margin-bottom: 0; border: 0.5px solid var(--line); border-bottom: 1px solid var(--ink); background: var(--wash); }
.tabs.seg .tab { border: 0; border-right: 0.5px solid var(--line); margin: 0; padding: 13px 18px; background: none; min-height: 44px; }
.tabs.seg .tab:last-child { border-right: 0; }
.tabs.seg .tab.on { background: var(--accent); color: var(--on-accent); }

.toolbar {
  display: flex;
  align-items: stretch;
  border: 0.5px solid var(--line);
  border-top: 0;
  background: var(--paper);
}
.toolbar form, .toolbar .cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  min-height: 52px;
  font-size: 13px;
  color: var(--muted);
}
.toolbar form { flex: 1 1 260px; margin: 0; }
.toolbar form input[type=text] { border: 0; padding: 0; font-size: 15px; background: none; flex: 1; }
.toolbar form input[type=text]:focus { box-shadow: none; }
.toolbar .cell.count strong { color: var(--ink); }
.toolbar a.cell { text-decoration: none; }
.toolbar a.cell:hover { background: var(--accent); color: var(--on-accent); }
.toolbar .vr { width: 0.5px; background: var(--line); flex: none; }
.toolbar .sr-only-label { position: absolute; left: -9999px; }
@media (max-width: 760px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar .vr { display: none; }
  .toolbar form, .toolbar .cell { border-top: 0.5px solid var(--line-soft); width: 100%; }
}

.table-wrap.slab { border-top: 0; }

/* Accent while the record is still ours, hairline once it is done. */
th.stripe, td.stripe { padding: 0; width: 4px; }
td.stripe { background: var(--line); }
td.stripe.live { background: var(--accent); }
td.ref { white-space: nowrap; }

/* ---- record head band ---- */

.recordhead {
  background: var(--ink);
  color: var(--paper);
  padding: 32px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.recordhead .grow { flex: 1 1 340px; display: flex; flex-direction: column; gap: 14px; }
.recordhead h1 { font-size: 36px; line-height: 1.1; max-width: 34ch; }
.recordhead .eyebrow { color: var(--paper); }
.recordhead .meta { font-size: 12px; color: rgba(255, 255, 255, 0.58); }
.recordhead .tag.plain, .recordhead .tag.done { color: var(--paper); border-color: rgba(255, 255, 255, 0.38); }
@media (max-width: 760px) {
  .recordhead { padding: 22px 18px; }
  .recordhead h1 { font-size: 26px; }
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 18px;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  min-height: 32px;
}

/* ---- the thread ---- */

.thread { display: flex; flex-direction: column; }
.thread .comment { display: flex; gap: 16px; border-top: 0; padding: 0; }
.thread .rail { flex: none; width: 10px; display: flex; flex-direction: column; align-items: center; }
.thread .rail .dot { width: 10px; height: 10px; background: var(--accent); flex: none; }
.thread .rail .dot.them { background: none; border: 1px solid var(--ink); }
.thread .rail .line { width: 1px; flex: 1 1 auto; background: var(--line-soft); }
.thread .said { flex: 1 1 auto; padding-bottom: 22px; }
.thread .comment:last-child .said { padding-bottom: 4px; }
.thread .comment-head { margin-bottom: 5px; }

.composer { border-top: 0.5px solid var(--line); margin-top: 20px; padding-top: 18px; }

/* ---- file dropzone ---- */

.dropzone {
  border: 0.5px dashed var(--line);
  background: var(--wash);
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.dropzone .lbl { margin: 0; }
.dropzone input[type=file] { border: 0; background: none; padding: 0; text-align: center; }

/* ---- split sign-in ---- */

.auth.split { padding: 0; align-items: stretch; }
.auth.split .side {
  flex: 0 0 46%;
  background: var(--ink);
  color: var(--paper);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.auth.split .side .eyebrow, .auth.split .side h1 { color: var(--paper); }
.auth.split .side .sub { color: rgba(255, 255, 255, 0.62); }
.auth.split .side h1 { font-size: 52px; line-height: 1.03; max-width: 22ch; }
.auth.split .side .accent-bar { margin: 0; }
.auth.split .side .fine { margin-top: auto; font-size: 12px; color: rgba(255, 255, 255, 0.58); }
.auth.split .side .mid { margin-top: auto; display: flex; flex-direction: column; gap: 18px; }
.auth.split .form-half { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth.split .btn { width: 100%; justify-content: center; }
@media (max-width: 860px) {
  .auth.split { flex-direction: column; }
  .auth.split .side { flex: none; padding: 32px 20px; gap: 18px; }
  .auth.split .side h1 { font-size: 32px; }
  .auth.split .side .mid, .auth.split .side .fine { margin-top: 0; }
  .auth.split .form-half { padding: 28px 20px 48px; }
}

/* ---- form, grouped with a reason per group ---- */

.fieldrow {
  padding: 20px 24px;
  border-top: 0.5px solid var(--line-soft);
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 24px;
  align-items: start;
}
.fieldrow:first-child { border-top: 0; }
.fieldrow .side .lbl { margin-bottom: 5px; display: flex; align-items: center; gap: 10px; }
.fieldrow .side p { font-size: 12px; color: var(--muted); margin: 0; text-wrap: pretty; }
.fieldrow .rowfields > label.field:last-child, .fieldrow .rowfields > .check:last-child { margin-bottom: 0; }
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.actionbar { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--ink); margin-top: 24px; padding-top: 20px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .fieldrow { grid-template-columns: 1fr; gap: 14px; padding: 18px 16px; }
  .actionbar .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------------- split view: overview left, record right ---------------- */

.wrap.wide { max-width: 1500px; }

.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }

.reclist {
  border: 0.5px solid var(--line);
  background: var(--paper);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  position: sticky;
  top: 90px;
}
.recitem {
  display: block;
  padding: 14px 16px 14px 13px;
  border-left: 3px solid transparent;
  border-bottom: 0.5px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
}
/* Done reads as done in the text, not with another coloured bar. */
.recitem.done .recitem-title { color: var(--muted); font-weight: 400; }
.recitem:hover { background: var(--wash); }
/* The accent marks one row: the open one. */
.recitem.on { background: var(--paper); border-left-color: var(--accent); }
.recitem.on .recitem-title { font-weight: 600; }
.recitem-title { display: block; font-weight: 500; line-height: 1.35; }
.recitem-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 7px; }
.recitem-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
}

/* Inside the pane there is no room for two columns of detail. */
.recpane .detail-grid { grid-template-columns: 1fr; }
.recpane .record { min-width: 0; }
.recpane .recordhead { padding: 22px; margin-bottom: 16px; }
.recpane .recordhead h1 { font-size: 26px; }

@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
  .reclist { position: static; max-height: 420px; }
}

/* The toolbar controls stay their own size, the search field takes the slack. */
.toolbar form select { flex: 0 1 190px; min-width: 0; }
.toolbar form .btn { flex: none; white-space: nowrap; }

/* The overview reads as a rail: recessed, hairline, quiet. The record is the paper. */
.reclist { background: var(--wash); }
.recitem { background: transparent; }
.recitem:hover { background: var(--paper); }
.recpane .panel { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04); }

/* In the rail the Notion colours stay as a dot and coloured label, not nine
   blocks of fill fighting the titles. Full tint is for the record itself. */
.reclist .tag { background: none; font-weight: 400; margin: 0; }
.reclist .tag[class*="c-"]::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 5px;
  vertical-align: 1px;
  background: currentColor;
  border-radius: 50%;
}
.reclist .tag.plain, .reclist .tag.done, .reclist .tag.c-default { border: 0; color: var(--muted); }
.record > .panel:last-child { margin-bottom: 0; }
