/* =====================================================================
   Prisma-WFM — one stylesheet.
   Tokens first: change colours / spacing here and everything follows.
   ===================================================================== */
:root {
  /* Colour */
  --c-bg:            #f6f6f3;
  --c-surface:       #ffffff;
  --c-surface-2:     #f1f1ed;
  --c-ink:           #17171c;
  --c-ink-2:         #45454f;
  --c-muted:         #75757f;
  --c-line:          #e3e3de;
  --c-line-strong:   #cfcfc8;

  --c-brand:         #2d2a8c;   /* Prisma indigo */
  --c-brand-ink:     #ffffff;
  --c-brand-soft:    #ecebfa;
  --c-focus:         #6d67ff;

  --c-pending:       #8a6100;
  --c-pending-bg:    #fdf3d8;
  --c-approved:      #11754a;
  --c-approved-bg:   #dff4e8;
  --c-changes:       #b3261e;
  --c-changes-bg:    #fce6e3;

  --prism: linear-gradient(135deg, #ff5f6d 0%, #ffc371 25%, #47e0a0 50%, #3fa7ff 75%, #8b5cf6 100%);

  /* Spacing (4px scale) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 26px; --fs-2xl: 32px;

  /* Shape */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(20, 20, 30, .05), 0 1px 3px rgba(20, 20, 30, .04);
  --shadow-2: 0 8px 28px rgba(20, 20, 30, .10), 0 2px 6px rgba(20, 20, 30, .05);

  --page-max: 1180px;
  --topbar-h: 64px;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-ink);
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: var(--fs-xl); font-weight: 700; }
p { margin: 0; }
a { color: var(--c-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.muted { color: var(--c-muted); }
.ink { color: var(--c-ink); }
.small { font-size: var(--fs-sm); }
.block { display: block; }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); margin-bottom: var(--s-1); }
.section-title { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--s-3); }

.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack--sm { gap: var(--s-2); }
.stack--lg { gap: var(--s-5); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row--sm { gap: var(--s-2); }

/* ------------------------------------------------------------ brand + top bar */
.brand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--c-ink); font-weight: 700; font-size: 17px; white-space: nowrap; flex: none; }
.brand:hover { text-decoration: none; }
.brand--lg { font-size: 22px; }
.build-tag { font-size: 11px; font-weight: 500; color: var(--c-muted); font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.brand .build-tag { margin-left: var(--s-2); }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--c-line); }
.topbar__inner { max-width: var(--page-max); margin: 0 auto; height: var(--topbar-h); padding: 0 var(--s-5); display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.topbar__right { display: flex; align-items: center; gap: var(--s-3); }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.who__name { font-size: var(--fs-sm); font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who__role { font-size: var(--fs-xs); color: var(--c-muted); }

.tabs { background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
.tabs__inner { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--s-5); display: flex; gap: var(--s-5); overflow-x: auto; }
.tab { padding: var(--s-3) 0; color: var(--c-muted); font-weight: 500; font-size: var(--fs-sm); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--c-ink); text-decoration: none; }
.tab.is-active { color: var(--c-ink); border-bottom-color: var(--c-brand); }

/* ------------------------------------------------------------ page */
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--s-6) var(--s-5) var(--s-8); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6); }
.page-head h1 + p { margin-top: var(--s-2); }
.page-head__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: var(--s-4); font-size: var(--fs-sm); font-weight: 500; color: var(--c-muted); }
.back:hover { color: var(--c-ink); text-decoration: none; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5); border-radius: var(--r-pill);
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--c-brand); color: var(--c-brand-ink); }
.btn--primary:hover:not(:disabled) { background: #221f70; }
.btn--secondary { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line-strong); }
.btn--secondary:hover:not(:disabled) { border-color: var(--c-ink-2); }
.btn--ghost { background: transparent; color: var(--c-ink-2); }
.btn--ghost:hover:not(:disabled) { background: var(--c-surface-2); }
.btn--danger { background: var(--c-changes); color: #fff; }
.btn--danger-ghost { background: transparent; color: var(--c-changes); border-color: #efc4bf; }
.btn--danger-ghost:hover:not(:disabled) { background: var(--c-changes-bg); }
.btn--sm { min-height: 36px; padding: 0 var(--s-4); font-size: var(--fs-sm); }
.btn--xs { min-height: 30px; padding: 0 var(--s-3); font-size: 13px; }
.btn--block { width: 100%; }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--c-muted); }
.icon-btn:hover { background: var(--c-surface-2); color: var(--c-ink); }

