@import url("https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&family=Lora:wght@400;500&display=swap");

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --radius: 0.5rem; --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 12px;
  --background: hsl(0 0% 99%); --foreground: hsl(0 0% 3.9%);
  --card: hsl(0 0% 100%);      --card-foreground: hsl(0 0% 3.9%);
  --popover: hsl(0 0% 100%);   --popover-foreground: hsl(0 0% 3.9%);
  --primary: oklch(0.21 0.006 285.885); --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.967 0.001 286.375); --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: hsl(210 40% 96.1%); --muted-foreground: hsl(215.4 16.3% 46.9%);
  --accent: oklch(0.967 0.001 286.375); --accent-foreground: oklch(0.21 0.006 285.885);
  --destructive: oklch(0.577 0.245 27.325);
  --border: hsl(220 13% 91%); --input: hsl(220 13% 91%);
  --ring: oklch(0.705 0.015 286.067);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0/.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0/.08), 0 1px 2px -1px rgb(0 0 0/.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0/.1), 0 2px 4px -2px rgb(0 0 0/.1);
  --shadow-lg: 0 10px 22px -3px rgb(0 0 0/.13), 0 4px 6px -4px rgb(0 0 0/.08);

  /* Sidebar — light */
  --sidebar:        hsl(220 14% 97.5%);
  --sidebar-border: hsl(220 13% 88%);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-serif: "Lora", "Georgia", serif;
}

*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans); color: var(--foreground); background: var(--background);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11","ss01";
  font-size: 14px; line-height: 1.5;
}
p, ul, ol { margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.ck-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap; height: 36px; padding: 0 14px; border-radius: var(--radius-md);
  font: inherit; font-size: 13.5px; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
  text-decoration: none; vertical-align: middle;
}
.ck-btn img { width: 14px; height: 14px; flex-shrink: 0; pointer-events: none; }
.ck-btn--default   { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-xs); }
.ck-btn--default:hover:not(:disabled) { opacity: .9; }
.ck-btn--default img { filter: invert(1); }
.ck-btn--secondary { background: var(--secondary); color: var(--secondary-foreground); box-shadow: var(--shadow-xs); }
.ck-btn--secondary:hover:not(:disabled) { background: hsl(220 13% 92%); }
.ck-btn--outline   { background: var(--background); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-xs); }
.ck-btn--outline:hover:not(:disabled) { background: hsl(220 14% 96%); }
.ck-btn--ghost     { background: transparent; color: var(--foreground); }
.ck-btn--ghost:hover:not(:disabled) { background: hsl(220 14% 95%); }
.ck-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ck-btn--sm  { height: 30px; padding: 0 10px; gap: 5px; font-size: 12.5px; }
.ck-btn--sm img { width: 12px; height: 12px; }
.ck-btn--icon { width: 32px; padding: 0 !important; }

/* Inline action-button badge (e.g. "Review extracted checklist · 3 unreviewed") */
.wts-btn-badge {
  margin-left: 2px; padding: 1px 7px; border-radius: 4px;
  background: rgba(255,255,255,0.18); color: #fff;
  font-size: 11px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Icon-only button (transparent square) */
.wts-icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 5px; border: 0; background: transparent;
  cursor: pointer; transition: background 120ms ease;
  flex-shrink: 0;
}
.wts-icon-btn:hover { background: hsl(220 14% 94%); }

