/* ==========================================================================
   Zaedno. dashboard
   Same brand as zaedno.studio: Paper / Ink / Signal, Inter with a Literata italic
   accent, glass header with the logo lip, soft floating surfaces.
   Clients see the Paper side (like the website); the team sees the Ink side.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-italic-var.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #F4EFE6;
  --ink: #1B1B1F;
  --signal: #E8482B;
  --sun: #F2B632;
  --stone: #8A857C;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Literata", Georgia, serif;
  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 76rem;
  --nav-h: 4.25rem;
  --radius-lg: 1.75rem;
  --radius-md: 1.25rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);

  --fs-label: .8125rem;
  --fs-small: .9375rem;
  --fs-body: 1rem;
}

/* ---------- The two sides ---------- */
.theme-client {
  --bg: var(--paper);
  --fg: var(--ink);
  --surface: #FBF8F2;                    /* cards: a step lighter than the page */
  --surface-2: #EDE6DA;
  --muted: #6B665E;                      /* 5.1:1 on Paper */
  --line: rgba(27, 27, 31, .1);
  --field: #FFFDF9;
  --glass: rgba(244, 239, 230, .62);
  --glass-edge: rgba(255, 255, 255, .4);
  --shadow-1: 0 1px 2px rgba(27, 27, 31, .04), 0 8px 24px -12px rgba(27, 27, 31, .14);
  --shadow-2: 0 2px 4px rgba(27, 27, 31, .05), 0 22px 48px -20px rgba(27, 27, 31, .28);
  --accent-ink: #C7351B;                 /* Signal darkened for small text: 4.9:1 on Paper */
  color-scheme: light;
}
.theme-team {
  --bg: var(--ink);
  --fg: var(--paper);
  --surface: #24242A;
  --surface-2: #2D2D34;
  --muted: #B9B3A8;                      /* 8:1 on the surface */
  --line: rgba(244, 239, 230, .1);
  --field: #1F1F24;
  --glass: rgba(27, 27, 31, .6);
  --glass-edge: rgba(244, 239, 230, .1);
  --shadow-1: inset 0 1px 0 rgba(244, 239, 230, .06), 0 10px 28px -16px rgba(0, 0, 0, .6);
  --shadow-2: inset 0 1px 0 rgba(244, 239, 230, .08), 0 24px 50px -22px rgba(0, 0, 0, .75);
  --accent-ink: #FF8A73;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--fs-body)/1.55 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
/* Zero weight (:where), so a list that is also a card (.rows.panel) keeps the card's padding */
:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: .25rem; }
.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;
}
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 100; padding: .6rem 1rem; border-radius: 999px; background: var(--signal); color: var(--paper); font-weight: 700; }
.skip:focus { top: .75rem; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.main { padding-block: clamp(2.5rem, 6vw, 4.5rem) 6rem; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.block-sm { display: block; font-size: var(--fs-small); }
.warn { color: var(--accent-ink); font-weight: 600; }
.dot { color: var(--signal); }
.accent { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; }
.text-link { color: inherit; text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: .2em; text-decoration-thickness: 1.5px; font-weight: 500; }
.text-link:hover { text-decoration-color: currentColor; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Header: glass bar, logo lip (as on the website) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.9);
  backdrop-filter: blur(22px) saturate(1.9);
  box-shadow: inset 0 -1px 0 var(--glass-edge), 0 10px 30px -22px rgba(0, 0, 0, .35);
}
.topbar__inner { display: flex; align-items: center; gap: 1rem; min-height: var(--nav-h); }
.brand {
  --lip: 1.25rem;
  align-self: flex-start;
  display: flex;
  align-items: center;
  height: calc(var(--nav-h) + var(--lip));
  margin-bottom: calc(-1 * var(--lip));
  padding: var(--lip) clamp(1rem, 1.8vw, 1.5rem) 0;
  background: var(--ink);
  border-radius: 0 0 .35rem .35rem;
  box-shadow: 0 10px 22px -14px rgba(27, 27, 31, .45);
}
.brand img { height: 1.625rem; width: auto; }
.theme-team .brand {
  box-shadow: inset 1px 0 0 rgba(244, 239, 230, .16), inset -1px 0 0 rgba(244, 239, 230, .16),
              inset 0 -1px 0 rgba(244, 239, 230, .22), 0 14px 28px -12px rgba(0, 0, 0, .7);
}
.side-tag {
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--signal);
  color: var(--paper);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .02em;
}
.topnav { margin-left: auto; }
.topnav ul { display: flex; gap: .25rem; }
.topnav a {
  display: block;
  padding: .5rem .85rem;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s var(--ease);
}
.topnav a:hover { background: var(--line); }
.topnav a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.logout { display: flex; align-items: center; margin-left: 1rem; }

