:root {
  color-scheme: light;
  --navy-950: #10223f;
  --navy-900: #17345f;
  --navy-800: #1e4679;
  --navy-100: #e7eef7;
  --ink: #172033;
  --ink-soft: #536176;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --muted: #edf1f5;
  --border: #d8dfe7;
  --border-strong: #bdc8d5;
  --gold: #9a6515;
  --gold-soft: #fbf3e5;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #9a5b13;
  --warning-soft: #fff6e6;
  --success: #18734b;
  --success-soft: #eaf7f1;
  --focus: #2368c4;
  --shadow-sm: 0 1px 2px rgba(16, 34, 63, .06);
  --shadow-md: 0 8px 24px rgba(16, 34, 63, .08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "STSong", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
}

button, textarea, input { font: inherit; }
button, label[for="contract-file"] { touch-action: manipulation; }

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
a:focus-visible,
label[for="contract-file"]:focus-within {
  outline: 3px solid rgba(35, 104, 196, .28);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: var(--navy-950);
  color: #fff;
  border-radius: var(--radius-sm);
}
.skip-link:focus { transform: translateY(0); }

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 28px;
  background: var(--navy-950);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-lockup, .header-meta, .boundary-head, .input-actions, .submit-row, .safety-note, .privacy-chip {
  display: flex;
  align-items: center;
}

.brand-lockup { gap: 12px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 24px;
}
.eyebrow {
  margin: 0 0 2px;
  color: #aebdd0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand-title { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .03em; }
.header-meta { gap: 18px; color: #d9e2ee; font-size: 13px; }
.account-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
  text-align: left;
}
.account-button:hover { background: rgba(255,255,255,.12); }
.account-button strong, .account-button small { display: block; }
.account-button strong { font-size: 12px; }
.account-button small { color: #b8c5d6; font-size: 10px; }
.account-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #d9e2ee; color: var(--navy-950); font-weight: 750; }
.environment-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}
.status-dot { width: 7px; height: 7px; background: #75d9a8; border-radius: 50%; box-shadow: 0 0 0 3px rgba(117,217,168,.14); }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100dvh - 72px); }
.sidebar {
  padding: 26px 18px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
}
.tenant-name { margin: 0 10px 2px; color: #26364d; font-size: 13px; font-weight: 750; }
.workspace-name { margin: 0 10px 25px; color: #7b8798; font-size: 11px; }
.primary-nav { display: grid; gap: 4px; }
.nav-section-label { margin: 0 10px 10px; color: #7b8798; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nav-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 4px;
  padding: 10px 11px;
  border-radius: 8px;
  color: #42516a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 560;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-item svg, .privacy-chip svg, .safety-note svg, .boundary-head svg, .file-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item.active { background: var(--navy-100); color: var(--navy-900); }
.nav-item.disabled { color: #9aa5b4; }
.nav-item small { margin-left: auto; font-size: 10px; font-weight: 500; }
.nav-badge { min-width: 21px; margin-left: auto; padding: 2px 6px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 10px; text-align: center; }
.boundary-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #f9fafb; }
.boundary-head { gap: 8px; color: var(--navy-900); }
.boundary-head h2 { margin: 0; font-size: 14px; }
.boundary-card dl { margin: 14px 0; }
.boundary-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #e5eaf0; font-size: 12px; }
.boundary-card dl div:last-child { border-bottom: 0; }
.boundary-card dt { color: #748196; }
.boundary-card dd { margin: 0; color: #344258; font-weight: 600; text-align: right; }
.boundary-card p { margin: 10px 0 0; color: #6d798a; font-size: 11px; line-height: 1.55; }

.workspace { width: min(1260px, 100%); margin: 0 auto; padding: 42px 48px 72px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 26px; }
.page-heading .eyebrow { color: var(--gold); }
h1 { margin: 4px 0 8px; font-family: var(--font-serif); font-size: clamp(30px, 4vw, 42px); font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.page-summary { max-width: 640px; margin: 0; color: var(--ink-soft); }
.privacy-chip { gap: 7px; flex: 0 0 auto; padding: 8px 12px; border: 1px solid #d9c49e; border-radius: 999px; background: var(--gold-soft); color: #6f4a12; font-size: 12px; font-weight: 650; }
.privacy-chip svg { width: 16px; height: 16px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #e9eef4;
}
.login-screen::before { content: ""; position: fixed; inset: 0 0 auto; height: 36%; background: var(--navy-950); }
.login-card { position: relative; z-index: 1; width: min(520px, 100%); padding: 34px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 22px 60px rgba(16,34,63,.18); }
.login-brand { width: max-content; margin: -57px auto 36px; padding: 12px 16px; border-radius: 10px; background: var(--navy-950); color: #fff; box-shadow: var(--shadow-md); }
.login-kicker { margin: 0 0 2px; color: var(--gold); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.login-card h1 { font-size: 34px; }
.login-copy { margin: 0 0 22px; color: var(--ink-soft); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 22px; padding: 4px; border-radius: 9px; background: var(--muted); }
.auth-tab { min-height: 40px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-soft); cursor: pointer; font-weight: 650; }
.auth-tab.active { background: #fff; color: var(--navy-900); box-shadow: var(--shadow-sm); }
.auth-form { display: grid; }
.auth-form .field-label { margin-top: 12px; }
.auth-form .field-label:first-child { margin-top: 0; }
.auth-submit { width: 100%; margin-top: 20px; }
.field-help { margin-top: 6px; color: #738095; font-size: 11px; }
.login-options { display: grid; gap: 10px; }
.identity-button { min-height: 72px; display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; text-align: left; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.identity-button:hover { border-color: #8fa1b7; background: #f8fafc; box-shadow: var(--shadow-sm); }
.identity-button strong, .identity-button small { display: block; }
.identity-button strong { font-size: 14px; }
.identity-button small { margin-top: 2px; color: #738095; font-size: 12px; }
.identity-avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--navy-100); color: var(--navy-900); font-weight: 750; }
.login-note { margin: 18px 0 0; color: #8a95a5; font-size: 11px; text-align: center; }

.workspace-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.workspace-stats article { min-height: 132px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-sm); }
.workspace-stats span, .workspace-stats small { display: block; color: #748196; font-size: 12px; }
.workspace-stats strong { display: block; margin: 6px 0 2px; color: var(--navy-950); font-family: Georgia, serif; font-size: 34px; font-variant-numeric: tabular-nums; }
.dashboard-panel { padding: 22px; }
.task-list { display: grid; }
.task-row { min-height: 66px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 8px; border: 0; border-bottom: 1px solid #e7ebf0; background: #fff; color: var(--ink); cursor: pointer; text-align: left; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #f8fafc; }
.task-main strong, .task-main small { display: block; }
.task-main strong { font-size: 14px; }
.task-main small, .task-meta small { margin-top: 3px; color: #7c8899; font-size: 11px; }
.task-meta { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.task-meta svg { width: 17px; height: 17px; fill: none; stroke: #7c8899; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-state { padding: 42px 20px; color: #69768a; text-align: center; }
.empty-state strong { color: #35445a; }
.empty-state p { margin: 5px 0 18px; }

.agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.agent-card { position: relative; padding: 26px; }
.agent-card > .status-badge { position: absolute; top: 26px; right: 26px; }
.agent-card h2 { margin: 20px 0 7px; font-family: var(--font-serif); font-size: 23px; }
.agent-card p { color: var(--ink-soft); }
.agent-card ul { margin: 18px 0 24px; padding-left: 20px; color: #526075; font-size: 13px; }
.agent-card li { margin: 6px 0; }
.agent-card.planned { opacity: .68; min-height: 220px; }
.agent-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 9px; background: var(--navy-100); color: var(--navy-900); }
.agent-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.back-button { min-height: 36px; margin: 0 0 10px -8px; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--navy-800); cursor: pointer; font-weight: 700; }
.back-button:hover { background: var(--navy-100); }
.input-panel { padding: 26px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.panel-header.compact { margin-bottom: 16px; }
.panel-header h2, .decision-panel h2 { margin: 2px 0 0; font-family: var(--font-serif); font-size: 21px; line-height: 1.3; }
.step-label { color: var(--gold); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.input-actions { gap: 10px; }
.field-label { display: block; margin: 0 0 8px; color: #2f3b4f; font-size: 13px; font-weight: 700; }
.field-label span { color: var(--danger); }
textarea {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  padding: 15px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.75;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input[type="text"], input[type="email"], input[type="password"] { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--ink); }
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(35,104,196,.12); outline: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.file-drop { min-height: 88px; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px dashed #9eabb9; border-radius: 9px; background: #f8fafc; color: #35445a; cursor: pointer; }
.file-drop:hover { border-color: var(--navy-800); background: #f3f6fa; }
.file-drop > span:nth-child(3) { min-width: 0; flex: 1; }
.file-drop strong, .file-drop small { display: block; }
.file-drop small { margin-top: 3px; color: #738095; font-size: 11px; overflow-wrap: anywhere; }
.file-drop-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--navy-100); color: var(--navy-900); }
.file-drop-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.file-drop.has-file { border-style: solid; border-color: #9dcdb8; background: var(--success-soft); }
.file-drop.uploading { opacity: .7; pointer-events: none; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #8591a2; font-size: 11px; }
.or-divider::before, .or-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.input-panel.readonly-task .panel-header button,
.input-panel.readonly-task .form-grid,
.input-panel.readonly-task .file-drop,
.input-panel.readonly-task .or-divider,
.input-panel.readonly-task .submit-row { display: none; }
.input-panel.readonly-task textarea { background: #f8fafc; }
textarea:hover { border-color: #9eabb9; }
textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(35,104,196,.12); outline: 0; }
textarea::placeholder { color: #929cab; }
.field-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 7px; color: #778398; font-size: 12px; }
.field-meta p { margin: 0; }
.field-meta output { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.primary-button, .secondary-button, .danger-button, .text-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.primary-button { background: var(--navy-900); color: #fff; box-shadow: 0 2px 5px rgba(23,52,95,.18); }
.primary-button:hover { background: var(--navy-800); }
.secondary-button { border-color: var(--border-strong); background: #fff; color: #3b4a61; }
.secondary-button:hover { background: #f4f6f8; border-color: #98a7b8; }
.danger-button { border-color: #edc2bd; background: #fff; color: var(--danger); }
.danger-button:hover { background: var(--danger-soft); }
.text-button { min-height: 44px; padding-inline: 10px; background: transparent; color: var(--navy-800); }
.text-button:hover { background: var(--navy-100); }
button:disabled { cursor: not-allowed; opacity: .52; }
.file-button { cursor: pointer; }
.submit-row { justify-content: space-between; gap: 20px; margin-top: 20px; }
.safety-note { gap: 8px; color: #69768a; font-size: 12px; }
.safety-note svg { color: var(--warning); }
.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.primary-button.loading .spinner { display: block; }

.inline-message { margin-top: 12px; padding: 10px 12px; border-radius: 6px; font-size: 13px; }
.error-message { border: 1px solid #f0c5c0; background: var(--danger-soft); color: #8f2018; }
.section-divider { display: flex; align-items: center; gap: 14px; margin: 36px 0 18px; color: #7c8798; font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.section-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.result-summary { display: flex; justify-content: space-between; gap: 32px; padding: 24px 26px; border-left: 4px solid var(--gold); }
.result-copy h2 { margin: 10px 0 5px; font-family: var(--font-serif); font-size: 24px; }
.result-copy p { margin: 0; color: var(--ink-soft); }
.status-badge, .count-badge, .severity-badge { display: inline-flex; align-items: center; border-radius: 999px; font-size: 11px; font-weight: 750; }
.status-badge { padding: 5px 9px; }
.status-review { background: var(--warning-soft); color: #835012; }
.status-approved { background: var(--success-soft); color: var(--success); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }
.status-changes { background: var(--navy-100); color: var(--navy-800); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); margin: 0; border-left: 1px solid var(--border); }
.metrics div { min-width: 100px; padding: 6px 22px; border-right: 1px solid var(--border); text-align: center; }
.metrics div:last-child { border-right: 0; }
.metrics dt { color: #738095; font-size: 11px; }
.metrics dd { margin: 4px 0 0; color: var(--navy-950); font-family: Georgia, serif; font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .85fr); gap: 20px; margin-top: 20px; align-items: start; }
.findings-panel, .trace-panel, .decision-panel { padding: 22px; }
.count-badge { padding: 5px 9px; background: var(--muted); color: #59677b; }
.findings-list { display: grid; gap: 12px; }
.finding-card { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.finding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 16px 10px; }
.finding-head h3 { margin: 0; font-size: 15px; }
.finding-meta { margin: 4px 0 0; color: #7a8799; font-size: 11px; }
.severity-badge { flex: 0 0 auto; padding: 5px 8px; }
.severity-high { background: var(--danger-soft); color: var(--danger); }
.severity-medium { background: var(--warning-soft); color: var(--warning); }
.severity-low { background: var(--success-soft); color: var(--success); }
.finding-summary { margin: 0; padding: 0 16px 13px; color: #4d5a6e; font-size: 13px; }
.finding-summary strong, .recommendation-block strong { display: block; margin-bottom: 4px; color: #2f3c50; font-size: 11px; letter-spacing: .04em; }
.evidence-block { margin: 0 16px 15px; padding: 11px 12px; background: #f6f8fa; border-left: 3px solid #aab7c7; color: #37455b; font-family: var(--font-serif); font-size: 13px; }
.evidence-empty { color: #7b8797; font-family: var(--font-sans); font-style: italic; }
.recommendation-block { margin: 0 16px 15px; padding: 11px 12px; border-radius: 6px; background: var(--gold-soft); color: #5e481f; font-size: 12px; }
.recommendation-block p { margin: 0; }
.finding-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; background: #fbfcfd; border-top: 1px solid #e7ebf0; color: #758196; font-size: 11px; }
.locate-button { min-height: 32px; padding: 4px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--navy-800); cursor: pointer; font-size: 11px; font-weight: 700; }
.locate-button:hover { background: var(--navy-100); }
.detail-column { display: grid; gap: 20px; }
.panel-intro { margin: -4px 0 16px; color: #6f7c8f; font-size: 12px; }
.trace-list { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; max-height: 460px; overflow: auto; }
.trace-item { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 7px 0; }
.trace-item::before { content: ""; position: absolute; top: 20px; bottom: -8px; left: 5px; width: 1px; background: var(--border); }
.trace-item:last-child::before { display: none; }
.trace-node { z-index: 1; width: 11px; height: 11px; margin-top: 5px; border: 2px solid #8292a6; border-radius: 50%; background: #fff; }
.trace-copy strong { display: block; color: #3a475b; font-size: 12px; font-weight: 650; }
.trace-copy small { display: block; color: #8490a1; font-size: 10px; }
.decision-panel textarea { font-family: var(--font-sans); font-size: 13px; line-height: 1.55; }
.decision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.approve-button { grid-column: 1 / -1; }
.decision-complete { padding: 13px; border-radius: 7px; background: var(--success-soft); color: #176440; font-size: 13px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 8px; background: var(--navy-950); color: #fff; box-shadow: var(--shadow-md); font-size: 13px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .workspace { padding-inline: 28px; }
  .review-layout { grid-template-columns: 1fr; }
  .detail-column { grid-template-columns: 1fr 1fr; }
  .workspace-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-header { position: static; padding: 12px 16px; }
  .header-meta .tenant-label { display: none; }
  .environment-badge { display: none; }
  .brand-title { font-size: 14px; }
  .app-shell { display: block; }
  .sidebar { padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar nav { display: flex; gap: 5px; overflow-x: auto; }
  .tenant-name, .workspace-name, .nav-section-label, .boundary-card, .nav-item.disabled { display: none; }
  .nav-item { margin: 0; white-space: nowrap; }
  .workspace { padding: 26px 16px 56px; }
  .page-heading, .panel-header, .result-summary { flex-direction: column; }
  .privacy-chip { align-self: flex-start; }
  .input-panel, .findings-panel, .trace-panel, .decision-panel { padding: 18px; }
  .panel-header { gap: 14px; }
  .input-actions { width: 100%; justify-content: space-between; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .field-meta { flex-direction: column; gap: 2px; }
  .metrics { width: 100%; border-left: 0; border-top: 1px solid var(--border); padding-top: 14px; }
  .metrics div { min-width: 0; padding-inline: 9px; }
  .detail-column { grid-template-columns: 1fr; }
  .decision-actions { grid-template-columns: 1fr; }
  .approve-button { grid-column: auto; }
  .workspace-stats, .agent-grid, .form-grid { grid-template-columns: 1fr; }
  .workspace-stats article { min-height: 104px; }
  .task-row { align-items: flex-start; }
  .task-meta small { display: none; }
  .file-drop { align-items: flex-start; flex-wrap: wrap; }
  .file-drop .secondary-button { width: 100%; }
  .login-card { padding: 26px 20px; }
  .login-brand { margin-top: -49px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