/* ── Badge ─────────────────────────────────────────────────────────────── */
.ck-badge {
  display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-md);
  padding: 2px 7px; font-size: 11.5px; font-weight: 500; border: 1px solid transparent;
  white-space: nowrap; line-height: 1.5;
}
.ck-badge--default     { background: var(--primary); color: var(--primary-foreground); }
.ck-badge--secondary   { background: var(--secondary); color: var(--secondary-foreground); }
.ck-badge--outline     { color: var(--muted-foreground); border-color: var(--border); background: transparent; }
.ck-badge--destructive { background: var(--destructive); color: #fff; }
.wts-badge-success { background: hsl(142 50% 94%); color: hsl(142 55% 26%); }
.wts-badge-amber   { background: hsl(38 95% 93%);  color: hsl(28 90% 32%); }

/* ── Card ──────────────────────────────────────────────────────────────── */
.ck-card {
  background: var(--card); color: var(--card-foreground); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 20px; padding: 22px 0;
}
.ck-card__header  { padding: 0 22px; display: flex; flex-direction: column; gap: 3px; }
.ck-card__title   { font-size: 13.5px; font-weight: 600; line-height: 1; letter-spacing: -0.005em; }
.ck-card__desc    { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.4; }
.ck-card__content { padding: 0 22px; }

/* ── KPI grid ──────────────────────────────────────────────────────────── */
.ck-kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.ck-kpi-grid .ck-card { padding: 18px 0; gap: 10px; }
.ck-kpi-grid .ck-card__header { padding: 0 18px; gap: 2px; }
.ck-kpi-grid .ck-card__content { padding: 0 18px; }
.ck-kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ── Page scaffold ─────────────────────────────────────────────────────── */
.ck-page { display: flex; flex-direction: column; gap: 18px; }
.ck-page__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ck-page__title  { font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.ck-muted { color: var(--muted-foreground); font-size: 13.5px; }

/* ── Table ─────────────────────────────────────────────────────────────── */
.ck-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ck-table thead tr { border-bottom: 1px solid var(--border); }
.ck-table th {
  text-align: left; padding: 11px 16px; height: 40px;
  font-weight: 500; font-size: 10.5px; color: var(--muted-foreground);
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.06em;
  background: hsl(220 14% 98%);
}
.ck-table thead { position: sticky; top: 0; z-index: 2; }
.ck-table tbody tr { border-top: 1px solid var(--border); transition: background 120ms ease; }
.ck-table tbody tr:first-child { border-top: 0; }
.ck-table td { padding: 13px 16px; vertical-align: middle; }

/* ── WTS Shell ─────────────────────────────────────────────────────────── */
.wts-shell { display: grid; grid-template-columns: 240px 1fr; height: 100vh; overflow: hidden; }
.wts-main  { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.wts-content { flex: 1; overflow-y: auto; background: var(--background); }
.wts-content-inner { max-width: 1280px; margin: 0 auto; padding: 28px 32px 56px; }

/* ── Sidebar (LIGHT) ───────────────────────────────────────────────────── */
.wts-sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
}
.wts-sidebar__brand {
  display: flex; align-items: center; gap: 11px; padding: 18px 16px 14px;
  flex-shrink: 0;
}
.wts-sidebar__logo {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(135deg, hsl(213 80% 38%), hsl(213 70% 28%));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13.5px;
  flex-shrink: 0; letter-spacing: -0.02em; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}
.wts-sidebar__brand-name { font-size: 13px; font-weight: 600; color: var(--foreground); letter-spacing: -0.015em; line-height: 1.2; white-space: nowrap; }
.wts-sidebar__brand-sub  { font-size: 11px; color: hsl(220 9% 52%); margin-top: 2px; white-space: nowrap; }

.wts-sidebar__nav { display: flex; flex-direction: column; padding: 4px 10px; flex: 1; overflow-y: auto; }
.wts-sidebar__section { margin-bottom: 4px; }
.wts-sidebar__group-label {
  padding: 14px 9px 4px; font-size: 10px; font-weight: 600; color: hsl(220 9% 58%);
  text-transform: uppercase; letter-spacing: 0.08em;
}

.wts-sidebar__item {
  position: relative;
  display: flex; align-items: center; gap: 9px; padding: 0 9px; height: 32px;
  border-radius: 6px; border: 0; background: transparent;
  color: hsl(220 9% 32%);
  font-family: inherit; font-size: 13px; text-align: left; cursor: pointer; width: 100%;
  transition: background 120ms ease, color 120ms ease;
  margin-bottom: 1px;
}
.wts-sidebar__item:hover { background: hsl(220 14% 93%); color: hsl(220 9% 18%); }
.wts-sidebar__item[data-active="true"] {
  background: hsl(0 0% 100%);
  color: hsl(220 9% 12%); font-weight: 500;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 0 0 1px hsl(220 13% 89%);
}
.wts-sidebar__item-rail {
  position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: background 120ms ease;
}
.wts-sidebar__item[data-active="true"] .wts-sidebar__item-rail {
  background: hsl(213 80% 45%);
}
.wts-sidebar__item-icon { display: grid; place-items: center; width: 16px; flex-shrink: 0; }
.wts-sidebar__item-icon img { opacity: 0.6; }
.wts-sidebar__item:hover .wts-sidebar__item-icon img { opacity: 0.85; }
.wts-sidebar__item[data-active="true"] .wts-sidebar__item-icon img { opacity: 1; }

/* Sidebar user chip */
.wts-sidebar__user-wrap { flex-shrink: 0; padding: 10px; position: relative; }
.wts-sidebar__user {
  display: flex; align-items: center; gap: 10px; padding: 8px 9px;
  border-radius: 8px; border: 1px solid var(--border);
  background: hsl(0 0% 100%); color: inherit;
  width: 100%; text-align: left; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  box-shadow: var(--shadow-xs);
}
.wts-sidebar__user:hover { border-color: hsl(220 13% 82%); }
.wts-sidebar__user-name  { font-size: 12.5px; font-weight: 500; color: var(--foreground); line-height: 1.2; }
.wts-sidebar__user-email {
  font-size: 10.5px; color: var(--muted-foreground); line-height: 1.2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100px; margin-top: 1px;
}

.wts-sidebar__dropdown {
  position: absolute; bottom: calc(100% - 4px); left: 10px; right: 10px;
  background: var(--popover); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-md); padding: 6px; z-index: 60;
}
.wts-sidebar__dropdown-header { padding: 8px 10px 8px; }
.wts-sidebar__dropdown-divider { height: 1px; background: var(--border); margin: 0 2px 4px; }
.wts-sidebar__dropdown-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px;
  border-radius: 5px; border: 0; background: transparent; color: var(--foreground);
  font-family: inherit; font-size: 13px; text-align: left; cursor: pointer;
  transition: background 120ms ease;
}
.wts-sidebar__dropdown-item:hover { background: hsl(220 14% 95%); }

/* ── Header ────────────────────────────────────────────────────────────── */
.wts-header {
  height: 52px; flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 0 28px; border-bottom: 1px solid var(--border); background: var(--background);
}
.wts-header__breadcrumb { display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: wrap; }
.wts-header__crumb-parent  {
  font-size: 12.5px; color: var(--muted-foreground); background: transparent;
  border: 0; padding: 4px 6px; border-radius: 4px;
  font-family: inherit; transition: background 120ms ease, color 120ms ease;
}
.wts-header__crumb-parent:not([disabled]):hover { background: hsl(220 14% 95%); color: var(--foreground); cursor: pointer; }
.wts-header__crumb-current { font-size: 12.5px; font-weight: 500; color: var(--foreground); padding: 4px 6px; white-space: nowrap; }
.wts-header__crumb-parent  { white-space: nowrap; }

/* Role switcher */
.wts-role-switcher {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--background);
  font: inherit; font-size: 12.5px; color: var(--foreground); cursor: pointer;
  box-shadow: var(--shadow-xs); transition: background 150ms ease;
}
.wts-role-switcher:hover { background: hsl(220 14% 96%); }
.wts-role-dot { width: 6px; height: 6px; border-radius: 50%; background: hsl(142 60% 45%); flex-shrink: 0; box-shadow: 0 0 0 3px hsl(142 60% 45% / 0.15); }

