/*
 * GOMBOC client portal — "Studio" design system.
 *
 * One stylesheet for every page (login, client directory, client portal).
 * Principles (Gomboc brand + design standard):
 *   - Quiet chrome: one neutral family, ink text, white surfaces. The Gomboc
 *     gradient appears ONCE per page — in the real wordmark image — and never
 *     as a wash, bar or glow.
 *   - Colour carries meaning only: amber = the client's turn to review,
 *     green = approved / posted, neutral = in production.
 *   - Two typefaces: Clash Display (brand display, used sparingly) + Geist (UI).
 *   - Phone first, 32px+ targets (36px on touch), visible focus, WCAG AA text.
 *
 * Theme: light is the default (`:root`). `[data-theme="dark"]` swaps only the
 * tokens, so every component reads the same token set in either theme.
 */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --surface-3: #EFF1F3;
  --line: #E3E6EA;
  --line-2: #D2D7DD;
  --ink: #0E1116;
  --ink-2: #4A525E;
  --ink-3: #69717D;
  --ink-inv: #FFFFFF;
  --accent: #1A7F93;          /* Gomboc teal, darkened for AA on white */
  --accent-soft: #E3F2F5;
  --focus: #1A7F93;
  --scrim: rgba(14, 17, 22, 0.42);

  --review-bg: #FFF3E0; --review-fg: #8A4A00; --review-dot: #E58A00; --review-line: #F6D6A6;
  --ok-bg: #E7F5EC;     --ok-fg: #0F6B39;     --ok-dot: #1E9E55;     --ok-line: #BFE3CC;
  --prod-bg: #EEF1F4;   --prod-fg: #47505B;   --prod-dot: #8D96A2;   --prod-line: #DADFE4;
  --plan-bg: #F5F6F7;   --plan-fg: #69717D;   --plan-dot: #C0C6CE;   --plan-line: #E3E6EA;
  --hold-bg: #F2F2F2;   --hold-fg: #6B6B6B;   --hold-dot: #A3A3A3;   --hold-line: #DEDEDE;
  --danger: #C2272D;
  --danger-bg: #FDECEC;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-2: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 16px 40px -12px rgba(16, 24, 40, 0.22), 0 2px 6px rgba(16, 24, 40, 0.06);
  --shadow-sheet: -24px 0 60px -24px rgba(16, 24, 40, 0.28);

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Clash Display", "Geist", ui-sans-serif, system-ui, sans-serif;

  --topbar-h: 56px;
  --page-max: 1320px;
  --gutter: 16px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0B0D10;
  --surface: #121519;
  --surface-2: #161A1F;
  --surface-3: #1D2228;
  --line: #242A31;
  --line-2: #313841;
  --ink: #EDEFF2;
  --ink-2: #A9B1BC;
  --ink-3: #8C949F;
  --ink-inv: #0B0D10;
  --accent: #4BB8CD;
  --accent-soft: rgba(75, 184, 205, 0.14);
  --focus: #4BB8CD;
  --scrim: rgba(0, 0, 0, 0.6);

  --review-bg: rgba(229, 138, 0, 0.14); --review-fg: #F5B95C; --review-dot: #F0A23A; --review-line: rgba(240, 162, 58, 0.32);
  --ok-bg: rgba(30, 158, 85, 0.15);     --ok-fg: #6FD49A;     --ok-dot: #3CC173;     --ok-line: rgba(60, 193, 115, 0.3);
  --prod-bg: rgba(141, 150, 162, 0.14); --prod-fg: #B4BCC6;   --prod-dot: #7F8893;   --prod-line: rgba(141, 150, 162, 0.26);
  --plan-bg: rgba(141, 150, 162, 0.08); --plan-fg: #8C949F;   --plan-dot: #5B636D;   --plan-line: rgba(141, 150, 162, 0.18);
  --hold-bg: rgba(160, 160, 160, 0.1);  --hold-fg: #9A9A9A;   --hold-dot: #6E6E6E;   --hold-line: rgba(160, 160, 160, 0.2);
  --danger: #F07178;
  --danger-bg: rgba(240, 113, 120, 0.12);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 18px 44px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
  --shadow-sheet: -24px 0 60px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

@media (min-width: 768px) {
  :root { --gutter: 28px; }
}
@media (min-width: 1200px) {
  :root { --gutter: 40px; }
}

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
.is-hidden { display: none !important; }
::selection { background: var(--accent-soft); color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }

.ic {
  width: 16px; height: 16px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 20px; height: 20px; }