/* ------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--c-ink-2); }
.field__hint { font-size: var(--fs-xs); color: var(--c-muted); }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
  color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--c-line-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s, background .3s;
}
.input:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-soft); }
textarea.input { resize: vertical; min-height: 80px; }
.input.is-saving { background: var(--c-surface-2); }
.input.is-saved { border-color: var(--c-approved); box-shadow: 0 0 0 3px var(--c-approved-bg); }
.input--title { font-weight: 600; font-size: 17px; border-color: transparent; padding-left: var(--s-2); margin-left: calc(-1 * var(--s-2)); }
.input--title:hover { border-color: var(--c-line); }
.form-error { color: var(--c-changes); font-size: var(--fs-sm); background: var(--c-changes-bg); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); }

/* ------------------------------------------------------------ chips + progress */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--pending  { color: var(--c-pending);  background: var(--c-pending-bg); }
.chip--approved { color: var(--c-approved); background: var(--c-approved-bg); }
.chip--changes  { color: var(--c-changes);  background: var(--c-changes-bg); }
.chip--sm { font-size: 11.5px; padding: 2px 8px; margin-left: var(--s-2); }

.progress { height: 6px; background: var(--c-surface-2); border-radius: var(--r-pill); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--c-approved); border-radius: inherit; transition: width .3s; }
.progress--thin { height: 4px; margin: 6px 0 4px; }
.progress--thin span { background: var(--c-brand); }

