:root {
  color-scheme: dark;
  --bg-primary: #080808;
  --bg-secondary: #0D0D0D;
  --surface-primary: #121212;
  --surface-secondary: #181818;
  --surface-hover: #1D1D1D;
  --gold-primary: #C6A15B;
  --gold-light: #D8BC7A;
  --gold-muted: #8F7545;
  --gold-dark: #6F572D;
  --text-primary: #F5F1E8;
  --text-secondary: #AAA59A;
  --text-muted: #9A958C;
  --border-dark: rgba(255, 255, 255, 0.07);
  --border-gold: rgba(198, 161, 91, 0.32);
  --danger: #E7C4BC;
  --danger-border: rgba(176, 92, 82, 0.45);
  --font-ui: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Palatino Linotype", Palatino, Georgia, serif;
  --sidebar: 264px;
  --radius: 16px;
  --ease: 180ms ease;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg-primary); }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 var(--font-ui);
  color: var(--text-primary);
  background: var(--bg-primary);
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0 0 12px; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.2; }
a { color: var(--gold-light); }
a:hover { color: var(--text-primary); }
::selection { background: rgba(198, 161, 91, 0.35); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 99px; }
* { scrollbar-color: #2c2c2c transparent; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  padding: 8px 12px;
  background: var(--gold-light);
  color: #1a1408;
  text-decoration: none;
  border-radius: 8px;
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.menu-btn, .scrim { display: none; }

.shell { display: flex; min-height: 100vh; min-width: 0; }
.sidebar {
  width: var(--sidebar);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 16px 18px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-dark);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.canvas { padding: 28px 32px 72px; outline: none; }

.brand-link { display: block; color: inherit; text-decoration: none; }
.brand-link:hover .wordmark { color: var(--gold-light); }
.wordmark {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.28rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.15;
  transition: color var(--ease);
}
.gold-line {
  display: block;
  width: 72px;
  height: 1px;
  margin: 14px 0 12px;
  background: linear-gradient(90deg, #A9823E, #E0C98D, #B88D46);
}
.brand-sub, .brand-sign {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.brand-sub { color: var(--gold-light); }
.brand-sign { margin-top: 10px; color: var(--text-muted); }
.brand-lockup { padding: 0 8px 8px; }

.side-nav { display: grid; gap: 4px; padding: 8px 0; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.035); color: var(--text-primary); }
.side-nav a[aria-current="page"] {
  color: var(--gold-light);
  background: linear-gradient(90deg, rgba(198, 161, 91, 0.16), rgba(198, 161, 91, 0.03));
  box-shadow: inset 2px 0 0 var(--gold-primary);
}
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-dark); }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 0 4px; }
.side-user-meta { min-width: 0; display: flex; flex-direction: column; }
.side-user-name, .who-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-user-role {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 0.82rem;
  flex: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-dark);
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(16px);
}
.topbar-copy { min-width: 0; flex: 1; }
.eyebrow {
  margin: 0 0 2px;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-primary);
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--gold-light); }
.page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.topbar-actions:empty { display: none; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-name { max-width: 160px; color: var(--text-secondary); font-size: 0.92rem; }

.menu-btn {
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
  cursor: pointer;
}

.page { display: grid; gap: 18px; }
.lede { margin: 0; color: var(--text-secondary); }
.muted { color: var(--text-secondary); }
.hero, .identity {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 8px;
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 0.95;
}
.display-sub {
  margin: 14px 0 0;
  color: var(--gold-light);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.82rem;
}
.hero-place {
  margin: 0;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.identity h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.identity-actions, .badges, .hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.badges { margin-top: 14px; }
.hero-meta { list-style: none; padding: 0; margin: 14px 0 0; gap: 18px; color: var(--text-secondary); }
.hero-meta li { display: flex; flex-direction: column; gap: 2px; }
.hero-meta span {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-grid, .board, .detail-grid, .form-grid {
  display: grid;
  gap: 16px;
}
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.board, .detail-grid { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: 1 / -1; }

.kpi, .panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 42%),
    var(--surface-primary);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  box-shadow: var(--inset), var(--shadow);
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 156px;
  padding: 20px 20px 18px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid rgba(198, 161, 91, 0.5);
  transition: border-color var(--ease), background-color var(--ease), box-shadow var(--ease);
}
.kpi:hover {
  border-color: var(--border-gold);
  background:
    linear-gradient(180deg, rgba(198, 161, 91, 0.08), rgba(255, 255, 255, 0) 46%),
    var(--surface-hover);
}
.kpi-kicker, .panel h2, .panel > h3, fieldset.panel legend {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 600;
}
.kpi-value {
  font-size: clamp(2.2rem, 3vw, 2.9rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kpi-hint { margin-top: auto; color: var(--text-secondary); font-size: 0.92rem; }
.panel { padding: 20px 22px 18px; }
.panel > h2 { margin: 0 0 14px; }
.panel-head h2 { margin: 0; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.text-link {
  color: var(--gold-light);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.text-link:hover { color: var(--text-primary); }

.lead-mini { list-style: none; margin: 0; padding: 0; }
.lead-mini a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-dark);
  color: inherit;
  text-decoration: none;
}
.lead-mini li:last-child a { border-bottom: 0; padding-bottom: 0; }
.lead-mini-name { font-weight: 600; }
.lead-mini a:hover .lead-mini-name { color: var(--gold-light); }

.badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}
.badge-to_verify { color: #E7D7B0; background: rgba(198, 161, 91, 0.12); border-color: rgba(198, 161, 91, 0.32); }
.badge-to_contact { color: #D5E0D4; background: rgba(122, 146, 124, 0.16); border-color: rgba(168, 186, 166, 0.28); }
.badge-contact_attempt { color: #DDD6C8; background: rgba(186, 174, 150, 0.12); border-color: rgba(186, 174, 150, 0.28); }
.badge-conversation_done { color: #F0E7D4; background: rgba(198, 161, 91, 0.18); border-color: rgba(216, 188, 122, 0.35); }
.badge-further_handling { color: #D2CDC4; background: rgba(255, 255, 255, 0.05); }
.badge-rejected, .badge-block { color: #F0D2CB; background: rgba(140, 74, 66, 0.18); border-color: rgba(196, 139, 132, 0.35); }
.badge-quiet { color: var(--text-secondary); }

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}
.filters .grow { grid-column: span 2; }
.filters label, .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filters label > span, .field > label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.filters .check {
  flex-direction: row;
  align-items: center;
  min-height: 46px;
  gap: 10px;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
}
.field input:not([type="checkbox"]):not([type="hidden"]),
.field select,
.field textarea,
.filters input:not([type="checkbox"]),
.filters select,
.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0c0c0c;
  color: var(--text-primary);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field textarea, .stack-form textarea {
  height: auto;
  min-height: 128px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
}
.field input:not([type="checkbox"]):focus,
.field select:focus,
.field textarea:focus,
.filters input:focus,
.filters select:focus {
  outline: 2px solid transparent;
  border-color: rgba(198, 161, 91, 0.8);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.16);
}
::placeholder { color: var(--text-muted); opacity: 1; }
.control { position: relative; }
.control-select select,
.filters select {
  appearance: none;
  padding-right: 40px;
}
.filters label:has(select) { position: relative; }
.filters label:has(select)::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 19px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--gold-light);
  border-bottom: 1.5px solid var(--gold-light);
  transform: rotate(45deg);
  pointer-events: none;
}
.control-select::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--gold-light);
  border-bottom: 1.5px solid var(--gold-light);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select option { background: #161616; color: var(--text-primary); }
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #C6A15B;
  flex: none;
}
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check span { font-size: 0.95rem; letter-spacing: 0; text-transform: none; color: var(--text-primary); }
.req { margin-left: 4px; color: var(--gold-light); text-decoration: none; }
.help { margin: 0; color: var(--text-muted); font-size: 0.82rem; }
.is-invalid input, .is-invalid select, .is-invalid textarea { border-color: var(--danger-border); }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--danger); font-size: 0.86rem; }
.form-alert, .callout {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
}
.form-alert, .callout-caution {
  border: 1px solid var(--danger-border);
  background: rgba(120, 64, 56, 0.18);
  color: #F3E6DC;
}
.callout-caution ul { margin: 8px 0 0; padding-left: 18px; }
.callout-caution li + li { margin-top: 8px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .is-wide { grid-column: 1 / -1; }
.filters .form-actions { grid-column: 1 / -1; }
fieldset.panel { margin: 0 0 16px; }
fieldset.panel legend {
  padding: 0 8px;
  background: var(--surface-primary);
}
fieldset.panel .form-grid { margin-top: 14px; }
.callout h2 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.panel .stack-form { margin-top: 18px; }
.evidence + .evidence { padding-top: 16px; border-top: 1px solid var(--border-dark); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stack-form { display: grid; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), filter var(--ease), box-shadow var(--ease);
}
.btn-primary {
  background: linear-gradient(180deg, #E0C98D 0%, #C6A15B 48%, #A9823E 100%);
  color: #1A1408;
  font-weight: 600;
  border-color: rgba(224, 201, 141, 0.4);
}
.btn-primary:hover { filter: brightness(1.06); color: #1A1408; }
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.14);
}
.btn-ghost:hover { border-color: var(--border-gold); color: var(--gold-light); }
.btn-quiet {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: var(--text-secondary);
  padding-left: 10px;
}
.btn-quiet:hover { background: rgba(255, 255, 255, 0.035); color: var(--text-primary); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 12px; }
a:focus-visible, button:focus-visible, .menu-btn:focus-visible, .nav-toggle:focus-visible ~ .shell .menu-btn {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.table-scroll { position: relative; overflow-x: auto; }
.data {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.data th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-dark);
}
.data td {
  padding: 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-dark);
}
.data tbody tr { transition: background-color var(--ease); }
.data tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.lead-row { position: relative; }
.lead-link { color: var(--text-primary); font-weight: 600; text-decoration: none; }
.lead-row:hover .lead-link { color: var(--gold-light); }
.lead-link::after { content: ""; position: absolute; inset: 0; }
.go { color: var(--gold-primary); margin-left: 6px; }
.result-meta { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pager span { color: var(--text-secondary); }

.facts { margin: 0; }
.facts div {
  display: grid;
  grid-template-columns: minmax(108px, 36%) 1fr;
  gap: 8px 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-dark);
}
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { margin: 0; color: var(--text-muted); font-size: 0.82rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.prose { overflow-wrap: anywhere; }
.figure {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.quote {
  margin: 14px 0;
  padding: 14px 16px;
  border-left: 2px solid var(--gold-primary);
  background: rgba(198, 161, 91, 0.05);
}
.quote p:last-child { margin: 0; }
.assessment {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-secondary);
  border: 1px solid var(--border-dark);
}
.assessment h3, .quote h3, .evidence-top {
  margin: 0 0 8px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 600;
}
.evidence + .evidence { margin-top: 12px; }
.evidence-meta { margin: 0; color: var(--text-secondary); }
.break { overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 4px 0 0; padding: 0 0 0 4px; }
.timeline li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 0 0 22px 22px;
  border-left: 1px solid rgba(198, 161, 91, 0.35);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 0 4px rgba(198, 161, 91, 0.12);
}
.timeline time { color: var(--text-muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.timeline strong { font-weight: 600; }
.timeline span { color: var(--text-secondary); }

.messages { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.msg {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
  background: rgba(198, 161, 91, 0.08);
}
.msg.error, .msg.warning {
  border-color: var(--danger-border);
  background: rgba(120, 64, 56, 0.18);
}

.solo { max-width: 640px; }
.solo h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 12px;
}
.gate-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 16px;
}
body.gate {
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(198, 161, 91, 0.16), transparent 60%),
    radial-gradient(520px 320px at 100% 100%, rgba(198, 161, 91, 0.07), transparent 55%),
    var(--bg-primary);
}
.gate-main .messages, .auth-card { width: min(460px, 100%); }
.auth-card {
  position: relative;
  padding: 42px 36px 36px;
  border-radius: 22px;
  border: 1px solid rgba(198, 161, 91, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 28%),
    var(--surface-primary);
  box-shadow: var(--inset), 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #E0C98D, transparent);
}
.auth-card .brand-lockup { padding: 8px 0 0; }
.brand-lockup.is-large .wordmark { font-size: clamp(1.8rem, 5vw, 2.5rem); letter-spacing: 0.16em; }
.gate-kicker {
  margin: 22px 0 6px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-primary);
  font-size: 0.75rem;
}
.auth-title {
  margin: 0 0 18px;
  font-size: 1.35rem;
  font-weight: 500;
}
.chat-log { display: grid; gap: 12px; max-height: min(52vh, 640px); overflow: auto; }
.bubble { max-width: min(720px, 100%); padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border-dark); background: var(--surface-secondary); }
.bubble.is-user { margin-left: auto; border-color: var(--border-gold); background: rgba(198, 161, 91, 0.08); }
.bubble-who { margin: 0 0 6px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-light); }
.chat-files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.chat-pending { margin: 0; color: var(--gold-light); }
.chat-form { display: grid; gap: 14px; }
.chat-form label { display: flex; flex-direction: column; gap: 6px; }
.chat-form label > span { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.chat-form textarea, .chat-form input[type="file"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0c0c0c;
  color: var(--text-primary);
}
.chat-form textarea { min-height: 120px; padding: 12px 14px; resize: vertical; }
.chat-form input[type="file"] { min-height: 46px; padding: 10px 14px; }
.chat-form textarea:focus, .chat-form input[type="file"]:focus {
  outline: 2px solid transparent;
  border-color: rgba(198, 161, 91, 0.8);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.16);
}
.dropzone { display: flex; flex-direction: column; gap: 6px; }
.dropzone-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.dropzone-target {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
  min-height: 132px;
  padding: 22px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(198, 161, 91, 0.45);
  background: radial-gradient(circle at 50% 0%, rgba(198, 161, 91, 0.1), transparent 58%), #0c0c0c;
  text-align: center;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}
