/* Shared visual system for the three LegalPilot entry points. */
:root {
  --lp-canvas: #e7f2f0;
  --lp-paper: #f7fbfc;
  --lp-ink: #182e32;
  --lp-muted: #52686d;
  --lp-edge: #bed6d6;
  --lp-primary: #195f54;
  --lp-deep: #103b36;
  --lp-tint: #e6f2ed;
  --lp-gold: #f4d5a0;
  --lp-shadow: 0 12px 32px #153b4817, inset 0 1px 0 #ffffffd9;
  --lp-atmosphere:
    radial-gradient(ellipse at 12% 8%, #a4e1d5 0%, transparent 47%),
    radial-gradient(ellipse at 95% 22%, #bac9f2 0%, transparent 51%),
    radial-gradient(ellipse at 65% 96%, #bedff1 0%, transparent 56%),
    linear-gradient(125deg, #edf9f4, #e4ecf9);
  --lp-glass: linear-gradient(140deg, #ffffffce, #ffffff85);
  --lp-glass-border: #ffffffdc;
}

body { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid #287e6f;
  outline-offset: 3px;
}
.lp-mark {
  display: grid;
  place-items: center;
  flex: 0 0 37px;
  width: 37px;
  height: 37px;
  border: 1px solid #ffffff45;
  border-radius: 11px;
  background: #ffffff14;
  color: #fff;
  font: 700 17px/1 Georgia, "Microsoft YaHei", serif;
}

/* Public intake */
.intake-view {
  --intake-bg: #f0f3f1;
  --intake-paper: #fdfefa;
  --intake-line: #dce6df;
  --intake-text: #19342d;
  --intake-content: 880px;
  --intake-gutter: max(14px, calc((100% - var(--intake-content)) / 2));
}
.intake-view #chat-area {
  background: radial-gradient(ellipse at 85% 0%, #e3eeeb, transparent 52%), var(--intake-bg);
}
.intake-view #chat-area > header {
  padding-inline: clamp(12px, 3vw, 26px);
  background: var(--intake-paper);
  border-bottom: 1px solid var(--intake-line);
  color: var(--intake-text);
  gap: 9px;
}
.intake-view .brand h1 { font-weight: 700; }
.intake-view .brand-sub { color: #536c62; }
.intake-view .lp-mark { background: #1d5751; border: 0; border-radius: 10px; }
.intake-view #drawer-toggle {
  width: 40px;
  height: 40px;
  background: #edf3ee;
}
.intake-view #drawer-toggle span { background: #34534a; }
.intake-view #lead-entry {
  min-height: 38px;
  padding-inline: 13px;
  border: 1px solid #c5d9cf;
  border-radius: 10px;
  background: #eef6f0;
  color: #194f42;
}
.intake-view #lead-entry:hover { background: #e2efe7; }
.intake-view #sidebar {
  padding-inline: 14px;
  border-right: 1px solid #d7e4da;
  background: #f3f7f2;
  color: var(--intake-text);
}
.intake-view .sidebar-head { min-height: 48px; padding: 0 2px 10px; }
.intake-view .sidebar-logo { color: #194f42; font-size: 19px; letter-spacing: .02em; }
.intake-view #drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #405e53;
}
.intake-view #drawer-close:hover { background: #e3eee5; }
.intake-view #new-chat {
  min-height: 44px;
  margin-bottom: 18px;
  border: 1px solid #1f5c4e;
  background: #1f5c4e;
  text-align: left;
}
.intake-view #new-chat:hover { background: #174d40; }
.intake-view #thread-list-title {
  margin: 0 8px 8px;
  color: #526b60;
  font-size: 12px;
  font-weight: 650;
}
.intake-view #thread-list { min-height: 0; }
.intake-view #thread-list li {
  min-height: 40px;
  border: 1px solid transparent;
  color: #304f44;
}
.intake-view #thread-list li:hover { background: #eaf1ea; }
.intake-view #thread-list li.active { border-color: #c3dacc; background: #e1eee5; color: #174d40; }
.intake-view #thread-list .del-btn { color: #536e64; }
.intake-view .product-menu {
  display: grid;
  flex: none;
  gap: 2px;
  margin-top: 12px;
  padding: 8px 4px 4px;
  border: 1px solid #dce7de;
  border-radius: 12px;
  background: #fcfefa;
}
.intake-view .product-menu :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #254d3f;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}
.intake-view .product-menu :is(button, a)::after {
  width: 6px;
  height: 6px;
  margin-right: 3px;
  transform: rotate(-45deg);
  border-right: 1px solid #698879;
  border-bottom: 1px solid #698879;
  content: "";
}
.intake-view .product-menu :is(button, a):hover { background: #e9f2eb; }
.intake-view #product-info-dialog {
  width: min(540px, calc(100% - 28px));
  height: fit-content;
  max-height: calc(100dvh - 28px);
}
#product-info-dialog .product-copy { color: #344f45; font-size: 14px; line-height: 1.7; }
#product-info-dialog .product-copy p { color: inherit; font: inherit; }
#product-info-dialog .product-copy h4:not(:first-child) { margin-top: 14px; }
#product-info-dialog .product-copy ol { margin: 0; padding-left: 1.4em; }
#product-info-dialog .product-copy ul { margin: 10px 0 0; padding-left: 1.4em; }
#product-info-dialog .product-copy li + li { margin-top: 8px; }
#product-info-dialog .customer-status:not(:empty) { margin-top: 8px; }
#customer-logout-confirm { margin-top: 10px; }