@media (max-width: 52rem) {
  /* Phones and small tablets: the links get their own scrolling row under the bar */
  .topbar__inner { flex-wrap: wrap; row-gap: 0; }
  .logout { margin-left: auto; }
  /* starts below the logo lip, so the pills never slide under it */
  .topnav { order: 3; flex-basis: 100%; margin: 1.6rem calc(-1 * var(--gutter)) 0; padding: .25rem var(--gutter) .6rem; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav ul { width: max-content; }
  .brand img { height: 1.4rem; }
  .brand { padding-inline: .8rem; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .topbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 0 var(--line); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  padding: .7rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--signal);
  color: var(--paper);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 6px 16px -10px rgba(232, 72, 43, .6);
  transition: background-color .3s var(--ease), transform .45s var(--spring), box-shadow .45s var(--spring);
}
.btn:hover { background: #D63E22; }
.btn:active { transform: scale(.97); transition-duration: .1s; }   /* feedback on press, not release */
.btn--block { width: 100%; }
.btn--sm { min-height: 2.25rem; padding: .45rem .9rem; font-size: var(--fs-small); }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--line); }
.btn-quiet {
  padding: .45rem .8rem;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  font-size: var(--fs-small);
  font-weight: 500;
  cursor: pointer;
  transition: transform .45s var(--spring), background-color .2s;
}
.btn-quiet:hover { background: color-mix(in srgb, var(--fg) 16%, transparent); }
.btn-quiet:active { transform: scale(.96); transition-duration: .1s; }

/* ---------- Page heads ---------- */
.crumbs { margin-bottom: .75rem; font-size: var(--fs-small); color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.eyebrow { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; font-size: .9375rem; font-weight: 600; color: var(--muted); }
.eyebrow::before { content: ""; width: 1.5rem; height: 2px; background: var(--signal); }
.page-title { font-size: clamp(2.25rem, 5.5vw, 4rem); font-weight: 500; line-height: 1.02; letter-spacing: -.045em; }
.lede { max-width: 38rem; margin-top: .9rem; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.45; color: var(--muted); }
.flash { margin-bottom: 1.5rem; padding: .8rem 1.1rem; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-1); font-weight: 500; animation: arrive .5s var(--spring); }
.flash::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .6rem; border-radius: 50%; background: #3BA55C; vertical-align: .1em; }
.flash--error::before { background: var(--signal); }
@keyframes arrive { from { opacity: 0; transform: translateY(-.4rem) scale(.98); } }

