/* ============================================================
   SLegalTools Web AI Early Access — app.css
   Canvas cream #fffaf5 · ink #111213 · accent #ff6500 · border #eaded2
   ============================================================ */

:root {
  --canvas: #fffaf5;
  --ink: #111213;
  --accent: #ff6500;
  --accent-dark: #e05700;
  --accent-soft: #fff1e6;
  --accent-wash: #ffe6d2;
  --border: #eaded2;
  --border-strong: #ddd0bf;
  --card: #ffffff;
  --shell: #17181a;
  --on-shell: #f5f2ec;
  --on-shell-dim: #b9b4aa;
  --shell-line: #2b2d30;
  --ok: #1d7a3e;
  --ok-soft: #e7f3ea;
  --err: #c2341b;
  --err-soft: #fbe9e4;
  --warn-soft: #fff6e5;
  --text: #111213;
  --text-2: #575047;
  --text-3: #8a8378;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17,18,19,.06), 0 8px 24px rgba(17,18,19,.05);
  --font: "Noto Sans Thai", "Leelawadee UI", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
/* P0: author `display` rules must never defeat the hidden attribute (citation reader,
   dropdown, banners all rely on [hidden] for closed state — incl. mobile overlay). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--canvas);
}
img, svg { max-width: 100%; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--ink); }

/* ---------- icons ---------- */
.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.25em;
}
.icon-lg { width: 30px; height: 30px; }
.icon-sm { width: 17px; height: 17px; }
.icon-xs { width: 14px; height: 14px; }
.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- a11y ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px;
}
.skip-link:focus { left: 12px; top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- EA banner ---------- */
.ea-banner {
  --ea-banner-h: 36px;
  position: sticky; top: 0; z-index: 150;
  background: var(--ink); color: #f5f2ec;
  font-size: 13px; line-height: 1.4;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--ea-banner-h); padding: 0 16px; text-align: center;
  white-space: nowrap; overflow: hidden;
}
.ea-banner .icon { color: #ffb389; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.4;
  padding: 10px 20px; min-height: 42px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: var(--card); color: var(--ink); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: inherit; border-color: transparent; }