.page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark { display: inline-flex; align-items: center; flex: none; }
.wordmark img { height: 18px; width: auto; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--ink-3); }
.crumbs .sep { color: var(--line-2); }
.crumbs a { color: var(--ink-2); border-radius: var(--r-sm); padding: 2px 4px; margin: -2px -4px; }
.crumbs a:hover { color: var(--ink); background: var(--surface-3); }
.crumbs .current { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 6px; flex: none; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--ink); color: var(--ink-inv); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 86%, var(--surface)); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: color-mix(in srgb, var(--line-2) 70%, var(--ink-3)); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.btn-approve { background: var(--ok-dot); color: #fff; }
.btn-approve:hover:not(:disabled) { background: color-mix(in srgb, var(--ok-dot) 88%, #000); }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover:not(:disabled) { background: var(--danger-bg); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-lg { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }

/* ------------------------------------------------------------ segmented */
.seg {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1), 0 0 0 1px var(--line);
}
[data-theme="dark"] .seg-btn[aria-pressed="true"] { background: var(--line-2); box-shadow: none; }

/* --------------------------------------------------------------- inputs */
.input, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 0 10px; height: 34px;
  font-size: 13.5px; color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.textarea { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; min-height: 72px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.field-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }

.search {
  position: relative; display: flex; align-items: center;
  min-width: 0; flex: 1 1 220px; max-width: 320px;
}
.search .ic { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 32px; height: 32px; background: var(--surface); }

/* --------------------------------------------------------- filter menus */
.filter { position: relative; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px 0 12px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: var(--surface); border: 1px dashed var(--line-2);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip .ic { color: var(--ink-3); }
.chip.is-set { border-style: solid; border-color: var(--line-2); color: var(--ink); background: var(--surface); box-shadow: var(--shadow-1); }
.chip .chip-value { color: var(--ink); font-weight: 500; }
.chip.is-set .chip-label { color: var(--ink-3); font-weight: 400; }
.chip.is-set .chip-label::after { content: ""; display: inline-block; width: 1px; height: 12px; background: var(--line-2); margin-left: 6px; vertical-align: -1px; }
.chip-clear { display: none; margin-left: 2px; border-radius: 4px; color: var(--ink-3); }
.chip.is-set .chip-clear { display: inline-flex; }
.chip-clear:hover { color: var(--ink); background: var(--surface-3); }

.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  min-width: 200px; max-height: 320px; overflow: auto;
  padding: 4px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
}
.menu-label { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink); text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); outline: none; }
.menu-item .check { margin-left: auto; color: var(--accent); visibility: hidden; }
.menu-item[aria-checked="true"] .check { visibility: visible; }
.menu-item[aria-checked="true"] { font-weight: 500; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ------------------------------------------------------- status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--prod-bg); color: var(--prod-fg);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--prod-dot); flex: none; }
.pill.t-review { background: var(--review-bg); color: var(--review-fg); }
.pill.t-review::before { background: var(--review-dot); }
.pill.t-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill.t-ok::before { background: var(--ok-dot); }
.pill.t-plan { background: var(--plan-bg); color: var(--plan-fg); }
.pill.t-plan::before { background: var(--plan-dot); }
.pill.t-hold { background: var(--hold-bg); color: var(--hold-fg); }
.pill.t-hold::before { background: var(--hold-dot); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--prod-dot); }
.dot.t-review { background: var(--review-dot); }
.dot.t-ok { background: var(--ok-dot); }
.dot.t-plan { background: var(--plan-dot); }
.dot.t-hold { background: var(--hold-dot); }

.badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--surface-3); color: var(--ink-2);
}
.badge-review { background: var(--review-bg); color: var(--review-fg); }
.feedback-flag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--review-bg); color: var(--review-fg);
}

.type-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.type-tag .ic { color: var(--ink-3); }