.wts-dropdown {
  position: absolute; background: var(--popover); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 4px; z-index: 50;
}
.wts-dropdown__label {
  font-size: 10.5px; font-weight: 600; color: var(--muted-foreground);
  padding: 6px 10px 4px; text-transform: uppercase; letter-spacing: 0.07em;
}
.wts-dropdown__item {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 10px;
  border-radius: 5px; border: 0; background: transparent; color: var(--foreground);
  font-family: inherit; font-size: 13px; text-align: left; cursor: pointer;
  transition: background 120ms ease;
}
.wts-dropdown__item:hover { background: hsl(220 14% 95%); }
.wts-dropdown__item--active { font-weight: 500; }
.wts-dropdown__item--danger { color: var(--destructive); }
.wts-dropdown__item--danger:hover { background: hsl(0 85% 96%); }

/* ── Activity feed (Overview) ──────────────────────────────────────────── */
.wts-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.wts-activity-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 22px; border-top: 1px solid var(--border);
  transition: background 120ms ease;
}
.wts-activity-item:first-child { border-top: 0; padding-top: 0; }
.wts-activity-item:last-child  { padding-bottom: 0; }
.wts-activity-item:hover { background: hsl(220 14% 97%); }
.wts-activity-icon {
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  flex-shrink: 0; margin-top: 1px;
}
.wts-activity-icon img { width: 13px; height: 13px; }

/* Inline link */
.wts-link {
  border: 0; background: transparent; padding: 0; color: var(--foreground);
  font: inherit; font-weight: 500; cursor: pointer; text-underline-offset: 2px;
}
.wts-link:hover { text-decoration: underline; }
.wts-link--button { color: hsl(213 80% 42%); }

/* ── Attention items (Overview) ────────────────────────────────────────── */
.wts-attention-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px; border-top: 1px solid var(--border);
  transition: background 120ms ease;
}
.wts-attention-item:first-child { border-top: 0; padding-top: 0; }
.wts-attention-item:last-child  { padding-bottom: 0; }
.wts-attention-item:hover { background: hsl(220 14% 97%); }
.wts-tag { font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.wts-tag--overdue { background: hsl(0 85% 95%);  color: hsl(0 72% 40%); }
.wts-tag--stale   { background: hsl(38 90% 93%); color: hsl(32 90% 36%); }

/* ── Toasts ────────────────────────────────────────────────────────────── */
.wts-toasts {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column-reverse; gap: 10px; z-index: 1000;
  pointer-events: none;
}
.wts-toast {
  display: flex; align-items: center; gap: 11px;
  background: hsl(0 0% 10%); color: #fff;
  padding: 11px 14px; border-radius: 8px;
  box-shadow: 0 14px 28px rgb(0 0 0 / 0.18), 0 4px 8px rgb(0 0 0 / 0.12);
  font-size: 13px; min-width: 240px; max-width: 360px;
  animation: wts-toast-in 200ms ease-out;
  pointer-events: auto;
}
.wts-toast__icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
}
.wts-toast--success .wts-toast__icon { background: hsl(142 60% 45%); }
.wts-toast--info    .wts-toast__icon { background: hsl(213 70% 50%); }
.wts-toast--error   .wts-toast__icon { background: hsl(0 72% 50%); }
.wts-toast__icon img { filter: invert(1); }
.wts-toast__title { font-weight: 500; line-height: 1.3; }
.wts-toast__desc  { font-size: 11.5px; color: hsl(0 0% 75%); margin-top: 2px; line-height: 1.4; }
@keyframes wts-toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Filter row ────────────────────────────────────────────────────────── */
.wts-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.wts-segmented {
  display: inline-flex; background: hsl(220 14% 96%);
  border: 1px solid var(--border); border-radius: 7px; padding: 3px;
}
.wts-segmented__item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; height: 26px; border-radius: 4px;
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--muted-foreground);
  font-weight: 500; transition: background 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.wts-segmented__item:hover { color: var(--foreground); }
.wts-segmented__item[data-active="true"] {
  background: var(--card); color: var(--foreground);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}
.wts-segmented__count {
  font-size: 10.5px; padding: 0 5px; border-radius: 999px;
  background: hsl(220 13% 88%); color: hsl(220 9% 32%);
  font-variant-numeric: tabular-nums;
}
.wts-segmented__item[data-active="true"] .wts-segmented__count { background: hsl(220 13% 92%); color: hsl(220 9% 22%); }

.wts-search-wrap, .wts-select-wrap {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--background);
  box-shadow: var(--shadow-xs);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.wts-search-wrap { width: 240px; }
.wts-search-wrap:focus-within, .wts-select-wrap:focus-within { border-color: hsl(220 13% 70%); }
.wts-search {
  flex: 1; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 13px; color: inherit;
}
.wts-select {
  border: 0; outline: none; background: transparent;
  font: inherit; font-size: 13px; color: inherit;
  appearance: none; padding-right: 4px; cursor: pointer; min-width: 110px;
}

/* ── Empty state ───────────────────────────────────────────────────────── */
.wts-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 56px 24px; gap: 10px;
}
.wts-empty__icon {
  width: 44px; height: 44px; border-radius: 12px; background: hsl(220 14% 96%);
  display: grid; place-items: center;
}
.wts-empty__title { font-size: 14px; font-weight: 500; color: var(--foreground); }
.wts-empty__sub   { font-size: 12.5px; color: var(--muted-foreground); max-width: 360px; line-height: 1.45; }

/* ── Engagements table ─────────────────────────────────────────────────── */
.wts-row-clickable { cursor: pointer; }
.wts-row-clickable:hover { background: hsl(220 14% 98%); }
.wts-row-chevron { opacity: 0.2; transition: opacity 120ms ease, transform 120ms ease; }
.wts-row-clickable:hover .wts-row-chevron { opacity: 0.7; transform: translateX(2px); }