/* ---------- Blocks and panels ---------- */
.block { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.block__head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem; }
.block__head .block__title { margin-bottom: 0; }
.block__title { margin-bottom: 1.1rem; font-size: 1.375rem; font-weight: 600; letter-spacing: -.025em; }
.block__sub { margin: 2rem 0 .75rem; font-size: 1.0625rem; font-weight: 600; }
.panel { padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.panel--accent { background: var(--ink); color: var(--paper); }
.theme-team .panel--accent { background: var(--surface-2); }
.panel--accent p { margin-bottom: 1.25rem; color: #D6D0C5; }
.split { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.split > .block { margin-bottom: 0; }
@media (min-width: 52rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
}
.empty { padding: 1.5rem; border-radius: var(--radius-md); border: 1.5px dashed var(--line); color: var(--muted); }
/* One rhythm between stacked pieces inside a section: list, form, note */
.empty:not(:last-child), .rows:not(:last-child) { margin-bottom: 1.25rem; }
.block > .muted.small { margin-top: .75rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.stats li, .stats a { display: grid; gap: .2rem; }
.stats li { padding: 1.25rem 1.4rem; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-1); }
.stats a { text-decoration: none; }
.stats__n { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stats__l { font-size: var(--fs-small); color: var(--muted); }
.stat { font-size: 2.25rem; font-weight: 600; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat + .muted { margin-top: .35rem; }

/* Rows */
.rows { margin-block: .5rem 1rem; }
.rows.panel { margin-block: 0 1rem; padding-block: .5rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-block: .85rem; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row--stack { display: grid; justify-content: stretch; }
.row__end { display: flex; align-items: center; gap: .6rem; font-variant-numeric: tabular-nums; }
.row form { display: flex; flex-wrap: wrap; gap: .5rem; }
.row > span { display: grid; gap: .2rem; }
.row > span .pill { justify-self: start; }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  vertical-align: middle;
}
.pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--stone); }
.pill--in_progress::before, .pill--req-quoted::before { background: var(--sun); }
.pill--in_review::before, .pill--you::before, .pill--req-new::before, .pill--inv-unpaid::before { background: var(--signal); }
.pill--delivered::before, .pill--inv-paid::before, .pill--req-accepted::before { background: #3BA55C; }
.pill--you, .pill--inv-overdue { background: var(--signal); color: var(--paper); }
.pill--you::before, .pill--inv-overdue::before { background: var(--paper); }

/* ---------- Project cards ---------- */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1.25rem; }
.pcard__link {
  display: grid;
  gap: .6rem;
  height: 100%;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  transition: transform .6s var(--spring), box-shadow .6s var(--spring);
}
@media (hover: hover) { .pcard__link:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); } }
.pcard__link:active { transform: scale(.985); transition-duration: .12s; }
.pcard__top { display: flex; flex-wrap: wrap; gap: .4rem; }
.pcard__name { font-size: 1.375rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.pcard__meta { font-size: var(--fs-small); color: var(--muted); }
.pcard__next { padding-top: .75rem; border-top: 1px solid var(--line); font-size: var(--fs-small); }
.pcard__next span { margin-right: .35rem; font-weight: 700; color: var(--accent-ink); }

/* Progress: four steps on a line */
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-block: .35rem; padding: 0; list-style: none; }
.progress li { display: grid; gap: .45rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.progress__mark { height: .3rem; border-radius: 999px; background: var(--surface-2); }
.progress .is-done .progress__mark { background: var(--fg); opacity: .55; }
.progress .is-current .progress__mark { background: var(--signal); }
.progress .is-current { color: var(--fg); }
.progress--paused .progress__mark { background-image: repeating-linear-gradient(-45deg, transparent 0 4px, var(--line) 4px 8px); }
@media (max-width: 30rem) { .progress__label { font-size: .6875rem; } }

/* ---------- Project page ---------- */
.now { display: grid; gap: 1.5rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.now .progress li { font-size: var(--fs-small); }
.now .progress__mark { height: .4rem; }
.now__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.25rem 2rem; }
.now__facts dt { margin-bottom: .2rem; font-size: var(--fs-label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.now__facts dd { font-weight: 500; }
.you { color: var(--accent-ink); }
.rounds { display: inline-flex; gap: .25rem; margin-right: .5rem; vertical-align: middle; }
.rounds i { width: .7rem; height: .7rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--fg); opacity: .5; }
.rounds i.is-used { background: var(--signal); box-shadow: none; opacity: 1; }

.deliverables { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.dcard { display: grid; gap: 1.25rem; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.dcard--awaiting_review { box-shadow: inset 0 0 0 1.5px var(--signal), var(--shadow-1); }
@media (min-width: 52rem) { .dcard { grid-template-columns: 1fr auto; align-items: start; } }
.dcard__main { display: grid; gap: .5rem; justify-items: start; }
.dcard__status { font-size: var(--fs-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dcard--awaiting_review .dcard__status { color: var(--accent-ink); }
.dcard--approved .dcard__status { color: #2E8A4B; }
.theme-team .dcard--approved .dcard__status { color: #6FCF8E; }
.dcard__title { font-size: 1.25rem; font-weight: 600; letter-spacing: -.025em; }
.dcard__note { white-space: pre-line; }
.dcard__actions { display: grid; gap: .6rem; min-width: min(100%, 17rem); }
.dcard__actions form .btn { width: 100%; }
.changes summary { width: 100%; list-style: none; }
.changes summary::-webkit-details-marker { display: none; }
.changes[open] summary { margin-bottom: .75rem; }
.changes form { display: grid; gap: .75rem; }
.filechip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 100%;
  padding: .45rem .8rem;
  border-radius: .75rem;
  background: var(--surface-2);
  font-size: var(--fs-small);
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.filechip::before { content: "↓"; color: var(--accent-ink); font-weight: 700; }
.filechip span { color: var(--muted); font-weight: 400; white-space: nowrap; }
.filechip:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--fg) 8%); }

/* Conversation */
.thread { display: grid; gap: .9rem; margin-bottom: 1.25rem; }
.msg { max-width: 88%; padding: 1rem 1.15rem; border-radius: var(--radius-md) var(--radius-md) var(--radius-md) .35rem; background: var(--surface); box-shadow: var(--shadow-1); }
.msg--mine { justify-self: end; border-radius: var(--radius-md) var(--radius-md) .35rem var(--radius-md); background: var(--surface-2); box-shadow: none; }
.msg__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; margin-bottom: .35rem; font-size: var(--fs-small); }
.msg__meta time { color: var(--muted); font-size: var(--fs-label); }
.msg__team { padding: .05rem .45rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: .6875rem; font-weight: 700; }
.theme-team .msg__team { background: var(--signal); }
.msg__about { margin-bottom: .35rem; font-size: var(--fs-small); color: var(--accent-ink); font-weight: 600; }
.msg__body { white-space: pre-line; overflow-wrap: anywhere; }
.msg .filechip { margin-top: .6rem; }
.compose { display: grid; gap: 1rem; padding: 1.25rem; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.compose__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.file-pick { position: relative; display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-small); font-weight: 500; cursor: pointer; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick span { padding: .45rem .8rem; border-radius: 999px; background: var(--line); }
.file-pick:focus-within span { outline: 2px solid var(--signal); outline-offset: 2px; }
.file-pick span::before { content: "+ "; color: var(--accent-ink); font-weight: 700; }

/* Timeline */
.timeline { position: relative; display: grid; gap: 1rem; padding-left: 1.25rem; }
.timeline::before { content: ""; position: absolute; left: .3rem; top: .4rem; bottom: .4rem; width: 1.5px; background: var(--line); }
.timeline li { position: relative; display: grid; gap: .1rem; font-size: var(--fs-small); }
.timeline li::before { content: ""; position: absolute; left: -1.25rem; top: .4rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--signal); }
.timeline time { font-size: var(--fs-label); color: var(--muted); }
.filelist { display: grid; gap: .4rem; font-size: var(--fs-small); overflow-wrap: anywhere; }

/* Feed (overview) */
.feed { display: grid; }
.feed li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; padding-block: .8rem; border-bottom: 1px solid var(--line); }
.feed__time { color: var(--muted); font-size: var(--fs-small); white-space: nowrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th, .table td { padding: .95rem 1.1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table thead th { font-size: var(--fs-label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody th { font-weight: 500; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * { margin-left: .5rem; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; }
.inline-form select { padding: .35rem .6rem; border-radius: .6rem; border: 1px solid var(--line); background: var(--field); font-size: var(--fs-small); }

/* ---------- Forms ---------- */
.field { display: grid; gap: .4rem; }
.field__label { font-size: var(--fs-small); font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select,
.field textarea {
  width: 100%;
  padding: .75rem .9rem;
  border: 1.5px solid var(--line);
  border-radius: .9rem;
  background: var(--field);
  font-size: 1rem;                       /* 16px: no zoom on iOS */
  line-height: 1.4;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 6rem; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 18%, transparent);
}
.field input[type="file"] { font-size: var(--fs-small); }
.field--inline { grid-auto-flow: column; align-items: center; gap: .6rem; }
.field--inline select { width: auto; }
.check { display: flex; align-items: center; gap: .55rem; font-size: var(--fs-small); cursor: pointer; }
.check input, .choice input { accent-color: var(--signal); width: 1.1rem; height: 1.1rem; }
.form-error { color: var(--accent-ink); font-weight: 500; }
.form-narrow { max-width: 46rem; }
.form-narrow form, form.form-narrow { display: grid; gap: 1.25rem; }
.grid-form { display: grid; gap: 1rem 1.25rem; }
@media (min-width: 40rem) {
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-form .field--wide { grid-column: 1 / -1; }
}
.grid-form .btn { justify-self: start; }

/* Team-only forms tucked away until needed */
.teamform { margin-top: 1.25rem; padding-block: 0; }
.teamform > summary {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-block: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.teamform > summary::-webkit-details-marker { display: none; }
.teamform > summary::before { content: "+"; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--signal); color: var(--paper); font-weight: 700; transition: transform .45s var(--spring); }
.teamform[open] > summary::before { transform: rotate(45deg); }
.teamform > form { padding-bottom: 1.5rem; }
.form-narrow .block__title { margin-bottom: 1.25rem; }
section.form-narrow { margin-top: 2rem; }

/* Request choices */
.choices { display: grid; gap: 1.25rem; margin: 0; padding: 0; border: 0; }
.choices legend { margin-bottom: .75rem; }
.choices__group { display: grid; gap: .5rem; }
.choices__title { font-size: var(--fs-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .75rem;
  padding: .85rem 1rem;
  border-radius: 1rem;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer;
  transition: box-shadow .2s, transform .45s var(--spring);
}
.choice:active { transform: scale(.99); transition-duration: .1s; }
.choice input { grid-row: span 2; margin: .2rem 0 0; }
.choice__name { font-weight: 600; }
.choice__desc { font-size: var(--fs-small); color: var(--muted); }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--signal); }

/* Requests list */
.reqs { display: grid; gap: 1rem; }
.req { display: grid; gap: .6rem; }
.req__head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.req__title { font-size: 1.25rem; font-weight: 600; letter-spacing: -.025em; }
.req__body { white-space: pre-line; overflow-wrap: anywhere; }
.req__reply { margin-top: .5rem; padding: 1rem 1.15rem; border-radius: var(--radius-md); background: var(--surface-2); }
.req__reply p:last-child { white-space: pre-line; }
.req__form { display: grid; gap: 1rem; margin-top: .75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* ---------- Login ---------- */
.login { max-width: 26rem; margin: clamp(2rem, 10vh, 6rem) auto 0; display: grid; gap: 1.5rem; }
.login__title { font-size: clamp(3rem, 12vw, 4.5rem); font-weight: 500; line-height: .98; letter-spacing: -.05em; animation: materialise .9s var(--spring) both; }
.login__title .accent { font-size: 1.08em; }
.login__form { display: grid; gap: 1rem; animation: arrive .7s .1s var(--spring) both; }
.login__note, .login__sent { color: var(--muted); font-size: var(--fs-small); }
.login__sent strong { color: var(--fg); }
.code-input { font-size: 1.75rem !important; font-weight: 600; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
@keyframes materialise { from { opacity: 0; filter: blur(10px); transform: translateY(.15em) scale(.98); } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .pcard__link:hover, .btn:active, .pcard__link:active { transform: none; }
}

/* ---------- Passkeys, account, security ---------- */
a.btn-quiet { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.btn-quiet[aria-current="page"] { background: var(--fg); color: var(--bg); }
.logout { gap: .4rem; }
.login__passkey { display: grid; gap: .75rem; }
.login__or { display: flex; align-items: center; gap: .75rem; margin-top: .25rem; font-size: var(--fs-small); color: var(--muted); }
.login__or::before, .login__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login__passkey .form-error:empty, .passkey-add .form-error:empty { display: none; }
.cf-turnstile { min-height: 65px; }
.block-gap { margin-bottom: 1.25rem; max-width: 40rem; }
.passkey-add { display: grid; justify-items: start; gap: .75rem; margin-top: 1.25rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-block: 1.25rem .75rem; }
.nudge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  box-shadow: inset 0 0 0 1.5px var(--signal), var(--shadow-1);
}
.nudge__title { margin-bottom: .25rem; font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.nudge__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.table tr.is-warn > * { background: color-mix(in srgb, var(--signal) 10%, transparent); }

/* Team → Access */
.access-form { display: grid; gap: 1rem; max-width: 46rem; }
.access-client { margin: 0; border: 0; }
.access-client__all { font-size: 1rem; }
.access-client__projects { display: grid; gap: .6rem; margin-top: 1rem; padding: 1rem 0 0 1.75rem; border-top: 1px solid var(--line); }
.access-client__projects .check:has(input:disabled) { opacity: .6; cursor: default; }
.row__end form { display: inline-flex; }

/* ---------- Roles at a glance ---------- */
.role-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-block: .2rem; }
.pill--role-admin { background: var(--signal); color: var(--paper); }
.pill--role-admin::before { background: var(--paper); }
.pill--role-staff { background: color-mix(in srgb, var(--sun) 22%, transparent); color: var(--fg); }
.pill--role-staff::before { background: var(--sun); }
.pill--role-client { background: color-mix(in srgb, #3BA55C 20%, transparent); color: var(--fg); }
.pill--role-client::before { background: #3BA55C; }
.pill--blocked { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.pill--blocked::before { background: currentColor; }

/* Row actions: side by side, same height; the risky one reads as a warning */
.row > .row__end { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; }
.row__end .btn-quiet { min-height: 2.25rem; padding-inline: .95rem; }
.btn-quiet--danger { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent-ink) 45%, transparent); }
.btn-quiet--danger:hover { background: color-mix(in srgb, var(--signal) 14%, transparent); }