/* --------------------------------------------------------- client header */
.client-head { padding: 28px 0 0; }
.cover {
  height: 132px; border-radius: var(--r-xl); margin-bottom: -36px;
  background-size: cover; background-position: center 50%;
  border: 1px solid var(--line);
}
.client-id { display: flex; align-items: center; gap: 16px; min-width: 0; position: relative; }
.logo-tile {
  width: 64px; height: 64px; border-radius: var(--r-lg); flex: none;
  background: #FFFFFF; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: var(--shadow-2);
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.logo-tile .logo-fallback { font-size: 28px; }
.cover + .client-id .logo-tile { width: 72px; height: 72px; border: 3px solid var(--bg); margin-left: 16px; }
.client-name { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; }
.client-tagline { margin-top: 4px; color: var(--ink-2); font-size: 13.5px; max-width: 60ch; }
.client-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.client-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 112px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.1; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
button.stat { text-align: left; transition: border-color 120ms ease, background-color 120ms ease; }
button.stat:hover { border-color: var(--line-2); background: var(--surface-2); }
@media (min-width: 768px) {
  .client-name { font-size: 32px; }
  .logo-tile { width: 72px; height: 72px; }
}

/* ------------------------------------------------------------------ tabs */
.tabs {
  display: flex; gap: 4px; margin-top: 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px; margin-bottom: -1px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab .badge { height: 18px; min-width: 18px; font-size: 11px; }

.panel { padding: 20px 0 64px; }

/* ----------------------------------------------------------- review strip */
.review-strip {
  margin-bottom: 20px; padding: 14px;
  background: var(--surface); border: 1px solid var(--review-line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-1);
}
.review-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.review-strip-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.review-strip-title .ic { color: var(--review-dot); }
.review-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.review-card {
  flex: 1 0 220px; max-width: 320px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 10px 12px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color 120ms ease, background-color 120ms ease;
}
.review-card:hover { border-color: var(--review-line); background: var(--review-bg); }
.review-card-title { font-size: 13px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.review-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- toolbar */
.toolbar {
  position: sticky; top: var(--topbar-h); z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 0; margin-bottom: 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.toolbar-period { display: flex; align-items: center; gap: 4px; margin-right: 4px; }
.period-label { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; min-width: 9ch; margin-left: 6px; font-variant-numeric: tabular-nums; }
.toolbar-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1 1 0; }
@media (max-width: 767px) {
  .toolbar { gap: 8px; position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; }
  .toolbar .search { order: 10; flex: 1 1 100%; max-width: none; }
  .toolbar-filters { order: 11; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .toolbar-filters::-webkit-scrollbar { display: none; }
  .toolbar-spacer { display: none; }
  .toolbar .seg { margin-left: auto; }
}

/* --------------------------------------------------------------- calendar */
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-1); }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-dow span { padding: 8px 10px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.02em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell {
  min-height: 128px; padding: 6px; min-width: 0;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-grid > .cal-cell:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-cell.is-weekend { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.cal-cell.is-out { background: var(--surface-2); }
.cal-cell.is-out .cal-num { color: var(--ink-3); opacity: 0.6; }
.cal-num {
  align-self: flex-start;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px; margin-bottom: 2px;
  border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.cal-cell.is-today .cal-num { background: var(--ink); color: var(--ink-inv); font-weight: 600; }

.cal-chip {
  width: 100%; display: flex; align-items: center; gap: 6px; min-width: 0;
  height: 24px; padding: 0 6px 0 4px; border-radius: 5px;
  font-size: 12px; text-align: left; color: var(--ink);
  background: var(--prod-bg); border-left: 2px solid var(--prod-dot);
  transition: filter 120ms ease, background-color 120ms ease;
}
.cal-chip:hover { filter: brightness(0.97); }
[data-theme="dark"] .cal-chip:hover { filter: brightness(1.18); }
.cal-chip .ic { width: 13px; height: 13px; color: var(--ink-3); }
.cal-chip-title { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.t-review { background: var(--review-bg); border-left-color: var(--review-dot); }
.cal-chip.t-review .ic { color: var(--review-fg); }
.cal-chip.t-ok { background: var(--ok-bg); border-left-color: var(--ok-dot); }
.cal-chip.t-ok .ic { color: var(--ok-fg); }
.cal-chip.t-plan { background: var(--plan-bg); border-left-color: var(--plan-dot); color: var(--ink-2); }
.cal-chip.t-hold { background: var(--hold-bg); border-left-color: var(--hold-dot); color: var(--ink-2); }
.cal-chip .fb { color: var(--review-dot); flex: none; }
.cal-more {
  align-self: flex-start; height: 22px; padding: 0 6px; border-radius: 5px;
  font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.cal-more:hover { background: var(--surface-3); color: var(--ink); }

.cal.is-week .cal-cell { min-height: 420px; }
.cal.is-week .cal-chip { height: auto; min-height: 44px; align-items: flex-start; padding: 6px 6px 6px 6px; }
.cal.is-week .cal-chip-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.3; }
.cal.is-week .cal-chip .ic { margin-top: 1px; }
.cal-week-head { display: flex; align-items: baseline; gap: 6px; padding: 2px 2px 6px; }
.cal-week-head .dow { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }

/* agenda (phone) */
.agenda { display: flex; flex-direction: column; gap: 12px; }
.agenda-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.agenda-day-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.agenda-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); flex: none; }
.agenda-date .d { font-size: 15px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.agenda-date .m { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.agenda-day.is-today .agenda-date { background: var(--ink); border-color: var(--ink); color: var(--ink-inv); }
.agenda-day.is-today .agenda-date .m { color: inherit; opacity: 0.75; }
.agenda-dow { font-weight: 600; font-size: 13.5px; }
.agenda-items { display: flex; flex-direction: column; }
.agenda-items .row:last-child { border-bottom: 0; }

.empty {
  text-align: center; padding: 56px 16px; color: var(--ink-2);
  background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-xl);
}
.empty .ic { width: 28px; height: 28px; color: var(--ink-3); margin: 0 auto 10px; }
.empty-title { font-weight: 600; color: var(--ink); margin-bottom: 4px; }

/* ------------------------------------------------------------- list rows */
.month-group { margin-bottom: 24px; }
.month-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  padding: 0 4px 8px;
}
.month-title .subtle { font-weight: 400; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-1); }
.row {
  width: 100%; display: grid; align-items: center; gap: 12px;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--line);
  transition: background-color 120ms ease;
}
.rows .row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row-date { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.row-date .d { font-size: 13px; font-weight: 500; color: var(--ink); }
.row-date .t { font-size: 12px; color: var(--ink-3); }
.row-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.type-glyph {
  width: 32px; height: 32px; flex: none; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--ink-2);
}
.row-text { min-width: 0; }
.row-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.row-sub .sep { color: var(--ink-3); opacity: 0.6; }
.row-side { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.row-side .feedback-flag { display: inline-flex; }
@media (max-width: 639px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .row-date { flex-direction: row; gap: 6px; }
  .row-side { justify-content: flex-start; }
}
.content-card.hidden-by-filter, .content-card.hidden-by-page { display: none !important; }
.month-group.all-hidden { display: none !important; }

.disclosure { margin: 0 0 20px; }
.disclosure > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--ink); background: var(--surface-2); }
.disclosure > summary .ic { transition: transform 150ms ease; }
.disclosure[open] > summary .ic { transform: rotate(90deg); }
.disclosure > .disclosure-body { margin-top: 16px; }

.show-more-wrap { display: flex; justify-content: center; margin-top: 8px; }

/* ----------------------------------------------------------------- sheet */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: var(--scrim);
  opacity: 0; transition: opacity 180ms ease;
}
.overlay.is-open { opacity: 1; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(600px, 100vw);
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.is-open { transform: translateX(0); }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.sheet-body-wrap { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
#itemModalBody { min-height: 100%; display: flex; flex-direction: column; }
.item-detail { display: flex; flex-direction: column; min-height: 100%; }
.detail-head { padding: 20px 64px 16px 24px; border-bottom: 1px solid var(--line); }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 12.5px; color: var(--ink-3); }
.detail-meta .sep { color: var(--line-2); }
.detail-title { margin-top: 10px; font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.detail-status { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.detail-body { flex: 1 1 auto; padding: 8px 24px 24px; }
.section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.section-label { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.01em; }
.section-hint { font-size: 12px; color: var(--ink-3); }
.prose { font-size: 14px; line-height: 1.6; color: var(--ink); max-width: 68ch; }
.prose.plain { white-space: pre-wrap; }
.prose p { margin: 0 0 0.6em; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }
.prose u { text-decoration: underline; text-underline-offset: 2px; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--surface-3); padding: 0.05em 0.3em; border-radius: 4px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.caption-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; }
.clamped { max-height: 7.4em; overflow: hidden; position: relative; }
.clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(to bottom, transparent, var(--surface)); }
.clamped.expanded { max-height: none; }
.clamped.expanded::after { display: none; }
.link-btn { font-size: 12.5px; font-weight: 500; color: var(--accent); border-radius: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

.links { display: flex; flex-direction: column; gap: 6px; }
.link-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color 120ms ease, background-color 120ms ease;
}
.link-row:hover { border-color: var(--line-2); background: var(--surface-2); }
.link-row .type-glyph { width: 32px; height: 32px; }
.link-row-text { min-width: 0; flex: 1; }
.link-row-title { font-size: 13.5px; font-weight: 500; }
.link-row-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-row > .ic { color: var(--ink-3); }
.link-row.is-primary { border-color: var(--review-line); background: var(--review-bg); }
.link-row.is-primary .type-glyph { background: var(--surface); color: var(--review-fg); }
.link-row.is-disabled { border-style: dashed; background: var(--surface-2); cursor: default; }
.link-row.is-disabled:hover { border-color: var(--line); }
.link-row.is-disabled .link-row-title { color: var(--ink-2); }

.ref-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ref-thumb { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); cursor: zoom-in; aspect-ratio: 4 / 3; }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform 200ms ease; }
.ref-thumb:hover img { transform: scale(1.03); }

