/* Shared visual language for the Law × AI research tools. */
:root {
  color-scheme: light;
  --ink: #183d3b;
  --muted: #647471;
  --paper: #f6f6ef;
  --surface: #fffef8;
  --line: #d8e1d7;
  --accent: #0f625b;
  --accent-soft: #e5eee7;
  --gold: #ba8243;
  --danger: #a14138;
  --danger-soft: #fff0eb;
  --radius: 14px;
  --shadow: 0 9px 30px #23443b08;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
a:hover {
  text-decoration-thickness: 2px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 9px;
  padding: 0.65rem 1rem;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: var(--accent-soft);
  border-color: #acc4b7;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button.primary,
.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
button.primary:hover {
  background: #174e48;
}
.danger {
  color: var(--danger);
}
:focus-visible {
  outline: 3px solid #d7a85c;
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefc;
  color: var(--ink);
  padding: 0.6rem 0.8rem;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 110px;
}
label {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-weight: 500;
  letter-spacing: -0.025em;
}
h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.14;
}
h2 {
  font-size: 1.65rem;
  line-height: 1.25;
}
h3 {
  font-size: 1rem;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.mono {
  font-family: ui-monospace, Consolas, monospace;
}
.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  background: var(--ink);
  color: #fff;
  padding: 12px;
  z-index: 20;
}
.skip-link:focus {
  top: 12px;
}
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.header-inner {
  max-width: 1440px;
  margin: auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.brand {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-decoration: none;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  background: var(--ink);
  color: var(--surface);
  width: 32px;
  height: 32px;
  margin-right: 10px;
  border-radius: 7px;
  font-weight: 500;
}
.suite-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.suite-nav a {
  color: var(--muted);
  text-decoration: none;
}
.suite-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}
.app-shell {
  max-width: 1440px;
  padding: 36px 32px 60px;
  margin: 0 auto;
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
.hero p {
  max-width: 700px;
  color: var(--muted);
  margin-bottom: 0;
}
.hero h1 {
  margin-bottom: 12px;
}
.hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar,
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.panel,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel + .panel {
  margin-top: 18px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2,
.section-head h3 {
  margin: 0;
}
.field {
  margin-bottom: 16px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.note {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.7;
}
.tag,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  letter-spacing: 0.025em;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 99px;
}
.badge.warning {
  background: #fff1d8;
  color: #815923;
  border-color: #e9d8b5;
}
.badge.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #ecd2cb;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
}
.stat strong {
  display: block;
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 4px;
}
.stat span {
  font-size: 0.77rem;
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 50px 24px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.empty h3 {
  color: var(--ink);
  font-size: 1.1rem;
}
.status-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(640px, 90vw);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 6px 28px #132d3926;
  z-index: 50;
}
.status-bar[hidden] {
  display: none;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}
pre {
  overflow: auto;
  background: var(--accent-soft);
  padding: 16px;
  border-radius: 8px;
}
code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85em;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.75rem;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  width: min(720px, calc(100vw - 32px));
  max-height: 90vh;
  padding: 28px;
  box-shadow: 0 25px 100px #183d3b30;
}
dialog::backdrop {
  background: #15322d70;
  backdrop-filter: blur(3px);
}
dialog .dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
dialog .dialog-head h2 {
  margin: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
.error-text {
  color: var(--danger);
}
.success-text {
  color: var(--accent);
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.chip-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nowrap {
  white-space: nowrap;
}
@media (max-width: 1000px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .suite-nav {
    gap: 12px;
  }
  .hero {
    display: block;
  }
  .hero-actions {
    margin-top: 20px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .header-inner,
  .app-shell,
  .footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  .app-shell {
    padding-top: 28px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .panel,
  .card {
    padding: 18px;
  }
  .suite-nav {
    font-size: 0.72rem;
    gap: 12px;
    overflow-wrap: anywhere;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .footer {
    display: block;
  }
  .footer span {
    display: block;
    margin-bottom: 6px;
  }
  .hero h1 {
    font-size: 2.4rem;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 14px;
  }
  .actions button,
  .toolbar button {
    font-size: 0.82rem;
  }
  .table-scroll {
    overflow: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
