:root {
  --ink: #13262d;
  --ink-2: #33484e;
  --muted: #718187;
  --paper: #f5f4ef;
  --surface: #ffffff;
  --surface-soft: #f9f9f6;
  --line: #dfe3dc;
  --line-strong: #cbd2c9;
  --green: #157a64;
  --green-soft: #e3f3ea;
  --gold: #c8991d;
  --gold-soft: #fff4d8;
  --coral: #bf5c43;
  --coral-soft: #fce9e3;
  --blue: #2b6f9e;
  --blue-soft: #e6f0f7;
  --shadow: 0 20px 50px rgb(31 51 49 / 7%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 0%, rgb(229 214 93 / 18%), transparent 24rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: absolute;
  z-index: 20;
  top: -4rem;
  left: 1rem;
  padding: .7rem 1rem;
  border-radius: .5rem;
  color: white;
  background: var(--ink);
}
.skip-link:focus { top: 1rem; }

.topbar {
  display: flex;
  position: sticky;
  z-index: 10;
  top: 0;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 clamp(1.25rem, 5vw, 5.25rem);
  border-bottom: 1px solid rgb(223 227 220 / 80%);
  background: rgb(245 244 239 / 88%);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .58rem;
  color: var(--ink);
  font-size: 1.13rem;
  letter-spacing: -.04em;
  text-decoration: none;
}
.brand strong { font-weight: 750; }
.brand-mark {
  display: flex;
  width: 27px;
  height: 27px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 5px;
  border-radius: 8px;
  background: var(--ink);
}
.brand-mark i { display: block; width: 100%; height: 2px; border-radius: 3px; background: #e5d65d; }
.brand-mark i:nth-child(2) { width: 68%; }
.product-badge {
  margin-left: .25rem;
  padding: .26rem .48rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.demo-label { display: inline-flex; align-items: center; gap: .42rem; color: var(--muted); font-size: .8rem; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.avatar {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #e5d65d;
  font-size: .7rem;
  font-weight: 750;
}

main { width: min(1440px, 100%); margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 5.25rem) 4rem; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 3rem; padding: clamp(2.8rem, 6vw, 5.4rem) 0 clamp(2rem, 4vw, 3.3rem); }
.eyebrow, .panel-kicker {
  margin: 0;
  color: var(--green);
  font-size: .67rem;
  font-weight: 760;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.intro h1 { max-width: 730px; margin: .72rem 0 0; font-size: clamp(2.2rem, 4.4vw, 4.15rem); font-weight: 680; letter-spacing: -.065em; line-height: .98; }
.intro-copy { max-width: 645px; margin: 1.3rem 0 0; color: var(--ink-2); font-size: 1.06rem; line-height: 1.58; }
.intro-meta { display: flex; min-width: max-content; align-items: center; gap: 1.3rem; padding: 1.05rem 1.35rem; border: 1px solid var(--line); border-radius: 14px; background: rgb(255 255 255 / 55%); }
.metric { display: grid; gap: .2rem; }
.metric-value { font-size: 1.35rem; font-weight: 720; letter-spacing: -.04em; }
.metric-label { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.metric-divider { width: 1px; height: 31px; background: var(--line); }

.workspace-shell { display: grid; grid-template-columns: minmax(285px, .77fr) minmax(0, 1.9fr); overflow: hidden; min-height: 735px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.queue-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fbfbf8; }
.panel-title-row { display: flex; align-items: start; justify-content: space-between; padding: 1.45rem 1.3rem 1rem; }
.panel-kicker { color: var(--muted); font-size: .61rem; }
.panel-title-row h2 { margin: .37rem 0 0; font-size: 1rem; letter-spacing: -.03em; }
.icon-button { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: white; }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.queue-tabs { display: flex; gap: .9rem; padding: 0 1.3rem .8rem; border-bottom: 1px solid var(--line); }
.queue-tab { position: relative; padding: 0 0 .65rem; border: 0; color: var(--muted); background: transparent; font-size: .76rem; font-weight: 600; }
.queue-tab span { display: inline-grid; min-width: 16px; height: 16px; place-items: center; margin-left: .14rem; border-radius: 50%; color: var(--ink-2); background: #e9ece7; font-size: .62rem; }
.queue-tab.is-active { color: var(--ink); }
.queue-tab.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; border-radius: 3px; background: var(--green); content: ""; }
.case-list { flex: 1; overflow: auto; padding: .45rem .55rem; }
.case-item { display: grid; gap: .48rem; width: 100%; padding: .95rem .75rem; border: 1px solid transparent; border-radius: 11px; text-align: left; background: transparent; transition: background .15s ease, border .15s ease; }
.case-item:hover { background: #f3f5f1; }
.case-item.is-selected { border-color: #cbd8d1; background: #edf6f0; box-shadow: inset 3px 0 var(--green); }
.case-item.is-closed { opacity: .68; }
.case-line, .case-subline, .case-meta { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.supplier { overflow: hidden; font-size: .83rem; font-weight: 700; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.case-subline { color: var(--ink-2); font-size: .73rem; }
.case-subline span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-meta { color: var(--muted); font-size: .66rem; }
.status-pill, .channel-pill, .flag { display: inline-flex; width: max-content; align-items: center; gap: .3rem; padding: .27rem .43rem; border-radius: 99px; font-size: .59rem; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.status-pill.review { color: #8c6111; background: var(--gold-soft); }
.status-pill.awaiting { color: var(--blue); background: var(--blue-soft); }
.status-pill.resolved { color: var(--green); background: var(--green-soft); }
.status-pill.revalidating { color: #8d5e18; background: #fff1d8; }
.queue-footer { display: flex; align-items: center; gap: .45rem; padding: .9rem 1.3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .65rem; }
.tiny-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.case-panel { min-width: 0; background: var(--surface); }
.case-content { display: flex; min-height: 100%; flex-direction: column; }
.case-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.7rem clamp(1.25rem, 3vw, 2.25rem) 1.35rem; border-bottom: 1px solid var(--line); }
.case-breadcrumb { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .71rem; }
.case-breadcrumb .slash { color: var(--line-strong); }
.case-header h2 { max-width: 580px; margin: .55rem 0 .5rem; font-size: clamp(1.35rem, 2.3vw, 1.9rem); letter-spacing: -.045em; line-height: 1.08; }
.case-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; }
.case-header-actions { display: flex; align-items: center; gap: .55rem; }
.case-header-actions .icon-button { width: 34px; height: 34px; }
.status-main { display: grid; gap: .55rem; justify-items: end; text-align: right; }
.status-caption { color: var(--muted); font-size: .66rem; }

.case-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(240px, .8fr); flex: 1; }
.main-work { padding: 1.6rem clamp(1.25rem, 3vw, 2.25rem) 1.8rem; }
.side-work { padding: 1.55rem 1.25rem; border-left: 1px solid var(--line); background: var(--surface-soft); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.section-heading h3 { margin: 0; font-size: .84rem; letter-spacing: -.015em; }
.section-heading small { color: var(--muted); font-size: .66rem; }
.validation-stack { display: grid; gap: .58rem; }
.validation-row { display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: .66rem; padding: .68rem .72rem; border: 1px solid var(--line); border-radius: 9px; }
.validation-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; font-size: .75rem; font-weight: 800; }
.validation-row.pass .validation-icon { color: var(--green); background: var(--green-soft); }
.validation-row.block .validation-icon { color: var(--coral); background: var(--coral-soft); }
.validation-title { font-size: .76rem; font-weight: 700; }
.validation-detail { margin-top: .12rem; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.flag { color: var(--green); background: var(--green-soft); }
.flag.block { color: var(--coral); background: var(--coral-soft); }

.draft-area { margin-top: 1.6rem; }
.draft-tabs { display: flex; gap: 1rem; margin-bottom: -.5px; border-bottom: 1px solid var(--line); }
.draft-tab { padding: .52rem 0 .65rem; border: 0; color: var(--muted); background: transparent; font-size: .72rem; font-weight: 700; }
.draft-tab.is-active { position: relative; color: var(--ink); }
.draft-tab.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; border-radius: 2px; background: var(--ink); content: ""; }
.draft-card { margin-top: 1rem; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; }
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .66rem .82rem; border-bottom: 1px solid var(--line); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .64rem; }
.draft-bar-left { display: flex; align-items: center; gap: .48rem; min-width: 0; }
.channel-indicator { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.copy-button { padding: .24rem .42rem; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-2); background: white; font-family: inherit; font-size: .62rem; font-weight: 700; }
.draft-body { padding: 1rem .95rem 1.1rem; color: var(--ink-2); font-size: .75rem; line-height: 1.57; }
.draft-body p { margin: 0 0 .75rem; }
.draft-body p:last-child { margin-bottom: 0; }
.message-logic { display: grid; gap: .45rem; margin: .9rem 0; padding: .74rem; border-left: 2px solid var(--gold); border-radius: 0 7px 7px 0; background: #fffaf0; }
.message-logic div { display: grid; grid-template-columns: 78px 1fr; gap: .35rem; }
.message-logic span { color: var(--muted); font-size: .63rem; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.message-logic strong { color: var(--ink-2); font-size: .69rem; font-weight: 650; }
.evidence-panel { padding: .9rem; color: var(--ink-2); font-size: .73rem; line-height: 1.55; }
.evidence-panel dl { display: grid; grid-template-columns: minmax(92px, .45fr) 1fr; gap: .65rem .9rem; margin: 0; }
.evidence-panel dt { color: var(--muted); font-size: .64rem; }
.evidence-panel dd { margin: 0; font-weight: 650; }

.action-card { margin-top: 1.1rem; padding: .85rem; border: 1px solid #cfe1d5; border-radius: 10px; background: #f3faf5; }
.action-card h4 { margin: 0; font-size: .76rem; }
.action-card p { margin: .25rem 0 .75rem; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.action-row { display: flex; align-items: center; gap: .55rem; }
.primary-button, .secondary-button { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; gap: .42rem; padding: .45rem .68rem; border-radius: 7px; font-size: .7rem; font-weight: 750; }
.primary-button { border: 1px solid var(--ink); color: white; background: var(--ink); }
.primary-button:hover { background: #25434b; }
.primary-button:disabled { cursor: wait; opacity: .62; }
.secondary-button { border: 1px solid var(--line-strong); color: var(--ink-2); background: white; }

.side-section + .side-section { margin-top: 1.55rem; padding-top: 1.35rem; border-top: 1px solid var(--line); }
.side-section h3 { margin: 0 0 .78rem; color: var(--ink-2); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.case-facts { display: grid; gap: .7rem; }
.case-fact { display: grid; gap: .14rem; }
.case-fact span { color: var(--muted); font-size: .65rem; }
.case-fact strong { font-size: .74rem; font-weight: 700; line-height: 1.35; }
.case-fact a { color: var(--green); text-decoration: none; }
.activity { position: relative; display: grid; gap: .9rem; padding-left: 1rem; }
.activity::before { position: absolute; top: .2rem; bottom: .2rem; left: 3px; width: 1px; background: var(--line-strong); content: ""; }
.activity-item { position: relative; display: grid; gap: .14rem; }
.activity-item::before { position: absolute; top: .23rem; left: -1rem; width: 7px; height: 7px; border: 2px solid var(--surface-soft); border-radius: 50%; background: var(--line-strong); content: ""; }
.activity-item.is-current::before { background: var(--gold); }
.activity-item.is-complete::before { background: var(--green); }
.activity-item strong { color: var(--ink-2); font-size: .69rem; }
.activity-item span { color: var(--muted); font-size: .63rem; line-height: 1.35; }
.adviser-card { display: flex; align-items: center; gap: .65rem; padding: .68rem; border-radius: 8px; background: #eef0eb; }
.adviser-avatar { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: #3f6261; font-size: .61rem; font-weight: 750; }
.adviser-card strong { display: block; font-size: .7rem; }
.adviser-card span { color: var(--muted); font-size: .63rem; }
.disclaimer { margin: 1.55rem 0 0; color: var(--muted); font-size: .61rem; line-height: 1.45; }

.workflow-note { display: grid; grid-template-columns: .9fr 1.7fr; gap: 4rem; margin-top: 2rem; padding: 2.1rem .2rem 0; border-top: 1px solid var(--line); }
.workflow-note h2 { max-width: 390px; margin: .55rem 0 .7rem; font-size: 1.28rem; letter-spacing: -.045em; line-height: 1.08; }
.workflow-note-copy > p:last-child { max-width: 475px; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.workflow-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.workflow-steps li { display: grid; align-content: start; gap: .42rem; }
.workflow-steps span { color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .66rem; font-weight: 750; }
.workflow-steps strong { font-size: .77rem; }
.workflow-steps small { color: var(--muted); font-size: .7rem; line-height: 1.45; }

.empty-state { padding: 2rem .9rem; color: var(--muted); font-size: .76rem; text-align: center; }
.toast { position: fixed; z-index: 30; right: 1rem; bottom: 1rem; max-width: 290px; padding: .75rem .9rem; border: 1px solid #b9d9c7; border-radius: 9px; color: #15533f; background: #e8f7ed; box-shadow: 0 12px 32px rgb(22 52 43 / 16%); font-size: .75rem; font-weight: 650; opacity: 0; pointer-events: none; transform: translateY(.5rem); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1000px) {
  .intro { display: grid; gap: 1.5rem; }
  .workspace-shell { grid-template-columns: 290px minmax(0, 1fr); }
  .case-body { grid-template-columns: 1fr; }
  .side-work { border-top: 1px solid var(--line); border-left: 0; }
  .side-work { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .side-section + .side-section { margin-top: 0; padding-top: 0; border-top: 0; }
  .disclaimer { display: none; }
  .workflow-note { grid-template-columns: 1fr; gap: 1.6rem; }
}

@media (max-width: 760px) {
  .topbar { min-height: 61px; padding: 0 1rem; }
  .product-badge, .demo-label { display: none; }
  main { padding-right: 1rem; padding-left: 1rem; }
  .intro { padding: 2.6rem 0 1.7rem; }
  .intro h1 { font-size: clamp(2.1rem, 11vw, 3.2rem); }
  .intro-meta { width: 100%; justify-content: space-around; }
  .workspace-shell { display: flex; min-height: 0; flex-direction: column; overflow: visible; }
  .queue-panel { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .case-list { display: flex; overflow-x: auto; padding: .6rem; }
  .case-item { min-width: 230px; }
  .queue-footer { display: none; }
  .case-header { padding: 1.25rem; }
  .case-header-actions .icon-button { display: none; }
  .status-main { align-items: end; }
  .case-body { display: block; }
  .main-work { padding: 1.25rem; }
  .side-work { display: grid; grid-template-columns: 1fr; padding: 1.25rem; }
  .side-section + .side-section { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
  .message-logic div { grid-template-columns: 1fr; gap: .1rem; }
  .workflow-steps { grid-template-columns: 1fr; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; } }