.detail-foot {
  position: sticky; bottom: 0; z-index: 1;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.detail-foot:empty { display: none; }
.workflow-actions { display: flex; align-items: center; gap: 8px; }
.workflow-actions .grow { flex: 1; }
.workflow-note { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.workflow-note .ic { color: var(--ok-dot); }
.request-changes-form { display: flex; flex-direction: column; gap: 8px; }
.request-changes-form .row-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* comments */
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.comment-list:empty { display: none; }
.comment-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-3); border: 1px solid var(--line);
}
.comment-bubble { min-width: 0; }
.comment-top { display: flex; align-items: baseline; gap: 8px; }
.comment-author { font-size: 13px; font-weight: 600; }
.comment-timestamp { font-size: 12px; color: var(--ink-3); }
.comment-text { margin-top: 2px; font-size: 13.5px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-tools { display: flex; align-items: center; gap: 2px; margin-top: 4px; margin-left: -6px; }
.comment-tools .btn { height: 24px; padding: 0 6px; font-size: 12px; }
.comment-owner-actions { display: inline-flex; gap: 2px; }
.comment-resolve-btn[data-state="open"] { color: var(--review-fg); }
.comment-resolve-btn[data-state="resolved"] { color: var(--ok-fg); }
.comment-item[data-resolved="true"] .comment-text { color: var(--ink-2); }
.comment-edit-textarea { margin-top: 6px; }
.comment-edit-actions { display: flex; gap: 6px; margin-top: 6px; }
.composer { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); }
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer .input, .composer .textarea { border: 0; box-shadow: none; padding-left: 0; padding-right: 0; background: transparent; }
.composer .input { height: 26px; font-weight: 500; }
.composer .textarea { min-height: 56px; padding-top: 2px; }
.composer .input:focus, .composer .textarea:focus { box-shadow: none; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.composer-hint { font-size: 12px; color: var(--ink-3); }

/* -------------------------------------------------------------- dialogs */
.dialog {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dialog.is-hidden, .dialog[hidden] { display: none !important; }
.dialog-backdrop { position: absolute; inset: 0; background: var(--scrim); }
.dialog-panel {
  position: relative; width: 100%; max-width: 440px; max-height: 82vh; overflow: auto;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  border: 1px solid var(--line);
}
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dialog-title { font-size: 15px; font-weight: 600; }
.dialog-body { padding: 8px; }
.day-panel-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); text-align: left; }
.day-panel-item:hover { background: var(--surface-2); }
.day-panel-item .row-text { flex: 1; }

