/* Viabo
   Copyright (c) 2026 Sutura Foundry Limited. All rights reserved.
   Proprietary and confidential. See LICENSE. */
/* Built on the Sutura Minimal Executive design system: monochrome by default, one practice colour,
   tactile depth on things you can press. Fonts are bundled so nothing loads from outside the office. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/manrope-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* The practice colour. Everything else derives from it. */
  --accent: #22292E;
  --accent-hover: color-mix(in srgb, var(--accent) 84%, #fff);
  --accent-subtle: color-mix(in srgb, var(--accent) 6%, #fff);
  --accent-border: color-mix(in srgb, var(--accent) 40%, #fff);
  --accent-glow: color-mix(in srgb, var(--accent) 14%, transparent);
  /* The Viabo palette: charcoal on warm off-white, as on the website */
  --black: #22292E; --dark: #2B3338; --charcoal: #3D454B;
  --bg: #F7F6F3; --surface: #FFFFFF; --surface-2: #F3F2EF;
  --ink: #22292E; --muted: #5B6369; --light: #A8A39B; --line: #E3E1DD; --press: #D6D3CE; --line-strong: #CFCBC4;
  --blue: #2F7FA0; --rose: #D9566B;
  /* Status colours stay, quietly: a blocked client or an overdue court date must stand out. */
  --ok: #166534;   --ok-bg: #F0FDF4;
  --warn: #92400E; --warn-bg: #FFFBEB;
  --bad: #B91C1C;  --bad-bg: #FEF2F2;
  --todo: #3D454B; --todo-bg: #F3F2EF;
  --mute-bg: #F3F2EF;
  --radius: 8px; --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(34, 41, 46, .05), 0 10px 24px -14px rgba(34, 41, 46, .16);
  --shadow-sm: 0 1px 2px rgba(34, 41, 46, .07);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: "Manrope", "Inter", "Segoe UI", system-ui, Arial, sans-serif;
  --mono: "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--ink); text-decoration-color: var(--light); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--ink); }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.mono, .ref { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--press); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--light); }

/* shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 15px; letter-spacing: -.01em; padding: 4px 10px 18px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.brand .mark { width: 26px; height: 26px; display: block; flex: none; }
.viabo-logo { display: block; height: 44px; width: auto; margin: 0 0 18px -6px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius);
  color: var(--charcoal); text-decoration: none; font-weight: 600; min-height: 38px;
  transition: background-color .2s ease, color .2s ease;
}
.nav a > span:first-child { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.nav .ni { width: 18px; height: 18px; flex: none; color: var(--muted); transition: color .2s ease, transform .25s var(--ease); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a:hover .ni { color: var(--ink); transform: translateX(1px); }
.nav { display: flex; flex-direction: column; gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 10px 4px; }
.nav a.on { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--ink); font-weight: 800; box-shadow: inset 3px 0 0 var(--accent); }
.nav a.on .ni { color: var(--accent); }
.side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.mainwrap { min-width: 0; display: flex; flex-direction: column; }
main { padding: 26px 32px 60px; max-width: 1180px; width: 100%; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.head .sub { color: var(--muted); margin-top: 4px; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

/* top bar: back, search, profile pin */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .grow { flex: 1; }
.search { position: relative; width: min(380px, 100%); }
.search input[type=search] { padding-left: 32px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13px; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 11px var(--mono); color: var(--light); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--surface); }
.results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 300px; max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, .18); padding: 6px; z-index: 30;
}
.results .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 8px 4px; }
.results a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.results a:hover, .results a.sel { background: var(--accent-subtle); }
.results .s { color: var(--muted); font-size: 12px; }
.results .none { padding: 10px; color: var(--muted); font-size: 13px; }
.pin { position: relative; }
.pin > button { padding: 3px; border-radius: 999px; box-shadow: none; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 8px; }
.pin > button:hover { border-color: var(--light); transform: none; box-shadow: none; }
.pin > button .burger { width: 16px; height: 16px; margin: 0 6px 0 2px; color: var(--muted); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 36px -8px rgba(0, 0, 0, .18); padding: 6px; z-index: 30;
}
.menu .who { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 13.5px; border: 0; background: none; box-shadow: none; }
.menu a:hover, .menu button:hover { background: var(--surface-2); transform: none; box-shadow: none; }
.back { box-shadow: none !important; }

/* avatars: a photo when someone added one, initials otherwise */
.av { --s: 28px; width: var(--s); height: var(--s); border-radius: 999px; flex: none; display: inline-grid; place-items: center;
  overflow: hidden; color: #fff; font: 600 calc(var(--s) * .38)/1 var(--sans); letter-spacing: .02em; vertical-align: middle; background: var(--charcoal); }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.xs { --s: 20px; } .av.sm { --s: 24px; } .av.lg { --s: 76px; } .av.md { --s: 40px; }
.av.g0 { background: #22292E; } .av.g1 { background: #3D454B; } .av.g2 { background: #1F5E78; } .av.g3 { background: #555D63; } .av.g4 { background: #8B3A4A; }
.person { display: inline-flex; align-items: center; gap: 7px; }

/* On a smaller laptop window the menu moves to the top, so pages and their tables get the full width. */
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; }
  .brand { padding: 4px 8px; width: 100%; }
  .nav { display: flex; flex-direction: row; gap: 4px; overflow-x: auto; width: 100%; scrollbar-width: none; padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  .nav a { white-space: nowrap; }
  .side .foot { display: none; }
  .topbar { padding: 8px 16px; }
  .search kbd { display: none; }
  main { padding: 20px 16px 50px; }
}

/* cards and layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h2 { margin-bottom: 4px; }
.card > .hint { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .n { font: 800 26px/1.15 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.alert .n { color: var(--ink); }
/* Things you can open lift a little under the pointer. */
a.stat, .lift { transition: transform .2s var(--spring), box-shadow .2s var(--spring), border-color .2s ease; }
a.stat:hover, .lift:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(34, 41, 46, .35); border-color: var(--line-strong); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.list .row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.list .t { font-weight: 600; }
.list .why { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 8px 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; border-top: 0; background: var(--surface-2); }
thead th:first-child { border-top-left-radius: 6px; } thead th:last-child { border-top-right-radius: 6px; }
tr.link { cursor: pointer; }
tbody tr { transition: background-color .15s ease; }
tr.link:hover td, tbody tr:hover td { background: var(--accent-subtle); }
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--light) var(--surface-2); }
/* Always show the scroll bar, so a column off to the side is never out of reach. */
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 99px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--light); border-radius: 99px; }

