@import url('./tokens.css');
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.7 var(--font);
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 15px;
  transition:
    background 0.16s,
    border-color 0.16s;
}
button:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary);
}
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
button.danger {
  color: var(--danger);
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
input,
select,
textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  min-width: 0;
  width: 100%;
}
textarea {
  resize: vertical;
  line-height: 1.8;
  min-height: 105px;
}
input[type='checkbox'] {
  width: 20px;
  min-height: 20px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: var(--surface);
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
.app-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 27px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 8px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  background: var(--primary);
  color: var(--on-primary);
  font: 700 23px var(--document);
  border-radius: 5px;
}
.brand strong {
  font-size: 18px;
  letter-spacing: 1px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.2px;
}
.nav-group {
  display: grid;
  gap: 6px;
}
.nav-label {
  color: var(--muted);
  font-size: 12px;
  padding: 0 12px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 6px;
}
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.nav-link:hover {
  text-decoration: none;
  background: var(--surface-soft);
}
.nav-glyph {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 16px 8px 0;
  color: var(--muted);
  font-size: 12px;
}
.workspace {
  min-width: 0;
}
.topbar {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
}
.topbar-title {
  font-weight: 600;
}
.topbar-sub {
  color: var(--muted);
  font-size: 12px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.user-chip {
  color: var(--muted);
  font-size: 13px;
}
.content {
  max-width: 1440px;
  margin: auto;
  padding: 30px 32px 64px;
  min-width: 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 27px;
  line-height: 1.4;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 16px;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.subtitle,
.muted {
  color: var(--muted);
}
.subtitle {
  font-size: 14px;
  margin: 0;
  max-width: 70ch;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 20px;
  min-width: 0;
}
.panel-head {
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h2,
.panel-head h3 {
  margin: 0;
}
.panel-body {
  padding: 22px;
  min-width: 0;
}
.toolbar,
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar {
  margin-bottom: 20px;
}
.toolbar input {
  width: min(300px, 100%);
}
.toolbar select {
  width: auto;
  min-width: 150px;
}
.table-wrap {
  overflow-x: auto;
  border-radius: 0 0 9px 9px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: normal;
  font-size: 14px;
}
th {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 500;
  padding: 13px 18px;
  font-size: 12px;
  white-space: nowrap;
}
td {
  padding: 17px 18px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  min-width: 90px;
  max-width: 380px;
  overflow-wrap: anywhere;
}
td:first-child {
  min-width: 180px;
}
.cell-title {
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}
.cell-meta {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-soft);
  color: var(--muted);
  white-space: nowrap;
}
.pill.good {
  background: var(--good-soft);
  color: var(--good);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.notice {
  background: var(--primary-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.notice.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.notice.danger,
.form-error {
  background: var(--danger-soft);
  color: var(--danger);
}
.form-error {
  border-radius: 5px;
  padding: 10px 12px;
  margin-top: 12px;
}
.empty {
  text-align: center;
  padding: 52px 24px 56px;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.empty-symbol {
  font: 30px var(--document);
  color: var(--primary);
  background: var(--primary-soft);
  padding: 12px 20px;
  border-radius: 8px;
}
.empty h3,
.empty p {
  margin: 0;
}
.empty p {
  color: var(--muted);
  max-width: 48ch;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}
.field-label {
  font-size: 13px;
  font-weight: 500;
}
.field-help {
  font-size: 12px;
  color: var(--muted);
}
.span-2 {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}
dialog {
  width: min(780px, calc(100% - 32px));
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #101e3280;
}
.dialog-head {
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  margin: 0;
  font-size: 19px;
}
.dialog-body {
  padding: 24px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.document {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 40px clamp(20px, 5vw, 64px);
  min-height: 500px;
  box-shadow: var(--shadow);
  font-family: var(--document);
  font-size: 17px;
  line-height: 2;
  overflow-wrap: anywhere;
}
.document h2 {
  text-align: center;
  margin-bottom: 28px;
}
.document p {
  white-space: pre-wrap;
}
.document-editor {
  display: grid;
  gap: 14px;
}
.block-row {
  display: grid;
  gap: 6px;
}
.block-label {
  font-size: 12px;
  color: var(--muted);
}
.document-editor textarea {
  font-family: var(--document);
  font-size: 16px;
  line-height: 1.9;
  min-height: 110px;
}
.document-editor table input {
  min-width: 110px;
}
.fact-list {
  display: grid;
  gap: 12px;
}
.fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.fact dt {
  color: var(--muted);
  font-size: 13px;
}
.fact dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.contract-toolbar {
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.contract-toolbar select {
  width: auto;
  max-width: 100%;
}
.tabbar {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.tabbar a {
  padding: 10px 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}
.tabbar a.active {
  color: var(--primary);
  border-color: var(--primary);
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.compare-pane {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.compare-pane strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}
.report-item {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.report-item:first-child {
  border-top: 0;
}
.report-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.report-title strong {
  font-size: 14px;
}
.evidence {
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
  background: var(--surface-soft);
  padding: 12px;
  border-radius: 5px;
  margin-top: 12px;
}
.job-state {
  padding: 16px;
  background: var(--surface-soft);
  border-radius: 6px;
}
.file-zone {
  border: 1px dashed var(--line);
  background: var(--surface-soft);
  padding: 22px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(440px, 100%);
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.login-card .brand {
  padding: 0;
  margin-bottom: 32px;
}
.login-card h1 {
  font-size: 25px;
}
.login-card .form-grid {
  grid-template-columns: 1fr;
}
.login-card .form-actions button {
  width: 100%;
}
.login-footer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  background: var(--ink);
  color: var(--surface);
  padding: 13px 20px;
  border-radius: 8px;
  max-width: calc(100% - 32px);
  box-shadow: var(--shadow);
  white-space: pre-wrap;
}
.demo-bar {
  padding: 7px 20px;
  text-align: center;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
}
.source-list {
  display: grid;
  gap: 10px;
  max-height: 500px;
  overflow: auto;
}
.loading {
  padding: 40px 20px;
  color: var(--muted);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
small {
  font-size: 12px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mono {
  font-family: ui-monospace, monospace;
}
.hidden,
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    width: auto;
  }
  .content {
    padding: 24px;
  }
  .topbar {
    padding-inline: 24px;
  }
}
@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 16px;
  }
  .sidebar .nav-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
  }
  .sidebar .nav-label,
  .sidebar-foot {
    display: none;
  }
  .nav-link {
    padding: 8px 11px;
    font-size: 13px;
  }
  .brand {
    padding: 0;
  }
  .topbar {
    padding: 12px 16px;
    align-items: flex-start;
  }
  .content {
    padding: 24px 16px 64px;
  }
  .topbar-actions {
    gap: 8px;
  }
  .topbar-sub {
    display: none;
  }
  h1 {
    font-size: 24px;
  }
  .form-grid,
  .compare-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .span-2 {
    grid-column: auto;
  }
  .panel-body {
    padding: 18px;
  }
  .panel-head {
    padding: 16px 18px;
  }
  .dialog-body {
    padding: 18px;
  }
  .document {
    padding: 24px 18px;
  }
  .login-card {
    padding: 26px;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar input,
  .toolbar select {
    width: 100%;
  }
  .user-chip {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.report-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.report-card:last-child {
  border-bottom: 0;
}
.report-card-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.report-card-head h3 {
  margin: 0;
}
.evidence-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.evidence-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.evidence-block:target {
  background: var(--primary-soft);
}
.diff-item {
  margin-block: 20px;
}
.nav-group {
  min-width: 0;
}