/* ------------------------------------------------------------ cards + grids */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card--pad { padding: var(--s-5); }
.card--link { display: block; color: inherit; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card--link:hover { text-decoration: none; box-shadow: var(--shadow-2); border-color: var(--c-line-strong); transform: translateY(-1px); }

.grid { display: grid; gap: var(--s-5); }
.grid--projects { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid--proofs { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.project-card { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.project-card__top { display: flex; justify-content: space-between; gap: var(--s-3); align-items: flex-start; }
.project-card__name { font-size: var(--fs-lg); font-weight: 650; }
.project-card__due { font-size: 13px; color: var(--c-muted); white-space: nowrap; padding-top: 3px; }
.project-card__count { font-size: var(--fs-sm); color: var(--c-muted); display: flex; align-items: center; flex-wrap: wrap; }
.project-card__count strong { color: var(--c-ink); margin-right: 4px; }

/* proof tiles (client grid) */
.proof-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.proof-tile.is-approved { border-color: #bfe5cf; }
.proof-tile__body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.proof-tile__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-2); min-width: 0; }
.proof-tile__head > .chip { flex: none; }
.proof-tile__name { font-weight: 600; color: var(--c-ink); line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.proof-tile__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--s-1); }
.proof-tile__actions .btn { flex: 1 1 auto; }
.tile-check { position: absolute; top: var(--s-3); left: var(--s-3); z-index: 2; background: rgba(255,255,255,.95); border-radius: var(--r-sm); width: 36px; height: 36px; display: grid; place-items: center; box-shadow: var(--shadow-1); cursor: pointer; }
.tile-check input { width: 20px; height: 20px; accent-color: var(--c-brand); cursor: pointer; margin: 0; }

.thumb { display: block; aspect-ratio: 4 / 3; background: var(--c-surface-2); border-bottom: 1px solid var(--c-line); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: repeating-conic-gradient(#f3f3ef 0 25%, #fafaf7 0 50%) 0 0 / 20px 20px; }
.thumb--static { border: 1px solid var(--c-line); border-radius: var(--r-md); }
.thumb img.is-loading { opacity: 0; } /* grey .thumb background shows through until loaded */
.thumb img { transition: opacity .2s; }
.thumb__ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; padding: var(--s-4); color: var(--c-ink-2); }
.thumb__ph-title { font-weight: 600; font-size: var(--fs-sm); }
.thumb__ph-sub { font-size: var(--fs-xs); color: var(--c-muted); }
.thumb__ph--pending { background: repeating-linear-gradient(-45deg, var(--c-surface-2) 0 10px, #ebebe6 10px 20px); color: var(--c-muted); }

.specs { margin: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.specs__row { display: flex; justify-content: space-between; gap: var(--s-3); }
.specs dt { color: var(--c-muted); }
.specs dd { margin: 0; text-align: right; font-weight: 500; }

/* sticky "approve selected" bar */
.select-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--c-ink); color: #fff; box-shadow: 0 -8px 24px rgba(0,0,0,.15); }
.select-bar__inner { max-width: var(--page-max); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; font-weight: 600; }
.select-bar .btn--ghost { color: #d7d7e0; }
.select-bar .btn--ghost:hover { background: rgba(255,255,255,.08); }
.select-bar .btn--primary { background: #fff; color: var(--c-ink); }

/* ------------------------------------------------------------ proof detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-5); align-items: start; }
.detail__side { display: flex; flex-direction: column; gap: var(--s-4); position: sticky; top: calc(var(--topbar-h) + var(--s-4)); }
.detail__head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); min-width: 0; }
.detail__title { font-size: var(--fs-lg); line-height: 1.3; max-width: 100%; overflow-wrap: anywhere; }
.detail__side, .detail__side > * { min-width: 0; }
.detail__side .card--pad > * + * { margin-top: var(--s-4); }
.viewer { position: relative; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; min-height: 320px; display: flex; align-items: center; justify-content: center; }
/* zoomable JPG preview */
.zoom { position: relative; width: 100%; overflow: hidden; cursor: zoom-in; touch-action: none; overscroll-behavior: contain;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background: repeating-conic-gradient(#f3f3ef 0 25%, #fafaf7 0 50%) 0 0 / 20px 20px; }
.zoom.is-zoomed { cursor: grab; }
.zoom.is-zoomed.is-dragging { cursor: grabbing; }
.zoom:focus-visible { outline-offset: -3px; }
.zoom__img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.zoom__controls { position: absolute; right: var(--s-3); bottom: var(--s-3); display: flex; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-pill); box-shadow: var(--shadow-1); overflow: hidden; cursor: default; }
.zoom__btn { border: 0; background: transparent; font: inherit; font-weight: 600; min-width: 44px; height: 40px; padding: 0 var(--s-3); cursor: pointer; color: var(--c-ink); }
.zoom__btn:hover { background: var(--c-surface-2); }
.zoom__level { font-size: 13px; min-width: 60px; border-left: 1px solid var(--c-line); border-right: 1px solid var(--c-line); font-variant-numeric: tabular-nums; }
.viewer__pdf { width: 100%; height: 80vh; min-height: 480px; border: 0; display: block; }
.viewer__bar { position: absolute; top: var(--s-3); right: var(--s-3); display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: flex-end; }
.viewer__bar:empty { display: none; }
.viewer__bar .btn { box-shadow: var(--shadow-1); }
.viewer .thumb__ph { min-height: 320px; }
.viewer:has(.zoom) { min-height: 0; display: block; }
.approval-record { background: var(--c-approved-bg); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.approval-record__text { font-weight: 600; color: var(--c-approved); margin-bottom: 2px; }

/* comments */
.comments { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.comment { background: var(--c-surface-2); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.comment--mine { background: var(--c-brand-soft); }
.comment--change { border-left: 4px solid var(--c-changes); background: var(--c-changes-bg); }
.comment__tag { display: inline-block; margin-bottom: 4px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--c-changes); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.comment-note { font-size: 13px; color: var(--c-muted); line-height: 1.4; }
.uploaded { font-size: 13px; color: var(--c-muted); margin-top: 2px; }
.uploaded--indent { padding-left: var(--s-2); margin-left: calc(-1 * var(--s-2)); }
.proof-tile__title, .staff-proof__title { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.comment__meta { display: flex; flex-wrap: wrap; gap: 4px var(--s-2); font-size: 13px; margin-bottom: 2px; }
.comment__body { white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.comments--feed { max-height: 70vh; overflow: auto; }

/* ------------------------------------------------------------ staff project */
.dropzone { border: 2px dashed var(--c-line-strong); border-radius: var(--r-lg); background: var(--c-surface); padding: var(--s-6) var(--s-5); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); cursor: pointer; margin-bottom: var(--s-6); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--c-brand); background: var(--c-brand-soft); }
.dropzone__title { font-weight: 650; font-size: var(--fs-lg); }
.dropzone .muted { max-width: 640px; }
.dropzone .btn { margin-top: var(--s-2); pointer-events: none; }

.staff-proof { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-5); padding: var(--s-5); }
.staff-proof__main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.staff-proof__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); min-width: 0; }
.staff-proof__head > .chip { flex: none; margin-top: 8px; }
.staff-proof__title > textarea.input--title { width: 100%; min-width: 0; resize: none; overflow: hidden; line-height: 1.35; min-height: 44px; overflow-wrap: anywhere; }
.staff-proof__name { min-width: 0; overflow-wrap: anywhere; }
.staff-proof__foot { display: flex; justify-content: flex-end; }
.staff-proof__comments summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--s-3); }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.slot { border: 1.5px dashed var(--c-line-strong); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: border-color .15s, background .15s; }
.slot.is-filled { border-style: solid; border-color: var(--c-line); background: var(--c-surface-2); }
.slot.is-over { border-color: var(--c-brand); background: var(--c-brand-soft); }
.slot__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.slot__file { font-size: var(--fs-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot__busy { display: flex; align-items: center; gap: var(--s-2); color: var(--c-ink-2); }
.slot__error { font-size: 13px; color: var(--c-changes); background: var(--c-changes-bg); border-radius: var(--r-sm); padding: 6px 10px; }
.thumb__ph .spinner { margin-bottom: var(--s-2); }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }

/* board */
.board { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-5); align-items: start; }
.filters { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.filter { border: 1px solid var(--c-line-strong); background: var(--c-surface); border-radius: var(--r-pill); padding: 6px 14px; font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; display: inline-flex; gap: var(--s-2); align-items: center; min-height: 36px; }
.filter.is-active { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }
.filter__n { font-size: var(--fs-xs); opacity: .7; }
.table-wrap { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); font-weight: 600; padding: var(--s-3) var(--s-4); background: var(--c-surface-2); }
.table td { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--c-line); vertical-align: middle; }
.table a { font-weight: 600; }
.table td { overflow-wrap: break-word; }
.table td:first-child { overflow-wrap: anywhere; min-width: 16ch; }
.table th:nth-child(5) { white-space: nowrap; }
.table th, .table td { padding-left: var(--s-3); padding-right: var(--s-3); }
.table th:first-child, .table td:first-child { padding-left: var(--s-4); }
.comment__meta a { overflow-wrap: anywhere; }
.table td:nth-child(5) { white-space: nowrap; }
.table .chip { white-space: normal; line-height: 1.25; }

/* ------------------------------------------------------------ dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15,15,25,.45); display: flex; align-items: center; justify-content: center; padding: var(--s-4); animation: fade .15s ease-out; }
.dialog { background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; animation: pop .18s ease-out; }
.dialog--wide { max-width: 720px; }
.dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); padding: var(--s-4) var(--s-4) 0 var(--s-5); }
.dialog__head .icon-btn { flex: none; }
.dialog__title { font-size: var(--fs-lg); line-height: 1.3; min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; padding-top: 6px; }
.dialog__body { min-width: 0; overflow-wrap: anywhere; }
.approve-list li { overflow-wrap: anywhere; }
.dialog__body { padding: var(--s-4) var(--s-5) var(--s-5); }
.approve-list { margin: 0; padding-left: var(--s-5); max-height: 180px; overflow: auto; color: var(--c-ink-2); }
.approve-statement { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border: 1.5px solid var(--c-brand); background: var(--c-brand-soft); border-radius: var(--r-md); font-weight: 600; cursor: pointer; }
.approve-statement input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--c-brand); flex: none; }
.radio-list { display: flex; flex-direction: column; gap: var(--s-2); }
.radio-card { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border: 1px solid var(--c-line-strong); border-radius: var(--r-md); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--c-brand); background: var(--c-brand-soft); }
.radio-card input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--c-brand); flex: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ------------------------------------------------------------ toast, loading, empty */
.toast { position: fixed; left: 50%; bottom: calc(var(--s-5) + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 60; background: var(--c-ink); color: #fff; padding: var(--s-3) var(--s-5); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast--err { background: var(--c-changes); }
.loading { display: flex; align-items: center; justify-content: center; gap: var(--s-3); color: var(--c-muted); padding: var(--s-7) var(--s-4); font-size: var(--fs-sm); }
.loading--page { min-height: 60vh; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--c-line-strong); border-top-color: var(--c-brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: var(--s-8) var(--s-4); border: 1px dashed var(--c-line-strong); border-radius: var(--r-lg); background: var(--c-surface); }
.empty__title { font-weight: 600; font-size: var(--fs-lg); margin-bottom: var(--s-2); }

/* ------------------------------------------------------------ login */
.login-page { background: radial-gradient(1200px 600px at 20% -10%, #ecebfa 0%, transparent 60%), var(--c-bg); }
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s-5) var(--s-4); gap: var(--s-5); }
.login__card { width: 100%; max-width: 400px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: var(--s-6) var(--s-5); }
.login__lead { margin: var(--s-3) 0 var(--s-5); }
.login__foot { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 960px) {
  .detail, .board { grid-template-columns: 1fr; }
  .detail__side { position: static; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .staff-proof { grid-template-columns: 1fr; }
  .staff-proof__media { max-width: 280px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-top: 1px solid var(--c-line); padding: var(--s-2) 0; }
  .table td { border: 0; padding: 4px var(--s-4); display: flex; justify-content: space-between; gap: var(--s-3); text-align: right; }
  .table td::before { content: attr(data-label); color: var(--c-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; text-align: left; }
}
@media (max-width: 600px) {
  :root { --topbar-h: 56px; }
  h1 { font-size: 23px; }
  .topbar__inner, .tabs__inner { padding: 0 var(--s-4); }
  .page { padding: var(--s-5) var(--s-4) calc(var(--s-8) + 40px); }
  .page-head { margin-bottom: var(--s-5); }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1 1 100%; }
  .who { display: none; }
  .brand { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; }
  .brand .build-tag { margin-left: 0; font-size: 10px; }
  .topbar__right { gap: var(--s-1); }
  .grid { gap: var(--s-4); }
  .grid--proofs { grid-template-columns: 1fr; }
  .slots, .fields { grid-template-columns: 1fr; }
  .viewer__pdf { height: 70vh; min-height: 360px; }
  .dialog { max-height: calc(100dvh - 24px); }
  .overlay { align-items: flex-end; padding: 0; }
  .dialog { border-radius: var(--r-lg) var(--r-lg) 0 0; max-width: none; padding-bottom: env(safe-area-inset-bottom); }
}
