:root {
  --bg: #f6f8fb;
  --surface-2: #f2f6f5;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3e7;
  --line-strong: #c7d2da;
  --teal: #087f72;
  --teal-2: #e4f6f2;
  --blue: #2563eb;
  --amber: #b7791f;
  --amber-2: #fff5df;
  --red: #c24138;
  --green: #1f8f57;
  --graphite: #17211f;
  --shadow: 0 18px 52px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
  --sidebar-width: 264px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(246, 248, 251, 0.94), rgba(241, 246, 247, 0.98)),
    linear-gradient(90deg, rgba(8, 127, 114, 0.08), transparent 34%, rgba(37, 99, 235, 0.06)),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  text-rendering: geometricPrecision;
}

button,
input,
select,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 6px;
}

.brand-lockup {
  min-height: 174px;
  justify-content: center;
  padding: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(135deg, var(--teal), var(--blue));
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 12px 22px rgba(8, 127, 114, 0.18);
}

.brand-mark.image-mark {
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-lockup .brand-mark.image-mark {
  width: 144px;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  background: #010617;
  box-shadow: 0 18px 36px rgba(1, 11, 31, 0.18);
}

.brand-mark.image-mark img {
  width: 82%;
  height: 82%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}

.brand-lockup .brand-mark.image-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 11px;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.nav-item.active {
  color: var(--teal);
  background: linear-gradient(90deg, var(--teal-2), #ffffff);
  box-shadow:
    inset 3px 0 0 var(--teal),
    var(--shadow-soft);
}

.sidebar-status {
  margin-top: auto;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 143, 87, 0.12);
}

.workspace {
  min-width: 0;
  padding: 22px 24px 30px;
  display: grid;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  margin: -22px -24px 0;
  padding: 18px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(246, 248, 251, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(219, 227, 231, 0.72);
}

.topbar h1,
.command-copy h2,
.module-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions,
.command-actions,
.module-head,
.search-row,
.project-meta,
.segmented-actions,
.lane-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.segmented-actions,
.lane-actions {
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent),
    var(--graphite);
  box-shadow: 0 12px 22px rgba(23, 33, 31, 0.18);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.primary-button:active,
.ghost-button:active,
.icon-button:active {
  transform: translateY(0);
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.danger-action {
  color: var(--red);
}

.compact-action {
  min-height: 36px;
  padding: 0 12px;
}

.icon-button {
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

.icon-button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

section[id] {
  scroll-margin-top: 96px;
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.command-center {
  min-height: 390px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(228, 246, 242, 0.84)),
    #e6eeee;
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.86);
  position: relative;
}

.command-copy {
  padding: clamp(28px, 3.4vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.8)),
    rgba(255, 255, 255, 0.94);
  z-index: 1;
}

.command-copy h2 {
  max-width: 620px;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.16;
  letter-spacing: 0;
  text-wrap: balance;
}

.command-copy h2 span {
  display: inline-block;
}

.command-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.project-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  background: rgba(39, 102, 216, 0.1);
  font-weight: 700;
  font-size: 12px;
}

.badge.success {
  color: var(--green);
  background: rgba(31, 143, 87, 0.12);
}

.badge.warning {
  color: var(--amber);
  background: var(--amber-2);
}

.command-visual {
  margin: 0;
  min-width: 0;
  min-height: 390px;
  position: relative;
}

.command-visual picture,
.command-visual img {
  width: 100%;
  height: 100%;
  display: block;
}

.command-visual img {
  object-fit: cover;
  object-position: center;
  filter: saturate(0.98) contrast(1.02);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.project-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.project-query {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 10px;
  margin-bottom: 12px;
}

.project-search-row {
  margin: 0;
}

.project-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.inline-collapsible {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 250, 0.78);
  overflow: hidden;
}

.inline-collapsible-summary {
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 800;
}

.inline-collapsible-summary::-webkit-details-marker {
  display: none;
}

.inline-collapsible .project-list,
.inline-collapsible .timeline-grid {
  padding: 12px;
}

.project-count {
  min-height: 42px;
  justify-content: center;
}

.project-result {
  width: 100%;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.project-result:hover,
.project-result.active {
  border-color: rgba(15, 143, 130, 0.48);
  background: linear-gradient(180deg, #ffffff, var(--teal-2));
  box-shadow: 0 8px 18px rgba(8, 127, 114, 0.08);
}

.project-result strong,
.project-result small {
  display: block;
}

.project-result small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.project-result-meta {
  min-width: 116px;
  display: grid;
  justify-items: end;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.project-result.empty {
  cursor: default;
  grid-template-columns: 1fr;
  place-items: center;
  color: var(--muted);
}

.project-form label {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.project-form input,
.project-form select,
.project-stage-filter {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  outline: 0;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.project-form input:focus,
.project-form select:focus,
.project-stage-filter:focus {
  border-color: rgba(15, 143, 130, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 143, 130, 0.1);
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.timeline-item {
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  align-content: center;
  gap: 6px;
}

.timeline-item span,
.timeline-item small {
  color: var(--muted);
  font-size: 12px;
}

.timeline-item strong {
  font-size: 14px;
}

.timeline-item.active {
  border-color: rgba(15, 143, 130, 0.45);
  background: linear-gradient(180deg, #ffffff, var(--teal-2));
  box-shadow: 0 10px 22px rgba(8, 127, 114, 0.08);
}

.timeline-item.done {
  color: var(--green);
  background: rgba(31, 143, 87, 0.1);
}

.metric-tile,
.module-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.metric-tile {
  min-height: 118px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 7px;
  position: relative;
  overflow: hidden;
}

.metric-tile::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  opacity: 0.78;
}

.metric-label,
.metric-tile small {
  color: var(--muted);
  font-size: 13px;
}

.metric-tile strong {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
  letter-spacing: 0;
}

.flow-strip {
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.flow-step {
  min-height: 54px;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  display: grid;
  align-content: center;
  gap: 5px;
  color: var(--muted);
}

.flow-step span {
  font-size: 11px;
  font-weight: 800;
}

.flow-step strong {
  color: var(--ink);
  font-size: 14px;
}

.flow-step.active {
  color: var(--teal);
  background: linear-gradient(180deg, #ffffff, var(--teal-2));
  box-shadow: inset 0 0 0 1px rgba(15, 143, 130, 0.22);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.project-control-section {
  grid-template-columns: 1fr;
}

.module-panel {
  padding: 18px;
  min-width: 0;
}

.compact-panel {
  position: sticky;
  top: 18px;
}

.module-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.module-head h2 {
  font-size: 21px;
}

.collapsible-panel {
  padding: 0;
  overflow: hidden;
}

.collapsible-summary {
  min-height: 82px;
  margin: 0;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel[open] .collapsible-summary {
  border-bottom: 1px solid var(--line);
}

.summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.collapse-indicator {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: rgba(238, 244, 245, 0.92);
  font-size: 12px;
  font-weight: 800;
}

.collapse-indicator::after {
  content: "展开";
}

.collapsible-panel[open] .collapse-indicator::after {
  content: "收起";
}

.collapsible-panel .coverage-list {
  padding: 14px 18px 18px;
}

.helper-text {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.upload-zone {
  min-height: 148px;
  border: 1px dashed #98aca8;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(242, 246, 245, 0.86)),
    #f8fbfa;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--teal);
  background: linear-gradient(180deg, #ffffff, var(--teal-2));
  box-shadow: inset 0 0 0 1px rgba(8, 127, 114, 0.08);
}

.upload-zone input {
  display: none;
}

.upload-zone strong {
  font-size: 17px;
}

.upload-zone small {
  color: var(--muted);
}

.upload-large {
  width: 34px;
  height: 34px;
  color: var(--teal);
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  min-height: 0;
}

.file-pill {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--graphite);
  background: #eef4f5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.result-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.insight-card,
.knowledge-card,
.law-card,
.suggestion-card,
.evidence-card,
.review-lane {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.insight-card {
  min-height: 160px;
  padding: 15px;
  display: grid;
  gap: 10px;
}

.insight-card h3,
.knowledge-card h3,
.law-card h3,
.suggestion-card h3 {
  margin: 0;
  font-size: 16px;
}

.insight-card ul,
.law-card ul,
.suggestion-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.score-criteria,
.coverage-list,
.checklist,
.suggestion-list,
.assistant-list,
.submission-gate {
  display: grid;
  gap: 10px;
}

.criteria-row,
.coverage-row,
.check-row {
  min-height: 54px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(242, 246, 245, 0.84);
  display: grid;
  gap: 8px;
}

.criteria-row header,
.coverage-row header,
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.criteria-row strong,
.coverage-row strong {
  font-size: 14px;
}

.criteria-row small,
.coverage-row small {
  color: var(--muted);
}

.criteria-edit-row {
  grid-template-columns: minmax(140px, 1fr) 84px 84px 40px;
  align-items: end;
}

.criteria-edit-row label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.criteria-edit-row input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  outline: 0;
}

.criteria-edit-row input:focus {
  border-color: rgba(15, 143, 130, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 143, 130, 0.1);
}

.criteria-editor-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.bar-track {
  height: 7px;
  border-radius: 999px;
  background: #dbe5e4;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--value, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.assistant-item {
  min-height: 60px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
}

.assistant-item strong,
.assistant-item small {
  display: block;
}

.assistant-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.audit-trail {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
}

.audit-trail h3 {
  margin: 0;
  font-size: 15px;
}

.audit-item {
  display: grid;
  gap: 3px;
}

.audit-item span {
  color: var(--muted);
  font-size: 12px;
}

.audit-item strong {
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ledger-table {
  width: 100%;
  min-width: 880px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  overflow: hidden;
}

.ledger-table th,
.ledger-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.72);
}

.ledger-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f6faf9;
  position: sticky;
  top: 0;
}

.ledger-table tbody tr:hover td {
  background: #f8fbfa;
}

.ledger-table .empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 28px 14px;
}

.ledger-table td strong,
.ledger-table td small {
  display: block;
}

.ledger-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.soft-pill,
.risk-pill,
.status-button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.soft-pill {
  color: var(--blue);
  background: rgba(39, 102, 216, 0.1);
}

.risk-pill.high {
  color: var(--red);
  background: rgba(194, 65, 56, 0.1);
}

.risk-pill.mid {
  color: var(--amber);
  background: var(--amber-2);
}

.risk-pill.low {
  color: var(--green);
  background: rgba(31, 143, 87, 0.1);
}

.status-button {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  cursor: pointer;
}

.status-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.search-row {
  height: 42px;
  padding: 0 12px;
  margin: 16px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.search-row input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.knowledge-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.knowledge-card {
  min-height: 134px;
  padding: 15px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.knowledge-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: #eef4f5;
  color: var(--muted);
  font-size: 12px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.evidence-card {
  min-height: 154px;
  padding: 15px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.evidence-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.evidence-card strong,
.evidence-card small {
  display: block;
}

.evidence-card small,
.evidence-card p {
  color: var(--muted);
}

.evidence-card p {
  margin: 0;
  line-height: 1.6;
  font-size: 14px;
}

.module-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.module-toggle {
  min-height: 70px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  align-content: center;
  gap: 6px;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.module-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.module-toggle strong {
  font-size: 14px;
}

.module-toggle small {
  color: var(--muted);
}

.module-toggle:has(input:checked) {
  border-color: rgba(15, 143, 130, 0.55);
  background: linear-gradient(180deg, #ffffff, var(--teal-2));
  box-shadow: 0 8px 18px rgba(8, 127, 114, 0.08);
}

.writer-toolbar {
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.document-preview {
  min-height: 420px;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(217, 226, 223, 0.38) 1px, transparent 1px) 0 0 / 44px 44px,
    #fbfcfd;
  border: 1px solid var(--line);
}

.document-preview h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.doc-section {
  margin: 0 0 14px;
  padding: 14px;
  border-left: 3px solid var(--teal);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.doc-section h4 {
  margin: 0 0 8px;
}

.doc-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  min-height: 360px;
  margin: 0;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.check-row {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.check-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.check-row.pass {
  color: var(--green);
  background: rgba(31, 143, 87, 0.1);
}

.check-row.warn {
  color: var(--amber);
  background: var(--amber-2);
}

.score-board {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.score-ring {
  width: 184px;
  height: 184px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--ink);
  background:
    radial-gradient(circle at center, #ffffff 58%, transparent 59%),
    conic-gradient(var(--teal) var(--score, 0deg), #e1e9e7 0);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 0 0 10px rgba(255, 255, 255, 0.68),
    var(--shadow-soft);
}

.score-ring span {
  font-size: 40px;
  font-weight: 800;
}

.score-ring small {
  color: var(--muted);
}

.score-bars {
  display: grid;
  gap: 12px;
}

.score-bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 180px) minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.score-bar-row strong {
  color: var(--ink);
  font-size: 14px;
}

.suggestion-card {
  padding: 14px;
}

.suggestion-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.review-lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-lane {
  min-height: 146px;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.review-lane header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-lane strong,
.review-lane small {
  display: block;
}

.review-lane small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.review-lane.done {
  border-color: rgba(31, 143, 87, 0.35);
  background: rgba(31, 143, 87, 0.06);
}

.review-lane.returned {
  border-color: rgba(201, 134, 25, 0.45);
  background: var(--amber-2);
}

.lane-actions {
  align-self: end;
}

.lane-actions .ghost-button {
  min-height: 34px;
  padding: 0 12px;
}

.gate-row {
  min-height: 66px;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gate-row.pass {
  color: var(--green);
  background: linear-gradient(180deg, #ffffff, rgba(31, 143, 87, 0.1));
}

.gate-row.warn {
  color: var(--amber);
  background: linear-gradient(180deg, #ffffff, var(--amber-2));
}

.gate-row strong,
.gate-row small {
  display: block;
}

.gate-row small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.law-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.law-card {
  min-height: 188px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.law-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(23, 33, 31, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 24px;
  background: rgba(22, 32, 31, 0.38);
  display: grid;
  place-items: start center;
}

.modal-backdrop[hidden] {
  display: none;
}

.search-modal {
  width: min(780px, 100%);
  max-height: calc(100vh - 48px);
  margin-top: 8vh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: auto;
}

.search-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
}

.modal-search-row {
  margin: 0;
}

.global-results {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.global-result {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  display: grid;
  gap: 4px;
}

.global-result:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.global-result span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.global-result strong {
  font-size: 15px;
}

.global-result small {
  color: var(--muted);
  line-height: 1.5;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #07121d;
  color: var(--ink);
  overflow-x: hidden;
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(620px, 1.2fr) minmax(420px, 0.8fr);
  background:
    linear-gradient(90deg, rgba(3, 9, 20, 0.96), rgba(5, 20, 31, 0.82) 50%, rgba(239, 247, 248, 0.98) 50%),
    #07121d;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(135deg, #06111e, #0b2631),
    #07121d;
}

.login-visual > picture,
.login-visual > picture > img {
  width: 100%;
  height: 100%;
  display: block;
}

.login-visual > picture > img {
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05) brightness(0.72);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 12, 24, 0.92), rgba(4, 12, 24, 0.58)),
    linear-gradient(180deg, rgba(4, 12, 24, 0.12), rgba(4, 12, 24, 0.84)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 80px);
}

.login-visual-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: clamp(28px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  color: #fff;
}

.login-visual-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.login-brand.brand-lockup {
  min-height: 110px;
}

.login-brand .brand-mark {
  color: #fff;
}

.login-brand .brand-mark.image-mark {
  width: 88px;
  height: 110px;
  border-color: rgba(97, 220, 255, 0.34);
  box-shadow:
    0 18px 36px rgba(0, 179, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.login-brand small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
}

.login-status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 800;
}

.login-chain-hero {
  max-width: 960px;
  display: grid;
  gap: 14px;
}

.login-chain-hero h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
}

.login-chain-hero p:not(.eyebrow) {
  max-width: 100%;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.7;
  font-size: clamp(14px, 1.25vw, 15px);
  white-space: nowrap;
}

.chain-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.chain-board::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 22px;
  height: 1px;
  background: linear-gradient(90deg, rgba(29, 233, 255, 0.9), rgba(72, 115, 255, 0.45));
}

.chain-node {
  position: relative;
  min-height: 126px;
  padding: 14px;
  border-radius: 8px;
  display: grid;
  align-content: end;
  gap: 7px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 16px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
}

.chain-node span {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #06121f;
  background: linear-gradient(135deg, #48f4ff, #6ea2ff);
  font-size: 12px;
  font-weight: 900;
}

.chain-node strong {
  font-size: 16px;
}

.chain-node small {
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.5;
}

.chain-node.active {
  background:
    linear-gradient(180deg, rgba(29, 233, 255, 0.22), rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.12);
  border-color: rgba(72, 244, 255, 0.36);
}

.login-panel {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  padding: clamp(22px, 4vw, 52px);
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(248, 251, 252, 0.98), rgba(232, 241, 243, 0.98)),
    #f5f8fa;
}

.login-card {
  width: min(100%, 468px);
  padding: clamp(24px, 4vw, 36px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 252, 0.9)),
    #fff;
  box-shadow:
    0 30px 70px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 18px;
  backdrop-filter: blur(20px);
}

.login-card-head {
  display: grid;
  gap: 10px;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 36px);
  letter-spacing: 0;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.login-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-field input,
.login-field select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.login-field input:focus,
.login-field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(8, 127, 114, 0.12);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.login-error {
  min-height: 20px;
  color: #b42318;
  font-size: 13px;
  font-weight: 800;
}

.login-error:empty {
  display: none;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

.demo-login {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.demo-login span {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.demo-login button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.demo-login button:hover {
  border-color: var(--teal);
  background: var(--teal-2);
}

@media (max-width: 1180px) {
  .login-shell {
    grid-template-columns: minmax(520px, 1fr) minmax(390px, 0.8fr);
  }

  .login-chain-hero p:not(.eyebrow) {
    white-space: normal;
  }

  .chain-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chain-board::before {
    display: none;
  }

  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand span:last-child,
  .nav-item span:last-child,
  .sidebar-status span:last-child {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .sidebar {
    padding: 22px 14px;
  }

  .sidebar .brand-lockup {
    min-height: 70px;
  }

  .sidebar .brand-lockup .brand-mark.image-mark {
    width: 50px;
    height: 63px;
  }

  .topbar {
    margin-left: -24px;
    margin-right: -24px;
  }

  .metrics-grid,
  .law-grid,
  .evidence-grid,
  .timeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .compact-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
    background: #f5f8fa;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .login-visual {
    min-height: 680px;
    height: auto;
  }

  .login-panel {
    min-height: auto;
    height: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    box-shadow: none;
  }

  .sidebar .brand-lockup {
    min-height: 96px;
  }

  .sidebar .brand-lockup .brand-mark.image-mark {
    width: 76px;
    height: 95px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    min-width: 48px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar {
    position: static;
    margin: 0;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .top-actions .ghost-button,
  .top-actions .primary-button {
    flex: 1 1 180px;
  }

  .command-center {
    grid-template-columns: 1fr;
  }

  .command-copy h2 {
    font-size: clamp(28px, 7vw, 34px);
  }

  .command-copy h2 span {
    display: inline;
  }

  .command-visual {
    min-height: 260px;
  }

  .flow-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-grid,
  .knowledge-list,
  .module-selector,
  .project-form,
  .review-lanes {
    grid-template-columns: 1fr;
  }

  .score-board {
    grid-template-columns: 1fr;
  }

  .score-ring {
    justify-self: center;
  }

  .search-modal {
    margin-top: 2vh;
  }
}

@media (max-width: 560px) {
  .login-visual {
    min-height: 760px;
  }

  .login-visual-overlay {
    padding: 22px;
  }

  .login-visual-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-chain-hero h1 {
    font-size: 32px;
    white-space: normal;
  }

  .login-chain-hero p:not(.eyebrow) {
    font-size: 14px;
  }

  .chain-board {
    grid-template-columns: 1fr;
  }

  .chain-node {
    min-height: 96px;
  }

  .login-panel {
    padding: 18px;
  }

  .login-card {
    padding: 22px;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-query,
  .project-result,
  .criteria-edit-row {
    grid-template-columns: 1fr;
  }

  .project-result-meta {
    justify-items: start;
  }

  .criteria-edit-row .icon-button,
  .criteria-editor-actions .ghost-button,
  .criteria-editor-actions .primary-button {
    width: 100%;
  }

  .metrics-grid,
  .law-grid,
  .evidence-grid,
  .timeline-grid {
    grid-template-columns: 1fr;
  }

  .command-copy {
    padding: 24px;
  }

  .command-copy h2 {
    font-size: 28px;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .icon-button {
    flex: 0 0 40px;
  }

  .command-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .score-bar-row {
    grid-template-columns: 1fr;
  }

  .segmented-actions,
  .lane-actions,
  .writer-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .search-modal {
    max-height: calc(100vh - 24px);
  }
}