/* ── Engagement header ─────────────────────────────────────────────────── */
.wts-eng-header {
  display: flex; flex-direction: column; gap: 24px;
  padding-bottom: 8px;
}
.wts-eng-header__top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.wts-eng-header__top > div:first-child { min-width: 0; flex: 1; }
.wts-eng-header__title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wts-eng-header__client { font-size: 14px; color: var(--muted-foreground); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wts-fwd {
  display: inline-flex; align-items: center; gap: 8px;
  background: hsl(220 14% 96%); border: 1px solid var(--border);
  border-radius: 7px; padding: 5px 9px 5px 10px; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  font: inherit;
}
.wts-fwd:hover { background: hsl(220 14% 93%); border-color: hsl(220 13% 80%); }
.wts-fwd__addr { font-family: var(--font-mono); font-size: 11.5px; color: var(--foreground); letter-spacing: -0.01em; white-space: nowrap; }
.wts-fwd { white-space: nowrap; }
.wts-fwd__divider { width: 1px; height: 14px; background: var(--border); margin: 0 2px; }
.wts-fwd__label { font-size: 11.5px; color: var(--muted-foreground); }

.wts-metric-row {
  display: flex; align-items: stretch; gap: 0;
  padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.wts-metric { padding: 0 28px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; border-right: 1px solid var(--border); }
.wts-metric:first-child { padding-left: 0; }
.wts-metric:last-child  { padding-right: 0; border-right: 0; }
.wts-metric__label { font-size: 10.5px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.07em; }
.wts-metric__value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.wts-metric__value-sm { font-size: 14px; font-weight: 500; line-height: 1.35; margin-top: 2px; }
.wts-metric__sub { font-size: 11.5px; color: var(--muted-foreground); }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.wts-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding-bottom: 0; margin-bottom: 4px;
}
.wts-tab {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; padding: 10px 14px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.wts-tab:hover { color: var(--foreground); }
.wts-tab[data-active="true"] { color: var(--foreground); border-bottom-color: hsl(213 80% 45%); }

/* ── Asks table ────────────────────────────────────────────────────────── */
.wts-asks-table td { padding: 12px 16px; }
.wts-mini-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 500; padding: 1px 6px;
  border-radius: 4px;
}
.wts-mini-tag--amber { background: hsl(38 95% 93%); color: hsl(28 90% 32%); }
.wts-attach-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--muted-foreground); padding: 2px 6px;
  border-radius: 4px; background: hsl(220 14% 96%); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.wts-attach-chip--lg { font-size: 12px; padding: 3px 8px; }
.wts-source-link {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12.5px; color: hsl(213 80% 42%); cursor: pointer;
  text-decoration: none; padding: 2px 0; white-space: nowrap;
}
.wts-source-link:hover { text-decoration: underline; }

.wts-add-manual {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px dashed var(--border); background: transparent;
  padding: 7px 14px; border-radius: 7px;
  font-family: inherit; font-size: 12.5px; color: var(--muted-foreground);
  cursor: pointer; transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.wts-add-manual:hover { background: hsl(220 14% 96%); border-color: hsl(220 13% 78%); color: var(--foreground); }
.wts-add-manual--review { align-self: center; padding: 9px 18px; font-size: 13px; }

/* ── Email log ─────────────────────────────────────────────────────────── */
.wts-email-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 16px 18px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column;
}
.wts-email-card__top {
  display: flex; align-items: flex-start; gap: 11px; padding-bottom: 10px;
  border-bottom: 1px solid hsl(220 14% 95%); margin-bottom: 10px;
}
.wts-dir-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px;
}
.wts-dir-dot--in  { background: hsl(213 80% 50%); box-shadow: 0 0 0 3px hsl(213 80% 50% / 0.15); }
.wts-dir-dot--out { background: hsl(220 9% 55%);  box-shadow: 0 0 0 3px hsl(220 9% 55% / 0.15); }
.wts-email-card__subject { font-size: 14px; font-weight: 600; color: var(--foreground); margin-bottom: 6px; line-height: 1.35; }
.wts-email-card__body    { font-size: 13px; color: hsl(220 9% 32%); line-height: 1.55; }
.wts-email-card__footer  {
  display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; margin-top: 12px;
  border-top: 1px solid hsl(220 14% 95%);
}
.wts-link-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 11.5px; font-weight: 500;
  border: 0; padding: 3px 8px; border-radius: 4px; cursor: pointer;
  background: hsl(220 14% 96%); color: hsl(220 9% 32%);
  transition: background 120ms ease;
  white-space: nowrap;
}
.wts-link-tag:hover { background: hsl(220 14% 92%); }
.wts-link-tag--success { background: hsl(142 50% 94%); color: hsl(142 55% 28%); }
.wts-link-tag--success:hover { background: hsl(142 50% 90%); }