.dropzone-target.is-over {
  border-style: solid;
  border-color: var(--gold-light);
  background: rgba(198, 161, 91, 0.12);
}
.dropzone-target:focus-within {
  border-color: rgba(198, 161, 91, 0.8);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.16);
}
.dropzone-copy { max-width: 36ch; color: var(--text-secondary); }
.dropzone-names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.dropzone-names:empty, .dropzone-note:empty { display: none; }
.dropzone-names li {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 0.85rem;
}
.dropzone-note { margin: 0; color: var(--danger); font-size: 0.9rem; }
.dropzone-copy, .dropzone-names, .dropzone-note { position: relative; z-index: 1; pointer-events: none; }
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .menu-btn { display: inline-flex; }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ease);
  }
  .nav-toggle:checked ~ .scrim { opacity: 1; pointer-events: auto; }
  .sidebar {
    position: fixed;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    height: 100vh;
  }
  .nav-toggle:checked ~ .shell .sidebar { transform: translateX(0); }
  body.app:has(.nav-toggle:checked) { overflow: hidden; }
  .topbar, .canvas { padding-left: 16px; padding-right: 16px; }
  .canvas { padding-top: 20px; }
}
@media (min-width: 981px) {
  .nav-toggle { display: none; }
}
@media (max-width: 800px) {
  .board, .detail-grid, .hero, .identity { grid-template-columns: 1fr; display: grid; }
  .identity-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .table-scroll { overflow: visible; }
  .data { min-width: 0; }
  .data thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .data, .data tbody, .data tr, .data td { display: block; width: auto; }
  .data tr { padding: 12px 0; border-bottom: 1px solid var(--border-dark); }
  .data td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border: 0;
    padding: 5px 0;
    text-align: right;
  }
  .data td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: left;
    flex: none;
  }
  .data td.name-cell { display: block; text-align: left; padding-bottom: 8px; }
  .data td.empty { display: block; text-align: left; }
  .data td.empty::before { content: none; }
  .who-name { display: none; }
}
@media (max-width: 720px) {
  .form-grid, .filters { grid-template-columns: 1fr; }
  .form-grid .is-wide, .filters .grow { grid-column: auto; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 420px) {
  .auth-card { padding: 32px 20px 24px; }
  .brand-lockup.is-large .wordmark { letter-spacing: 0.1em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