.btn-ghost:hover { background: rgba(17,18,19,.06); }
.btn-danger-outline { background: transparent; color: var(--err); border-color: rgba(194,52,27,.45); font-weight: 500; }
.btn-danger-outline:hover { border-color: var(--err); background: var(--err-soft); }
.btn-sm { padding: 6px 14px; min-height: 36px; font-size: 14px; }
.btn-lg { padding: 13px 26px; min-height: 50px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-slim { padding: 4px 12px; min-height: 32px; font-size: 13.5px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: none;
  background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(17,18,19,.07); color: var(--accent); }

.input, .select {
  font-family: inherit; font-size: 15.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 14px; min-height: 44px; width: 100%;
}
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input-lg { min-height: 64px; font-size: 17px; }
.input-sm { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.textarea { resize: vertical; line-height: 1.7; }
#homeQuestion { min-height: 128px; }
.select { appearance: auto; }
.field-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }
.form-error { color: var(--err); font-size: 14.5px; margin-top: 12px; background: var(--err-soft); border-radius: 8px; padding: 8px 12px; }

.input-ghost {
  font-family: inherit; font-size: 15.5px; color: var(--ink);
  background: transparent; border: none; outline: none; flex: 1; min-width: 0; min-height: 40px;
}

/* ---------- generic bits ---------- */
.h2 { font-size: 28px; font-weight: 700; line-height: 1.45; letter-spacing: 0; }
.h3 { font-size: 20px; font-weight: 700; line-height: 1.45; }
.text-muted { color: var(--text-2); }
.muted-line { color: var(--text-3); font-size: 14.5px; }
.text-accent { color: var(--accent); }
.fineprint { color: var(--text-3); font-size: 13px; margin-top: 12px; line-height: 1.6; }
.link-plain { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link-plain:hover { text-decoration: underline; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 32px;
}

.notice { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid; margin: 18px 0; }
.notice p { font-size: 14.5px; color: var(--text-2); }
.notice .icon { margin-top: 3px; }
.notice-warn { background: var(--warn-soft); border-color: #eedbb2; color: #7a5a12; }
.notice-error { background: var(--err-soft); border-color: #ecc5ba; color: var(--err); }
.notice-info { background: var(--accent-soft); border-color: var(--accent-wash); color: #8a4710; }

.banner { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.6; padding: 9px 14px; border-radius: 9px; margin-bottom: 8px; }
.banner .icon { margin-top: 3px; }
.banner-warn { background: var(--accent-soft); border: 1px solid var(--accent-wash); color: #7c4210; }
.banner-info { background: var(--warn-soft); border: 1px solid #eedbb2; color: #6f5716; }

.empty-state { text-align: center; padding: 64px 24px; color: var(--text-2); }
.empty-state .icon-lg { color: var(--text-3); margin-bottom: 14px; }
.empty-state p { margin-top: 6px; }
.empty-state .muted-line { margin-top: 4px; }

/* skeletons (no gradients — subtle pulse) */
.skel { background: rgba(17,18,19,.06); border-radius: 8px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.skel-line { height: 14px; margin: 12px 0; }
.skel-line.w80 { width: 80%; }
.skel-title { height: 30px; width: 60%; margin-bottom: 18px; }
.skel-card { height: 110px; margin: 12px 0; }

/* chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; line-height: 1.4;
  background: var(--canvas); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 12px;
}
.chip .icon-xs { color: var(--text-3); }
.chip-strong { background: var(--accent-soft); border-color: var(--accent-wash); color: #9c4d00; font-weight: 600; }
.chip-strong .icon-xs { color: var(--accent); }
.chip-ok { background: var(--ok-soft); border-color: #c8e2cf; color: var(--ok); }
.chip-ok .icon-xs { color: var(--ok); }
.chip-warn { background: var(--warn-soft); border-color: #eedbb2; color: #8a6414; }
.chip-warn .icon-xs { color: #b58515; }
.chip-law { background: #f4f0fa; border-color: #e2d9f2; color: #5b4a86; }
.chip-law .icon-xs { color: #7a68a8; }
button.chip { cursor: pointer; font-family: inherit; }
.chip-click { padding: 8px 18px; font-size: 14px; min-height: 40px; }
button.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-click { background: var(--card); }
.chip-select { padding: 8px 18px; font-size: 14.5px; }
.chip-select.active { background: var(--accent); border-color: var(--accent); color: #111213; font-weight: 700; }

.hint-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.hint-label { font-size: 13.5px; color: var(--text-3); }
.hint-chips-center { justify-content: center; }

/* toast */
.toast-region { position: fixed; left: 0; right: 0; bottom: 22px; z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--on-shell);
  font-size: 14.5px; padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(17,18,19,.25);
  animation: toast-in .18s ease;
}
.toast .icon { color: #ffb389; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* modal */
.modal-root:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 350; background: rgba(17,18,19,.52);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: var(--card); border-radius: 14px; border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(17,18,19,.22);
  width: 100%; max-width: 440px; padding: 26px 28px;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-body { font-size: 15px; color: var(--text-2); line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ============================================================
   PUBLIC SHELL
   ============================================================ */
.pub-header { background: var(--canvas); border-bottom: 1px solid var(--border); position: sticky; top: var(--sdeeka-banner-height, 0px); z-index: 100; }
.pub-header-inner {
  max-width: 1488px; margin: 0 auto; padding: 0 56px; /* 1376 content + 2×56 gutters */
  min-height: 84px; display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
/* The SVG already fills its square viewBox; size it to the tile at every breakpoint. */
.brand-mark {
  display: block; width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 11px;
}
.brand-mark img {
  display: block; width: 100%; height: 100%; object-fit: contain;
}
.brand-word { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -0.015em; line-height: 1; }
.brand-on-dark .brand-word { color: var(--on-shell); font-size: 24px; }
.pub-nav { display: flex; align-items: center; gap: 28px; margin: 0 auto; }
.pub-nav a { text-decoration: none; font-size: 17px; font-weight: 600; color: var(--text-2); padding: 6px 2px; }
.pub-nav a:hover { color: var(--accent); }
.pub-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.pub-header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.avatar-menu { position: relative; }
.avatar-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 14px 5px 6px; min-height: 42px; cursor: pointer; font-family: inherit;
}
.avatar-btn:hover { border-color: var(--border-strong); }
.avatar-circle {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: #ffe5d1; color: #191511;
  box-shadow: inset 0 0 0 1px rgba(25,21,17,.14);
  font-size: 13px; font-weight: 700; line-height: 1; user-select: none;
}
.avatar-sm, .avatar-circle--sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md, .avatar-circle--md { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg, .avatar-circle--lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-fallback {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity .15s ease;
}
.avatar-img {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  background: #ffe5d1; opacity: 0; transition: opacity .15s ease;
}
.avatar-img.is-loaded, .avatar-circle.is-loaded .avatar-img { opacity: 1; }
.avatar-circle.has-avatar .avatar-fallback { opacity: 0; }
.avatar-name { font-size: 14.5px; font-weight: 600; color: var(--ink); max-width: 168px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 130;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); min-width: 248px; max-width: min(320px, calc(100vw - 24px));
  padding: 6px; display: flex; flex-direction: column;
}
.dropdown-profile {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px 11px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border); min-width: 0;
}
.dropdown-profile > :not(.avatar-circle) {
  min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px;
}
.dropdown-profile strong, .dropdown-profile-name {
  display: block; font-size: 14.5px; font-weight: 700; line-height: 1.35; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dropdown-profile small, .dropdown-profile-email,
.dropdown-profile > :not(.avatar-circle) > span:not(.chip),
.dropdown-profile > :not(.avatar-circle) > p {
  display: block; font-size: 12.5px; line-height: 1.35; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px 12px; border-radius: 8px; text-decoration: none;
  background: none; border: none; font: inherit; font-size: 14.5px; color: var(--ink); cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--accent-soft); color: #9a3e00; }

.drawer-member-card {
  display: flex; align-items: center; gap: 11px;
  margin: 6px 14px 8px; padding: 10px 12px; min-height: 54px;
  background: #ffffff; border: 1px solid #e4d7ca; border-radius: 12px;
  text-decoration: none; color: var(--ink); min-width: 0;
}
a.drawer-member-card:hover { border-color: #cb7944; background: #fff9f4; }
.drawer-member-card > :not(.avatar-circle):not(.icon) {
  min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px;
}
.drawer-member-card strong, .drawer-member-name {
  display: block; font-size: 14.5px; font-weight: 700; line-height: 1.35; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drawer-member-card small, .drawer-member-email, .drawer-member-sub,
.drawer-member-card > :not(.avatar-circle):not(.icon) > span:not(.chip),
.drawer-member-card > :not(.avatar-circle):not(.icon) > p {
  display: block; font-size: 12.5px; line-height: 1.35; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pub-main { max-width: 1488px; margin: 0 auto; padding: 0 56px; }
.pub-footer { border-top: 1px solid var(--border); margin-top: 72px; }
.pub-footer-inner {
  max-width: 1488px; margin: 0 auto; padding: 22px 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13.5px;
}
.pub-footer-links { display: flex; gap: 18px; }
.pub-footer a { color: var(--text-2); text-decoration: none; }
.pub-footer a:hover { color: var(--accent); }

.page-narrow { max-width: 900px; margin: 0 auto; padding: 40px 0 80px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; min-height: calc(100vh - var(--sdeeka-top, 84px)); }
.app-sidebar {
  width: 236px; flex: none; background: var(--shell); color: var(--on-shell-dim);
  display: flex; flex-direction: column;
  position: sticky; top: var(--sdeeka-top, 84px); height: calc(100vh - var(--sdeeka-top, 84px)); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #d8c9ba transparent;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 12px 18px; }
.sb-close { color: var(--on-shell-dim); display: none; }
.sb-nav { display: flex; flex-direction: column; padding: 8px 12px; gap: 2px; }
.sb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px; text-decoration: none;
  color: var(--on-shell-dim); font-size: 14.5px; font-weight: 500;
  border-left: 3px solid transparent; margin-left: -12px; padding-left: 15px;
}
.sb-item .icon { color: var(--on-shell-dim); }
.sb-item:hover { color: var(--on-shell); background: rgba(25,21,17,.05); }
.sb-item.active { color: #9a3e00; background: rgba(255,101,0,.12); border-left-color: var(--accent); font-weight: 600; }
.sb-item.active .icon { color: var(--accent); }
.sb-access-note { font-size: 12.5px; line-height: 1.55; color: var(--on-shell-dim); padding: 10px 15px; margin: 6px 0 0; border-top: 1px solid var(--shell-line); }
a.sb-access-login { display: flex; gap: 8px; text-decoration: none; color: var(--on-shell-dim); }
a.sb-access-login:hover { color: #9a3e00; }
.sb-history { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px 12px 8px; border-top: 1px solid var(--shell-line); margin-top: 8px; }
.sb-history-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 6px; min-width: 0; padding: 6px 8px 4px 12px; }
.sb-history-title { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--on-shell-dim); text-transform: none; letter-spacing: .01em; padding: 2px 0; margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-history-title .icon { flex: 0 0 auto; }
.sb-history-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-history-all {
  display: inline-flex; align-items: center; flex: 0 0 auto; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: #9a3e00; text-decoration: none;
  padding: 2px 4px; border-radius: 6px;
}
.sb-history-all:hover { text-decoration: underline; background: var(--accent-soft); }
.sb-history-notice { font-size: 12px; line-height: 1.5; color: var(--text-2); padding: 2px 12px 6px; }
.sb-history-notice a { color: #9a3e00; font-weight: 600; }
.sb-history-list {
  overflow-y: auto; flex: 1; min-height: 0; padding: 0 4px 8px 0;
  scrollbar-width: thin; scrollbar-color: #d8c9ba transparent;
}
.sb-hist-item { position: relative; }
.sb-hist-link {
  display: block; text-decoration: none; color: var(--on-shell);
  padding: 8px 34px 8px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5;
}
.sb-hist-link:hover { background: #f6ede4; color: var(--ink); }
.sb-hist-link.current { background: #ffeddd; color: #843807; font-weight: 600; }
.sb-hist-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-hist-time { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.sb-hist-del {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 7px; border: none; cursor: pointer;
  background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center;
}
.sb-hist-del:hover { color: var(--err); background: var(--err-soft); }
.sb-hist-empty { color: var(--text-2); font-size: 12.5px; padding: 10px 12px; line-height: 1.6; }
.sb-foot { font-size: 11.5px; line-height: 1.6; color: var(--text-2); padding: 12px 18px; border-top: 1px solid var(--shell-line); margin-top: auto; }

.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--canvas); }
.app-content-header {
  min-height: 94px; display: flex; align-items: center; gap: 16px;
  padding: 12px 40px; border-bottom: 1px solid var(--border); background: var(--canvas);
}
.app-menu-btn { display: none; }
.app-page-title { font-size: 21px; font-weight: 700; letter-spacing: 0; }
.app-quicksearch {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 0 18px; width: 360px; max-width: 42vw;
}
.app-quicksearch .icon { color: var(--text-3); }
.app-quicksearch input { border: none; outline: none; background: transparent; font-family: inherit; font-size: 14.5px; min-width: 0; width: 100%; padding: 9px 0; }
.app-backdrop { position: fixed; inset: 0; z-index: 140; background: rgba(17,18,19,.5); }

/* ============================================================
   HOME
   ============================================================ */
.home-hero { text-align: center; padding: 58px 0 42px; }
.hero-title { font-size: clamp(38px, 5.4vw, 62px); font-weight: 800; line-height: 1.45; letter-spacing: 0; }
.hero-sub { font-size: clamp(20px, 2.6vw, 30px); font-weight: 500; color: var(--text-2); line-height: 1.5; margin-top: 16px; }
.home-grid { display: grid; grid-template-columns: 63fr 37fr; gap: 14px; align-items: stretch; }
.home-grid > * { min-width: 0; }

.home-card-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 26px; }
.home-card-icon {
  width: 72px; height: 72px; flex: none; border-radius: 18px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.home-card-icon .icon { width: 34px; height: 34px; }
.home-card-title { font-size: 29px; font-weight: 700; line-height: 1.45; letter-spacing: 0; }
.home-card-blurb { color: var(--text-2); font-size: 16px; line-height: 1.75; margin-top: 6px; max-width: 56ch; }

.home-main-card { display: flex; flex-direction: column; padding: 36px 38px 32px; }
.home-mcp-card { display: flex; flex-direction: column; align-items: stretch; padding: 36px 32px 30px; }
@media (min-width: 961px) {
  .home-main-card, .home-mcp-card { min-height: 480px; }
}
.home-mcp-card .home-card-icon { margin-bottom: 16px; }
.mcp-cta { margin-top: 18px; border: 2px solid var(--accent); color: var(--accent); font-weight: 700; }
.mcp-cta:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.mcp-install-link { display: flex; justify-content: center; margin-top: 10px; font-size: 14px; }
.mcp-free-strip {
  margin-top: 16px; display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--accent-wash); background: var(--accent-soft);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13.5px; line-height: 1.65; color: #7c4210;
}
.mcp-free-strip .icon { color: var(--accent); margin-top: 2px; flex: none; }

.mode-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 20px; }
.mode-tab {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15.5px; font-weight: 600;
  background: var(--canvas); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 16px; min-height: 46px; cursor: pointer; overflow-wrap: anywhere;
}
.mode-tab:hover { color: var(--accent); border-color: var(--accent-wash); }
.mode-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.search-inline-row { display: flex; gap: 10px; }
.search-inline-row .input { flex: 1; min-width: 0; }
.search-inline-row .btn-lg { min-height: 64px; }
.ask-actions { margin-top: 14px; }

.home-strip-card {
  margin-top: 14px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  border: 1px solid var(--border-strong); padding: 26px 32px;
}
.home-strip-icon {
  width: 48px; height: 48px; flex: none; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.home-strip-icon .icon { width: 24px; height: 24px; }
.home-strip-copy { flex: 1; min-width: 260px; }
.home-strip-copy h2 { font-size: 19px; font-weight: 700; line-height: 1.45; }
.home-strip-copy p { color: var(--text-2); font-size: 15px; line-height: 1.7; margin-top: 3px; }
.home-strip-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.access-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 600;
  border-radius: 999px; padding: 6px 14px;
}
.corpus-line { text-align: center; color: var(--text-3); font-size: 14px; padding: 26px 16px 0; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-bar { padding: 18px 20px; margin-top: 6px; }
.search-bar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-bar-input {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card);
  padding: 0 14px; min-height: 46px;
}
.search-bar-input .icon { color: var(--text-3); }
.search-bar-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search-bar-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-bar-filters .select { width: auto; min-width: 130px; }
.search-callout {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 14px; color: var(--text-2);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 16px; margin: 16px 0 6px;
}
.result-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.result-card { padding: 20px 22px; }
.result-title { font-size: 17px; font-weight: 700; line-height: 1.55; text-decoration: none; display: block; }
.result-title:hover { color: var(--accent); }
.result-snippet {
  color: var(--text-2); font-size: 14.5px; line-height: 1.7; margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 28px 0 8px; }
.pager-page { color: var(--text-2); font-size: 14.5px; font-weight: 600; }
.results-loading { padding: 8px 0; }
.results-loading .muted-line { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   CASE
   ============================================================ */
.case-article { max-width: 820px; }
.case-title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; line-height: 1.35; letter-spacing: -0.01em; }
.meta-line { display: flex; gap: 10px; font-size: 14.5px; color: var(--text-2); line-height: 1.7; margin-top: 4px; }
.meta-label { flex: none; font-weight: 600; color: var(--text-3); min-width: 84px; }
.case-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.case-laws { margin-top: 26px; }
.case-laws .h3 { font-size: 17px; }
.case-text { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 26px; }
.case-para {
  font-size: 17px; line-height: 1.85; color: var(--ink);
  max-width: 76ch; margin-bottom: 18px;
}
.cite-quote-hl { background: var(--accent-wash); border-radius: 4px; padding: 1px 3px; box-shadow: 0 0 0 2px var(--accent-wash); }
.case-nonotice { margin-top: 22px; }

/* ============================================================
   CHAT
   ============================================================ */
body.page-chat .app-content { height: calc(100vh - 36px); overflow: hidden; }
body.page-chat .app-content-header { display: none; }
.chat-layout { flex: 1; min-height: 0; display: flex; width: 100%; }
.chat-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.chat-inner { max-width: 860px; margin: 0 auto; padding: 30px 32px 24px; }

.chat-empty { text-align: center; padding: 60px 12px 30px; color: var(--text-2); }
.chat-empty-icon { color: var(--border-strong); margin-bottom: 10px; }
.chat-empty .icon-lg { width: 40px; height: 40px; }
.chat-empty .hint-chips { max-width: 620px; margin: 18px auto 0; }

/* turns */
.turn { margin: 22px 0; }
.turn-user { display: flex; justify-content: flex-end; }
.turn-user-bubble {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px 16px 4px 16px; box-shadow: var(--shadow);
  padding: 12px 18px; max-width: 78%;
  font-size: 16px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
}
.turn-ai { max-width: 78ch; }
.ai-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.ai-meta .icon { color: var(--accent); }
.ai-block { font-size: 16.5px; line-height: 1.85; }
.ai-block p { margin-bottom: 12px; overflow-wrap: anywhere; }
.ai-block .ai-source-quote { margin: 8px 0 16px; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: #fff; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-block .ai-court-excerpt { margin: 8px 0 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.ai-block .ai-court-excerpt summary { padding: 9px 14px; cursor: pointer; color: var(--text); font-weight: 600; }
.ai-block .ai-court-excerpt summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ai-excerpt-preview { display: block; margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 400; }
.ai-excerpt-label { display: block; color: var(--text-2); font-size: 0.9em; }
.ai-excerpt-label ~ .ai-excerpt-label { margin-top: 6px; }
.ai-court-excerpt:not([open]) .ai-excerpt-open,
.ai-court-excerpt[open] .ai-excerpt-closed,
.ai-court-excerpt[open] .ai-excerpt-preview { display: none; }
.ai-block .ai-court-excerpt .ai-source-quote { margin: 0 12px 12px; }
.ai-block .ai-list { margin: 0 0 12px 0; padding-left: 24px; list-style: disc; }
.ai-block .ai-list li { margin-bottom: 6px; overflow-wrap: anywhere; }
.ai-block code { background: rgba(17,18,19,.07); border-radius: 4px; padding: 0 4px; font-family: Consolas, "Courier New", monospace; font-size: .92em; }
.ai-status { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--text-2); padding: 4px 0; }
.ai-status .icon { color: var(--accent); }
.ai-dots::after { content: ""; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.ai-caret { display: inline-block; width: 2px; height: 1.05em; background: var(--accent); vertical-align: -0.15em; margin-left: 2px; animation: pulse .9s ease-in-out infinite; }
.turn-actions { display: flex; gap: 10px; margin-top: 10px; }
.turn-error-box { border: 1px solid #ecc5ba; background: var(--err-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 8px; }
.turn-error-box strong { color: var(--err); font-size: 14.5px; }
.turn-error-box p { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.turn-cancelled { font-size: 13.5px; color: var(--text-3); margin-top: 8px; display: flex; align-items: center; gap: 6px; }

/* citation chips inside answers */
.cite-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 7px; margin: 0 2px;
  border: 1px solid var(--accent-wash); background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; font-weight: 700; border-radius: 999px;
  cursor: pointer; font-family: inherit; vertical-align: 1px;
}
.cite-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* composer */
.composer-zone {
  border-top: 1px solid var(--border); background: var(--canvas);
  padding: 8px 32px 18px;
}
.composer-topline { max-width: 860px; margin: 0 auto 4px; display: flex; justify-content: flex-end; }
.composer-topline .btn { color: var(--text-2); font-size: 13.5px; min-height: 38px; }
.composer-topline .btn:hover { color: var(--accent); }
.composer-zone-inner, .composer { max-width: 860px; margin: 0 auto; }
#chatContextStatus { max-width: 860px; margin: 6px auto 0; padding: 0 4px; font-size: 12px; line-height: 1.5; }
.composer { display: flex; align-items: flex-end; gap: 10px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
#composerInput {
  flex: 1; border: none; outline: none; resize: none; background: transparent;
  font-family: inherit; font-size: 16px; line-height: 1.7; padding: 8px 0; max-height: 8.5em;
}
.btn-send { border-radius: 10px; min-height: 40px; min-width: 46px; }
.composer-expired {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px dashed var(--border-strong); border-radius: 14px;
  padding: 16px 20px; color: var(--text-2); font-size: 15px; line-height: 1.7;
}
.composer-expired .icon { color: var(--accent); margin-top: 3px; }
.composer-expired a { color: var(--accent); font-weight: 600; }
.composer-meta {
  max-width: 860px; margin: 4px auto 0; padding: 0 6px;
  display: flex; justify-content: flex-end; align-items: center;
}
.story-meta {
  display: flex; justify-content: flex-end; align-items: center;
  margin: 4px 2px 0;
}
.char-counter {
  font-size: 11.5px; line-height: 1.3; letter-spacing: 0.01em;
  color: var(--text-3, #8c8177); opacity: 0.85;
  font-variant-numeric: tabular-nums; user-select: none;
}
.char-counter.is-near { color: #a85a29; opacity: 1; }
.char-counter.is-limit { color: #b42318; opacity: 1; font-weight: 500; }

/* citation reader panel */
.cite-panel {
  width: 420px; flex: none; border-left: 1px solid var(--border); background: var(--card);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.cite-panel-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.cite-panel-heading { flex: 1; min-width: 0; }
.cite-panel-kicker { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .03em; }
.cite-panel-title { font-size: 16px; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cite-back { display: none; }
.cite-chips-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px 0; }
.cite-chips-row .cite-chip { min-width: 30px; height: 30px; }
.cite-chips-row .cite-chip.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.cite-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 28px; font-size: 16.5px; line-height: 1.85; scrollbar-width: thin; scrollbar-color: #d8c9ba transparent; }
.cite-deka-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cite-badges { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.cite-badge { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.6; border-radius: 8px; padding: 8px 12px; }
.cite-badge .icon { margin-top: 2px; }
.cite-badge-warn { background: var(--warn-soft); border: 1px solid #eedbb2; color: #8a6414; }
.cite-badge-stale { background: #f1eff9; border: 1px solid #ddd8ea; color: #5b4a86; }
.cite-badge-note { background: var(--warn-soft); border: 1px solid #eedbb2; color: #8a6414; }
.cite-para { margin-bottom: 14px; }
.cite-para-hl { border-left: 3px solid var(--accent-wash); padding-left: 10px; }
.cite-para .p-no { font-size: 12px; color: var(--text-3); font-weight: 700; margin-right: 6px; }
.cite-panel-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.cite-loading { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 14.5px; padding: 8px 0; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap { display: flex; justify-content: center; padding: 56px 0 96px; }
.login-card { width: 100%; max-width: 480px; position: relative; }
.login-test-tag {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 13px; color: var(--text-2);
  background: var(--canvas); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; margin-bottom: 20px;
}
.login-tabs { margin-bottom: 6px; }
.pending-box {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid var(--accent-wash);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 18px 0 6px;
}
.pending-box > .icon { color: var(--accent); margin-top: 3px; }
.pending-box strong { font-size: 14px; color: #9c4d00; }
.pending-text { font-size: 15px; line-height: 1.65; margin-top: 2px; color: var(--ink); }
.pending-box .icon-btn { width: 32px; height: 32px; margin-left: auto; color: #9c4d00; }
.login-pane .btn { margin-top: 22px; }

/* ============================================================
   ACCOUNT (warm light cards — AAA contrast)
   ============================================================ */
body.page-account .app-content { background: var(--canvas); }
body.page-account .app-content-header { background: var(--canvas); border-bottom-color: var(--border); }
body.page-account .app-page-title { color: var(--ink); }
body.page-account .app-quicksearch { background: #ffffff; border-color: var(--border-strong); }
body.page-account .app-quicksearch input { color: var(--ink); }
.account-page { padding: 30px 40px 70px; }
.account-hero { margin-bottom: 24px; }
.account-hero-title { color: var(--ink); font-size: clamp(30px, 3.4vw, 48px); font-weight: 800; line-height: 1.25; letter-spacing: -0.015em; }
.account-hero-accent { color: #9a3e00; }
.account-hero-sub { color: var(--text-2); font-size: 16px; line-height: 1.75; margin-top: 8px; max-width: 64ch; }
.account-profile-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #ffffff; border: 1px solid #e6ddd2; border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(17,18,19,.04);
}
.account-profile-bar > :not(.avatar-circle):not(.chip):not(.badge):not(.btn) {
  min-width: 0; flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px;
}
.account-profile-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0;
}
.account-profile-name, .account-profile-bar strong, .account-profile-bar h2 {
  font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--ink); margin: 0;
  overflow-wrap: anywhere;
}
.account-profile-email, .account-profile-bar small,
.account-profile-bar > :not(.avatar-circle) > span:not(.chip):not(.avatar-circle):not(.avatar-fallback),
.account-profile-bar > :not(.avatar-circle) > p {
  font-size: 14px; line-height: 1.5; color: var(--text-2); margin: 0;
  overflow-wrap: anywhere;
}
.account-provider-badge, .account-profile-provider {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12.5px; font-weight: 600; color: #9a3e00;
  background: var(--accent-soft); border: 1px solid var(--accent-wash);
  border-radius: 999px; padding: 3px 11px; margin-top: 2px;
}
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.account-grid > * { min-width: 0; }
.panel-d {
  border: 1px solid #e6ddd2; border-radius: var(--radius);
  padding: 28px 30px; display: flex; flex-direction: column; gap: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(17,18,19,.04);
}
.panel-d-title { color: var(--ink); font-size: 25px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; }
#identityChannels {
  margin-top: 22px; background: #ffffff; border: 1px solid #e6ddd2;
  padding: 24px 30px; gap: 10px;
}
#identityChannels h2 { color: var(--ink); font-size: 21px; font-weight: 700; line-height: 1.35; margin: 0; }
#identityChannels p { color: var(--text-2); font-size: 15px; line-height: 1.7; margin: 0; }
#identityChannels .btn { align-self: flex-start; margin-top: 6px; }
.card-d-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.empty-state-dark { color: var(--text-2); }
.empty-state-dark .btn { margin-top: 14px; }
.card-d {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fffcf9; border: 1px solid #e6ddd2; border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 14px;
}
.card-d-icon {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  background: var(--accent-soft); color: #9a3e00;
  display: flex; align-items: center; justify-content: center;
}
.card-d-main { flex: 1; min-width: 0; }
.access-state { color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1.55; }
.access-detail { color: var(--text-2); font-size: 15.5px; line-height: 1.75; margin-top: 4px; }
.access-days { color: #9a3e00; font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.access-extras { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.access-extra { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); font-size: 13.5px; line-height: 1.65; }
.access-extra .icon { color: var(--ok); margin-top: 2px; }
.access-extras .btn { margin-top: 8px; align-self: flex-start; }
body.page-account .btn-outline { background: #ffffff; border-color: #cfc2b4; color: var(--ink); }
body.page-account .btn-outline:hover { border-color: var(--accent); color: #9a3e00; background: var(--accent-soft); }
body.page-account .card-d .btn-outline[disabled] { opacity: .55; background: #f8f3ed; color: var(--text-2); }

.history-switch-card { padding: 18px 24px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch-label { color: var(--ink); font-size: 15.5px; font-weight: 700; display: block; }
.switch {
  width: 52px; height: 30px; flex: none; border-radius: 999px; border: none; cursor: pointer;
  background: #cfc2b4; position: relative; transition: background .18s ease; padding: 0;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(17,18,19,.18); transition: left .18s ease;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] .switch-knob { left: 25px; }
.switch-confirm { color: #9a3e00; font-size: 13px; font-weight: 600; margin-top: 10px; line-height: 1.6; }

.conv-list { display: flex; flex-direction: column; gap: 10px; }
.conv-item {
  display: flex; align-items: center; gap: 12px;
  background: #fffcf9; border: 1px solid #e6ddd2; border-radius: var(--radius-sm); padding: 12px 14px;
}
.conv-info { flex: 1; min-width: 0; text-decoration: none; }
.conv-info:hover .conv-title { color: #9a3e00; }
.conv-title { color: var(--ink); font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.conv-del {
  width: 36px; height: 36px; flex: none; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.conv-del:hover { color: var(--err); border-color: #ecc5ba; background: var(--err-soft); }
.conv-empty {
  color: var(--text-2); font-size: 15px; background: #fffcf9; border: 1px dashed #d8c9ba;
  border-radius: var(--radius-sm); padding: 28px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.conv-empty .icon-lg { color: var(--text-3); margin-bottom: 6px; }
.conv-empty .btn { margin-top: 12px; }
.account-page-pad { padding: 60px 40px; }

.dev-tools { margin-top: 40px; background: #ffffff; border: 1px solid #e6ddd2; border-radius: var(--radius); }
.dev-tools summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  color: var(--text-2); font-size: 13px; padding: 12px 18px; user-select: none;
}
.dev-tools summary::-webkit-details-marker { display: none; }
.dev-tools summary::after { content: "▸"; margin-left: auto; color: var(--text-2); }
.dev-tools[open] summary::after { content: "▾"; }
.dev-tools summary:hover { color: var(--ink); }
.dev-tools-body { border-top: 1px solid #e6ddd2; padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.dev-tools-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dev-tools-row .field-label { margin: 0; color: var(--text-2); }
.dev-tools-row .input { width: auto; min-width: 240px; background: #ffffff; border-color: #cfc2b4; color: var(--ink); }
body.page-account .fineprint { color: var(--text-2); }

/* ============================================================
   MCP (app shell)
   ============================================================ */
.mcp-page { padding: 30px 24px 60px; max-width: none; }
.mcp-title { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; }
.mcp-head { margin-bottom: 26px; }
.mcp-head .muted-line { margin-top: 8px; font-size: 15px; }
.mcp-steps { display: flex; gap: 14px; margin-bottom: 22px; }
.mcp-step {
  flex: 1; display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--border); background: var(--card); border-radius: var(--radius);
  padding: 16px 18px;
}
.step-no {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14.5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.mcp-step strong { font-size: 15.5px; }
.mcp-step p { font-size: 13.5px; color: var(--text-3); margin-top: 2px; }
.mcp-grid { display: grid; grid-template-columns: minmax(0, 70fr) minmax(0, 30fr); gap: 16px; align-items: start; }
.mcp-grid > * { min-width: 0; }
.mcp-apps { margin: 14px 0 18px; }
.config-box {
  background: #17181a; color: #f5f2ec; border-radius: var(--radius-sm);
  padding: 18px 20px; overflow-x: auto; margin: 0;
  font-size: 13.5px; line-height: 1.8;
}
.config-box code { font-family: Consolas, "Courier New", monospace; white-space: pre; }
.mcp-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.mcp-entitle-card { background: var(--accent-soft); border-color: var(--accent-wash); }
.mcp-entitle-card .h3 { color: #7c4210; }
.mcp-entitle-card .entitle-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--accent-wash); }
.mcp-entitle-card .entitle-row:last-child { border-bottom: none; }
.mcp-entitle-card .entitle-row .icon { color: var(--accent); margin-top: 3px; }
.mcp-entitle-card .entitle-row p { font-size: 13.5px; margin-top: 2px; color: #7c4210; line-height: 1.7; }
.mcp-entitle-card .entitle-row strong { color: #5c2f0a; }
.mcp-bottom-card {
  margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 20px 24px;
}
.mcp-bottom-card .icon { color: var(--accent); }
.mcp-bottom-card p { font-weight: 600; flex: 1; min-width: 200px; }

/* ============================================================
   ERRORS
   ============================================================ */
.error-state { padding: 90px 16px; }
.error-search {
  display: flex; align-items: center; gap: 10px; max-width: 520px; margin: 26px auto 18px;
  border: 1px solid var(--border-strong); background: var(--card);
  border-radius: 999px; padding: 4px 6px 4px 18px;
}
.error-search .icon { color: var(--text-3); }
.error-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .pub-header-inner, .pub-main { padding-left: 32px; padding-right: 32px; }
  .app-quicksearch { width: 300px; }
  .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .pub-main { padding: 0 16px; }
  .pub-footer-inner { padding: 18px 16px; }

  /* app shell → drawer */
  .app-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; height: 100%;
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: none; width: 280px;
  }
  .app-shell.drawer-open .app-sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.45); }
  .sb-close { display: inline-flex; }
  .app-menu-btn { display: inline-flex; }
  .app-content-header { padding: 10px 16px; min-height: 74px; position: sticky; top: var(--sdeeka-banner-height, 0px); z-index: 90; }
  .app-quicksearch { max-width: none; flex: 1; width: auto; }
  body.page-chat .app-content-header { display: flex; }
  body.page-chat .app-content {
    height: calc(100vh - var(--sdeeka-banner-height, 0px));
    height: calc(100dvh - var(--sdeeka-banner-height, 0px));
  }
  .chat-layout { flex-direction: column; }
  .cite-panel {
    position: fixed; inset: 0; z-index: 210; width: 100%; height: 100%;
    border-left: none; top: 0;
  }
  .cite-back { display: inline-flex; }
  .composer-zone { padding: 10px 16px 14px; }
  .chat-inner { padding: 20px 16px; }
  .turn-user-bubble { max-width: 92%; }

  .home-grid, .mcp-grid { grid-template-columns: 1fr; }
  .mcp-steps { flex-direction: column; }
  .account-page { padding: 22px 20px 60px; }
  .account-hero-title { font-size: clamp(28px, 7.6vw, 34px); }
  .account-profile-bar, #identityChannels { padding: 18px; }
  .panel-d { padding: 20px 18px; }
  .panel-d-title { font-size: 22px; }
  .mcp-page { padding: 22px 16px 50px; }
  .chat-layout .chat-main { flex: 1; }
}

@media (max-width: 560px) {
  .ea-banner { font-size: 11.5px; gap: 6px; }
  .mode-tabs { flex-direction: column; }
  .brand-mark { width: 36px; height: 36px; border-radius: 9px; }
  .brand-word { font-size: 22px; }
  .brand-on-dark .brand-word { font-size: 20px; }
  .home-card-head { gap: 14px; margin-bottom: 18px; }
  .home-card-title { font-size: 20px; }
  .home-main-card, .home-mcp-card { padding: 22px 20px; }
  .home-strip-card { padding: 20px 16px; gap: 14px; }
  .home-strip-copy { min-width: 0; }
  body { font-size: 15.5px; }
  .btn { min-height: 44px; }
  .hero-title { font-size: clamp(30px, 8.4vw, 40px); }
  .hero-sub { font-size: clamp(17px, 4.6vw, 22px); }
  .card { padding: 20px 18px; }
  .search-inline-row { flex-direction: column; align-items: stretch; }
  .mode-tab { width: 100%; flex: none; }
  .search-bar-filters { width: 100%; }
  .search-bar-filters .select { flex: 1; min-width: 0; }
  .home-strip-right { width: 100%; }
  .home-strip-right .btn { flex: 1; }
  .pub-nav { justify-content: flex-start; }
  .case-para { font-size: 16.5px; }
  .cite-chip { min-width: 30px; height: 30px; }
  .ai-block { font-size: 16px; }
  .turn-ai { max-width: 100%; }
  .login-wrap { padding: 28px 16px 70px; }
  .dev-tools-row .input { width: 100%; min-width: 0; }
  .dev-tools-row .btn { flex: 1 1 auto; }
  .mcp-bottom-card .btn { width: 100%; }
}


/* ============================================================
   V1 MINIMALIST ORANGE UPGRADES
   (Comparable Story Search · Chained Preview · Compare · Statute Hub)
   ============================================================ */

.story-home-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.select-compact { width: auto; min-width: 195px; }
.select-sm { min-height: 38px; padding: 6px 12px; font-size: 14px; width: auto; }
.chip-xs { padding: 5px 13px; font-size: 13px; min-height: 32px; }
.chip-link { text-decoration: none; cursor: pointer; }
.chip-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip-law-main { background: var(--accent-soft); border-color: var(--accent-wash); color: #9c4d00; font-weight: 600; }
.chip-law-main .icon-xs { color: var(--accent); }

/* Search dual-mode & filters */
.search-head-row { margin-bottom: 14px; }
.search-mode-tabs { border-bottom: none; padding-bottom: 0; margin-bottom: 10px; }
.story-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.story-textarea { min-height: 96px; font-size: 15.5px; }
.story-hints { margin-top: 6px; }
.search-filters-strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.plenary-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--canvas); cursor: pointer; min-height: 38px;
}
.plenary-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.story-submit-btn { margin-left: auto; }

/* Autocomplete dropdown */
.search-suggest-wrap { position: relative; }
.suggest-dropdown {
  position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 130;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(17,18,19,.12); padding: 6px; display: flex; flex-direction: column;
}
.suggest-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px;
  border-radius: 8px; text-decoration: none; color: var(--ink);
}
.suggest-item .icon { color: var(--accent); margin-top: 3px; }
.suggest-item:hover { background: var(--accent-soft); }
.suggest-text { display: flex; flex-direction: column; min-width: 0; }
.suggest-text strong { font-size: 14px; font-weight: 600; line-height: 1.45; }
.suggest-text span { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Statute shortcut & Story profile strips */
.law-shortcut-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid var(--accent-wash);
  border-radius: var(--radius-sm); padding: 12px 16px; margin: 14px 0 6px; font-size: 14px; color: #7c4210;
}
.law-shortcut-strip strong { color: #9c4d00; display: inline-flex; align-items: center; gap: 6px; }
.story-profile-strip {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 10px 15px; margin: 14px 0 6px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.65;
}
.story-profile-kicker { font-weight: 700; color: var(--accent); margin-right: 6px; }

/* Results toolbar & view pills */
.results-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 18px 0 10px;
}
.view-pills {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px;
}
.view-pill {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-2);
  background: transparent; border: none; border-radius: 999px;
  padding: 5px 13px; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.view-pill:hover { color: var(--accent); }
.view-pill.active { background: var(--ink); color: #fff; }

.result-group-block { margin-top: 20px; }
.result-group-title {
  font-size: 16px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.group-count { color: var(--text-3); font-weight: 500; font-size: 14px; }
.stance-sup { color: var(--ok); }
.stance-opp { color: #b24300; }

/* Result card v1 refinements */
.result-issue-line {
  margin-top: 8px; padding: 7px 11px; border-radius: 8px;
  background: var(--canvas); border: 1px solid var(--border);
  font-size: 13.5px; line-height: 1.6; color: var(--ink);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px;
}
.issue-ans { font-weight: 700; color: var(--accent-dark); font-size: 13px; white-space: nowrap; }
.result-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
}
.result-read-link { margin-left: auto; font-size: 14px; }
.btn-compare-active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark);
}

/* Breadcrumb & Case v1 sections */
.breadcrumb-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-3); margin-bottom: 10px;
}
.breadcrumb-line a { color: var(--text-2); text-decoration: none; }
.breadcrumb-line a:hover { color: var(--accent); }

.case-sec-title {
  font-size: 18px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.case-summary-card {
  margin-top: 24px; padding: 20px 24px;
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.summary-kicker {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 8px;
}
.summary-tag { font-weight: 500; font-size: 12px; color: var(--text-3); }
.summary-body { font-size: 15.5px; line-height: 1.75; color: var(--ink); }
.summary-principle { font-size: 14.5px; line-height: 1.7; color: var(--text-2); margin-top: 10px; }
.court-chain-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.court-step {
  background: var(--canvas); border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 12px; display: flex; flex-direction: column; gap: 2px;
}
.court-name { font-size: 12px; color: var(--text-3); font-weight: 600; }
.court-res { font-size: 13.5px; color: var(--ink); line-height: 1.5; }

/* Issue Q&A cards */
.case-issues-sec { margin-top: 28px; }
.issue-card-list { display: flex; flex-direction: column; gap: 12px; }
.issue-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.issue-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.issue-card-q { font-size: 16px; font-weight: 700; line-height: 1.55; color: var(--ink); flex: 1; min-width: 220px; }
.issue-card-holding { font-size: 14.5px; line-height: 1.75; color: var(--text-2); margin-top: 8px; }
.issue-quote {
  margin: 12px 0 0; padding: 10px 14px;
  background: var(--canvas); border-left: 3px solid var(--accent-wash); border-radius: 0 8px 8px 0;
  font-size: 14px; color: var(--text-2); line-height: 1.7;
}
.quote-jump-btn {
  background: none; border: none; padding: 0; margin-top: 6px; font-family: inherit; font-size: 13px; cursor: pointer;
}

/* Connected Judgments Network (Chained Judgments) */
.case-network-sec {
  margin-top: 28px; padding: 20px 22px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.network-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.network-head .case-sec-title { margin-bottom: 0; }
.rel-subblock + .rel-subblock { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.rel-subtitle { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.rel-mini-list { display: flex; flex-direction: column; gap: 10px; }
.rel-mini-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--canvas);
}
.rel-mini-contrast { background: #fff9f2; border-color: #f3d5b5; }
.rel-mini-body { flex: 1; min-width: 220px; }
.rel-tag-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.rel-badge {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text-2);
}
.rel-badge-accent { background: var(--accent-soft); border-color: var(--accent-wash); color: #9c4d00; }
.rel-badge-warn { background: var(--warn-soft); border-color: #eedbb2; color: #8a5600; }
.rel-heuristic-tag { font-size: 11.5px; color: var(--text-3); }
.rel-winner-tag { font-size: 11.5px; font-weight: 600; color: var(--ok); }
.rel-mini-title { display: block; font-size: 14.5px; font-weight: 700; text-decoration: none; line-height: 1.5; color: var(--ink); }
.rel-mini-title:hover { color: var(--accent); }
.rel-mini-reason { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }
.rel-mini-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.rel-empty-msg { padding: 8px 0; }

.para-num { font-size: 12px; font-weight: 700; color: var(--text-3); margin-right: 8px; user-select: none; }
.case-para-hl {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 8px 12px; border-radius: 6px; transition: background .3s ease;
}

/* Quick Preview Slide-over Drawer */
.preview-backdrop {
  position: fixed; inset: 0; z-index: 240; background: rgba(17,18,19,.36);
}
.preview-drawer {
  position: fixed; top: var(--sdeeka-banner-height, 0px); right: 0; bottom: 0; z-index: 250;
  width: 480px; max-width: 100vw; background: var(--card); border-left: 1px solid var(--border);
  box-shadow: -12px 0 36px rgba(17,18,19,.14);
  display: flex; flex-direction: column;
}
.pv-head-title { font-size: 17px; font-weight: 700; line-height: 1.5; color: var(--ink); margin-bottom: 6px; }
.pv-sec-label { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.pv-summary-box {
  margin-top: 14px; padding: 12px 14px; background: var(--canvas);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14.5px; line-height: 1.7;
}
.pv-issues { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.pv-issue-card {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; line-height: 1.65;
}
.pv-issue-card strong { display: block; color: var(--ink); }
.pv-ans { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--accent-dark); margin-top: 2px; }
.pv-issue-card p { color: var(--text-2); margin-top: 4px; }
.pv-network { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.pv-network-head { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pv-rel-group + .pv-rel-group { margin-top: 12px; }
.pv-rel-list { display: flex; flex-direction: column; gap: 8px; }
.pv-rel-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 9px 11px; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px;
}
.pv-rel-warn { background: #fff9f2; border-color: #f3d5b5; }
.pv-rel-main { flex: 1; min-width: 0; }
.pv-mini-tag { display: inline-block; font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.pv-chain-btn {
  display: block; text-align: left; background: none; border: none; padding: 0;
  font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink); cursor: pointer; line-height: 1.45;
}
.pv-chain-btn:hover { color: var(--accent); text-decoration: underline; }
.pv-rel-reason { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.5; }
.pv-footer-actions {
  display: flex; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border);
}
.pv-footer-actions .btn { flex: 1; }

/* Floating Minimalist Compare Tray */
.compare-tray {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 220;
  background: var(--ink); color: var(--on-shell); border-radius: 999px;
  box-shadow: 0 12px 32px rgba(17,18,19,.28); padding: 8px 12px 8px 18px;
  max-width: calc(100vw - 24px);
}
.compare-tray-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-tray-count { font-size: 13.5px; font-weight: 700; color: #ffb389; white-space: nowrap; }
.compare-tray-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tray-rm {
  background: none; border: none; color: #9c4d00; font-weight: 700; cursor: pointer; padding: 0 2px; font-size: 14px;
}
.compare-tray-actions { display: flex; align-items: center; gap: 6px; }
.compare-tray-actions .btn-ghost { color: var(--on-shell-dim); }

/* Compare Matrix Page & Statute Hub */
.compare-page { padding: 36px 0 80px; }
.compare-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.compare-add-form { display: flex; gap: 8px; align-items: center; min-width: 320px; }
.compare-table-wrap { padding: 0; overflow-x: auto; margin-top: 14px; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: 14.5px; }
.compare-table th, .compare-table td {
  padding: 16px 18px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  vertical-align: top; text-align: left;
}
.compare-table th:last-child, .compare-table td:last-child { border-right: none; }
.compare-table thead th { background: var(--canvas); }
.compare-row-head { width: 185px; background: var(--canvas); font-weight: 700; color: var(--text-2); }
.compare-case-link { display: block; margin-top: 8px; font-size: 15px; font-weight: 700; text-decoration: none; line-height: 1.45; }
.compare-case-link:hover { color: var(--accent); }
.compare-issue-item + .compare-issue-item { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.compare-issue-item strong { display: block; font-size: 14px; line-height: 1.5; }
.compare-ans { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--accent-dark); margin-top: 2px; }
.compare-issue-item p, .compare-snippet { font-size: 14px; color: var(--text-2); line-height: 1.65; margin-top: 4px; }

.statute-box { background: #fffcf8; }
.statute-text { white-space: pre-line; font-size: 16px; line-height: 1.85; color: var(--ink); }

@media (max-width: 640px) {
  .preview-drawer { top: 0; width: 100vw; }
  .compare-tray { border-radius: 16px; width: calc(100vw - 24px); }
  .compare-add-form { width: 100%; min-width: 0; }
}


/* ============================================================
   V1.1 — readability, similarity score, member lock, featured, saved
   ============================================================ */

/* Boxed, high-contrast judgment text with Thai legal paragraph indent */
.case-text.card {
  margin-top: 28px; border-top: 1px solid var(--border);
  padding: 26px 34px 30px; background: #ffffff;
  border: 1px solid var(--border-strong);
}
.case-text-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--border);
}
.case-text-head .case-sec-title { margin-bottom: 0; }
.font-size-ctrl { display: inline-flex; gap: 4px; background: var(--canvas); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.case-text-body { font-size: 17.5px; color: #1b1c1e; }
.case-text-body .case-para {
  position: relative; font-size: inherit; line-height: 2; color: #1b1c1e;
  max-width: none; margin: 0 0 14px; padding-left: 40px;
  text-indent: 2.2em; text-align: left; word-break: normal; overflow-wrap: anywhere;
}
.case-text-body .para-num {
  position: absolute; left: 0; top: .35em; text-indent: 0;
  min-width: 26px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--canvas); border: 1px solid var(--border); color: var(--text-3);
  font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; margin: 0;
}
.case-text-body .case-para-hl { background: var(--accent-soft); border-left: none; box-shadow: inset 3px 0 0 var(--accent); border-radius: 6px; padding-top: 6px; padding-bottom: 6px; }

/* Similarity score + matching points */
.result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.score-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: #9c4d00; white-space: nowrap;
  background: var(--accent-soft); border: 1px solid var(--accent-wash); border-radius: 999px; padding: 3px 10px;
}
.score-pill-sm { font-size: 11.5px; padding: 1px 8px; }
.score-dots { display: inline-flex; gap: 2px; }
.sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-wash); display: inline-block; }
.sdot.on { background: var(--accent); }
.match-points { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.mp-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.mp-chip {
  font-size: 12px; color: var(--text-2); background: var(--canvas);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; line-height: 1.6;
}
.pv-rel-tags { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }

/* Member lock cards */
.lock-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(0deg, var(--card), var(--card)); border: 1px dashed var(--accent);
  border-radius: var(--radius); padding: 18px 20px; margin: 14px 0;
}
.lock-card-sm { padding: 12px 14px; gap: 10px; }
.lock-icon {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.lock-copy { flex: 1; min-width: 220px; }
.lock-copy strong { font-size: 15.5px; color: var(--ink); }
.lock-copy p { font-size: 13.5px; color: var(--text-2); margin-top: 2px; line-height: 1.65; }
.lock-sub { color: var(--text-3) !important; }
.lock-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.network-locked { background: var(--card); }

/* Saved button */
.btn-saved { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }

/* Featured judgments carousel */
.featured-sec { margin-top: 22px; }
.featured-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.featured-title { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.featured-title .icon { color: var(--accent); }
.featured-nav { display: flex; gap: 4px; }
.featured-viewport { overflow: hidden; }
.featured-track { display: flex; gap: 14px; transition: transform .5s ease; }
.featured-card { display: flex; flex-direction: column; padding: 20px 22px; min-height: 230px; box-sizing: border-box; }
.featured-card .chip-row { margin-top: 0; }
.featured-card-title { font-size: 16px; font-weight: 700; line-height: 1.55; text-decoration: none; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured-card-title:hover { color: var(--accent); }
.featured-card-sum { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-top: 8px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.featured-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.featured-card-foot .chip { margin: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.feat-dot { width: 8px; height: 8px; border-radius: 999px; border: none; background: var(--border-strong); cursor: pointer; padding: 0; transition: width .2s ease; }
.feat-dot.on { width: 22px; background: var(--accent); }

@media (max-width: 640px) {
  .case-text.card { padding: 18px 16px 22px; }
  .case-text-body .case-para { padding-left: 0; text-indent: 1.6em; }
  .case-text-body .para-num { position: static; display: inline-block; margin-right: 6px; }
  .lock-actions { align-items: stretch; width: 100%; }
}
.discovery-links { display:flex; flex-wrap:wrap; gap:.5rem; margin:.6rem 0; }

/* Collapsible technical disclosure (e.g. /about IT review notes) */
details.fineprint {
  margin-top: 24px; padding: 14px 18px;
  background: #ffffff; border: 1px solid #e6ddd2; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; line-height: 1.7;
}
details.fineprint > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 600; color: var(--text-2); user-select: none;
}
details.fineprint > summary::-webkit-details-marker { display: none; }
details.fineprint > summary::after { content: "▸"; color: var(--text-3); flex-shrink: 0; }
details.fineprint[open] > summary { margin-bottom: 10px; color: var(--ink); }
details.fineprint[open] > summary::after { content: "▾"; }
details.fineprint p + p { margin-top: 8px; }

/* Clean legal reader & page print output */
@media print {
  #analysisReport,
  .consent-panel,
  .consent-reopen,
  .ea-banner,
  .pub-header,
  .pub-footer,
  .reader-toc,
  .reader-promo,
  .case-actions,
  .preview-backdrop,
  .preview-drawer,
  .compare-tray,
  .toast-region,
  .site-drawer,
  .site-drawer-backdrop,
  .app-sidebar {
    display: none !important;
  }
  .reader-layout { display: block !important; max-width: none !important; }
  .pub-main, .page-case { max-width: none !important; padding: 0 !important; }
}
