/* LegalSling app styles. No build step: edit and deploy. */

:root {
  --ink: #0a0f1c;
  --ink-2: #1f2937;
  --text: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5e7eb;
  --line-soft: #eef1f4;
  --bg: #ffffff;
  --canvas: #f4f5f7;
  --tint: #f8fafc;
  --red: #dc2626;
  --red-strong: #b91c1c;
  --red-bg: #fef2f2;
  --red-line: #fecaca;
  --amber: #b45309;
  --amber-mark: #f59e0b;
  --amber-bg: #fff7ed;
  --amber-line: #fed7aa;
  --term: #facc15;
  --term-bg: #fef9c3;
  --green: #22c55e;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --topbar: 68px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.icon { width: 20px; height: 20px; flex: none; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.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;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: grid; gap: 16px; }
.stack-sm { margin-top: 14px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 36px;
  height: var(--topbar);
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.tabs { display: flex; align-self: stretch; gap: 30px; }

.tab {
  display: flex;
  align-items: center;
  margin-bottom: -1px;
  border-bottom: 2.5px solid transparent;
  color: var(--muted);
  font-size: 15.5px;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(380px, 30vw);
  height: 44px;
  margin-left: auto;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted-2);
}
.search:focus-within { border-color: var(--ink); color: var(--ink); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.search input::placeholder { color: var(--muted-2); }

.guest-links { display: flex; gap: 22px; margin-left: auto; }
.guest-links a { color: var(--muted); font-weight: 600; text-decoration: none; }
.guest-links a:hover { color: var(--ink); }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu--right { margin-left: auto; }

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line);
}

.menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 250px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.menu__panel form { margin: 0; }
.menu__panel a,
.menu__panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu__panel a:hover,
.menu__panel button:hover { background: var(--tint); }
.menu__panel .icon { width: 18px; height: 18px; color: var(--muted); }
.menu__panel .danger { color: var(--red); }
.menu__panel .danger .icon { color: var(--red); }
.menu__who { display: grid; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.menu__who strong { color: var(--ink); }
.menu__who span { font-size: 13px; color: var(--muted); }

/* ---------- Buttons, chips, tags ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #1f2937; }
.btn--dark:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: var(--red-strong); }
.btn--block { width: 100%; }
.btn--small { align-self: flex-start; padding: 8px 14px; font-size: 13.5px; }
.btn--small .icon { width: 17px; height: 17px; }
.btn--cta { flex: 1; height: 60px; border-radius: 14px; font-size: 16.5px; }
.btn.is-busy { opacity: 0.7; pointer-events: none; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--tint); color: var(--ink); }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link--small { align-self: flex-start; margin: -4px 0 2px; font-size: 13px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip strong { font-size: 14px; }
.chip span { font-size: 12px; color: var(--muted); }
.chip--ghost { justify-content: center; color: var(--muted); }
.chip--small { flex-direction: row; padding: 7px 13px; font-size: 13.5px; font-weight: 600; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  padding: 2px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--tint);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.tag--red { background: var(--red-bg); color: var(--red-strong); border-color: var(--red-line); }
.tag--amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.tag--dark { background: var(--ink); color: #fff; border-color: var(--ink); }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
}
.count--red { background: var(--red-bg); color: var(--red-strong); }
.count--amber { background: var(--amber-bg); color: var(--amber); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status--running .status__dot { background: var(--amber-mark); animation: pulse 1.4s ease-in-out infinite; }
.status--failed .status__dot { background: var(--red); }

.eyebrow {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Review workspace ---------- */

.workspace-page { height: 100vh; overflow: hidden; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(390px, 34vw, 580px);
  height: calc(100vh - var(--topbar));
}

.pane-switch { display: none; }

.doc-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--canvas);
  border-right: 1px solid var(--line);
}

.doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.doc-toolbar__file { display: flex; align-items: center; gap: 14px; min-width: 0; }
.doc-toolbar__icon { width: 26px; height: 26px; color: var(--muted); }
.doc-toolbar__text { min-width: 0; }
.doc-toolbar__name {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-toolbar__meta {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.doc-toolbar__tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--tint);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.tool {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.tool:hover { background: #fff; }
.tool__value { min-width: 50px; color: var(--ink-2); font-size: 14px; font-weight: 650; text-align: center; }
.tool__divider { width: 1px; height: 22px; margin: 0 6px; background: var(--line); }

.doc-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 40px 40px 140px;
  scroll-behavior: smooth;
}

.paper {
  --zoom: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 76px 92px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  box-shadow: var(--shadow);
  color: #1f2937;
  font-size: calc(16.5px * var(--zoom));
  line-height: 1.8;
}
.paper--empty { display: grid; gap: 20px; min-height: 60vh; align-content: start; }

.doc-title {
  margin: 0 0 2.3em;
  color: var(--ink);
  font-size: 1.55em;
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.doc-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  margin: 2.1em 0 1em;
  padding-bottom: 0.75em;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.03em;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.doc-heading__num { flex: none; color: var(--muted-2); font-family: var(--mono); font-size: 0.88em; font-weight: 500; }

.para { margin: 0 0 1.05em; overflow-wrap: anywhere; }

.page-break {
  position: relative;
  margin: 2.4em -92px;
  border-top: 1px dashed var(--line);
  text-align: center;
}
.page-break span {
  position: relative;
  top: -0.8em;
  padding: 0 12px;
  background: #fff;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.clause {
  position: relative;
  margin: 0 -26px;
  padding: 0.35em 26px 0.1em;
  border-radius: 12px;
  cursor: pointer;
  scroll-margin-top: 24px;
  transition: background 0.15s, box-shadow 0.15s;
}
.clause:hover { background: var(--tint); }
.clause--red { background: var(--red-bg); box-shadow: inset 3px 0 0 var(--red); }
.clause--red:hover { background: #fde8e8; }
.clause--amber { background: var(--amber-bg); box-shadow: inset 3px 0 0 var(--amber-mark); }
.clause--amber:hover { background: #ffedd5; }
.clause.is-selected { background: #f1f5f9; box-shadow: inset 0 0 0 1.5px var(--ink); }
.clause--red.is-selected { background: #fee2e2; box-shadow: inset 3px 0 0 var(--red), inset 0 0 0 1.5px var(--red); }
.clause--amber.is-selected { background: #ffedd5; box-shadow: inset 3px 0 0 var(--amber-mark), inset 0 0 0 1.5px var(--amber-mark); }
.clause .doc-heading { margin-top: 1.2em; }

.clause__tag {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  padding: 2px 9px;
  border: 1px solid;
  border-radius: 999px;
  background: #fff;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.15s;
}
.clause:hover .clause__tag,
.clause.is-selected .clause__tag,
.clause:focus-visible .clause__tag { opacity: 1; }
.clause__tag--red { color: var(--red-strong); border-color: var(--red-line); }
.clause__tag--amber { color: var(--amber); border-color: var(--amber-line); }

mark { background: none; color: inherit; }
.hl-term {
  background-image: linear-gradient(transparent 60%, var(--term-bg) 60%);
  box-shadow: inset 0 -2px 0 var(--term);
  font-weight: 650;
}
.hl-risk {
  color: var(--red-strong);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.hl-risk--amber { color: #9a3412; text-decoration-color: var(--amber-mark); }

.hide-terms .hl-term { background: none; box-shadow: none; font-weight: inherit; }
.hide-red .clause--red { background: none; box-shadow: none; }
.hide-red .hl-risk--red { color: inherit; font-weight: inherit; text-decoration: none; }
.hide-red .clause__tag--red { display: none; }
.hide-amber .clause--amber { background: none; box-shadow: none; }
.hide-amber .hl-risk--amber { color: inherit; font-weight: inherit; text-decoration: none; }
.hide-amber .clause__tag--amber { display: none; }

.is-flash { animation: flash 1.8s ease-out; }

.legend {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.legend__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.legend__item:hover { background: var(--tint); }
.legend__item[aria-pressed="false"] { opacity: 0.4; }
.swatch { width: 18px; height: 18px; border: 1.5px solid; border-radius: 5px; }
.swatch--term { background: var(--term-bg); border-color: var(--term); }
.swatch--red { background: #fee2e2; border-color: #f87171; }
.swatch--amber { background: #ffedd5; border-color: #fb923c; }

.skeleton { display: grid; gap: 14px; }
.skeleton span { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton span:nth-child(1) { width: 45%; margin: 0 auto 18px; height: 20px; }
.skeleton span:nth-child(3) { width: 92%; }
.skeleton span:nth-child(4) { width: 80%; }
.skeleton span:nth-child(5) { width: 60%; }

/* ---------- Analyst panel ---------- */

.analyst {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.analyst__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.analyst__badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 16px rgba(10, 15, 28, 0.22);
}
.analyst__badge .icon { width: 24px; height: 24px; }
.analyst__who h2 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 650; }

.analyst__tabs {
  display: flex;
  gap: 4px;
  padding: 6px 18px 0;
  border-bottom: 1px solid var(--line);
}
.analyst__tab {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.analyst__tab:hover { color: var(--ink); }
.analyst__tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.analyst__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  scroll-behavior: smooth;
}
.analyst__scroll > .card + .card { margin-top: 18px; }
.view { display: flex; flex-direction: column; gap: 18px; }

.analyst__foot {
  display: grid;
  gap: 12px;
  padding: 16px 24px 14px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.analyst__legal {
  margin: 0;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.ask {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.ask:focus-within { border-color: var(--ink); }
.ask__input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.ask__input::placeholder { color: var(--muted-2); }
.ask__send {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}
.ask__send:disabled { opacity: 0.45; cursor: default; }
.cta-row { display: flex; gap: 10px; }

.card {
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card--compact { padding: 16px 20px; }
.card--warning { background: #fffdf6; border-color: #fcd9a4; }
.card--notice p { margin: 0 0 8px; }
.card--danger { border-color: var(--red-line); }
.card__title { margin: 0; color: var(--ink); font-size: 17px; }
.card__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.card__label .icon { width: 19px; height: 19px; }
.card__label .count { margin-left: auto; }
.card__label--red { color: var(--red-strong); }
.card__label--amber { color: var(--amber); }
.card--warning .card__label { color: #92400e; }
.card__hint { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.card__hint:last-child { margin-bottom: 0; }
.card__sub { margin: -6px 0 12px; color: var(--muted); font-size: 13.5px; }

.bullets { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bullets li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.bullets li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}
.bullets li.is-flag { color: var(--red); font-weight: 650; }
.bullets li.is-flag::before { background: var(--red); }

.ref {
  display: inline;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  vertical-align: 1px;
  cursor: pointer;
}
.ref:hover { border-color: var(--ink); color: var(--ink); }

.pref {
  padding: 1px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--tint);
  color: var(--muted);
  font-size: 0.8em;
  font-style: normal;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.pref:hover { border-color: var(--ink); color: var(--ink); }

.law { margin: 0 0 4px; color: var(--ink); font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }
.law--muted { color: var(--muted); }
.evidence {
  margin: 12px 0 0;
  padding: 12px 16px;
  background: var(--tint);
  border-left: 3px solid var(--ink);
  border-radius: 0 12px 12px 0;
  color: var(--ink-2);
  font-size: 14px;
  font-style: italic;
}
.note {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--amber-bg);
  border-radius: 12px;
  color: #7c2d12;
  font-size: 13.5px;
}

.list { display: grid; gap: 10px; margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.list--tight { gap: 6px; }
.list__detail { display: block; margin-top: 2px; color: var(--muted); }
.list .tag { margin-top: 6px; }

.flag-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.flag-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.flag-item:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.flag-item--red { border-left: 3px solid var(--red); }
.flag-item--amber { border-left: 3px solid var(--amber-mark); }
.flag-item__ref { color: var(--muted-2); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.flag-item__title { color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.35; }
.flag-item__why { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.flag-item .tag { margin-top: 5px; }

.facts { display: grid; margin: 0; }
.facts__row {
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
}
.facts__row:first-child { padding-top: 0; border-top: 0; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; color: var(--ink-2); }

.reflection {
  margin: 0 0 12px;
  padding: 16px 20px;
  background: var(--tint);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  color: var(--ink-2);
  font-size: 15px;
  font-style: italic;
  line-height: 1.6;
}
.reflection:last-child { margin-bottom: 0; }

.fineprint { margin: 2px 4px 8px; color: var(--muted-2); font-size: 12px; line-height: 1.55; }

.perspective { padding: 14px 16px; background: var(--tint); border: 1px solid var(--line-soft); border-radius: 16px; }
.perspective__pick { display: grid; gap: 10px; margin: 0; }
.perspective__label { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: var(--ink); font-size: 14px; font-weight: 650; }
.perspective__label .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
.perspective__hint { color: var(--muted); font-weight: 400; }
.perspective .chips { padding-left: 28px; }
.perspective__current { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ink-2); font-size: 14px; }
.perspective__current .icon { width: 18px; height: 18px; color: var(--muted); }
.perspective__role { color: var(--muted); }
.perspective__current .link { margin-left: auto; font-size: 13px; }

/* Clauses tab */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filter {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.filter span { color: var(--muted-2); }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter.is-active span { color: rgba(255, 255, 255, 0.7); }

.clause-rows { margin: 0; padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--line); border-radius: 16px; }
.clause-rows li + li { border-top: 1px solid var(--line-soft); }
.clause-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: #fff;
  border: 0;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}
.clause-row:hover { background: var(--tint); }
.clause-row__num { min-width: 36px; color: var(--muted-2); font-family: var(--mono); font-size: 12.5px; }
.clause-row__title { flex: 1; min-width: 0; overflow: hidden; font-size: 14.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.clause-row__note { color: var(--muted); }
.clause-row__note .icon { width: 16px; height: 16px; }
.clause-row__chevron { width: 18px; height: 18px; color: var(--muted-2); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.dot--red { background: var(--red); }
.dot--amber { background: var(--amber-mark); }

.clause-detail { display: flex; flex-direction: column; gap: 14px; }
.clause-detail__title { margin: -6px 0 0; color: var(--ink); font-size: 22px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.25; }

.back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.back:hover { background: var(--tint); color: var(--ink); }
.back .icon { width: 18px; height: 18px; }

.flag-banner { display: grid; gap: 8px; padding: 16px 18px; border: 1px solid; border-radius: 16px; font-size: 14.5px; }
.flag-banner p { margin: 0; }
.flag-banner--red { background: var(--red-bg); border-color: var(--red-line); color: #7f1d1d; }
.flag-banner--amber { background: var(--amber-bg); border-color: var(--amber-line); color: #7c2d12; }
.flag-banner__title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.flag-banner__title .icon { width: 18px; height: 18px; }
.flag-banner blockquote { margin: 0; padding: 10px 14px; background: rgba(255, 255, 255, 0.75); border-radius: 10px; font-style: italic; }

.block { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; }
.block p { margin: 0 0 10px; }
.block p:last-child { margin-bottom: 0; }
.block__label {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.impact { margin-top: 10px; padding: 12px 14px; background: var(--tint); border-radius: 12px; }
.block__label + .impact { margin-top: 0; }
.impact--you { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.impact__who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px !important; color: var(--ink); font-size: 14px; font-weight: 700; }
.impact__role { color: var(--muted); font-size: 12.5px; font-weight: 500; }

.lean {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px;
  background: var(--tint);
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 650;
}
.lean .icon { width: 18px; height: 18px; }
.lean--other { background: #fff7ed; color: #9a3412; }
.lean--you { background: #f0fdf4; color: #166534; }

.notes-box textarea {
  width: 100%;
  min-height: 86px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}
.notes-box textarea:focus { border-color: var(--ink); outline: 0; }
.notes-box__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.save-state { margin: 0; color: var(--muted-2); font-size: 12.5px; }

.check { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); }
.check--small { font-size: 13px; }
.check a { color: var(--ink); }

/* Ask tab */
.chat { display: flex; flex-direction: column; gap: 16px; }
.chat__intro { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.suggestions { display: grid; gap: 8px; margin-top: 6px; }
.suggestion {
  padding: 11px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.suggestion:hover { border-color: var(--ink); }
.chat__thread { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 92%; padding: 12px 16px; border-radius: 18px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul { margin: 0 0 8px; padding-left: 18px; }
.bubble ul:last-child { margin-bottom: 0; }
.bubble--user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.bubble--assistant { align-self: flex-start; background: var(--tint); border: 1px solid var(--line-soft); color: var(--ink-2); border-bottom-left-radius: 6px; }
.bubble--error { background: var(--red-bg); border-color: var(--red-line); color: #7f1d1d; }
.typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); animation: bounce 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

/* Progress */
.steps { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }
.step { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 14.5px; }
.step__mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: transparent;
}
.step__mark .icon { width: 14px; height: 14px; }
.step.is-active { color: var(--ink); font-weight: 650; }
.step.is-active .step__mark { border-color: var(--ink); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.step.is-done { color: var(--ink-2); }
.step.is-done .step__mark { background: var(--ink); border-color: var(--ink); color: #fff; }
.step__count { color: var(--muted); font-weight: 500; }
.bar { height: 6px; margin-bottom: 12px; overflow: hidden; background: var(--line-soft); border-radius: 999px; }
.bar__fill { display: block; width: 6%; height: 100%; background: var(--ink); border-radius: inherit; transition: width 0.6s ease; }

/* ---------- Pages ---------- */

.page { max-width: 1080px; margin: 0 auto; padding: 48px 28px 80px; }
.page--narrow { max-width: 740px; }
.page__head h1 { margin: 6px 0 12px; color: var(--ink); font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.025em; line-height: 1.1; }
.lede { max-width: 700px; margin: 0; color: var(--muted); font-size: 17px; }

.upload { display: grid; gap: 18px; margin-top: 32px; padding: 28px; }
.upload__form { display: grid; gap: 16px; }
.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 42px 24px;
  background: var(--tint);
  border: 2px dashed #d5dae1;
  border-radius: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone.is-over,
.dropzone:focus-within { background: #fff; border-color: var(--ink); }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 4px; background: var(--ink); border-radius: 15px; color: #fff; }
.dropzone__title { color: var(--ink); font-size: 17px; font-weight: 650; }
.dropzone__hint { color: var(--muted); font-size: 13.5px; }
.dropzone__file { margin-top: 6px; padding: 6px 14px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; font-weight: 650; }
.upload__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.upload__error { margin: 0; color: var(--red); font-size: 14px; font-weight: 600; }
.upload__privacy { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; }
.upload__privacy .icon { width: 16px; height: 16px; }

.paste > summary { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14.5px; font-weight: 650; list-style: none; cursor: pointer; }
.paste > summary::-webkit-details-marker { display: none; }
.paste > summary .icon { width: 18px; height: 18px; color: var(--muted); }
.paste[open] > summary { margin-bottom: 14px; }

.samples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.samples form { display: inline; margin: 0; }

.section-title { margin: 44px 0 14px; color: var(--muted); font-size: 13px; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; }

.doc-rows { margin: 0; padding: 0; overflow: hidden; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.doc-rows li + li { border-top: 1px solid var(--line-soft); }
.doc-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; color: inherit; text-decoration: none; }
.doc-row:hover { background: var(--tint); }
.doc-row__icon { display: grid; flex: none; place-items: center; width: 42px; height: 42px; background: var(--tint); border: 1px solid var(--line-soft); border-radius: 12px; color: var(--muted); }
.doc-row__main { display: grid; flex: 1; gap: 2px; min-width: 0; }
.doc-row__title { overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.doc-row__meta,
.doc-row__snippet { overflow: hidden; color: var(--muted); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.doc-row__chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.doc-row__date { min-width: 90px; color: var(--muted-2); font-size: 13px; text-align: right; }

.empty { padding: 72px 24px; text-align: center; }
.empty h1 { margin: 8px 0; color: var(--ink); }
.empty p { color: var(--muted); }
.empty--inline { padding: 28px; border: 1px dashed var(--line); border-radius: 18px; }
.empty--inline p { margin: 0; }

.prose h1 { margin: 6px 0 14px; color: var(--ink); font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.025em; line-height: 1.12; }
.prose h2 { margin: 36px 0 10px; color: var(--ink); font-size: 20px; }
.prose p,
.prose li { color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.prose ol { display: grid; gap: 10px; padding-left: 22px; }

/* Forms and auth */
.auth-page { background: var(--canvas); }
.auth { display: grid; place-content: center; gap: 18px; min-height: calc(100vh - var(--topbar)); padding: 48px 16px; }
.auth__card { width: min(440px, 100%); padding: 36px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth__card h1 { margin: 0 0 6px; color: var(--ink); font-size: 26px; letter-spacing: -0.02em; }
.auth__lede { margin: 0 0 22px; color: var(--muted); }
.auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.auth__links a { color: var(--ink); font-weight: 650; }
.auth__footnote { max-width: 440px; margin: 0 auto; color: var(--muted-2); font-size: 12.5px; text-align: center; }

.form { display: grid; gap: 16px; }
.form--inline { grid-template-columns: 1fr auto; align-items: end; }
.field { display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; font-weight: 650; }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
}
.field input:focus,
.field textarea:focus { border-color: var(--ink); outline: 0; }
.field__hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.field__error { color: var(--red); font-size: 13px; font-weight: 650; }
.form-error,
.form-notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.form-error { background: var(--red-bg); color: #7f1d1d; }
.form-notice { background: #f0fdf4; color: #14532d; }

.toast {
  position: fixed;
  top: calc(var(--topbar) + 14px);
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(640px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 650;
  transform: translateX(-50%);
  animation: toast-in 0.25s ease, toast-out 0.4s ease 6s forwards;
}
.toast--success { background: var(--ink); color: #fff; }
.toast--error { background: var(--red); color: #fff; }

/* ---------- Lawyer brief ---------- */

.brief-page { background: var(--canvas); }
.brief { max-width: 920px; margin: 0 auto; padding: 28px 24px 80px; }
.brief__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brief__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.brief__sheet { padding: 64px 72px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.brief__head { margin-bottom: 6px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.brief__brand { margin: 0 0 18px; color: var(--ink); font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.brief__head h1 { margin: 0 0 6px; color: var(--muted); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
.brief__doc { margin: 0 0 8px; color: var(--ink); font-size: 28px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; }
.brief__meta { margin: 0; color: var(--muted); font-size: 14px; }
.brief__section { padding: 26px 0 8px; border-bottom: 1px solid var(--line-soft); }
.brief__section:last-of-type { border-bottom: 0; }
.brief__section h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; color: var(--ink); font-size: 17px; break-after: avoid; }
.brief__num { display: grid; flex: none; place-items: center; width: 26px; height: 26px; background: var(--ink); border-radius: 50%; color: #fff; font-size: 13px; }
.brief__facts { display: grid; gap: 10px; margin: 0 0 12px; }
.brief__facts > div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; font-size: 14.5px; }
.brief__facts dt { color: var(--muted); font-weight: 650; }
.brief__facts dd { margin: 0; color: var(--ink-2); }
.brief__quote { display: block; margin-top: 4px; color: var(--muted); font-style: italic; }
.plain { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.brief__context textarea {
  width: 100%;
  padding: 14px;
  background: var(--tint);
  border: 1px dashed var(--muted-2);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
.brief__context textarea:focus { background: #fff; border-style: solid; border-color: var(--ink); outline: 0; }
.brief__context .save-state { margin: 6px 0 10px; }
.brief__context-text { font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.brief-item { margin-bottom: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; break-inside: avoid; }
.brief-item p { margin: 0 0 6px; font-size: 14.5px; }
.brief-item p:last-child { margin-bottom: 0; }
.brief-item--red { border-left: 4px solid var(--red); }
.brief-item--amber { border-left: 4px solid var(--amber-mark); }
.brief-item .brief-item__ref { color: var(--muted-2); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.brief-item .brief-item__title { color: var(--ink); font-size: 15.5px; font-weight: 700; }
.brief-item .brief-item__lean { color: var(--muted); font-size: 13px; }
.brief-item blockquote { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); font-size: 14px; font-style: italic; }
.brief-item__note { padding: 8px 12px; background: var(--amber-bg); border-radius: 8px; }
.brief__bullets { display: grid; gap: 8px; margin: 0 0 12px; padding-left: 20px; font-size: 14.5px; }
.brief__bullets li.is-flag { color: var(--red-strong); font-weight: 650; }
.brief__questions { display: grid; gap: 10px; margin: 0 0 12px; padding-left: 22px; font-size: 14.5px; }
.brief__ref { color: var(--muted); font-size: 13px; }
.brief__foot { margin-top: 28px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.print-only { display: none; }

/* ---------- Motion ---------- */

@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes flash { 0% { background-color: #fef08a; } 100% { background-color: transparent; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -8px); visibility: hidden; } }

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

/* ---------- Credits ---------- */

.credits-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.credits-chip:hover,
.credits-chip.is-active { border-color: var(--ink); }
.credits-chip .icon { width: 18px; height: 18px; color: var(--amber); }
.credits-chip__unit { color: var(--muted); font-weight: 550; }
.credits-chip.is-empty { background: var(--amber-bg); border-color: var(--amber-line); }
.menu__count { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 650; }

.status--waiting .status__dot { background: var(--amber-mark); }

.card__hint .icon { width: 16px; height: 16px; margin-right: 2px; vertical-align: -3px; color: var(--amber); }
.upload__credits { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 13.5px; }
.upload__credits .icon { width: 16px; height: 16px; color: var(--amber); }
.upload__credits a { color: var(--ink); font-weight: 650; }

.bubble__cost { align-self: flex-start; margin: -6px 0 0 6px; color: var(--muted-2); font-size: 12px; }

.verify-card { margin: 0 0 20px; }
.page__head + .verify-card { margin-top: 32px; }
.billing .page__head + .verify-card { margin-top: 0; }
.verify-card + .upload { margin-top: 0; }
.verify-card form { margin: 0; }
.analyst__scroll .verify-card { margin-bottom: 0; }

.needs-credits__cost { margin: 0; color: var(--ink-2); }
.needs-credits form { margin: 0; }

.packs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.packs--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pack {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 16px;
  background: var(--tint);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.pack__price { color: var(--ink); font-size: 24px; font-weight: 750; letter-spacing: -0.02em; }
.pack__credits { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.pack__hint { color: var(--muted); font-size: 12.5px; }
.pack .btn { margin-top: 10px; }
.packs--compact .pack { padding: 12px; }
.packs--compact .pack__price { font-size: 20px; }

.billing .page__head { margin-bottom: 28px; }
.billing .card { margin-bottom: 20px; }
.notice-line { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.notice-line .icon { width: 18px; height: 18px; color: var(--amber); }

.ledger { margin: 0 0 12px; padding: 0; overflow: hidden; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.ledger__row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; }
.ledger__row + .ledger__row { border-top: 1px solid var(--line-soft); }
.ledger__main { display: grid; flex: 1; gap: 2px; min-width: 0; }
.ledger__what { overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ledger__what a { text-decoration: none; }
.ledger__what a:hover { text-decoration: underline; }
.ledger__meta { color: var(--muted); font-size: 13px; }
.ledger__amount { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger__amount.is-credit { color: #15803d; }
.ledger__balance { min-width: 64px; color: var(--muted-2); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.ledger__link { display: inline-flex; align-self: center; align-items: center; gap: 5px; margin: 0; white-space: nowrap; }
.ledger__link .icon { width: 16px; height: 16px; }

/* ---------- Smaller screens ---------- */

@media (max-width: 1180px) {
  .search { width: 240px; }
  .credits-chip__unit { display: none; }
  .paper { padding: 60px 64px; }
  .page-break { margin-left: -64px; margin-right: -64px; }
}

@media (max-width: 960px) {
  .credits-chip { display: none; }
  .workspace { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar)); }
  .pane-switch { display: flex; gap: 4px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); }
  .pane-switch__btn { display: flex; flex: 1; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; background: none; border: 0; border-radius: 10px; color: var(--muted); font-weight: 650; cursor: pointer; }
  .pane-switch__btn.is-active { background: var(--ink); color: #fff; }
  .doc-pane,
  .analyst { display: none; flex: 1; border-right: 0; }
  .doc-pane.is-active,
  .analyst.is-active { display: flex; }
  .doc-scroll { padding: 16px 10px 120px; }
  .doc-toolbar { padding: 10px 14px; }
  .paper { padding: 36px 22px; }
  .page-break { margin-left: -22px; margin-right: -22px; }
  .clause { margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
  .legend { right: 12px; bottom: 12px; left: 12px; justify-content: space-between; gap: 2px; padding: 6px; }
  .legend__item { gap: 6px; padding: 7px 6px; font-size: 10.5px; letter-spacing: 0.04em; }
  .swatch { width: 14px; height: 14px; border-radius: 4px; }
  .doc-title { font-size: 1.3em; letter-spacing: 0.12em; }
}

@media (max-width: 760px) {
  :root { --topbar: 58px; }
  .topbar { gap: 16px; padding: 0 16px; }
  .brand { font-size: 18px; }
  .tabs { gap: 16px; }
  .tab { font-size: 14px; }
  .search { display: none; }
  .credits-chip { display: none; }
  .avatar { width: 36px; height: 36px; margin-left: auto; font-size: 13px; }
  .menu:has(.avatar) { margin-left: auto; }
  .page { padding: 28px 16px 60px; }
  .upload { padding: 18px; }
  .doc-row { flex-wrap: wrap; padding: 14px 16px; }
  .doc-row__chips { order: 3; justify-content: flex-start; width: 100%; padding-left: 58px; }
  .doc-row__date { display: none; }
  .doc-toolbar__tools .tool__value,
  .doc-toolbar__tools .tool__divider { display: none; }
  .analyst__head { padding: 14px 16px; }
  .analyst__scroll { padding: 16px; }
  .analyst__foot { padding: 12px 16px; }
  .btn--cta { height: 52px; font-size: 15.5px; }
  .facts__row { grid-template-columns: 1fr; gap: 2px; }
  .brief { padding: 16px 12px 60px; }
  .brief__sheet { padding: 28px 20px; }
  .brief__facts > div { grid-template-columns: 1fr; gap: 2px; }
  .form--inline { grid-template-columns: 1fr; }
  .auth__card { padding: 26px 20px; }
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger__row { flex-wrap: wrap; gap: 4px 12px; padding: 12px 16px; }
  .ledger__main { flex-basis: 100%; }
  .ledger__balance { margin-left: auto; }
}

@media (max-width: 420px) {
  .tabs { gap: 12px; }
  .tab { font-size: 13.5px; }
  .brand { font-size: 17px; }
}

/* ---------- Print (the lawyer brief) ---------- */

@media print {
  @page { margin: 16mm 15mm; }
  body,
  .brief-page { background: #fff; }
  .topbar,
  .toast,
  .no-print { display: none !important; }
  .print-only { display: block; }
  .brief { max-width: none; padding: 0; }
  .brief__sheet { padding: 0; border: 0; box-shadow: none; }
  .brief__context.is-empty { display: none; }
  .brief__num { background: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