.report-panel { max-width: 1080px; height: 88vh; max-height: none; display: flex; flex-direction: column; overflow: hidden; }
.report-panel iframe { flex: 1; width: 100%; border: 0; background: var(--surface-2); }

.lightbox { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(5, 6, 8, 0.88); }
.lightbox[hidden] { display: none !important; }
.lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; border-radius: var(--r-md); }
.lightbox .btn { position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, 0.12); color: #fff; }
.lightbox .btn:hover { background: rgba(255, 255, 255, 0.22); }

/* --------------------------------------------------------- files/reports */
.section-intro { margin-bottom: 16px; color: var(--ink-2); max-width: 70ch; }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-1); }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); text-align: left; width: 100%;
  transition: background-color 120ms ease;
}
.list-card > .list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.list-item .action { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.list-item.is-disabled { color: var(--ink-3); cursor: default; }
.list-item.is-disabled .type-glyph { opacity: 0.6; }
.report-month { font-size: 13px; font-weight: 600; margin: 20px 4px 8px; }
.report-month:first-child { margin-top: 0; }
.tag-new { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); margin-left: 6px; }
.upcoming { border: 1px dashed var(--line-2); border-radius: var(--r-xl); padding: 16px; background: var(--surface); }
.upcoming-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.upcoming ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.7; }