.intake-view #hero {
  padding: clamp(18px, 4vh, 42px) var(--intake-gutter) 24px;
  overscroll-behavior: contain;
}
.intake-view #hero > * { max-width: none; }
.intake-view .hero-card {
  padding: clamp(20px, 4vw, 40px);
  border: 1px solid #c7ddd2;
  border-radius: 18px;
  background: linear-gradient(115deg, #fcfffa, #e8f2e9);
  color: var(--intake-text);
  box-shadow: 0 9px 24px #163e380b;
}
.intake-view .hero-card::after { content: none; }
.intake-view .hero-card h2 { font-size: clamp(22px, 3.6vw, 38px); line-height: 1.25; letter-spacing: 0; }
.intake-view .hero-desc {
  display: block;
  max-width: 42rem;
  margin-top: 9px;
  color: #49665a;
  font-size: 14px;
  line-height: 1.65;
}
.intake-view .category-heading { margin-top: 22px; color: var(--intake-text); font-size: 16px; }
.intake-view .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.intake-view .quick-grid button, .intake-view .more-categories > summary {
  min-width: 0;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--intake-line);
  border-radius: 10px;
  background: var(--intake-paper);
  box-shadow: 0 2px 5px #163e3808;
}
.intake-view .quick-grid button:hover,
.intake-view .quick-grid button[aria-pressed="true"],
.intake-view .more-categories > summary:hover {
  border-color: #7fa89b;
  background: #ecf5ee;
}
.intake-view .quick-grid button[aria-pressed="true"] { box-shadow: inset 3px 0 var(--lp-primary); }
.intake-view .quick-grid b { color: var(--intake-text); font-size: 14px; }
.intake-view .quick-grid span { color: #536c62; overflow-wrap: anywhere; }
.intake-view .more-categories:not([open]) { grid-column: auto; }
.intake-view .more-categories > summary { align-content: center; color: #24564b; font-size: 13px; }
.intake-view .more-categories[open] > summary { min-height: 42px; }

.intake-view #messages { padding-inline: var(--intake-gutter); }
.intake-view .msg.user, .intake-view #send { background: #1c5a4d; color: #fff; }
.intake-view .msg.assistant { background: var(--intake-paper); border-color: var(--intake-line); box-shadow: 0 4px 14px #163e380c; }
.intake-view #composer, .intake-view .case-city-entry {
  padding-inline: var(--intake-gutter);
  background: var(--intake-paper);
}
.intake-view .case-city-entry { padding-block: 7px 3px; border-top: 1px solid var(--intake-line); }
.intake-view #composer { border: 0; padding-block: 6px calc(10px + var(--safe-b)); }
.intake-view #input { min-height: 44px; border-color: #c8dbcf; background: #f7faf7; }
.intake-view #input:focus { border-color: #5d9382; background: #fff; }
.intake-view #send, .intake-view #choose-evidence { min-height: 44px; border-radius: 10px; }
.intake-view #choose-evidence { width: 44px; border: 1px solid #c8dbcf; }
.intake-view .case-city-actions button, .intake-view #choose-evidence { background: #eaf3ed; color: #204d40; }
.intake-view .case-city-actions button:hover, .intake-view #choose-evidence:hover { background: #dcece2; }
.intake-view .case-city-actions #case-btn { background: #245a4f; color: #fff; }
.intake-view .case-sheet { background: var(--intake-paper); }
.intake-view .case-sheet .case-body { scrollbar-width: thin; }
@media (min-width: 1150px) { .intake-view .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .intake-view { --intake-gutter: 12px; }
  .intake-view .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .intake-view .hero-card { border-radius: 14px; }
  .intake-view .hero-desc { font-size: 13px; }
  .intake-view .category-heading { margin-top: 15px; }
}
@media (max-width: 360px) {
  .intake-view .lp-mark { display: none; }
}


/* Staff pages */
.staff-view { background: var(--lp-atmosphere); background-attachment: fixed; }
.staff-view .topbar, .staff-view .wb-top {
  background: linear-gradient(125deg, #173f42f5, #245461ed);
  border-bottom: 1px solid #ffffff70;
  padding-inline: clamp(14px, 4vw, 52px);
}
.staff-brand { display: flex; align-items: center; gap: 10px; }
.staff-view .staff-auth summary { color: #f4d5a0; padding-block: 8px; }
.staff-view .staff-auth form { box-shadow: var(--lp-shadow); }
.admin-view { --accent: var(--lp-primary); --line: var(--lp-edge); }
.admin-view main { max-width: 1400px; margin-inline: auto; padding: clamp(16px, 4vw, 42px); }
.admin-view .assistant-heading h2 { font-size: clamp(24px, 3vw, 36px); color: var(--lp-ink); }
.admin-view .assistant-heading p { color: var(--lp-muted); margin-top: 6px; }
.admin-view .lead-overview button {
  background: var(--lp-glass);
  border-radius: 15px;
  border-color: var(--lp-glass-border);
  box-shadow: var(--lp-shadow);
}
.admin-view .lead-overview button:hover,
.admin-view .lead-overview button.active,
.admin-view .lead-overview button[aria-pressed="true"] { background: var(--lp-tint); border-color: var(--lp-primary); }
.admin-view .lead-overview strong { color: var(--lp-primary); font-size: 29px; font-variant-numeric: tabular-nums; }
.admin-view .panel, .admin-view .service-diagnostics > summary {
  background: var(--lp-glass);
  border-color: var(--lp-glass-border);
  border-radius: 16px;
  box-shadow: var(--lp-shadow);
}
.admin-view .leads-panel { grid-column: 1 / -1; min-height: 140px; }
.admin-view .panel-head { padding: 16px; }
.admin-view .campaign-panel { min-height: 0; }
.admin-view .campaign-panel .panel-head { padding: 0 0 12px; }
.admin-view .campaign-item { overflow-wrap: anywhere; }
.admin-view .topbar-actions a { text-decoration: none; color: #fff; }
.admin-view .topbar-actions a:hover { text-decoration: underline; }
.admin-view .topbar-actions { flex-wrap: wrap; }
.admin-view #leadList { max-height: min(580px, 72vh); }
.admin-view #campaigns { scroll-margin-top: 16px; }

/* Lawyer workbench */
.workbench-view { height: 100dvh; }
.workbench-view .workflow { background: transparent; gap: 8px; padding: 12px clamp(12px, 4vw, 52px); }
.workbench-view .workflow a {
  justify-content: center;
  background: var(--lp-glass);
  border-color: var(--lp-glass-border);
  color: var(--lp-ink);
  min-height: 44px;
}
.workbench-view .workflow a:hover,
.workbench-view .workflow a[aria-current] {
  background: var(--lp-tint);
  color: var(--lp-deep);
  border-color: var(--lp-primary);
}
.workbench-view .wb-grid {
  gap: 16px;
  padding: 0 clamp(12px, 4vw, 52px) clamp(12px, 3vw, 28px);
}
.workbench-view .pane, .workbench-view .case-notice {
  background: var(--lp-glass);
  border: 1px solid var(--lp-glass-border);
  border-radius: 16px;
  box-shadow: var(--lp-shadow);
}
.workbench-view .pane-left { background: linear-gradient(145deg, #f9fffee0, #edf7fa8f); }
.workbench-view .section-title h2 { color: var(--lp-ink); }
.workbench-view .section-title p { color: var(--lp-muted); }
.workbench-view .btn.primary { color: #fff; background: var(--lp-primary); border-color: var(--lp-primary); }
.workbench-view .btn.primary:hover { background: var(--lp-deep); }
.workbench-view .profile-form :is(input, textarea), .workbench-view .similar-search input {
  border-color: var(--lp-edge);
  background: #ffffffbc;
}
@supports (backdrop-filter: blur(12px)) {
  .intake-view .hero-card,
  .intake-view #composer,
  .admin-view .leads-panel,
  .admin-view .campaign-panel,
  .workbench-view .pane {
    backdrop-filter: blur(17px) saturate(120%);
  }
}
@media (min-width: 1080px) {
  .workbench-view #profile-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench-view #profile-form > :not(:nth-child(3), :nth-child(4)) { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .workbench-view { height: auto; min-height: 100dvh; overflow: auto; }
  .workbench-view .wb-grid { grid-template-columns: minmax(0, 1fr); }
  .workbench-view .wb-case { flex: 1 0 100%; order: 3; }
  .workbench-view #case-select { min-width: 0; }
  .workbench-view .workflow { gap: 5px; }
}