/* ── Reply draft cards ─────────────────────────────────────────────────── */
.wts-draft__header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px 16px; border-bottom: 1px solid hsl(220 14% 95%);
}
.wts-draft__subject {
  padding: 14px 22px 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
.wts-draft__body {
  margin: 12px 22px 0; padding: 14px 16px;
  font-family: var(--font-serif); font-size: 14px;
  background: hsl(220 14% 98%); border-left: 2px solid hsl(220 13% 80%);
  border-radius: 4px; line-height: 1.65;
  white-space: pre-wrap; color: hsl(0 0% 15%);
}
.wts-draft__footer { display: flex; gap: 8px; align-items: center; padding: 16px 22px 20px; }

/* ── Form / fields ─────────────────────────────────────────────────────── */
.wts-form    { display: flex; flex-direction: column; gap: 18px; max-width: 580px; }
.wts-field   { display: flex; flex-direction: column; }
.wts-label   { font-size: 13px; font-weight: 500; line-height: 1; display: block; margin-bottom: 7px; color: var(--foreground); }
.wts-input {
  display: flex; align-items: center;
  height: 34px; width: 100%; padding: 4px 11px;
  border: 1px solid var(--input); background: var(--card);
  border-radius: 6px; font: inherit; font-size: 13px; color: var(--foreground);
  box-shadow: var(--shadow-xs); outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  font-family: inherit;
}
.wts-input:focus { border-color: hsl(213 80% 55%); box-shadow: 0 0 0 3px hsl(213 80% 55% / 0.18); }
textarea.wts-input { font-family: inherit; }
.wts-chip-assigned {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 4px; background: hsl(220 14% 96%);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 12.5px;
}
.wts-chip-x {
  display: inline-grid; place-items: center; width: 16px; height: 16px;
  border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  color: var(--muted-foreground);
}
.wts-chip-x:hover { background: hsl(220 14% 88%); color: var(--foreground); }

/* Switch */
.wts-switch {
  display: inline-block; width: 36px; height: 20px; border-radius: 999px;
  background: hsl(220 13% 80%); position: relative; cursor: pointer;
  transition: background 150ms ease;
}
.wts-switch__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 150ms ease;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
}
.wts-switch--on { background: hsl(213 80% 45%); }
.wts-switch--on .wts-switch__thumb { transform: translateX(16px); }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.wts-modal-overlay {
  position: fixed; inset: 0; background: rgb(15 23 42 / 0.45);
  z-index: 800; display: grid; place-items: center;
  animation: wts-fade-in 160ms ease-out;
}
.wts-modal {
  width: 100%; background: var(--card); border-radius: 12px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: wts-modal-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column; max-height: 88vh;
}
.wts-modal__header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.wts-modal__body   { padding: 18px 20px; overflow-y: auto; }
.wts-modal__footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
@keyframes wts-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wts-modal-in {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* ── Drawer (right-side slide-in) ──────────────────────────────────────── */
.wts-drawer-overlay {
  position: fixed; inset: 0; background: rgb(15 23 42 / 0.30);
  z-index: 700; opacity: 0; pointer-events: none;
  transition: opacity 220ms ease;
}
.wts-drawer-overlay--open { opacity: 1; pointer-events: auto; }
.wts-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  background: var(--card); z-index: 750;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 24px rgb(0 0 0 / 0.12);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
}
.wts-drawer--open { transform: translateX(0); }

/* ── Ask side panel (inside drawer) ────────────────────────────────────── */
.wts-panel { display: flex; flex-direction: column; height: 100%; }
.wts-panel__header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wts-panel__body { flex: 1; overflow-y: auto; padding: 22px 22px 18px; }
.wts-panel__title {
  font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--foreground);
  letter-spacing: -0.015em; background: transparent; border: 0; padding: 0;
  text-align: left; cursor: pointer; font-family: inherit; width: 100%;
  display: flex; align-items: flex-start; gap: 8px;
}
.wts-panel__title:hover .wts-panel__title-edit { opacity: 0.9; }
.wts-panel__title-edit { margin-top: 6px; flex-shrink: 0; transition: opacity 120ms ease; }

.wts-panel__section { margin-top: 22px; }
.wts-panel__section-label {
  font-size: 10.5px; font-weight: 600; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px;
}

.wts-source-email {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; background: hsl(220 14% 98%);
}
.wts-quote {
  font-family: var(--font-serif); font-style: italic; font-size: 13px;
  color: hsl(0 0% 30%); line-height: 1.55; padding: 6px 0 6px 10px;
  border-left: 2px solid hsl(220 13% 80%);
}
.wts-quote--review { font-size: 13.5px; margin-top: 8px; }

.wts-timeline { display: flex; flex-direction: column; gap: 10px; }
.wts-timeline__item { display: flex; align-items: flex-start; gap: 10px; }
.wts-timeline__dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: hsl(220 14% 96%); border: 1px solid var(--border);
  display: grid; place-items: center; flex-shrink: 0;
}
.wts-response {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; background: var(--card);
}
.wts-confidence {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  padding: 1px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.wts-confidence--high { background: hsl(142 50% 94%); color: hsl(142 55% 26%); }

.wts-panel__footer {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 14px 18px; border-top: 1px solid var(--border);
  background: hsl(220 14% 98%); flex-shrink: 0;
}

/* ── Review screen ─────────────────────────────────────────────────────── */
.wts-review__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding-bottom: 4px;
}
.wts-review__progress { text-align: right; }

.wts-review-card { transition: opacity 220ms ease, transform 220ms ease; }
.wts-review-card--done { opacity: 0.62; }
.wts-review-card__top {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px 0;
}
.wts-review-card__body {
  padding: 12px 20px 16px;
}
.wts-review-card__title {
  width: 100%; text-align: left;
  font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--foreground);
  letter-spacing: -0.015em;
  background: transparent; border: 0; padding: 0; cursor: pointer; font-family: inherit;
  display: block;
}
.wts-review-card__title:hover { color: hsl(213 80% 35%); }
.wts-review-card--done .wts-review-card__title { cursor: default; }
.wts-review-card--done .wts-review-card__title:hover { color: inherit; }
.wts-review-card__source {
  font-size: 12.5px; color: var(--muted-foreground); margin-top: 6px; line-height: 1.55;
}
.wts-review-card__source em { font-style: italic; color: hsl(220 9% 38%); }
.wts-review-card__actions {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 12px 18px 16px; border-top: 1px solid var(--border);
  background: hsl(220 14% 98%); border-radius: 0 0 12px 12px;
}