/* pills */
/* Status badges: a dot plus words, never colour alone. Only the ones that need action pulse. */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 6px;
  white-space: nowrap; border: 1px solid transparent; transition: transform .18s var(--spring); vertical-align: middle; line-height: 1.6; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; flex: none; }
.pill:hover { transform: scale(1.04); }
.pill.ok { background: var(--black); color: #fff; }
.pill.ok::before { background: #4ADE80; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: #FDE68A; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: #FECACA; }
.pill.bad::before { animation: none; }
.pill.todo { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.pill.todo::before { background: var(--muted); }
.pill.mute { background: var(--surface); color: var(--muted); border-color: var(--line); }
.pill.mute::before { background: var(--light); }
@keyframes pulse-dot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.45); opacity: .55; } }

/* checklist */
.check { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.check .name { font-weight: 600; }
.check .meta { font-size: 13px; color: var(--muted); }
.check details { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.check summary { cursor: pointer; }
.check .actions { display: flex; gap: 8px; align-items: center; }
.gate { border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; }
.gate.blocked { background: var(--surface-2); color: var(--ink); }
.gate.ready { background: var(--ok-bg); color: var(--ok); }
.gate ul { margin: 6px 0 0; padding-left: 18px; }
.gate .warn { color: var(--warn); }

/* stepper */
.steps { display: flex; gap: 6px; margin: 4px 0 18px; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1 1 0; min-width: 120px; border-top: 4px solid var(--line); border-radius: 2px; padding-top: 8px; font-size: 12.5px; transition: border-color .4s ease; }
.step .k { color: var(--muted); }
.step .nm { font-weight: 600; }
.step.done { border-color: var(--charcoal); }
.step.now { border-color: var(--accent); }

/* tasks */
.task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task input { margin-top: 4px; }
.task .tt { flex: 1; }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.due { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.due.late { color: var(--bad); font-weight: 600; }
.stage-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 2px; }

/* forms */
.f { display: block; margin-bottom: 12px; }
.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.f > em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; min-height: 40px; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 70px; }
input:hover, select:hover, textarea:hover { border-color: var(--light); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input[type=color] { width: 60px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.opt { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: var(--surface); cursor: pointer; }
.opt input { accent-color: var(--accent); }
.opt input { margin-top: 3px; }
.opts.stack { flex-direction: column; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-subtle); }

/* Buttons as on the website: flat, a small lift under the pointer, a soft press. */
button, .btn {
  font: inherit; font-weight: 600; font-size: 13.5px; border-radius: var(--radius); padding: 8px 14px; min-height: 38px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; vertical-align: middle; line-height: 1.3;
  box-shadow: var(--shadow-sm); user-select: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .2s ease, border-color .2s ease, color .2s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); border-color: var(--ink); box-shadow: 0 6px 14px -8px rgba(34, 41, 46, .35); }
button:active, .btn:active { transform: translateY(0) scale(.98); box-shadow: var(--shadow-sm); transition-duration: .08s; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
button.primary:active, .btn.primary:active { box-shadow: var(--shadow-sm); }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; padding: 0; min-height: 0; display: inline; color: var(--ink); font-weight: 600; box-shadow: none; text-decoration: underline; text-decoration-color: var(--light); text-underline-offset: 2px; }
button.link:hover, button.link:active { transform: none; box-shadow: none; }
button.small, .btn.small { font-size: 12.5px; padding: 5px 11px; min-height: 32px; }
button:disabled, button:disabled:hover { opacity: .45; cursor: not-allowed; transform: none; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.err { background: var(--bad-bg); color: var(--bad); border: 1px solid #FECACA; border-radius: var(--radius); padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.err ul { margin: 4px 0 0; padding-left: 18px; }
.note { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { position: relative; padding: 9px 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: color .2s ease; }
.tabs a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: center; transition: transform .28s var(--ease), opacity .2s ease; opacity: 0; }
.tabs a:hover { color: var(--ink); }
.tabs a:hover::after { transform: scaleX(.5); opacity: .35; }
.tabs a.on { color: var(--ink); font-weight: 700; }
.tabs a.on::after { transform: scaleX(1); opacity: 1; }

dl.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }

progress { width: 90px; height: 8px; vertical-align: middle; accent-color: var(--accent); }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(9, 9, 11, .45); backdrop-filter: blur(2px); }
dialog[open] { animation: rise .22s var(--spring); }
@keyframes rise { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
dialog form { padding: 20px; }
dialog h2 { margin-bottom: 6px; }
dialog .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
dialog.wide { width: min(860px, calc(100vw - 32px)); }

/* auth screens */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.auth .card { width: min(420px, 100%); }
.auth h1 { margin-bottom: 6px; }

/* workflow editor */
.stage-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.stage-edit .top { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.stage-edit .top input { flex: 1; font-weight: 600; }
.trow { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; margin-bottom: 6px; }
.frow { display: grid; grid-template-columns: 1fr 80px auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
@media (max-width: 600px) { .frow { grid-template-columns: 1fr 70px; } }
.hit { border-left: 3px solid var(--warn); padding-left: 10px; margin: 6px 0; font-size: 14px; }
pre.ev { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 4px 0 0; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }

/* version 2: logo, badge, diary, roles */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
@media (max-width: 1024px) { .brand { flex-direction: row; align-items: center; } }
img.logo { max-height: 40px; max-width: 120px; object-fit: contain; flex: none; }
img.logo.big { max-height: 72px; max-width: 220px; display: block; margin-bottom: 12px; }
.logo-preview { min-height: 50px; margin-bottom: 12px; }
.badge { display: inline-block; min-width: 20px; padding: 0 7px; white-space: nowrap; border-radius: 999px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); font-family: inherit; font-weight: 600; font-size: 11px; line-height: 18px; text-align: center; }
.badge.late { background: var(--surface-2); color: var(--bad); border-color: #FECACA; }
.nav a.on .badge { background: var(--accent); color: #fff; border-color: var(--accent); }
.grow { flex: 1; }
dialog .foot { align-items: center; }
.orow { display: grid; grid-template-columns: 1.4fr 1fr 110px auto; gap: 8px; margin-bottom: 6px; align-items: center; }
.orow:has(> :nth-child(2):last-child) { grid-template-columns: 1fr auto; }
.wtrow { display: grid; grid-template-columns: 1.6fr 120px 80px 1fr auto; gap: 8px; margin-bottom: 6px; }
@media (max-width: 700px) {
  .orow, .wtrow { grid-template-columns: 1fr 1fr; }
}

.cal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-bar select { width: auto; min-width: 180px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.dow { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.day { min-height: 104px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day.other { background: var(--surface-2); }
.day.other .dn { color: var(--muted); opacity: .6; }
.day.today .dn { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; align-self: flex-start; }
.dn { font-size: 12px; font-weight: 600; }
.ev { display: block; width: 100%; text-align: left; font-size: 12px; font-weight: 500; padding: 2px 6px; border-radius: 4px; border: 0; border-left: 3px solid var(--muted); background: var(--mute-bg); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: none; }
.ev:hover { filter: brightness(.96); background: var(--mute-bg); transform: none; box-shadow: none; }
.ev:active { transform: none; box-shadow: none; }
.ev.busy { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); border-left-color: var(--light); color: var(--muted); font-style: italic; }
.ev.k-deadline { border-left-color: var(--charcoal); }
.ev.k-court { border-left-color: var(--black); font-weight: 600; }
.ev.k-meeting { border-left-color: var(--light); }
.ev.done { text-decoration: line-through; opacity: .55; }
.agenda { display: none; }
.agenda .ev { white-space: normal; font-size: 14px; padding: 8px 10px; margin-bottom: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; background: var(--muted); vertical-align: middle; }
.sw.k-deadline { background: var(--warn); } .sw.k-court { background: var(--bad); } .sw.k-meeting { background: var(--todo); }
@media (max-width: 760px) {
  .cal { display: none; }
  .agenda { display: block; }
}

/* version 3: activity folding, costs, bills, printing */
#actcard.folded #activity { display: none; }
#actcard.folded .card-head { margin-bottom: 0; }
.mt { margin-top: 16px; margin-bottom: 6px; }
.num { text-align: right; white-space: nowrap; }
th.num { text-align: right; }
table.costs td { vertical-align: top; }
dl.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; max-width: 360px; margin: 8px 0 0 auto; font-variant-numeric: tabular-nums; }
dl.totals dt { color: var(--muted); }
dl.totals dd { margin: 0; text-align: right; }
dl.totals .grand { font-weight: 700; color: var(--ink); border-top: 2px solid var(--ink); padding-top: 6px; font-size: 16px; }
dl.totals dd, .num { font-family: var(--mono); font-size: .93em; }
.stat .n.small-n { font-size: 20px; }
.doc { padding: 28px; }
.lh { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 2px solid var(--accent); margin-bottom: 18px; }
.lh-firm { font-size: 18px; }
.lh-doc { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.lh-title { font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.lh-to { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 8px; }
.addr { white-space: pre-line; }
input.inline { width: auto; display: inline-block; padding: 4px 8px; }
table.bill-lines td { padding: 8px 6px; }
table.bill-lines td:nth-child(1) { width: 1%; white-space: nowrap; }
td.pick { width: 1%; }
tr.left-out td { opacity: .4; text-decoration: line-through; }
@media (max-width: 600px) { .lh-to { grid-template-columns: 1fr; } .lh-doc { text-align: left; align-items: flex-start; } .doc { padding: 16px; } }

@media print {
  .side, .noprint, dialog { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card, .card.doc { border: 0; box-shadow: none; padding: 0; background: #fff; }
  input.inline { border: 0; padding: 0; background: none; font-weight: 700; color: #000; }
  tr.left-out { display: none; }
  a { color: #000; text-decoration: none; }
}
table.bill-lines td.num.small, table.costs td.num.small { white-space: normal; min-width: 70px; }
@media (max-width: 600px) {
  table.bill-lines { font-size: 13px; }
  table.bill-lines td { padding: 6px 4px; }
  table.bill-lines td:nth-child(1), table.bill-lines td.num { white-space: normal; }
}
table.costs td:first-child { white-space: nowrap; }

/* version 4: documents, demo sign-in, workflow groups */
.legal { margin: 10px 0 0; font-size: 11px; }
.side .me .legal { margin: 0 0 8px; }
.demo-box { margin-top: 18px; padding: 12px; border: 1px dashed var(--light); border-radius: var(--radius); background: var(--surface-2); }
.demo-box code { font-weight: 700; }
.demo-box .list > li { padding: 5px 0; }
details.wf-group > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; }
details.wf-group > summary::-webkit-details-marker { display: none; }
details.wf-group > summary h2::before { content: "+ "; color: var(--muted); }
details.wf-group[open] > summary h2::before { content: "- "; }
.wf { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.wf h3 { margin-bottom: 2px; }
#upload input[type=file] { font-size: 13px; }
.badge.alert { background: var(--surface-2); color: var(--ink); }
.f.branches .opts { margin-bottom: 0; }
td.acts { white-space: nowrap; }
a.stat { display: block; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--accent); }

/* version 6: contacts, board, profile, theme presets */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ccard .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ccard .nm { font-weight: 700; overflow-wrap: anywhere; }
.ccard .s { font-size: 12px; color: var(--muted); }
.ccard .line { font-size: 13px; overflow-wrap: anywhere; }
.ccard .line span { color: var(--muted); display: inline-block; min-width: 46px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.ccard.focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 11.5px var(--mono); padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: var(--surface-2); color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.kind-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.bcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-width: 0; }
.bcol h3 { display: flex; justify-content: space-between; align-items: center; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--charcoal); padding: 2px 4px 10px; }
.bcol h3 .badge { background: var(--surface); }
.kcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); }
.kcard .k { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kcard .t { font-weight: 600; font-size: 13px; margin: 4px 0; }
.kcard .s { font-size: 12px; color: var(--muted); }
.kcard .bar { margin-top: 8px; justify-content: space-between; }
.prog { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.prog i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s cubic-bezier(.65, 0, .35, 1); }
.toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; gap: 2px; }
.toggle a { padding: 4px 12px; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.toggle a.on { background: var(--accent); color: #fff; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch i { width: 30px; height: 30px; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: transform .18s var(--spring); }
.swatch:hover i { transform: scale(1.15); }
.swatch:has(input:checked) i { box-shadow: 0 0 0 2px var(--ink); }
.swatch:has(input:checked) { color: var(--ink); font-weight: 600; }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.locked dd { display: flex; justify-content: space-between; gap: 8px; }
.busy-note { font-size: 13px; color: var(--muted); }
.overdue-note { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.overdue-note ul { margin: 6px 0 0; padding-left: 18px; }
.overdue-note a { color: var(--ink); }
.check:has(.pill.ok) .name::after { content: ""; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.sw-09090B { background: #09090B; } .sw-0F4C5C { background: #0F4C5C; } .sw-9A7B38 { background: #9A7B38; }
.sw-1E3A8A { background: #1E3A8A; } .sw-065F46 { background: #065F46; } .sw-881337 { background: #881337; }
.swatch input[type=color] { position: static; opacity: 1; pointer-events: auto; width: 30px; height: 30px; padding: 0; border: 3px solid #fff; border-radius: 999px; box-shadow: 0 0 0 1px var(--line); background: none; cursor: pointer; }
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type=color]::-webkit-color-swatch { border: 0; border-radius: 999px; }
#btype { width: auto; max-width: 300px; }

/* version 7: bills, payments, retainers */
.bfoot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.sig .sigline { height: 42px; border-bottom: 1px solid var(--ink); margin-bottom: 6px; max-width: 260px; }
.pay h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.pay .acct { margin-bottom: 8px; }
.pay a { overflow-wrap: anywhere; }
.pagebreak { height: 0; }
.ageing { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.ageing > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.ageing > div .mono { font-weight: 600; font-size: 14px; }
.ageing > div.late { border-color: #FECACA; background: var(--bad-bg); color: var(--bad); }
.acct-row { display: grid; grid-template-columns: 1.2fr 1.2fr 1.1fr 64px 1fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
@media (max-width: 700px) {
  .bfoot { grid-template-columns: minmax(0, 1fr); }
  .ageing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acct-row { grid-template-columns: 1fr 1fr; }
}
@media print {
  .pagebreak { break-before: page; page-break-before: always; }
  .bfoot { break-inside: avoid; }
  .pill::before { animation: none; }
}

/* version 8: sign-in, licence, help, timer, court, time, reports, settings */
.licence-line { color: var(--charcoal); font-weight: 600; margin: 0 0 6px; }
.lbanner { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid #FDE68A; padding: 8px 24px; font-size: 13px; }
.lbanner.bad { background: var(--bad-bg); color: var(--bad); border-color: #FECACA; }
.lbanner a { color: inherit; font-weight: 600; }
.helpbtn { width: 32px; height: 32px; padding: 0; border-radius: 999px; font-weight: 700; flex: none; }
.timerchip { display: inline-flex; align-items: center; gap: 7px; font: 600 12px var(--mono); padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sm); }
.timerchip i { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); }
.checklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.checklist li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.checklist .tick { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--press); flex: none; }
.checklist li.done { color: var(--muted); }
.checklist li.done .tick { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
progress { accent-color: var(--accent); }
.howto { padding-left: 20px; margin: 10px 0; }
.howto li { margin-bottom: 10px; }
.qrbox { margin: 10px 0 6px; }
.qr { width: 180px; height: 180px; display: block; border: 1px solid var(--line); border-radius: var(--radius); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.codes span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; text-align: center; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: min(520px, calc(100vw - 32px));
  background: var(--black); color: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0,0,0,.25); font-size: 13.5px; animation: rise .22s var(--spring); }
.docpreview { white-space: pre-wrap; font: 13px/1.5 var(--sans); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; max-height: 340px; overflow: auto; }
.feat { list-style: none; padding: 0; margin: 8px 0 12px; columns: 2; font-size: 13px; }
.feat li { padding: 2px 0 2px 20px; position: relative; break-inside: avoid; }
.feat li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 9px; height: 9px; border-radius: 3px; }
.feat li.yes::before { background: var(--accent); }
.feat li.no { color: var(--light); }
.feat li.no::before { border: 1.5px solid var(--press); }
.scale-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.band { margin-bottom: 6px; }
.band input { max-width: 200px; }
tr.bad-row td { background: var(--bad-bg); }
.offsite-bad { color: var(--bad); }
.cpad { align-self: end; padding-bottom: 10px; }
details.court, details.scalebox { margin: 4px 0 10px; }
details.court summary, details.scalebox summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--charcoal); margin-bottom: 8px; }
ul.fields { columns: 2; padding-left: 16px; }
.licence-mark { margin-top: 10px; }
.auth.intake .card { width: min(640px, 100%); }
td.late { color: var(--bad); font-weight: 600; }
@media (max-width: 600px) { .feat, ul.fields { columns: 1; } .codes { grid-template-columns: 1fr 1fr; } .timerchip { padding: 4px 8px; } }
@media print { .lbanner, .helpbtn, #timer, .toast { display: none !important; } }
.task .tt { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .task { flex-wrap: wrap; } .task .tt { flex-basis: calc(100% - 30px); } .task .due, .task > button { margin-left: 26px; } }
@media (min-width: 821px) { .tabs { flex-wrap: wrap; overflow-x: visible; } }

/* version 9: required fields, retainers, price list */
label.f:has(> input[required], > select[required], > textarea[required]) > span::after {
  content: "Required"; margin-left: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  color: var(--bad); vertical-align: 1px;
}
.svc-list { display: grid; gap: 6px; }
.svc { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.svc.off { background: var(--surface-2); color: var(--muted); }
.svc.off .qty, .svc.off .price { opacity: .5; }
.svc .qty { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.svc .qty input { width: 70px; }
.svc .price { white-space: nowrap; }
label.opt.cover { margin: 0 0 12px; }
table.pricelist input { width: 120px; text-align: right; }
table.pricelist select { width: auto; }
@media (max-width: 600px) { .svc { grid-template-columns: 1fr; } .svc .qty, .svc .price { margin-left: 26px; } }
.svc label.opt, .svc label.opt:has(input:checked) { border: 0; background: none; padding: 0; }
.svc:has(input[data-svc]:checked) { border-color: var(--accent-border); }

/* ---------------------------------------------------------------- tester sessions
   A tester's personal page, in the Sutura Foundry Limited brand: deep forest and sage on mist, Verdana for
   headings and labels, Georgia for reading. Both fonts come with Windows and macOS, so nothing loads. */
.tp {
  --tp-ink: #0F1E1A; --tp-heading: #152B30; --tp-muted: color-mix(in srgb, #0F1E1A 70%, #EEF2EC);
  --tp-paper: #EEF2EC; --tp-card: color-mix(in srgb, #EEF2EC 35%, #fff); --tp-panel: #D3DECF;
  --tp-line: #D3DECF; --tp-rule: #608F6F; --tp-accent: #0F1E1A; --tp-on-accent: #EEF2EC;
  --tp-head-font: Verdana, "DejaVu Sans", Geneva, sans-serif; --tp-body-font: Georgia, "DejaVu Serif", "Times New Roman", serif;
  min-height: 100vh; background: var(--tp-paper); color: var(--tp-ink); font-family: var(--tp-body-font); font-size: 15px;
  max-width: 760px; margin: 0 auto; padding: 20px 16px 40px;
}
body:has(> #app > .tp) { background: #EEF2EC; }
.tp h1, .tp h2, .tp h3, .tp button, .tp .f > span, .tp .opt, .tp legend, .tp-label, .tp-round, .tp-wait, .tp-foot, .tp .small { font-family: var(--tp-head-font); }
.tp h1, .tp h2, .tp h3 { color: var(--tp-heading); }
.tp button { background: var(--tp-panel); color: var(--tp-ink); border: 1px solid var(--tp-panel); box-shadow: none; }
.tp button:hover { background: color-mix(in srgb, var(--tp-panel) 80%, var(--tp-rule)); }
.tp button.primary { background: var(--tp-accent); color: var(--tp-on-accent); border-color: var(--tp-accent); }
.tp a { color: var(--tp-heading); text-decoration-color: var(--tp-rule); }
.tp input[type=text], .tp textarea { background: #fff; border-color: var(--tp-line); font-family: var(--tp-body-font); }
.tp-logo { width: 40px; height: 40px; border-radius: 4px; display: block; }
.tp h1, .tp h2, .tp h3 { font-family: var(--tp-head-font); }
.tp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0 16px; border-bottom: 2px solid var(--tp-rule); margin-bottom: 18px; }
.tp-mark { font-family: var(--tp-head-font); font-weight: 700; font-size: 17px; color: var(--tp-heading); }
.tp-title { color: var(--tp-muted); font-family: var(--tp-head-font); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tp-card { background: var(--tp-card); border: 1px solid var(--tp-line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.tp-card h1 { margin-bottom: 8px; }
.tp-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--tp-muted); }
.tp-nda { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; max-height: 55vh; overflow: auto; border: 1px solid var(--tp-line);
  border-radius: var(--radius); padding: 16px; background: var(--tp-paper); margin: 14px 0; }
.tp-sign { display: grid; gap: 12px; }
.tp-steps { padding-left: 20px; margin: 12px 0; }
.tp-steps li { margin-bottom: 6px; }
.tp-progress { height: 8px; background: var(--tp-line); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.tp-progress div { height: 100%; background: var(--tp-rule); transition: width .3s; }
.tp-round { font-size: 15px; margin: 22px 0 8px; }
.tp-intro { margin-bottom: 8px; }
.tp-tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tp-task { display: grid; grid-template-columns: 30px 1fr; gap: 10px; background: var(--tp-card); border: 1px solid var(--tp-line);
  border-left: 4px solid var(--tp-line); border-radius: var(--radius); padding: 14px; }
.tp-task.is-worked { border-left-color: var(--ok); }
.tp-task.is-confusing { border-left-color: #B45309; }
.tp-task.is-broken { border-left-color: var(--bad); }
.tp-task.is-skipped { border-left-color: var(--light); }
.tp-num { font-family: var(--tp-head-font); font-weight: 700; color: var(--tp-muted); }
.tp-body h3 { font-size: 15px; margin-bottom: 4px; }
.tp-body p { margin-bottom: 8px; }
.tp-wait { font-size: 13px; }
.tp-ready { color: var(--ok); background: var(--ok-bg); padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.tp-pending { color: var(--warn); background: var(--warn-bg); padding: 2px 8px; border-radius: 99px; }
.tp-results { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.tp-r { font-size: 13px; padding: 6px 12px; border-radius: 99px; }
.tp-r.on { background: var(--tp-accent); color: var(--tp-on-accent); border-color: var(--tp-accent); }
.tp-r-broken.on { background: var(--bad); border-color: var(--bad); }
.tp-r-confusing.on { background: #B45309; border-color: #B45309; }
.tp-r-worked.on { background: var(--ok); border-color: var(--ok); }
.tp-comment { width: 100%; font: inherit; }
.tp-noteform { display: flex; gap: 8px; align-items: flex-start; }
.tp-noteform textarea { flex: 1; font: inherit; }
.tp-notes { padding-left: 18px; }
.tp-scale { border: 0; padding: 0; margin: 0 0 14px; }
.tp-scale legend { font-weight: 600; margin-bottom: 6px; }
.tp-scale label { display: inline-flex; margin-right: 6px; }
.tp-scale input { position: absolute; opacity: 0; }
.tp-scale span { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--tp-line); border-radius: 50%; cursor: pointer; background: var(--tp-card); }
.tp-scale input:checked + span { background: var(--tp-accent); color: var(--tp-on-accent); border-color: var(--tp-accent); }
.tp-scale input:focus-visible + span { outline: 2px solid var(--tp-accent); outline-offset: 2px; }
.tp-foot { color: var(--tp-muted); font-size: 12px; margin-top: 24px; }
.warn-text { color: var(--warn); }
.nowrap { white-space: nowrap; }
@media (max-width: 480px) { .tp-task { grid-template-columns: 1fr; } .tp-num { display: none; } }
.addrow { align-items: end; padding: 8px 0; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- calmer screens
   Red means overdue and nothing else. Amber means due today or in the next two days. Everything else is plain. */
.ev.late { border-left-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.ev.soon { border-left-color: #D97706; background: var(--warn-bg); color: var(--warn); }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; background: var(--surface-2); color: var(--charcoal); }
.tag.late { background: var(--bad-bg); color: var(--bad); }
.tag.soon { background: var(--warn-bg); color: var(--warn); }
.needs { list-style: none; margin: 0; padding: 0; }
.need { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--surface-2); }
.need:first-child { border-top: 0; }
.need .what { flex: 1 1 260px; min-width: 0; }
.need .t { font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a { padding: 8px 14px; font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--muted); transition: background-color .25s ease, color .25s ease; }
.seg a:hover { color: var(--ink); background: var(--surface-2); }
.seg a.on { background: var(--accent); color: #fff; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; align-items: start; }
.soonlist { list-style: none; margin: 0; padding: 0; }
.soonlist li { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--surface-2); }
.soonlist li:first-child { border-top: 0; }
.soonlist .day { width: 52px; flex: none; font-size: 12.5px; color: var(--muted); min-height: 0; padding: 0; border: 0; display: block; }
.soonlist a.t { text-decoration: none; }
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.glance a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--surface-2); border-radius: 8px; text-decoration: none; }
.glance strong { font-size: 22px; }
.glance span { font-size: 12.5px; color: var(--muted); }
details.fold > summary { cursor: pointer; font-weight: 600; }
details.fold[open] > summary { margin-bottom: 10px; }
.actionbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.late-text { color: var(--bad); }
.overdue-note summary { cursor: pointer; }
.timechips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.timesheet td, .timesheet th { padding: 6px; vertical-align: top; }
.timesheet .tcell { width: 64px; }
.timesheet select, .timesheet input[type=text]:not(.tcell) { min-width: 220px; }
.helpnow { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.helpnow h3 { margin-bottom: 4px; }
.faq { border-top: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 6px 0 0; color: var(--charcoal); }

/* ---------------------------------------------------------------- settings overview (version 11) */
.setgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.setgroup h2 { margin-bottom: 2px; }
.setgroup > p { margin: 0 0 10px; }
.setlinks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.setlinks li + li { border-top: 1px solid var(--line); }
.setlinks a { display: flex; flex-direction: column; gap: 2px; padding: 10px 6px; margin: 0 -6px; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.setlinks a:hover { background: var(--surface-2); }
.setlinks strong { font-weight: 600; }

/* ---------------------------------------------------------------- record pages (version 12): frozen actions, sections, previous and next */
[data-sec][hidden] { display: none !important; }
.stick {
  position: sticky; top: var(--tbh, 57px); z-index: 15; background: var(--bg);
  margin: -6px 0 18px; padding: 6px 0 0; border-bottom: 1px solid transparent;
}
.stick.stuck { border-bottom-color: var(--line); box-shadow: 0 6px 12px -10px rgba(0, 0, 0, .25); }
.stick-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; }
.stick.tabs-only .stick-row { display: none; }
.stick-title { display: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.stick.stuck .stick-title { display: inline; }
.stick-acts { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.stick-acts .actionbar, .stick-acts .bar { display: flex; flex-wrap: wrap; gap: 6px; }
.stick-acts button, .stick-acts .btn { padding: 6px 11px; font-size: 13px; }
.stick-nav { margin-left: auto; }
.stick-nav:empty { display: none; }
.stick .in-stick { margin: 0; }
.stick .actionbar.in-stick { padding: 0; border: 0; background: none; }
.stick .sectabs { margin: 0; }
.sectabs .count { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 18px; }
.cols.tabbed { grid-template-columns: minmax(0, 1fr); }
.pager { display: inline-flex; align-items: center; gap: 6px; }
.pg { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border-radius: var(--radius); }
.pg:disabled { opacity: .35; }
.ccard[role="button"] { cursor: pointer; }
.ccard[role="button"]:hover { border-color: var(--light); }
dialog.contactview { width: min(460px, calc(100vw - 32px)); }
dialog.contactview .cv-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
dialog.contactview .ccard { cursor: default; }
@media (max-width: 1024px) { .stick-title { max-width: 26ch; } }
/* On a phone the frozen buttons stay on one line that scrolls sideways, so the row stays short. */
@media (max-width: 700px) {
  .stick-row { flex-wrap: nowrap; gap: 8px; }
  .stick.stuck .stick-row { flex-wrap: wrap; }
  .stick.stuck .stick-title { flex-basis: 100%; max-width: none; }
  .stick-acts { flex: 1 1 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .stick-acts .actionbar, .stick-acts .bar { flex-wrap: nowrap; }
  .stick-acts button, .stick-acts .btn { white-space: nowrap; }
  .stick-nav .pager .small { display: none; }
  .pg { width: 34px; height: 34px; }
}

/* A form field hidden by the page stays hidden whatever its layout. */
.f[hidden] { display: none !important; }

/* ---------------------------------------------------------------- a matter's own path (version 13) */
.step.skipped .k, .step.skipped .nm { color: var(--muted); }
.step.skipped .nm { text-decoration: line-through; text-decoration-color: var(--light); }
.step.skipped { border-top-style: dashed; }
details.path { margin-top: 14px; }
details.path > summary { font-size: 13px; color: var(--muted); cursor: pointer; }
details.path .bar { margin-top: 8px; }

/* ---------------------------------------------------------------- staff chat (version 14) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.chat-list { padding: 10px; display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; }
.chat-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 8px 4px; }
.chat-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.chat-list a:hover { background: var(--surface-2); }
.chat-list a.on { background: var(--accent); color: #fff; }
.chat-list a.on small { color: rgba(255, 255, 255, .75); }
.chat-list .nm { display: flex; flex-direction: column; min-width: 0; font-weight: 500; }
.chat-list small { font-weight: 400; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-none { padding: 4px 8px; margin: 0; }
.chat-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chat-msgs { display: flex; flex-direction: column; gap: 10px; height: min(55vh, 520px); overflow-y: auto; padding: 4px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 12px; }
#mtalk .chat-msgs { height: min(45vh, 420px); }
.msg { max-width: 78%; align-self: flex-start; background: var(--surface-2); border-radius: 12px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid var(--line); }
.msg .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg .meta strong { color: var(--ink); }
.msg .txt { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.chat-send { display: flex; gap: 8px; align-items: flex-end; }
.chat-send .f { flex: 1 1 auto; margin: 0; }
.chat-send textarea { width: 100%; resize: vertical; min-height: 44px; }
.chat-send button { min-height: 44px; }
.chat-people { max-height: 260px; overflow-y: auto; }
.chat-attach { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; position: relative; }
.chat-attach:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-file { display: block; font-size: 13px; margin-top: 4px; }
.chat-file[hidden] { display: none; }
.chat-files { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.chat-files a { font-weight: 500; overflow-wrap: anywhere; }
.chat-edit { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.chat-edit .f { margin: 0; }
.chat-edit textarea { width: 100%; min-width: min(60vw, 420px); }
@media (max-width: 760px) {
  .chat { grid-template-columns: minmax(0, 1fr); }
  .chat-list { max-height: 220px; }
  .msg { max-width: 92%; }
}

/* ---------------------------------------------------------------- version 16: the Viabo look */
.card-head h2, .card > h2 { letter-spacing: -.01em; }
.brand { font-weight: 800; }
.pill { border-radius: 999px; }
.badge { transition: transform .2s var(--ease); }
.nav a:hover .badge { transform: scale(1.06); }
dialog { border-radius: var(--radius-lg); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
/* Button labels stay on one line; where space is short the row wraps instead of the label. */
button, .btn { white-space: nowrap; }
button.link { white-space: normal; }
.card-head { flex-wrap: wrap; }
.card-head > :first-child { min-width: 0; flex: 1 1 220px; }
.card-head > button, .card-head > .btn, .card-head > .bar { flex: none; }
@media (max-width: 600px) {
  .brand { font-size: 14px; padding-bottom: 2px; }
  .brand small { display: none; }
  .side { padding: 8px 12px 6px; gap: 2px; }
  .nav a { min-height: 40px; padding: 8px 10px; }
  h1 { font-size: 23px; }
}
/* A file picker and its button share a row while there is room, and stack when there is not. */
.orow { flex-wrap: wrap; }
.orow input[type=file] { min-width: 0; flex: 1 1 180px; max-width: 100%; }

/* ---------------------------------------------------------------- version 17: tablets and phones */
/* The sidebar is exactly as tall as what the screen shows (Safari counts its own bars in 100vh). */
.side { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
/* A date range ("From ... To ...") keeps its two boxes apart and each label beside its own box. */
.bar > label.small { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.bar > label.small > input, .bar > label.small > select { width: auto; min-width: 0; }
.bar { gap: 10px 12px; }

.navbtn, .tb-brand, .searchbtn, .tabbar, .scrim { display: none; }
.navbtn, .searchbtn { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 10px; box-shadow: none; }
.navbtn svg, .searchbtn svg { width: 20px; height: 20px; position: static; transform: none; color: var(--ink); }

/* Tablets and phones: the menu slides in from the left instead of sitting in a scrolling strip. */
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: 1fr !important; }
  .side {
    position: fixed !important; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: auto !important; z-index: 60;
    flex-direction: column !important; flex-wrap: nowrap !important; align-items: stretch !important; padding: 18px 12px !important;
    transform: translateX(-104%); transition: transform .3s var(--ease); box-shadow: 0 0 48px rgba(20, 25, 28, .28); visibility: hidden;
  }
  body.navopen .side { transform: none; visibility: visible; }
  .side .brand { width: auto !important; padding: 4px 10px 18px !important; font-size: 15px !important; }
  .side .brand small { display: block !important; }
  .nav { flex-direction: column !important; overflow: visible !important; -webkit-mask-image: none !important; mask-image: none !important; gap: 14px !important; padding: 0 !important; }
  .nav-group { display: flex !important; }
  .nav-label { display: block !important; }
  .nav a.on { box-shadow: inset 3px 0 0 var(--accent) !important; }
  .side .foot { display: block !important; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(20, 25, 28, .42); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  body.navopen .scrim { opacity: 1; pointer-events: auto; }
  body.navopen { overflow: hidden; }
  .navbtn { display: inline-flex; }
  .tb-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 800; font-size: 15px; }
  .tb-brand > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
  .tb-brand .mark { width: 22px; height: 22px; }
  .tb-brand .logo { max-height: 26px; width: auto; }
}

/* Phones: search behind an icon, the on-the-go modules in a bottom bar, lists as cards. */
@media (max-width: 700px) {
  .topbar { gap: 6px; padding: 8px 12px !important; }
  .topbar .back { padding: 6px 10px; }
  .tb-brand > span { max-width: 38vw; }
  .search { display: none; }
  .searchbtn { display: inline-flex; }
  body.searching .search { display: block; position: absolute; left: 12px; right: 12px; top: calc(100% + 6px); width: auto; z-index: 31; }
  body.searching .search input[type=search] { min-height: 46px; font-size: 16px; box-shadow: 0 14px 30px -14px rgba(20, 25, 28, .45); }
  body.searching .searchbtn { background: var(--surface-2); }
  .helpbtn { width: 38px; height: 38px; }
  main { padding-bottom: 104px !important; }

  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px; padding: 6px 2px; border-radius: 10px; text-decoration: none; color: var(--muted);
    font-size: 11px; font-weight: 700; transition: color .2s ease, background-color .2s ease;
  }
  .tabbar a .ni { width: 22px; height: 22px; color: inherit; transition: transform .25s var(--ease); }
  .tabbar a::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); transform: scaleX(0); transition: transform .28s var(--ease); }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on .ni { color: var(--accent); transform: translateY(-1px); }
  .tabbar a.on::before { transform: scaleX(1); }
  .tabbar a:active { background: var(--surface-2); }
  .tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; padding: 0 5px; font-size: 10px; line-height: 16px; background: var(--accent); color: #fff; border-color: var(--accent); }
  .tabbar .badge.late { background: var(--bad); border-color: var(--bad); }

  /* Lists of records: one card per row, each line labelled with its column. */
  .table-wrap:has(table.cards) { overflow: visible; }
  table.cards, table.cards tbody, table.cards tfoot { display: block; }
  table.cards thead { display: none; }
  /* Each card: the first column as its title, then the rest in two columns, each label above its value. */
  table.cards tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; margin: 0 0 10px; box-shadow: var(--shadow-sm); transition: border-color .2s ease; }
  table.cards tr.link:active { border-color: var(--line-strong); }
  table.cards td { display: block; border: 0; padding: 0; text-align: left; background: none !important; min-width: 0; overflow-wrap: anywhere; }
  table.cards td::before { content: attr(data-label); display: block; margin-bottom: 1px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  table.cards td[data-label=""]::before { display: none; }
  table.cards td:first-child { grid-column: 1 / -1; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  table.cards td.acts, table.cards td:has(> button:only-child) { grid-column: 1 / -1; }
  table.cards td:empty { display: none; }
  .card table.cards tr { box-shadow: none; }
}
/* Buttons sharing a table cell keep a gap between them. */
td.acts { white-space: nowrap; }
td.acts > button + button, td.acts > .btn + .btn, td.acts > button + .btn, td.acts > .btn + button { margin-left: 6px; }
@media (max-width: 700px) { table.cards td.acts { display: flex; flex-wrap: wrap; gap: 6px; } table.cards td.acts > * + * { margin-left: 0; } table.cards td.acts::before { flex-basis: 100%; } }

/* ---------------------------------------------------------------- version 16.2: touch behaviour */
/* Sideways strips move sideways only: no up-and-down wobble, no swipe back a page, they settle on an item. */
.tabs, .stick-acts { overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar, .stick-acts::-webkit-scrollbar { display: none; }
.tabs a, .stick-acts > *, .stick-acts .actionbar > *, .stick-acts .bar > * { flex: none; scroll-snap-align: center; }
@media (max-width: 820px) {
  .tabs { flex-wrap: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
}
/* Every pop-up panel can be closed from its top corner. */
.dclose { position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 10px; border-color: transparent; box-shadow: none; background: transparent; }
.dclose:hover, .dclose:focus-visible { background: var(--surface); }
.dclose svg { width: 20px; height: 20px; }
.dclose:hover { border-color: var(--line-strong); }
dialog { position: fixed; }
dialog form { padding-top: 22px; }
dialog form > h2:first-child, dialog form > h3:first-child { padding-right: 44px; }
/* Phones: panels open from the top and scroll inside, with their buttons kept well above the browser's own bar. */
@media (max-width: 700px) {
  dialog, dialog.wide { width: calc(100vw - 16px); max-width: none; margin: calc(8px + env(safe-area-inset-top)) auto auto; max-height: calc(100dvh - 96px - env(safe-area-inset-bottom)); }
  dialog[open] { display: flex; flex-direction: column; }
  dialog form { overflow-y: auto; overscroll-behavior: contain; padding: 22px 16px 0; }
  dialog .foot { position: sticky; bottom: 0; background: var(--surface); margin: 16px -16px 0; padding: 12px 16px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
  dialog .foot button { min-height: 44px; }
}
/* Touch screens: typing boxes use 16px text, so phones do not zoom in when one is tapped. */
@media (pointer: coarse) {
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=tel], input:not([type]), select, textarea { font-size: 16px; }
}
html, body { overflow-x: hidden; }
