:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #68736d;
  --line: #dcded8;
  --paper: #fbfcf9;
  --canvas: #f2f4ef;
  --green: #24513d;
  --green-2: #3f755a;
  --green-soft: #e8f0ea;
  --gold: #a56c22;
  --gold-soft: #fff4dc;
  --red: #9f413d;
  --red-soft: #fcebea;
  --shadow: 0 18px 55px rgba(38, 54, 46, .09);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
[hidden] { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
  background:
    radial-gradient(circle at 18% 18%, rgba(99, 143, 117, .22), transparent 30rem),
    linear-gradient(135deg, #163d2d 0 53%, #f4f2e9 53%);
  padding: 6vw;
  gap: 8vw;
  align-items: center;
}

.auth-copy { color: white; max-width: 680px; }
.auth-copy h1 { font: 600 clamp(38px, 5vw, 70px)/1.18 Georgia, "Songti SC", serif; letter-spacing: -.03em; margin: 22px 0; }
.auth-copy .lead { color: rgba(255,255,255,.72); font-size: 18px; max-width: 560px; line-height: 1.8; }
.trust-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 34px; }
.trust-row span { border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 8px 13px; color: rgba(255,255,255,.82); font-size: 13px; }
.brand-mark { width: 58px; height: 58px; border: 1px solid rgba(255,255,255,.6); display: grid; place-items: center; border-radius: 16px 4px 16px 4px; font: 600 28px Georgia, serif; }
.brand-mark.small { width: 39px; height: 39px; border-color: #94aa9e; color: var(--green); font-size: 20px; border-radius: 11px 3px 11px 3px; }
.auth-card { width: 100%; max-width: 500px; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.72); padding: clamp(28px, 4vw, 50px); border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.auth-card h2 { font: 600 30px Georgia, "Songti SC", serif; margin: 7px 0 8px; }

.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--green-2); margin: 0 0 6px; }
.auth-copy .eyebrow { color: #b9d0c2; }
.muted { color: var(--muted); line-height: 1.6; }
.small-copy { font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 650; color: #47564f; margin: 16px 0 7px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd4ce;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition: border .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(63,117,90,.12); }
textarea { min-height: 138px; line-height: 1.65; resize: vertical; }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; line-height: 1.5; }
.check-row input { width: auto; margin-top: 3px; accent-color: var(--green); }
.link-button { color: var(--green); background: none; border: 0; padding: 0; text-decoration: underline; }
.primary, .secondary, .logout, .icon-button {
  border: 0;
  border-radius: 10px;
  padding: 11px 15px;
  font-weight: 700;
}
.primary { background: var(--green); color: white; width: 100%; margin-top: 17px; }
.primary:hover { background: #193f2f; }
.secondary { background: var(--green-soft); color: var(--green); }
.form-status { min-height: 22px; color: var(--red); font-size: 13px; margin-bottom: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
.app-shell.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 50; height: 100vh; min-width: 0; overflow: hidden; background: #f9faf7; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 5px 18px; }
.brand strong, .brand span { display: block; }
.brand strong { font: 600 20px Georgia, "Songti SC", serif; }
.brand span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.brand-copy { min-width: 0; flex: 1; white-space: nowrap; }
.sidebar-control { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 20px; }
.sidebar-control:hover, .sidebar-control:focus-visible { color: var(--green); background: var(--green-soft); }
.mobile-only { display: none; }
.sidebar-new-thread { width: 100%; display: flex; align-items: center; gap: 10px; border: 1px solid #cbd7cf; border-radius: 11px; padding: 11px 12px; margin-bottom: 12px; background: white; color: var(--green); text-align: left; font-weight: 750; }
.sidebar-new-thread:hover { background: var(--green-soft); }
nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; color: #536058; padding: 12px 13px; border-radius: 10px; text-align: left; font-weight: 650; }
.nav-item:hover { background: #eef2ed; }
.nav-item.active { color: var(--green); background: var(--green-soft); }
.nav-item span:first-child { width: 20px; text-align: center; }
.sidebar-history { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; margin: 20px -4px 12px 0; padding-right: 4px; scrollbar-width: thin; }
.sidebar-section + .sidebar-section { margin-top: 20px; }
.sidebar-section-heading { min-height: 30px; display: flex; justify-content: space-between; align-items: center; padding: 0 8px; }
.sidebar-section-heading h2 { margin: 0; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.sidebar-section-heading .icon-button { font-size: 15px; padding: 4px 6px; }
.sidebar-list { min-width: 0; gap: 3px; }
.sidebar-list .list-item { min-width: 0; max-width: 100%; overflow: hidden; border: 0; background: transparent; border-radius: 9px; padding: 8px; }
.sidebar-list .list-item:hover, .sidebar-list .list-item.active { background: #edf1ec; }
.sidebar-list .list-item strong { font-weight: 650; }
.sidebar-list .list-item small { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-list .empty { border: 0; padding: 10px 8px; text-align: left; }
.scope-card { margin-top: auto; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 13px; display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.scope-card strong { color: var(--ink); font-size: 13px; }
.scope-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.logout { margin-top: 10px; color: #66726b; background: transparent; border: 1px solid var(--line); }
.account-entry { margin-top: 10px; width: 100%; border: 1px solid #cbd7cf; border-radius: 12px; background: var(--green-soft); color: var(--green); padding: 11px 12px; text-align: left; }
.account-entry span, .account-entry small { display: block; }
.account-entry span { font-weight: 750; }
.account-entry small { margin-top: 3px; color: var(--muted); }
.app-shell.sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .sidebar-history,
.app-shell.sidebar-collapsed .scope-card,
.app-shell.sidebar-collapsed .logout,
.app-shell.sidebar-collapsed .account-entry,
.app-shell.sidebar-collapsed .nav-item span:last-child,
.app-shell.sidebar-collapsed .sidebar-new-thread span:last-child { display: none; }
.app-shell.sidebar-collapsed .desktop-only { position: absolute; top: 62px; transform: rotate(180deg); }
.app-shell.sidebar-collapsed .sidebar-new-thread,
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding-inline: 8px; }
.app-shell.sidebar-collapsed .nav-item span:first-child { width: auto; }
.sidebar-backdrop { display: none; }

.content-shell { min-width: 0; }
.site-compliance-footer { padding: 0 24px 24px; text-align: center; font-size: 12px; }
.site-compliance-footer a { color: var(--muted); text-decoration: none; }
.site-compliance-footer a:hover, .site-compliance-footer a:focus-visible { color: var(--green); text-decoration: underline; }
.topbar { position: sticky; top: 0; z-index: 30; height: 82px; padding: 16px clamp(24px, 4vw, 56px); border-bottom: 1px solid var(--line); background: rgba(249,250,247,.9); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topbar-title { flex: 1; }
.topbar h1 { font: 600 26px Georgia, "Songti SC", serif; margin: 0; }
.user-chip { display: flex; gap: 10px; align-items: center; }
.user-chip > span { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: white; display: grid; place-items: center; font-weight: 800; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 13px; }
.user-chip small { color: var(--muted); margin-top: 3px; }
.view { padding: 24px clamp(24px, 4vw, 56px) 60px; max-width: 1600px; margin: 0 auto; }
.auth-main-view { min-height: calc(100vh - 82px); background: radial-gradient(circle at 12% 16%, rgba(99,143,117,.2), transparent 28rem); }
.auth-main-grid { min-height: calc(100vh - 150px); display: grid; grid-template-columns: minmax(0, .8fr) minmax(420px, 1.2fr); gap: clamp(28px, 6vw, 90px); align-items: center; max-width: 1120px; margin: 0 auto; }
.compact-auth-copy { color: var(--ink); }
.compact-auth-copy .eyebrow { color: var(--green-2); }
.compact-auth-copy h2 { font: 600 clamp(34px, 5vw, 58px)/1.2 Georgia, "Songti SC", serif; margin: 16px 0; }
.compact-auth-copy .lead { color: var(--muted); }
.auth-column { display: grid; gap: 16px; }
.auth-main-view .auth-card { max-width: none; padding: 28px; border-color: var(--line); }
.register-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.institution-login { background: rgba(255,255,255,.65); }
.related-web-links { display: grid; gap: 8px; margin-top: 16px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; }
.related-web-links h3 { margin: 0 0 4px; font-size: 14px; }
.notice-banner { border: 1px solid #ead9af; background: var(--gold-soft); border-radius: 12px; padding: 11px 15px; display: flex; gap: 12px; align-items: center; font-size: 13px; color: #66502d; margin-bottom: 18px; }
.notice-banner strong { color: #7b521c; white-space: nowrap; }
.assistant-workspace { min-height: calc(100vh - 166px); max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.conversation-viewport { flex: 1; display: flex; flex-direction: column; min-height: 360px; }
.assistant-welcome { max-width: 650px; margin: auto; padding: 54px 20px; text-align: center; color: var(--muted); }
.assistant-welcome h2 { margin: 10px 0; color: var(--ink); font: 600 clamp(28px, 4vw, 42px) Georgia, "Songti SC", serif; }
.assistant-welcome p:last-child { line-height: 1.8; }
.welcome-mark { width: 52px; height: 52px; margin: 0 auto 18px; display: grid; place-items: center; border: 1px solid #a8b9ae; border-radius: 16px 5px 16px 5px; color: var(--green); font: 600 24px Georgia, serif; }
.conversation-canvas { width: 100%; padding: 4px 0 24px; }
.conversation-canvas:empty { display: none; }
.composer-card { position: sticky; bottom: 16px; z-index: 20; max-height: min(70vh, 680px); overflow-y: auto; background: rgba(251,252,249,.96); border: 1px solid #cfd6d0; border-radius: 18px; padding: 16px 18px 18px; box-shadow: 0 16px 45px rgba(38,54,46,.12); backdrop-filter: blur(14px); }
.composer-card .segmented { margin-bottom: 12px; }
.composer-card .section-heading { margin-bottom: 8px; }
.composer-card .section-heading h2 { font-size: 18px; }
.composer-card textarea { min-height: 92px; }
.composer-card .primary { width: auto; min-width: 190px; float: right; }
.composer-card form::after { content: ""; display: block; clear: both; }
.composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.query-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 9px; }
.query-presets button { border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--green); padding: 5px 8px; font-size: 11px; }
.quick-composer-form textarea { min-height: 82px; margin: 0; }
.composer-footer { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.composer-footer .date-control { width: auto; display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); white-space: nowrap; }
.composer-footer .date-control input { width: 148px; padding: 8px 9px; }
.composer-boundary { flex: 1; margin: 0; color: var(--muted); font-size: 11px; }
.composer-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: 11px; }
.composer-divider::before, .composer-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
#documentReviewForm { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.58); }
#documentReviewForm .composer-boundary { margin: 4px 0 12px; }
.sample-download { display: inline-block; margin: 0 12px 10px 0; color: var(--green); font-size: 12px; }
.composer-footer .primary { float: none; min-width: 170px; margin: 0; padding: 9px 13px; }
.work-card, .result-zone, .gated-card, .task-index { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 30px rgba(38,54,46,.04); }
.work-card { padding: 22px; }
.work-card.narrow { max-width: 900px; margin-bottom: 18px; }
.segmented { display: inline-flex; padding: 4px; background: #e9ede8; border-radius: 10px; margin-bottom: 24px; }
.segment { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 8px 14px; font-weight: 650; }
.segment.active { background: #fff; color: var(--green); box-shadow: 0 2px 8px rgba(39,58,48,.09); }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-heading.compact { align-items: center; margin-bottom: 4px; }
.section-heading h2, .tasks-toolbar h2 { margin: 0; font: 600 22px Georgia, "Songti SC", serif; }
.soft-badge { color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 6px 9px; font-size: 11px; white-space: nowrap; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.button-row { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.button-row button { width: auto; margin: 0; min-width: 100px; }
.icon-button { background: transparent; color: var(--green); font-size: 19px; padding: 6px; }
.stack-list, .data-list, .audit-list { display: grid; gap: 8px; }
.empty { color: var(--muted); font-size: 13px; border: 1px dashed #ccd2cc; border-radius: 10px; padding: 18px; text-align: center; }
.empty.error-state { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, white); background: #fff8f7; }
.list-item { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px; }
.list-item button { width: 100%; border: 0; background: transparent; text-align: left; color: inherit; padding: 0; }
.list-item strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item small { display: block; color: var(--muted); margin-top: 5px; }
.result-zone { padding: 22px; min-height: 0; }
.result-zone:empty { display: none; }
.result-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 15px; margin-bottom: 15px; }
.result-header h2 { font: 600 22px Georgia, "Songti SC", serif; margin: 0 0 6px; }
.status-pill { border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 800; background: var(--green-soft); color: var(--green); }
.status-pill.warning { background: var(--gold-soft); color: var(--gold); }
.status-pill.danger { background: var(--red-soft); color: var(--red); }
.answer-item { border-left: 3px solid var(--green-2); padding: 7px 13px; margin: 12px 0; line-height: 1.7; background: #f6f8f5; border-radius: 0 9px 9px 0; }
.citation-token { color: var(--green); font: 12px ui-monospace, monospace; margin-left: 8px; }
.evidence-grid { display: grid; gap: 8px; margin-top: 16px; }
.evidence-card { border: 1px solid var(--line); border-radius: 11px; background: white; padding: 12px 14px; }
.evidence-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.evidence-card h3 { font-size: 14px; margin: 0 0 7px; }
.evidence-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.evidence-meta span { padding: 4px 6px; border-radius: 6px; background: #eff2ee; color: var(--muted); font-size: 10px; }
.quote { white-space: pre-wrap; background: #f1f4f1; border-radius: 8px; padding: 10px; color: #4d5b53; font: 12px/1.6 ui-monospace, "SFMono-Regular", monospace; }
.source-link { color: var(--green); font-size: 12px; display: inline-block; margin-top: 9px; }
.source-report-actions { min-height: 32px; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.source-report-button { border: 1px solid #c9d7ce; background: #fff; color: var(--green); border-radius: 8px; padding: 7px 9px; font-size: 12px; font-weight: 700; }
.source-report-button:hover, .source-report-button:focus-visible { background: var(--green-soft); outline: 2px solid transparent; box-shadow: 0 0 0 3px rgba(63,117,90,.14); }
.source-detail-button { border: 0; background: transparent; color: var(--green); padding: 0; margin: 0; font-size: 12px; white-space: nowrap; text-decoration: underline; }
.source-report-status { margin: 0; color: var(--green); background: var(--green-soft); border-radius: 8px; padding: 7px 9px; font-size: 12px; font-weight: 750; }
.source-report-unavailable { color: var(--muted); font-size: 11px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.action-row button { width: auto; margin: 0; }
.danger-button { border: 1px solid #edc8c5; color: var(--red); background: #fff; border-radius: 9px; padding: 9px 12px; font-weight: 700; }
.tasks-toolbar { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 18px; }
.compact-button { width: auto; margin: 0; white-space: nowrap; }
.gated-card { padding: 14px 17px; margin-bottom: 18px; background: #faf7ee; color: #665b42; box-shadow: none; }
.gated-card div { display: flex; align-items: center; gap: 8px; }
.gated-card p { margin: 6px 0 0 18px; font-size: 13px; line-height: 1.6; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-2); display: inline-block; }
.status-dot.warning { background: var(--gold); }
.work-center-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.work-center-filters label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.work-center-filters select { width: auto; min-width: 150px; padding: 8px 10px; }
.work-center-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.work-center-gate { margin-top: 18px; }
.task-index { padding: 16px; position: sticky; top: 100px; max-height: calc(100vh - 124px); overflow-y: auto; }
.task-list { display: grid; grid-template-columns: 1fr; gap: 9px; }
.work-run-card { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 15px; }
.work-run-card:hover { border-color: #b5c6bb; }
.work-run-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.work-run-heading h3 { margin: 2px 0 6px; font-size: 15px; }
.work-run-card > .muted { margin: 5px 0 12px; font-size: 12px; }
.work-run-card > button { width: 100%; margin: 4px 0 0; }
.work-run-alert { margin: 8px 0; padding: 8px 10px; border-radius: 8px; font-size: 12px; }
.work-run-alert.warning { color: #79551e; background: var(--gold-soft); }
.work-run-alert.danger { color: var(--red); background: var(--red-soft); }
.inline-work-runs { display: grid; gap: 9px; margin: 20px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.inline-work-run { background: #f7faf7; border-color: #cbd8cf; }
.inline-work-run > button { width: auto; justify-self: start; }
.document-mode-options, .document-suggestions, .document-review-questions { display: grid; gap: 10px; margin: 20px 0; }
.document-mode-options > h3, .document-suggestions > h3, .document-review-questions > h3 { margin: 0 0 4px; }
.document-mode-option, .document-suggestion { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfcfa; }
.document-review-question { border: 1px solid rgba(217, 119, 6, 0.25); border-radius: 12px; padding: 14px; background: rgba(255, 251, 235, 0.88); }
.document-review-question p:last-child { margin: 4px 0 0; line-height: 1.7; }
.document-mode-option p { margin: 7px 0; line-height: 1.6; }
.document-mode-option button { margin-top: 8px; width: auto; }
.document-suggestion.high-risk { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.document-suggestion .quote { white-space: pre-wrap; }
.document-suggestion .proposed-text { border-color: var(--green-2); background: #f2f8f3; }
.document-confirm-row { margin-top: 12px; }
.document-confirm-row.high-risk-confirm { color: var(--red); font-weight: 700; }
.task-card { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 16px; }
.task-card.active { border-color: #9ab3a3; box-shadow: 0 0 0 3px rgba(63,117,90,.1); }
.task-card h3 { font-size: 15px; line-height: 1.5; margin: 9px 0; }
.task-card p { color: var(--muted); font-size: 12px; margin: 0; }
.task-card button { margin-top: 12px; width: 100%; }
.task-detail { min-height: 420px; }
.task-detail:empty { display: grid; place-items: center; color: var(--muted); }
.task-detail:empty::before { content: "从左侧选择工作查看进度、证据、复核状态与结果。"; max-width: 340px; text-align: center; line-height: 1.7; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.metric { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 15px; }
.metric strong { display: block; font: 600 25px Georgia, serif; }
.metric span { color: var(--muted); font-size: 11px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.inline-form { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr .8fr auto; gap: 7px; margin-bottom: 14px; }
.inline-form input, .inline-form select { padding: 9px; }
.data-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid #e8eae6; padding: 10px 2px; }
.data-row:last-child { border-bottom: 0; }
.data-row strong, .data-row small { display: block; }
.data-row small { color: var(--muted); margin-top: 3px; }
.data-row button { width: auto; margin: 0; padding: 7px 9px; font-size: 11px; }
.snapshot-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.snapshot-row span { font: 10px ui-monospace, monospace; padding: 3px 5px; border-radius: 5px; background: #eef1ed; }
.audit-card { margin-bottom: 30px; }
.filter-row { display: flex; gap: 7px; }
.filter-row select, .filter-row input { width: auto; min-width: 130px; padding: 8px; }
.audit-event { display: grid; grid-template-columns: 160px 110px minmax(120px, .7fr) minmax(180px, 1fr) minmax(180px, 1fr); gap: 9px; border-bottom: 1px solid #e8eae6; padding: 9px 0; font-size: 11px; align-items: center; }
.audit-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-event .denied { color: var(--red); font-weight: 800; }
.audit-event .allowed { color: var(--green); font-weight: 800; }

dialog { border: 0; border-radius: 17px; box-shadow: var(--shadow); padding: 0; max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(20,33,27,.55); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; }
.dialog-card h2 { font: 600 24px Georgia, "Songti SC", serif; margin: 5px 0 16px; }
.source-report-lineage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.source-report-lineage div { background: #f2f5f1; border-radius: 9px; padding: 9px 10px; min-width: 0; }
.source-report-lineage dt { color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.source-report-lineage dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.source-report-guidance { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--red); font-size: 11px; }
.source-report-guidance p { margin: 0; line-height: 1.5; }
.source-report-guidance span { color: var(--muted); white-space: nowrap; }
.source-report-dialog-status { min-height: 38px; margin-top: 12px; line-height: 1.5; }
.source-detail-dialog { max-width: 680px; }
.source-drawer { inset: 0 0 0 auto; width: min(620px, calc(100% - 24px)); max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 18px 0 0 18px; overflow-y: auto; }
.source-drawer[open] { animation: drawer-in .2s ease-out; }
.source-drawer .dialog-card { min-height: 100%; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .72; } to { transform: translateX(0); opacity: 1; } }
.source-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.source-detail-actions .source-report-actions { margin-top: 0; }
.toast { position: fixed; z-index: 100; right: 22px; top: 20px; max-width: 420px; color: white; background: #263c31; border-radius: 10px; padding: 12px 15px; box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: var(--red); }

@media (max-width: 1050px) {
  .admin-grid, .work-center-grid { grid-template-columns: 1fr; }
  .task-index { position: static; max-height: none; }
  .task-detail { min-height: 180px; }
  .assistant-welcome { padding-block: 22px; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .inline-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; background: linear-gradient(155deg, #163d2d 0 42%, #f4f2e9 42%); padding: 28px 18px; }
  .auth-copy h1 { font-size: 38px; }
  .auth-main-grid { grid-template-columns: 1fr; align-items: start; }
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .mobile-only { display: grid; }
  .desktop-only { display: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(88vw, 320px); height: 100dvh; padding: 18px 14px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; border: 0; background: rgba(20,33,27,.42); }
  .app-shell.sidebar-collapsed .brand { justify-content: initial; padding-inline: 5px; }
  .app-shell.sidebar-collapsed .brand-copy,
  .app-shell.sidebar-collapsed .sidebar-history,
  .app-shell.sidebar-collapsed .scope-card,
  .app-shell.sidebar-collapsed .logout,
  .app-shell.sidebar-collapsed .account-entry,
  .app-shell.sidebar-collapsed .nav-item span:last-child,
  .app-shell.sidebar-collapsed .sidebar-new-thread span:last-child { display: initial; }
  .app-shell.sidebar-collapsed .sidebar-history { display: block; }
  .app-shell.sidebar-collapsed .scope-card { display: grid; }
  .app-shell.sidebar-collapsed .sidebar-new-thread,
  .app-shell.sidebar-collapsed .nav-item { justify-content: initial; padding-inline: 12px; }
  .topbar { height: 70px; padding: 12px 16px; }
  .topbar .sidebar-control { margin-left: -5px; }
  .topbar-title .eyebrow { display: none; }
  .user-chip div { display: none; }
  .view { padding: 18px; }
  .assistant-workspace { min-height: calc(100dvh - 128px); }
  .conversation-viewport { min-height: 300px; }
  .assistant-welcome { padding: 32px 8px; }
  .composer-card { bottom: 8px; max-height: 72dvh; padding: 12px; border-radius: 15px; }
  .composer-card .section-heading { align-items: start; flex-direction: column; }
  .composer-card .primary { width: 100%; }
  .composer-footer { align-items: stretch; flex-wrap: wrap; }
  .composer-footer .date-control { flex: 1 1 170px; }
  .composer-footer .date-control input { min-width: 0; width: 100%; }
  .composer-boundary { flex: 1 1 130px; align-self: center; }
  .composer-footer .primary { flex: 1 0 100%; width: 100%; }
  #documentReviewForm .form-row { grid-template-columns: 1fr; }
  .form-row, .metric-grid { grid-template-columns: 1fr; }
  .tasks-toolbar { align-items: stretch; flex-direction: column; }
  .work-center-filters { align-items: stretch; flex-direction: column; }
  .work-center-filters label { align-items: stretch; flex-direction: column; }
  .work-center-filters select { width: 100%; }
  .task-detail { min-height: 140px; }
  .notice-banner { align-items: start; flex-direction: column; }
  .audit-event { grid-template-columns: 1fr 1fr; }
  .filter-row { flex-wrap: wrap; }
  .source-report-lineage { grid-template-columns: 1fr; }
  .source-report-guidance { flex-direction: column; }
  .source-drawer { width: 100%; border-radius: 0; }
}