/* ── TP: Studies list ─────────────────────────────────────────────────── */
.wts-ai-breakdown {
  display: flex; gap: 12px; align-items: center; font-size: 12px; color: hsl(0 0% 30%);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.wts-ai-breakdown span { display: inline-flex; align-items: center; gap: 5px; }
.wts-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.wts-dot--green { background: hsl(142 55% 42%); }
.wts-dot--red   { background: hsl(0 70% 50%); }
.wts-dot--amber { background: hsl(38 90% 50%); }

.wts-pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: hsl(38 90% 50%);
  flex-shrink: 0; box-shadow: 0 0 0 0 hsl(38 90% 50% / 0.7);
  animation: wts-pulse 1.6s infinite ease-out;
}
@keyframes wts-pulse {
  0%   { box-shadow: 0 0 0 0   hsl(38 90% 50% / 0.6); }
  70%  { box-shadow: 0 0 0 8px hsl(38 90% 50% / 0);   }
  100% { box-shadow: 0 0 0 0   hsl(38 90% 50% / 0);   }
}

.wts-spin { animation: wts-spin 0.9s linear infinite; }
@keyframes wts-spin { to { transform: rotate(360deg); } }

/* ── TP: New study form ───────────────────────────────────────────────── */
.wts-newstudy { position: relative; min-height: calc(100vh - 52px - 56px); }
.wts-newstudy__section {
  padding: 26px 0; border-top: 1px solid hsl(220 14% 93%);
}
.wts-newstudy__section:first-of-type { border-top: 0; padding-top: 24px; }
.wts-newstudy__footer {
  position: sticky; bottom: 0; left: 0; right: 0;
  background: var(--background); border-top: 1px solid var(--border);
  margin: 0 -32px; padding: 0 32px;
  box-shadow: 0 -4px 8px rgb(0 0 0 / 0.04);
  z-index: 10;
}

.wts-multi-chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 6px; border: 1px solid var(--input); border-radius: 6px;
  background: var(--card); min-height: 40px;
  box-shadow: var(--shadow-xs);
}

.wts-currency-input {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--input); border-radius: 6px;
  background: var(--card); height: 34px; box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.wts-currency-input__pre, .wts-currency-input__suf {
  display: inline-flex; align-items: center; padding: 0 10px;
  font-size: 12px; color: var(--muted-foreground);
  background: hsl(220 14% 97%); border-right: 1px solid var(--border);
  font-family: var(--font-mono); letter-spacing: -0.01em;
}
.wts-currency-input__suf { border-right: 0; border-left: 1px solid var(--border); }
.wts-currency-input__input {
  border: 0; outline: none; padding: 4px 10px;
  font: inherit; font-size: 13px; width: 64px; text-align: right;
  font-variant-numeric: tabular-nums; background: transparent; font-family: inherit;
}

.wts-radio-group { display: flex; flex-direction: column; gap: 7px; }
.wts-radio, .wts-check {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 13px; color: var(--foreground); line-height: 1.4;
}
.wts-radio input[type="radio"], .wts-check input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: hsl(213 80% 45%); margin: 0; cursor: pointer;
}

.wts-combobox-list {
  margin-top: -2px;
  border: 1px solid var(--border); border-radius: 0 0 6px 6px;
  background: var(--popover); box-shadow: var(--shadow-md);
  max-height: 240px; overflow-y: auto; z-index: 30;
}
.wts-combobox-item {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: 0; background: transparent; font: inherit; font-size: 13px;
  color: var(--foreground); cursor: pointer; border-top: 1px solid hsl(220 14% 96%);
}
.wts-combobox-item:first-child { border-top: 0; }
.wts-combobox-item:hover { background: hsl(220 14% 95%); }
.wts-combobox-empty { padding: 14px; font-size: 12.5px; color: var(--muted-foreground); text-align: center; }

.wts-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; padding: 36px 24px;
  border: 2px dashed hsl(220 13% 80%); border-radius: 10px;
  background: hsl(220 14% 98%); cursor: pointer;
  font: inherit; color: inherit;
  transition: border-color 150ms ease, background 150ms ease;
}
.wts-dropzone:hover { border-color: hsl(213 80% 55%); background: hsl(213 80% 98%); }
.wts-upload-success {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: hsl(220 14% 98%);
  border: 1px solid var(--border); border-radius: 8px;
}
.wts-colmap { display: flex; flex-direction: column; gap: 8px; }
.wts-colmap__row {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card);
}
.wts-colmap__row--warn { background: hsl(38 95% 97%); border-color: hsl(38 90% 86%); }

/* ── TP: Study detail (running) ───────────────────────────────────────── */
.wts-shimmer {
  position: relative; height: 4px; border-radius: 2px;
  background: hsl(220 14% 94%); overflow: hidden;
}
.wts-shimmer__bar {
  height: 100%; background: hsl(213 80% 45%); border-radius: 2px;
  transition: width 240ms ease;
}
.wts-shimmer__pulse {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, hsl(0 0% 100% / 0.5) 50%, transparent 100%);
  background-size: 220px 100%;
  animation: wts-shimmer 1.6s linear infinite;
}
@keyframes wts-shimmer {
  from { background-position: -220px 0; }
  to   { background-position: calc(100% + 220px) 0; }
}
.wts-skel-row td { padding: 12px 16px; }
.wts-skel-line {
  height: 14px; width: 100%; border-radius: 3px;
  background: linear-gradient(90deg, hsl(220 14% 96%) 0%, hsl(220 14% 92%) 50%, hsl(220 14% 96%) 100%);
  background-size: 400px 100%;
  animation: wts-skel 1.4s linear infinite;
}
@keyframes wts-skel {
  from { background-position: -400px 0; }
  to   { background-position: 400px 0; }
}

