/* ── AHG authorisation workspace ─────────────────────────────────────────
   Pier's design language, exactly as design/ahg-authorisation renders it
   (index.html base overridden by theme.css): a minimal neutral workspace —
   pale grey rail, white canvas, Inter, monochrome ink, rounded dark
   primary actions, hairline separators. Warm colour is reserved for
   unresolved decisions. Scoped under .ws so the dark console is untouched. */

.ws {
  --ws-ink: #242424;
  --ws-muted: #737373;
  --ws-line: #ececec;
  --ws-paper: #ffffff;
  --ws-card: #ffffff;
  --ws-green: #262626;
  --ws-green-deep: #111111;
  --ws-mint: #f2f5f3;
  --ws-amber: #8c6227;
  --ws-amber-bg: #faf4e9;
  --ws-red: #a23e38;
  --ws-red-bg: #f8e8e5;
  --ws-nav: #f7f7f7;
  --ws-nav-ink: #585858;
  --ws-focus: #737373;

  background: var(--ws-paper);
  color: var(--ws-ink);
  font: 14px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.ws *, .ws *::before, .ws *::after { box-sizing: border-box; }

.ws :focus-visible {
  outline: 2px solid var(--ws-focus);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ── Shell ── */
.ws-shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }

.ws-rail {
  background: var(--ws-nav);
  color: #393939;
  border-right: 1px solid #eeeeee;
  padding: 25px 12px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.ws-brand {
  font: 600 23px/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -1px;
  color: #252525;
  text-decoration: none;
  margin-left: 14px;
}
.ws-brand span { display: none; }
.ws-brand-sub {
  font-size: 11px;
  color: #858585;
  margin: 4px 0 42px 14px;
}

.ws-navlabel {
  font-size: 11px;
  font-weight: 500;
  color: #919191;
  margin: 0 0 10px 14px;
}

.ws-nav { display: flex; flex-direction: column; gap: 4px; }
.ws-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 9px;
  color: var(--ws-nav-ink);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}
.ws-nav a:hover { background: #ededed; }
.ws-nav a[aria-current='page'] { background: #eaeaea; color: #202020; }
.ws-nav-ico { width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; }
.ws-nav svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ws-nav .ws-count {
  margin-left: auto;
  font-size: 11px;
  color: #767676;
  background: transparent;
  padding: 0;
}

.ws-rail-foot {
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid #e6e6e6;
  font-size: 12px;
  color: #858585;
}
.ws-rail-foot strong { display: block; color: #393939; font-weight: 600; }
.ws-rail-foot a { color: #858585; }
.ws-rail-foot a:hover { color: var(--ws-ink); }

.ws-canvas { min-width: 0; }

/* ── Screen header ── */
.ws-screenhead { padding: 30px 36px 20px; }
.ws-crumb { font-size: 11px; color: var(--ws-muted); }
.ws-crumb a { color: var(--ws-muted); text-decoration: none; }
.ws-crumb a:hover { color: var(--ws-ink); }
.ws-h1 {
  font: 600 30px/1.25 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -1px;
  margin: 10px 0 4px;
}
.ws-sub { color: var(--ws-muted); font-size: 13px; margin-top: 7px; }

.ws-pilltag {
  float: right;
  font-size: 10px;
  color: #818181;
  border: 1px solid #eeeeee;
  border-radius: 20px;
  padding: 4px 10px;
  background: #f7f7f7;
}

/* ── Requests: worklist + review ── */
.ws-requests { display: grid; grid-template-columns: 280px 1fr; gap: 0; align-items: start; }

.ws-worklist {
  padding: 6px 12px 40px 16px;
  border-right: 1px solid #efefef;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}
.ws-worklist-label {
  font-size: 11px;
  font-weight: 500;
  color: #919191;
  margin: 14px 10px 12px;
}
.ws-case {
  display: block;
  padding: 15px 13px;
  margin-bottom: 7px;
  border-radius: 11px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 120ms ease;
}
.ws-case:hover { background: #fafafa; }
.ws-case[aria-current='true'] { background: #f4f4f4; }
.ws-case-ref { font-size: 10px; color: #898989; display: flex; justify-content: space-between; }
/* Fast lane worklist: a tick box inside each case card, and a one-line batch bar */
.ws-fl-row { position: relative; }
.ws-fl-row > input { position: absolute; top: 16px; left: 12px; margin: 0; z-index: 1; accent-color: #242424; }
.ws-fl-row.ws-fl-selectable > .ws-case { padding-left: 34px; }
.ws-fl-batch {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 2px 0 10px; padding: 8px 10px 8px 12px; border-radius: 11px; background: #f7f7f7;
}
.ws-fl-check { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: #5d5d5d; cursor: pointer; }
.ws-fl-check input { margin: 0; accent-color: #242424; }
.ws-fl-confirm {
  font: inherit; font-size: 11.5px; font-weight: 500; white-space: nowrap;
  border: 0; border-radius: 22px; padding: 6px 12px; background: #242424; color: #fff; cursor: pointer;
}
.ws-fl-confirm:disabled { background: #d9d9d9; color: #8a8a8a; cursor: default; }
.ws-case-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.5;
  margin: 5px 0 4px;
  letter-spacing: -0.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ws-doclinks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ws-doclinks a { font-size: 11px; color: #5d5d5d; text-decoration: none; }
.ws-doclinks a:hover { text-decoration: underline; }
.ws-clause a { color: inherit; text-decoration: underline dotted; text-underline-offset: 4px; text-decoration-color: #c6c6c6; }
.ws-clause a:hover { color: var(--ws-ink); text-decoration-style: solid; }
.ws-case-state { font-size: 10px; display: flex; align-items: center; gap: 5px; }
.ws-dot { width: 5px; height: 5px; border-radius: 99px; display: inline-block; background: currentColor; }
.ws-state-review { color: #566359; }
.ws-state-assessing { color: var(--ws-muted); }
.ws-state-assessing .ws-dot { animation: ws-pulse 1.4s ease-in-out infinite; }
.ws-state-decided { color: #999999; }
.ws-state-unresolved { color: var(--ws-amber); }

@keyframes ws-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ── Review canvas — a continuous document, not a stack of cards ── */
.ws-review { padding: 6px 44px 140px 32px; max-width: 920px; }

.ws-section {
  padding: 20px 0;
  border-bottom: 1px solid #ebebeb;
  animation: ws-rise 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.ws-section:nth-child(1) { animation-delay: 0ms; }
.ws-section:nth-child(2) { animation-delay: 60ms; }
.ws-section:nth-child(3) { animation-delay: 120ms; }
.ws-section:nth-child(4) { animation-delay: 180ms; }
.ws-section:nth-child(5) { animation-delay: 240ms; }
.ws-section:nth-child(6) { animation-delay: 300ms; }

@keyframes ws-rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-section { animation: none; }
}

.ws-eyebrow {
  font-size: 11px;
  font-weight: 500;
  color: #777777;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ws-eyebrow span { font-size: 10px; color: #999999; }

/* Event strip — the case's decision events, in order */
.ws-eventstrip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ws-eventchip {
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 11px;
  border: 1px solid var(--ws-line);
  border-radius: 20px;
  background: var(--ws-card);
  color: #5d5d5d;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}
.ws-eventchip:hover { background: #f5f5f5; }
.ws-eventchip[aria-current='true'] {
  border-color: #eaeaea;
  background: #eaeaea;
  color: #202020;
}

/* Member strip — hairline band, as the design's member row */
.ws-member {
  display: flex;
  align-items: center;
  gap: 8px 17px;
  flex-wrap: wrap;
  font-size: 11px;
  border-top: 1px solid #efefef;
  border-bottom: 1px solid #efefef;
  padding: 12px 0;
}
.ws-member b { font-weight: 500; letter-spacing: 1px; }
.ws-masked { letter-spacing: 2.5px; color: var(--ws-muted); }
.ws-member .ws-quiet-btn { margin-left: auto; }

/* Recommendation — the verdict voice */
.ws-verdict {
  font: 600 27px/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.85px;
  margin: 12px 0 6px;
}
.ws-verdict-reason { font-size: 13px; line-height: 1.8; color: #606060; max-width: 640px; }
.ws-pause { margin-top: 16px; display: grid; gap: 5px; }
.ws-pause-item {
  display: flex;
  gap: 9px;
  font-size: 11px;
  color: #807052;
  align-items: baseline;
}
.ws-pause-item::before { content: 'ⓘ'; font-size: 11px; }

/* Collapsible assessment blocks — the design's details.block anatomy:
   symbol · title + sub-line · chevron; low-confidence blocks are amber
   cards and open by default. */
.ws-block { border-bottom: 1px solid #ebebeb; }
.ws-block > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 2px;
}
.ws-block > summary::-webkit-details-marker { display: none; }
.ws-block > summary:hover { background: #fafafa; }
.ws-symbol {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #747474;
  font-size: 15px;
  flex-shrink: 0;
}
.ws-block-title { flex: 1; min-width: 0; }
.ws-block-title b { font-size: 13px; font-weight: 550; display: block; }
.ws-block-title small { display: block; font-size: 11px; color: #818181; margin-top: 3px; }
.ws-block[open] > summary > .ws-caret { transform: rotate(90deg); }
.ws-block-body { padding: 0 14px 20px 37px; }
.ws-block-uncertain {
  border: 1px solid #eee3cd;
  border-radius: 12px;
  background: #fffdf9;
  margin: 14px 0 5px;
}
.ws-block-uncertain > summary { padding: 17px 15px; }
.ws-block-uncertain > summary:hover { background: transparent; }
.ws-block-uncertain .ws-symbol { color: #a27b3c; }
.ws-block-uncertain .ws-block-body { padding: 0 16px 18px 50px; }

/* Item verdict rows */
.ws-item { border-bottom: 1px solid #ebebeb; }
.ws-item:last-child { border-bottom: 0; }
.ws-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 15px 2px;
}
.ws-item summary::-webkit-details-marker { display: none; }
.ws-item summary:hover { background: #fafafa; }
.ws-item-desc { font-size: 13px; font-weight: 550; flex: 1; min-width: 0; }
.ws-chip {
  font-size: 10px;
  font-weight: 500;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.ws-chip-covered { background: #f1f3f1; color: #566359; }
.ws-chip-unclear { background: #faf2e4; color: var(--ws-amber); }
.ws-chip-excluded { background: var(--ws-red-bg); color: var(--ws-red); }
.ws-item-body { padding: 0 2px 20px; font-size: 12px; line-height: 1.8; color: #5f5f5f; }
.ws-item-body b, .ws-item-body strong { color: #454545; font-weight: 550; }
.ws-item-body .ws-basis {
  font-size: 13px;
  color: #454545;
  border-left: 2px solid #d9d9d9;
  padding: 2px 0 2px 14px;
  margin: 8px 0;
}
.ws-caret { color: #939393; font-size: 11px; transition: transform 150ms ease; }
.ws-item[open] .ws-caret { transform: rotate(90deg); }

/* Unresolved emphasis — the ONLY amber surface */
.ws-unresolved {
  background: #fffdf9;
  border: 1px solid #eee3cd;
  border-radius: 12px;
  padding: 15px 17px;
  margin-top: 12px;
}
.ws-unresolved .ws-eyebrow { color: #a27b3c; margin-bottom: 6px; }

/* Policy rows — real coverage descriptions are sentences and citations
   are long: chip beside a column, citation on its own line beneath. */
.ws-cover-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 2px;
  font-size: 13px;
  border-bottom: 1px solid #f2f2f2;
}
.ws-cover-row:last-of-type { border-bottom: 0; }
.ws-cover-row .ws-chip { flex-shrink: 0; margin-top: 3px; }
.ws-cover-body { flex: 1; min-width: 0; color: #5f5f5f; }
.ws-clause { display: block; font-size: 11px; color: var(--ws-muted); margin-top: 3px; }

/* Handler summary — the spoken verdict voice, sans-serif per the design
   (serif is reserved for source-document excerpts) */
.ws-handler {
  font-size: 15px;
  line-height: 1.8;
  color: #454545;
  letter-spacing: -0.1px;
  max-width: 62ch;
}
.ws-handler::before { content: '“'; font-size: 30px; color: #b5b5b5; line-height: 0; vertical-align: -9px; margin-right: 4px; }

/* Buttons */
.ws-btn {
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  border: 1px solid var(--ws-line);
  background: var(--ws-card);
  color: var(--ws-ink);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.ws-btn:hover { background: #f5f5f5; border-color: #d5d5d5; }
.ws-btn:active { transform: translateY(1px); }
.ws-btn:disabled { opacity: 0.55; cursor: default; }
.ws-btn-primary {
  background: #242424;
  border-color: #242424;
  border-radius: 22px;
  color: #ffffff;
  padding: 10px 18px;
}
.ws-btn-primary:hover { background: #444444; border-color: #444444; }
.ws-btn-danger { color: var(--ws-red); }
.ws-quiet-btn {
  font: inherit;
  font-size: 12px;
  background: transparent;
  border: 0;
  color: #565656;
  cursor: pointer;
  padding: 4px 6px;
}
.ws-quiet-btn:hover { text-decoration: underline; }

/* Decision bar — pinned, one place where money-adjacent action happens */
.ws-decisionbar {
  position: sticky;
  bottom: 16px;
  margin: 25px 0 16px;
  background: var(--ws-card);
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 17px 18px;
  box-shadow: 0 5px 24px rgba(0, 0, 0, 0.03);
}
.ws-decisionbar .ws-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.ws-decisionbar .ws-actions .ws-btn { font-size: 12px; border-radius: 22px; }
.ws-actions .ws-divider { width: 1px; height: 22px; background: var(--ws-line); margin: 0 4px; }
.ws-disagree-label { font-size: 11px; color: var(--ws-muted); }
.ws-note {
  font: inherit;
  font-size: 13px;
  width: 100%;
  border: 1px solid #dedede;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  background: var(--ws-card);
  color: var(--ws-ink);
  resize: vertical;
}

/* Decided state */
.ws-decided {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.ws-decided-word {
  font: 600 24px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.6px;
}
.ws-decided-word.ok { color: var(--ws-ink); }
.ws-decided-word.no { color: var(--ws-red); }
.ws-decided-word.esc { color: var(--ws-amber); }

/* Tables (shadow) */
.ws-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin: 6px 0 26px; }
.ws-tile { background: var(--ws-card); border: 1px solid #ececec; border-radius: 13px; padding: 23px; }
.ws-tile b {
  display: block;
  font: 550 36px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -1.2px;
  margin: 10px 0 6px;
}
.ws-tile span { display: block; font-size: 11px; color: var(--ws-muted); }

/* Shadow panels — the design's grid2 + agreement bar + legend */
.ws-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 1100px) { .ws-grid2 { grid-template-columns: 1fr; } }
.ws-panel {
  background: var(--ws-card);
  border: 1px solid #eaeaea;
  border-radius: 14px;
  padding: 26px;
}
.ws-panel h2 {
  font: 600 17px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.3px;
  margin: 0 0 8px;
}
.ws-panel-sub { color: var(--ws-muted); font-size: 13px; margin: 0; }
.ws-bars {
  display: flex;
  height: 12px;
  border-radius: 10px;
  overflow: hidden;
  margin: 25px 0 15px;
}
.ws-bars span { display: block; height: 100%; }
.ws-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: #454545; }
.ws-notice-success {
  background: #f3f5f3;
  color: #5b6a5d;
  border-radius: 9px;
  font-size: 12px;
  padding: 12px 14px;
  margin-top: 16px;
}

/* Rule rows — the design's .rule anatomy: badge + meta, sentence as heading */
.ws-rule { padding: 17px 0; border-bottom: 1px solid var(--ws-line); }
.ws-rule:last-of-type { border-bottom: 0; }
.ws-rule small { font-size: 11px; color: var(--ws-muted); margin-left: 6px; }
.ws-rule h3 {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0;
  margin: 9px 0 0;
  color: var(--ws-ink);
}

/* The worklist status filter (design's head-actions select) */
.ws-filter {
  font: inherit;
  font-size: 11px;
  color: var(--ws-ink);
  border: 1px solid #e7e7e7;
  background: var(--ws-card);
  border-radius: 9px;
  padding: 5px 8px;
  max-width: 140px;
}
.ws-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ws-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--ws-muted);
  padding: 15px 12px;
  border-bottom: 1px solid var(--ws-line);
}
.ws-table td { padding: 15px 12px; border-bottom: 1px solid var(--ws-line); }
.ws-table a { color: var(--ws-ink); text-underline-offset: 3px; }

/* Empty states — designed, not apologetic */
.ws-empty {
  margin: 30px 36px;
  padding: 46px 40px;
  border: 1px dashed #e0e0e0;
  border-radius: 16px;
  background: #fbfbfb;
  max-width: 620px;
}
.ws-empty h2 {
  font: 600 20px/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
}
.ws-empty p { color: var(--ws-muted); font-size: 13px; margin: 0 0 6px; max-width: 52ch; }
.ws-empty a { color: var(--ws-ink); }

.ws-footnote { font-size: 11px; color: var(--ws-muted); }

/* Load-bearing phrases surfaced from dense assessment prose: verbatim
   policy wording gets the design's source-passage highlight, two-reading
   markers are bolded. */
.ws-quote {
  background: #f4e5a9;
  color: inherit;
  padding: 0 3px;
  border-radius: 3px;
}
.ws-reading { font-weight: 650; color: var(--ws-ink); }

/* ── Document pills + hover preview — the design's citation chips and
   source-preview card, executed for real files ── */
.ws-docpill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  color: #5d5d5d;
  background: #f5f5f5;
  border: 1px solid #ebebeb;
  border-radius: 6px;
  padding: 3px 8px;
  text-decoration: none;
  transition: background 120ms ease;
}
.ws-docpill:hover { background: #ebebeb; }
.ws-unresolved .ws-docpill { background: #ffffff; border-color: #e9e4da; }

.ws-hoverlink {
  color: #565656;
  text-decoration: underline dotted;
  text-decoration-color: #c6c6c6;
  text-underline-offset: 4px;
}
.ws-hoverlink:hover { color: var(--ws-ink); text-decoration-style: solid; }

.ws-hovercard {
  /* Portalled to document.body (outside .ws) to escape the section
     entrance animation's containing block — so it carries its own
     palette variables and font. */
  --ws-ink: #242424;
  --ws-muted: #737373;
  --ws-line: #ececec;
  --ws-card: #ffffff;
  --ws-green: #262626;
  position: fixed;
  z-index: 40;
  width: min(330px, calc(100vw - 24px));
  padding: 15px 17px;
  background: var(--ws-card);
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.08);
  font: 12px/1.55 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #444444;
  box-sizing: border-box;
}
.ws-hovercard *, .ws-hovercard *::before, .ws-hovercard *::after { box-sizing: border-box; }
.ws-hovercard-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #858585;
  font-size: 10px;
  margin-bottom: 10px;
}
.ws-hovercard-title { font-weight: 550; font-size: 12px; overflow-wrap: anywhere; margin-bottom: 8px; color: var(--ws-ink); }
.ws-hovercard iframe {
  width: 100%;
  height: 200px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #ffffff;
}
.ws-hovercard img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}
.ws-hovercard pre {
  white-space: pre-wrap;
  font: 11px/1.7 ui-monospace, Consolas, monospace;
  color: #656565;
  border-left: 2px solid #d9d9d9;
  padding-left: 11px;
  margin: 0;
  max-height: 180px;
  overflow: auto;
}
.ws-hovercard-open {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  color: #333333;
  text-decoration: none;
}
.ws-hovercard-open:hover { text-decoration: underline; }

/* ── Evidence drawer — the design's evidence pane: a panel over the
   right side of the screen; the assessment and its scroll position stay
   put behind it. Portalled to document.body, so it carries its own
   variables. ── */
.ws-evidence-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.33);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
}
.ws-evidence {
  --ws-ink: #242424;
  --ws-muted: #737373;
  --ws-line: #ececec;
  --ws-red: #a23e38;
  width: min(560px, 100vw);
  height: 100%;
  overflow: auto;
  background: #fafafa;
  padding: 26px;
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.12);
  font: 13px/1.6 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ws-ink);
  box-sizing: border-box;
  animation: ws-drawer-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.ws-evidence *, .ws-evidence *::before, .ws-evidence *::after { box-sizing: border-box; }
@keyframes ws-drawer-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-evidence { animation: none; }
}
.ws-evidence-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.ws-evidence-eyebrow { font-size: 10px; color: #858585; margin-bottom: 6px; }
.ws-evidence-head b {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}
.ws-evidence-head small { display: block; font-size: 11px; color: var(--ws-muted); margin-top: 3px; }
.ws-evidence-doc {
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 430px;
  border: 1px solid #e5e5e5;
  border-radius: 9px;
  background: #ffffff;
}
.ws-evidence-img {
  max-width: 100%;
  border: 1px solid #e5e5e5;
  border-radius: 9px;
  background: #ffffff;
}
.ws-evidence-text {
  white-space: pre-wrap;
  font: 12.5px/1.8 ui-monospace, Consolas, monospace;
  color: #454545;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 9px;
  padding: 20px;
  margin: 0;
  max-height: calc(100vh - 230px);
  overflow: auto;
}
.ws-evidence-newtab {
  display: inline-block;
  color: #555555;
  font-size: 12px;
  margin-top: 12px;
  text-underline-offset: 3px;
}
.ws-evidence-foot { font-size: 10px; color: #999999; margin: 10px 0 0; }

/* ── Correction modal — the design's decision dialog. Portalled to
   document.body (same containing-block hazard as the hover card), so it
   carries its own variables. ── */
.ws-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.33);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ws-modal {
  --ws-ink: #242424;
  --ws-muted: #737373;
  --ws-line: #ececec;
  --ws-paper: #ffffff;
  --ws-card: #ffffff;
  --ws-green: #262626;
  --ws-green-deep: #111111;
  --ws-red: #a23e38;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--ws-card);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 25px 100px rgba(0, 0, 0, 0.13);
  font: 13px/1.6 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ws-ink);
  box-sizing: border-box;
}
.ws-modal *, .ws-modal *::before, .ws-modal *::after { box-sizing: border-box; }
.ws-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ws-modal-head b { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }
.ws-modal-x {
  border: 0;
  background: #f5f5f5;
  color: var(--ws-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
}
.ws-modal-x:hover { color: var(--ws-ink); }
.ws-modal-hint {
  background: #fafafa;
  border: 1px solid #eeeeee;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 12px;
  color: var(--ws-muted);
  margin: 14px 0 2px;
}
.ws-modal label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #454545;
  margin: 16px 0 6px;
}
.ws-modal label.ws-modal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ws-ink);
  cursor: pointer;
}
.ws-modal-said {
  background: #fafafa;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12.5px;
}
.ws-modal select,
.ws-modal textarea {
  font: inherit;
  font-size: 13px;
  width: 100%;
  border: 1px solid #dedede;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--ws-card);
  color: var(--ws-ink);
}
.ws-modal textarea { resize: vertical; }
.ws-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.ws-modal-actions .ws-btn { border-radius: 22px; font-size: 12px; }

/* ── Boxed form cards — the design's panels, for our inbox form ── */
.ws-formgrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .ws-formgrid { grid-template-columns: 1fr; } }
.ws-formcard {
  background: var(--ws-card);
  border: 1px solid #eaeaea;
  border-radius: 14px;
  padding: 22px 26px;
}
.ws-formcard .ws-cover-row:first-of-type { padding-top: 2px; }
/* Inside a form card each row stacks: label, hint, control, file pills.
   Native file inputs refuse to shrink, so side-by-side layout collapses
   the label column at card widths — vertical is robust at any width. */
.ws-formcard .ws-cover-row { display: block; }
.ws-formcard input:not([type='checkbox']),
.ws-formcard select {
  border: 1px solid #dedede;
  border-radius: 10px;
  background: var(--ws-card);
  color: var(--ws-ink);
}
.ws-filepills { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }

/* Drop targets: each document row accepts dropped files */
.ws-dropzone {
  border-radius: 12px;
  outline: 1.5px dashed transparent;
  outline-offset: 4px;
  transition: outline-color 120ms ease, background 120ms ease;
}
.ws-dropzone.is-over { outline-color: #9a9a9a; background: #fafafa; }
.ws-drophint { margin-left: 12px; font-size: 11.5px; color: var(--ws-muted); }
/* The pills below each row show what is attached; the native control's
   own "No file chosen" text would contradict a dropped file. */
.ws-formcard .ws-dropzone input[type='file'] {
  color: transparent;
  width: 124px;
  border: 0;
  padding: 0;
  background: transparent;
}

/* Pack picker — the workspace idiom instead of the OS select popup */
.ws-select { position: relative; width: 240px; margin-top: 8px; }
.ws-select-btn {
  font: inherit;
  font-size: 13px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #dedede;
  border-radius: 10px;
  background: var(--ws-card);
  color: var(--ws-ink);
  cursor: pointer;
}
.ws-select-btn[aria-expanded='true'] { border-color: #bdbdbd; }
.ws-select-chev { font-size: 11px; color: var(--ws-muted); }
.ws-select-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--ws-card);
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.ws-select-opt {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ws-ink);
  cursor: pointer;
}
.ws-select-opt.is-hi { background: #f4f4f4; }
.ws-select-opt.is-on { font-weight: 600; }
.ws-pill-x {
  border: 0;
  background: transparent;
  color: var(--ws-muted);
  font-size: 10px;
  padding: 4px;
  cursor: pointer;
}
.ws-pill-x:hover { color: var(--ws-red); }