/* ------------------------------------------------------------------ toast */
.toast-wrap {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-lg);
  background: var(--ink); color: var(--ink-inv);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(8px); transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast .ic { color: #6FD49A; }
.toast.is-error .ic { color: #F59AA0; }
.toast.is-info .ic { color: #8ED3E0; }
[data-theme="dark"] .toast .ic { color: var(--ok-dot); }

/* ------------------------------------------------------------- directory */
.dir-head { padding: 36px 0 8px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.dir-title { font-family: var(--font-display); font-weight: 600; font-size: 32px; letter-spacing: -0.02em; line-height: 1.1; }
.dir-sub { color: var(--ink-2); margin-top: 6px; }
.overview { margin: 24px 0 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 18px; box-shadow: var(--shadow-1); }
.overview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.overview-title { font-weight: 600; }
.overview-total { color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.stack-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.stack-bar span { display: block; height: 100%; min-width: 4px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-top: 14px; }
@media (min-width: 768px) { .legend { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.legend-item { display: flex; flex-direction: column; gap: 2px; }
.legend-key { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.legend-key i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.legend-val { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.overview-month[hidden] { display: none; }

.client-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 64px; }
@media (min-width: 640px) { .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .client-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.client-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.client-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.client-card .logo-tile { width: 52px; height: 52px; border-radius: var(--r-md); box-shadow: none; }
.client-card .logo-tile img { padding: 6px; }
.client-card-text { min-width: 0; flex: 1; }
.client-card-name { font-weight: 600; font-size: 14.5px; }
.client-card-tag { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.client-card > .ic { color: var(--ink-3); transition: transform 140ms ease, color 140ms ease; }
.client-card:hover > .ic { color: var(--ink); transform: translateX(2px); }
.section-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------------ auth */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); padding: 28px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-logo .logo-tile { width: 64px; height: 64px; }
.auth-logo .wordmark img { height: 24px; }
.auth-eyebrow { text-align: center; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.auth-title { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -0.015em; margin-top: 4px; }
.auth-sub { text-align: center; color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.auth-form { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.auth-form .input { height: 40px; font-size: 14px; }
.auth-error { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--r-md); background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.auth-foot { margin-top: 24px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.auth-foot img { height: 12px; width: auto; }

/* ---------------------------------------------------------------- footer */
.site-foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px 0 40px; font-size: 12px; color: var(--ink-3); }
.site-foot img { height: 11px; width: auto; opacity: 0.9; }

/* --------------------------------------------------------------- touch */
@media (pointer: coarse) {
  .btn, .chip, .input { height: 36px; }
  .btn-sm { height: 32px; }
  .btn-icon { width: 36px; }
  .seg-btn { height: 30px; }
  .menu-item { min-height: 40px; }
}

/* phone sheet = full screen */
@media (max-width: 639px) {
  .sheet { width: 100vw; }
  .detail-head { padding: 16px 56px 14px 16px; }
  .detail-body { padding: 4px 16px 20px; }
  .detail-foot { padding-left: 16px; padding-right: 16px; }
  .ref-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-width: 0; flex: 1 1 0; }
  .client-stats { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* phone refinements */
@media (max-width: 639px) {
  .hide-sm { display: none !important; }
  .review-strip-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .crumbs .crumb-parent, .crumbs .crumb-parent + .sep { display: none; }
  .workflow-actions .request-changes-btn, .workflow-actions .approve-btn { flex: 1 1 0; }
  .workflow-actions .hide-sm + .grow { display: none; }
}

/* =====================================================================
 * v6.1 - detailed pass: ClickUp naming as the primary label, thicker
 * cards, two-line calendar cards, big week tiles, clearer approval states,
 * consistent asset slots, grouped Files, Reports feature.
 * (Appended so it overrides the base rules above.)
 * ===================================================================== */

/* ClickUp code label - "CAROUSEL #01", "POST 04 · REEL #10" */
.code {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap;
}
.code span { overflow: hidden; text-overflow: ellipsis; }
.code .ic { color: var(--ink-3); }
.code-lg { font-size: 12.5px; }

/* "done" = Approved / Posted / Approved - uploaded on GD: the same green
   highlight everywhere (previous feedback), driven by the ok tone. */
.t-ok { --tone-edge: var(--ok-dot); --tone-tint: var(--ok-bg); }
.t-review { --tone-edge: var(--review-dot); --tone-tint: var(--review-bg); }
.t-prod { --tone-edge: var(--prod-dot); --tone-tint: transparent; }
.t-plan { --tone-edge: var(--plan-dot); --tone-tint: transparent; }
.t-hold { --tone-edge: var(--hold-dot); --tone-tint: transparent; }

/* list rows - bigger and thicker */
.row {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 16px; padding: 14px 18px;
  box-shadow: inset 3px 0 0 var(--tone-edge, transparent);
  background: color-mix(in srgb, var(--tone-tint, transparent) 55%, var(--surface));
}
.row:hover { background: color-mix(in srgb, var(--tone-tint, transparent) 80%, var(--surface-2)); }
.row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-title { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { margin-top: 0; font-size: 12.5px; }
.row-side { gap: 10px; }
.row-chev { color: var(--ink-3); width: 16px; height: 16px; }
.date-tile {
  width: 52px; height: 56px; border-radius: var(--r-lg); flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line);
}
.date-tile .m { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.date-tile .d { font-size: 20px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.month-title { font-size: 15px; padding: 0 2px 10px; align-items: center; }
@media (max-width: 639px) {
  .row { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .row-side { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .row-chev { display: none; }
  .date-tile { width: 44px; height: 48px; }
  .date-tile .d { font-size: 17px; }
  .row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* month calendar: two-line cards (code + title) */
.cal-cell { min-height: 148px; gap: 4px; padding: 6px 6px 8px; }
.cal-chip {
  height: auto; flex-direction: column; align-items: stretch; gap: 1px;
  padding: 5px 7px 6px 8px; border-radius: 7px;
  border-left: 0; box-shadow: inset 3px 0 0 var(--tone-edge, var(--prod-dot));
  background: color-mix(in srgb, var(--tone-tint, var(--prod-bg)) 100%, var(--surface));
}
.cal-chip.t-prod, .cal-chip.t-plan, .cal-chip.t-hold { background: var(--surface-2); border: 1px solid var(--line); }
.cal-chip-top { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.cal-chip-top .ic { width: 12px; height: 12px; color: var(--ink-3); flex: none; }
.cal-chip-code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip-title { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip .fb { display: inline-flex; color: var(--review-dot); }
.cal-chip .fb .ic { width: 12px; height: 12px; color: var(--review-dot); }

/* week view: big tiles */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r-xl); background: var(--surface-2); border: 1px solid var(--line); min-height: 460px; }
.week-col.is-weekend { background: color-mix(in srgb, var(--surface-3) 55%, var(--surface-2)); }
.week-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 6px; }
.week-head .dow { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.week-num { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.week-col.is-today .week-num { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; border-radius: 999px; background: var(--ink); color: var(--ink-inv); font-size: 17px; }
.week-count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.week-items { display: flex; flex-direction: column; gap: 8px; }
.week-empty { font-size: 12.5px; color: var(--ink-3); padding: 8px 4px; }
.week-tile {
  display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%;
  padding: 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: inset 0 3px 0 var(--tone-edge, var(--prod-dot)), var(--shadow-1);
  transition: box-shadow 120ms ease, transform 120ms ease, border-color 120ms ease;
}
.week-tile:hover { transform: translateY(-1px); border-color: var(--line-2); box-shadow: inset 0 3px 0 var(--tone-edge, var(--prod-dot)), var(--shadow-2); }
.week-tile.t-ok, .week-tile.t-review { background: color-mix(in srgb, var(--tone-tint) 70%, var(--surface)); }
.wt-top { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); min-width: 0; }
.wt-top .ic { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.wt-code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-top .fb { color: var(--review-dot); display: inline-flex; }
.wt-title { font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wt-time { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); }
.wt-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.wt-foot .pill { font-size: 11.5px; height: 20px; padding: 0 7px; }
.wt-cta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--review-fg); }
@media (max-width: 1100px) {
  .week { grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
}

/* agenda (phone) uses the same rows */
.agenda-items .row { grid-template-columns: minmax(0, 1fr) auto; }

/* toolbar: two rows (period + view, then search + filters + legend) */
.toolbar { row-gap: 10px; padding: 12px 0; }
.toolbar-row2 { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-row2 .search { max-width: 340px; }
.period-label { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin-left: 8px; }
.seg-lg .seg-btn { height: 30px; padding: 0 12px; font-size: 13px; }
.legend-inline { margin-left: auto; display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline .dot { width: 8px; height: 8px; }
@media (max-width: 1023px) { .legend-inline { display: none; } }
@media (max-width: 767px) {
  .toolbar-row2 .search { max-width: none; flex: 1 1 100%; }
  .toolbar-row2 .toolbar-filters { flex: 1 1 100%; }
}

/* client header */
.client-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.stat { min-width: 168px; padding: 12px 16px; gap: 4px; }
.stat-value { font-size: 26px; }
.stat-review { border-color: var(--review-line); background: color-mix(in srgb, var(--review-bg) 60%, var(--surface)); }
.stat-review:hover { background: var(--review-bg) !important; }

/* review strip - bigger, thicker cards */
.review-strip { padding: 16px; }
.review-strip-title { font-size: 15px; }
.review-card { flex: 1 0 240px; max-width: 340px; gap: 8px; padding: 14px; background: var(--surface); border-color: var(--review-line); box-shadow: inset 0 3px 0 var(--review-dot); }
.review-card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.review-cta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--review-fg); }

/* detail sheet header */
.detail-head { padding: 22px 64px 18px 24px; box-shadow: inset 0 3px 0 var(--tone-edge, transparent); }
.detail-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.detail-title { margin-top: 8px; font-size: 22px; }
.detail-when { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.detail-when .ic { color: var(--ink-3); }

/* asset & link slots - same order, same alignment, every post */
.link-row { padding: 12px; gap: 12px; }
.link-glyph { width: 36px; height: 36px; border-radius: var(--r-md); flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ink-2); }
.link-row-text { display: flex; flex-direction: column; gap: 1px; }
.link-row-title { font-size: 14px; font-weight: 600; }
.link-open { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 10px; border-radius: var(--r-md); font-size: 12.5px; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); }
.link-row.is-primary .link-glyph { background: var(--surface); color: var(--review-fg); }
.link-row.is-primary .link-open { background: var(--ink); color: var(--ink-inv); border-color: var(--ink); }
.link-row.is-disabled .link-glyph { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-3); }
.link-row.is-disabled .link-row-title { color: var(--ink-2); font-weight: 500; }

/* approval decision + state banners (sheet footer) */
.decision { flex-direction: column; align-items: stretch; gap: 10px; }
.decision-hint { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.decision-hint .ic { color: var(--ink-3); }
.decision-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.decision-buttons .btn { height: 44px; font-size: 14px; font-weight: 600; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-lg); }
.banner.is-ok { background: var(--ok-bg); color: var(--ok-fg); }
.banner.is-info { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.banner-icon { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); }
.banner.is-ok .banner-icon { background: var(--ok-dot); color: #fff; }
.banner-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.banner-title { font-weight: 600; font-size: 14px; color: inherit; }
.banner-sub { font-size: 12.5px; opacity: 0.85; }
.banner .btn { color: inherit; }
.request-changes-form .row-actions .btn { height: 36px; }

/* files */
.file-group { margin-bottom: 24px; }
.group-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 2px 10px; }
.file-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) { .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.file-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
a.file-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.file-card.is-disabled { border-style: dashed; box-shadow: none; background: var(--surface-2); }
.file-glyph { width: 40px; height: 40px; border-radius: var(--r-md); flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ink-2); }
.file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: 12.5px; color: var(--ink-3); }
.file-open { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.team-check { margin-bottom: 24px; padding: 16px; border-radius: var(--r-xl); border: 1px dashed var(--line-2); background: var(--surface); }
.team-check-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.team-check-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.check-row { display: grid; grid-template-columns: 20px 190px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 2px; border-top: 1px solid var(--line); font-size: 13px; }
.check-row:first-child { border-top: 0; }
.check-row .ic { margin-top: 1px; }
.check-row.is-shared .ic { color: var(--ok-dot); }
.check-row.is-pending .ic { color: var(--review-dot); }
.check-row.is-missing .ic { color: var(--ink-3); }
.check-label { font-weight: 500; }
.check-note { color: var(--ink-3); }
@media (max-width: 639px) { .check-row { grid-template-columns: 20px minmax(0, 1fr); } .check-note { grid-column: 2; } }

/* reports */
.report-feature { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: center; padding: 20px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.report-feature-art { height: 120px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 16px 18px; }
.report-feature-art span { width: 18px; border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--accent) 70%, var(--surface)); }
.report-feature-art span:nth-child(4) { background: var(--accent); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.report-feature-title { font-family: var(--font-display); font-weight: 600; font-size: 28px; letter-spacing: -0.02em; margin-top: 4px; }
.report-feature-sub { color: var(--ink-2); margin-top: 4px; }
.report-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.list-item .list-item-title, .list-item .list-item-sub { display: block; }
.list-actions { display: inline-flex; align-items: center; gap: 4px; }
.upcoming { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.upcoming-title { font-weight: 600; margin-bottom: 2px; }
.report-panel-actions { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 639px) { .report-feature { grid-template-columns: minmax(0, 1fr); } .report-feature-art { height: 84px; } }

/* login: show / hide password */
.password-field { position: relative; }
.password-field .input { padding-right: 44px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.password-toggle:hover { color: var(--ink); }
.seg-lg .seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--ink-inv); box-shadow: none; }
[data-theme="dark"] .seg-lg .seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--ink-inv); }
/* keep the decision bar at the very bottom of the panel even for short posts */
.sheet-body-wrap { display: flex; flex-direction: column; }
#itemModalBody { flex: 1 0 auto; min-height: 0; }
.item-detail { flex: 1 0 auto; min-height: 0; }

/* =====================================================================
 * v6.2 - stickers + Approved vs Posted (client feedback 2026-10)
 *   Needs approval = amber · In review = violet (with the team)
 *   Approved = fresh green · Posted = deeper teal-green
 * Approved and Posted each highlight the WHOLE card, in their own shade.
 * ===================================================================== */
:root {
  --approved-bg: #E6F6EC; --approved-fg: #0F6B39; --approved-dot: #1FA35A; --approved-line: #B9E3C9;
  --posted-bg:   #E1F2F0; --posted-fg:   #0A5C55; --posted-dot:   #0E8A7D; --posted-line:   #AFD9D3;
  --inreview-bg: #EFEBFC; --inreview-fg: #4B37A8; --inreview-dot: #6E56CF;
}
[data-theme="dark"] {
  --approved-bg: rgba(31, 163, 90, 0.16); --approved-fg: #74D9A0; --approved-dot: #36C175; --approved-line: rgba(54, 193, 117, 0.32);
  --posted-bg:   rgba(20, 168, 152, 0.16); --posted-fg:   #6FD8CB; --posted-dot:   #24B3A3; --posted-line:   rgba(36, 179, 163, 0.32);
  --inreview-bg: rgba(155, 135, 245, 0.16); --inreview-fg: #B9A9FF; --inreview-dot: #9B87F5;
}

.t-approved { --tone-edge: var(--approved-dot); --tone-tint: var(--approved-bg); --tone-line: var(--approved-line); }
.t-posted   { --tone-edge: var(--posted-dot);   --tone-tint: var(--posted-bg);   --tone-line: var(--posted-line); }
.t-review   { --tone-line: var(--review-line); }

.pill.t-approved { background: var(--approved-bg); color: var(--approved-fg); }
.pill.t-approved::before { background: var(--approved-dot); }
.pill.t-posted { background: var(--posted-bg); color: var(--posted-fg); }
.pill.t-posted::before { background: var(--posted-dot); }
.dot.t-approved { background: var(--approved-dot); }
.dot.t-posted { background: var(--posted-dot); }

/* full-card highlight: list rows, month cards, week tiles */
.row.t-approved, .row.t-posted, .row.t-review { background: color-mix(in srgb, var(--tone-tint) 85%, var(--surface)); }
.row.t-approved:hover, .row.t-posted:hover, .row.t-review:hover { background: var(--tone-tint); }
.cal-chip.t-approved, .cal-chip.t-posted { background: var(--tone-tint); border: 1px solid var(--tone-line); }
.cal-chip.t-review { border: 1px solid var(--review-line); }
.week-tile.t-approved, .week-tile.t-posted, .week-tile.t-review { background: var(--tone-tint); border-color: var(--tone-line); }
.detail-head.t-approved, .detail-head.t-posted { background: color-mix(in srgb, var(--tone-tint) 60%, var(--surface)); }

/* stickers - filled, small, unmistakable */
.sticker {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  height: 24px; padding: 0 9px 0 7px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.18);
}
.sticker .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.s-needs { background: var(--review-dot); }
.s-inreview { background: var(--inreview-dot); }
.s-approved { background: var(--approved-dot); }
.s-posted { background: var(--posted-dot); }
[data-theme="dark"] .sticker { color: #0B0D10; }

/* the "pop-up": stickers break out of the card's top-right corner */
.cal-chip, .week-tile { position: relative; }
.corner-sticker {
  position: absolute; top: -8px; right: 6px; z-index: 2;
  display: inline-flex; align-items: center; gap: 3px;
  height: 17px; padding: 0 6px 0 5px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: #fff;
  box-shadow: 0 2px 6px -1px rgba(16, 24, 40, 0.28);
  pointer-events: none;
}
.corner-sticker .ic { width: 10px; height: 10px; stroke-width: 2.6; }
[data-theme="dark"] .corner-sticker { color: #0B0D10; }
.cal-chip.has-sticker { margin-top: 8px; padding-top: 8px; }
.week-tile .corner-sticker { top: -9px; right: 10px; height: 19px; font-size: 10px; padding: 0 7px 0 6px; }
.week-tile.has-sticker { margin-top: 6px; }
.cal-cell .cal-num + .cal-chip.has-sticker { margin-top: 6px; }

/* header stat for approved & posted picks up both shades */
.stat-done:hover { background: color-mix(in srgb, var(--approved-bg) 50%, var(--surface)) !important; }
/* Posted: pushed toward teal-blue so a posted row/card is distinguishable from an approved one at a glance */
:root { --posted-bg: #DFEFF3; --posted-fg: #075A63; --posted-dot: #0B7F8A; --posted-line: #A7D3DB; }
[data-theme="dark"] { --posted-bg: rgba(42, 179, 196, 0.16); --posted-fg: #7FD6E2; --posted-dot: #2DB3C4; --posted-line: rgba(45, 179, 196, 0.34); }