/* ── TP: Filter row & candidate table ─────────────────────────────────── */
.wts-flag-filter-wrap {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 10px; height: 32px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--background); box-shadow: var(--shadow-xs);
}
.wts-flag-pill {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 4px;
  border: 1px solid var(--border); background: transparent;
  font: inherit; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  color: var(--muted-foreground); cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.wts-flag-pill:hover { background: hsl(220 14% 94%); color: var(--foreground); }
.wts-flag-pill--on { background: hsl(0 72% 50%); color: #fff; border-color: hsl(0 72% 50%); }

.wts-checkbox { width: 15px; height: 15px; accent-color: hsl(213 80% 45%); cursor: pointer; }

.wts-candidates-table td { padding: 10px 14px; }
.wts-candidates-table th { padding: 10px 14px; }

.wts-flag-dots { display: inline-flex; gap: 3px; }
.wts-flag-dot {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
}
.wts-flag-dot--pass { background: hsl(142 50% 92%); color: hsl(142 55% 26%); }
.wts-flag-dot--fail { background: hsl(0 85% 95%);   color: hsl(0 72% 38%); }
.wts-flag-dot--na   { background: hsl(220 14% 96%); color: hsl(220 9% 55%); }

.wts-overridden-tag {
  display: inline-flex; align-items: center;
  padding: 1px 6px; border-radius: 4px;
  border: 1px solid hsl(255 70% 80%); background: hsl(255 70% 97%); color: hsl(255 70% 42%);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
}

/* ── Candidate side panel ─────────────────────────────────────────────── */
.wts-highlight {
  background: hsl(54 95% 84%); padding: 0 1px;
  box-shadow: 0 1px 0 hsl(54 95% 64%); border-radius: 1px;
  color: inherit;
}
.wts-deflist {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px;
  margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.wts-deflist div { display: flex; justify-content: space-between; gap: 12px; min-width: 0; white-space: nowrap; }
.wts-deflist dt { color: var(--muted-foreground); margin: 0; flex-shrink: 0; }
.wts-deflist dd { margin: 0; font-weight: 500; color: var(--foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }

.wts-flag-row { display: flex; align-items: flex-start; gap: 9px; }
.wts-flag-row__icon {
  width: 20px; height: 20px; border-radius: 5px;
  display: grid; place-items: center; flex-shrink: 0;
}
.wts-flag-row__icon--pass { background: hsl(142 50% 92%); color: hsl(142 55% 26%); }
.wts-flag-row__icon--fail { background: hsl(0 85% 95%); color: hsl(0 72% 38%); }
.wts-flag-row__icon img { filter: none; opacity: 0.85; }
.wts-flag-row__evidence {
  font-size: 12px; color: hsl(0 0% 35%);
  font-family: var(--font-serif); font-style: italic;
  margin-top: 3px; padding-left: 8px;
  border-left: 2px solid hsl(220 13% 86%);
  line-height: 1.5;
}

/* Override section */
.wts-override { background: hsl(220 14% 98%); transition: background 200ms ease, border-color 200ms ease; }
.wts-override--active {
  background: hsl(255 70% 98%);
  border-top: 2px solid hsl(255 70% 70%);
}
.wts-override__radios { display: flex; gap: 6px; }
.wts-override__radio {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--card); cursor: pointer; font-size: 12.5px; font-weight: 500;
  transition: border-color 120ms ease, background 120ms ease;
  position: relative;
}
.wts-override__radio:hover { border-color: hsl(220 13% 76%); }
.wts-override__radio input { position: absolute; opacity: 0; pointer-events: none; }
.wts-override__radio--on.accept { border-color: hsl(142 55% 50%); background: hsl(142 50% 96%); color: hsl(142 55% 26%); }
.wts-override__radio--on.reject { border-color: hsl(0 72% 60%);   background: hsl(0 85% 97%);   color: hsl(0 72% 38%); }
.wts-override__radio--on.review { border-color: hsl(38 90% 55%);  background: hsl(38 95% 96%);  color: hsl(28 90% 32%); }
.wts-override__ai-tag {
  position: absolute; top: -7px; right: 6px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  padding: 1px 4px; border-radius: 3px;
  background: hsl(220 9% 36%); color: #fff;
}
.wts-audit-line {
  font-size: 10.5px; color: hsl(220 9% 50%);
  font-family: var(--font-mono); margin-top: 4px;
  line-height: 1.5;
}

/* ── Export modal: structure & cover sheet ────────────────────────────── */
.wts-export-group {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  margin-bottom: 10px;
}
.wts-export-group__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.wts-export-group__title { font-size: 12.5px; font-weight: 600; color: var(--foreground); }
.wts-export-group__count {
  font-size: 10.5px; color: var(--muted-foreground); font-variant-numeric: tabular-nums;
  background: hsl(220 14% 96%); padding: 1px 7px; border-radius: 4px;
}
.wts-export-group__cols { display: flex; flex-wrap: wrap; gap: 5px; }
.wts-export-col {
  display: inline-flex; padding: 2px 7px; border-radius: 4px;
  background: hsl(220 14% 96%); color: hsl(0 0% 22%); font-size: 11.5px;
  font-family: var(--font-mono);
}

.wts-cover { background: hsl(220 14% 96%); padding: 22px; }
.wts-cover__page {
  background: #fff; padding: 36px 44px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
  max-width: 540px; margin: 0 auto;
  font-family: var(--font-serif);
  color: hsl(0 0% 12%);
}
.wts-cover__title {
  font-size: 18px; font-weight: 600; text-align: center;
  letter-spacing: -0.01em; margin-bottom: 8px;
}
.wts-cover__meta {
  text-align: center; font-size: 11px; color: hsl(0 0% 35%);
  font-family: var(--font-sans); margin-bottom: 28px;
  padding-bottom: 16px; border-bottom: 1px solid hsl(220 14% 88%);
}
.wts-cover__sec { margin-bottom: 22px; }
.wts-cover__sec-title {
  font-family: var(--font-sans); font-size: 9.5px; font-weight: 600;
  color: hsl(0 0% 30%); text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.wts-cover__dl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.55; }
.wts-cover__dl > div { display: flex; gap: 12px; }
.wts-cover__dl dt { width: 160px; flex-shrink: 0; color: hsl(0 0% 38%); margin: 0; }
.wts-cover__dl dd { margin: 0; color: hsl(0 0% 12%); }
.wts-cover__list { font-size: 12px; line-height: 1.65; margin: 0; padding-left: 18px; }
.wts-cover__list li { margin-bottom: 3px; }
.wts-cover__audit {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid hsl(220 14% 88%);
  font-family: var(--font-mono); font-size: 9.5px;
  color: hsl(0 0% 50%); text-align: center;
}

/* ── Value display + Client portal ─────────────────────────────────────── */
.wts-value-num { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.wts-portal { height: 100vh; display: flex; flex-direction: column; background: hsl(220 20% 97%); }
.wts-portal__header {
  height: 58px; flex-shrink: 0; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--border);
}
.wts-portal__brand { display: flex; align-items: center; gap: 10px; }
.wts-portal__body { flex: 1; overflow-y: auto; }
.wts-portal-card {
  display: block; width: 100%; text-align: left; font: inherit;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.wts-portal-card:hover { border-color: hsl(213 80% 70%); box-shadow: var(--shadow-md); }
.wts-portal-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow-xs);
}
.wts-portal-item__type {
  width: 30px; height: 30px; border-radius: 8px; background: hsl(220 14% 96%);
  display: grid; place-items: center; flex-shrink: 0;
}

/* ── Responsive / mobile ───────────────────────────────────────────────── */
/* ── Onboarding banner + tour ─────────────────────────────────── */
.wts-onboard-banner { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid hsl(213 70% 85%); background: hsl(213 90% 97%); border-radius: 12px; box-shadow: var(--shadow-xs); }
.wts-onboard-banner__icon { width: 40px; height: 40px; border-radius: 10px; background: hsl(213 80% 45%); display: grid; place-items: center; flex-shrink: 0; }
.wts-onboard-banner__icon img { filter: invert(1); }
.wts-onboard-banner__title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.wts-onboard-banner__sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; line-height: 1.45; }
.wts-onboard-banner__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.wts-tour-card { position: fixed; bottom: 24px; left: 24px; width: 420px; max-width: calc(100vw - 48px); background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 2001; padding: 18px 20px; }
.wts-tour-card__step { font-size: 11px; font-weight: 600; color: hsl(213 80% 42%); text-transform: uppercase; letter-spacing: 0.07em; }
.wts-tour-card__title { font-size: 16px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }
.wts-tour-card__body { font-size: 13px; color: var(--muted-foreground); line-height: 1.55; margin-top: 8px; }
.wts-tour-dots { display: flex; gap: 5px; align-items: center; }
.wts-tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: background 150ms; }
.wts-tour-dot--on { background: hsl(213 80% 45%); }

/* Selectable criteria flag chips (analyst verdict) */
.wts-flag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font: inherit; font-size: 12px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; transition: border-color 120ms, background 120ms, color 120ms; }
.wts-flag-chip:hover { border-color: hsl(220 13% 76%); }
.wts-flag-chip--on { border-color: hsl(213 80% 55%); background: hsl(213 90% 96%); color: hsl(213 80% 35%); }
.wts-flag-chip .wts-flag-dot { width: 15px; height: 15px; font-size: 8px; }

.wts-hamburger { display: none; }
.wts-nav-overlay { display: none; }

@media (max-width: 900px) {
  .wts-shell { grid-template-columns: 1fr; }
  .wts-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 252px; z-index: 900;
    transform: translateX(-100%); transition: transform 260ms cubic-bezier(0.16,1,0.3,1);
  }
  .wts-sidebar--open { transform: translateX(0); box-shadow: 8px 0 28px rgb(0 0 0 / 0.18); }
  .wts-nav-overlay {
    display: block; position: fixed; inset: 0; background: rgb(15 23 42 / 0.4);
    z-index: 850; opacity: 0; pointer-events: none; transition: opacity 220ms ease;
  }
  .wts-nav-overlay--open { opacity: 1; pointer-events: auto; }
  .wts-hamburger {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border: 1px solid var(--border); border-radius: 7px; background: var(--background);
    cursor: pointer; flex-shrink: 0; padding: 0;
  }
  .wts-header { padding: 0 14px; gap: 8px; }
  .wts-content-inner { padding: 20px 16px 48px; }
  .ck-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .wts-cols-2, .wts-cols-2-1 { grid-template-columns: 1fr !important; }
  .wts-metric-row { flex-wrap: wrap; row-gap: 14px; }
  .wts-metric { flex: 1 1 42%; min-width: 130px; border-right: 0 !important; padding: 0 14px 0 0 !important; }
  .ck-card__content:has(> table.ck-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ck-card__content:has(> table.ck-table) > .ck-table { min-width: 600px; }
  .ck-page__header { flex-wrap: wrap; }
  .wts-drawer { width: 100vw !important; }
  .wts-modal-overlay { padding: 14px; }
  .wts-eng-header__title { white-space: normal; }
  .wts-eng-header__top { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .ck-kpi-grid { grid-template-columns: 1fr; }
  .wts-search-wrap { width: 100%; }
  .wts-portal__header { padding: 0 14px; }
  .ck-page__title { font-size: 20px; }
  .wts-eng-header__title { font-size: 22px; }
  .wts-onboard-banner { flex-wrap: wrap; }
  .wts-onboard-banner__actions { flex: 1 0 100%; justify-content: stretch; margin-top: 6px; }
  .wts-onboard-banner__actions .ck-btn { flex: 1; }
  .wts-tour-card { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .wts-tour-card--top { top: 12px; bottom: auto; }
}