:root {
  color-scheme: light;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #f9fafb;
  --panel: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #f1f5f9;
  --sidebar-muted: #94a3b8;
  --sidebar-active-bg: rgba(16, 185, 129, 0.15);
  --sidebar-active-text: #34d399;
  --dashboard-topbar-height: 65px;
  --sage: #059669;
  --sage-dark: #047857;
  --sage-light: #d1fae5;
  --coral: #ef4444;
  --coral-light: #fee2e2;
  --gold: #f59e0b;
  --gold-light: #fef3c7;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --mint: #d1fae5;
  --cream: #fef9ef;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  font-family: "Inter", "Manrope", system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv11", "ss01";
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  min-height: 100vh;
  padding: 0;
}

.dashboard-menu {
  position: sticky;
  top: var(--dashboard-topbar-height);
  align-self: start;
  height: calc(100vh - var(--dashboard-topbar-height));
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 5;
}

.menu-item {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 10px 12px;
  background: transparent;
  color: var(--sidebar-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.menu-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text);
}

.menu-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 700;
}

.dashboard-content {
  min-width: 0;
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}

.dashboard-screen[hidden] {
  display: none !important;
}

.dashboard-screen.active {
  display: grid;
  gap: 24px;
  padding: 28px 32px 48px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--sage);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-links {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.language-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.language-control select {
  width: auto;
  min-width: 116px;
  padding: 8px 32px 8px 10px;
  background: rgba(255, 255, 255, 0.82);
}

.lang-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  font-size: 0.95rem;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-button {
  min-height: 38px;
  padding: 0 14px;
}

.user-pill {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  background: var(--paper);
  font-size: 0.82rem;
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 33, 31, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.auth-modal {
  position: relative;
  width: min(480px, 100%);
  padding: 28px;
  border: 1px solid rgba(47, 111, 94, 0.18);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.auth-modal h2 {
  font-size: clamp(2rem, 5vw, 3.3rem);
}

.auth-modal p,
.auth-modal small {
  color: var(--muted);
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

.commercial-shell {
  width: min(1240px, calc(100% - 32px));
}

.landing-view,
.dashboard-view {
  min-height: 100vh;
}

.commercial-hero {
  min-height: 78vh;
  padding: 28px 0 48px;
}

.browser-demo {
  display: grid;
  gap: 16px;
}

.demo-browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.demo-browser-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--coral);
}

.demo-browser-bar span:nth-child(2) {
  background: var(--gold);
}

.demo-browser-bar span:nth-child(3) {
  background: var(--sage);
}

.demo-message,
.demo-assistant {
  padding: 18px;
  border-radius: 8px;
  line-height: 1.65;
}

.demo-message {
  background: var(--cream);
  color: var(--ink);
  font-weight: 800;
}

.demo-assistant {
  border: 1px solid rgba(47, 111, 94, 0.16);
  background: #fff;
}

.demo-assistant p,
.commercial-card-grid p,
.domain-item span,
.knowledge-card p,
.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.commercial-card-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--dashboard-topbar-height);
  box-sizing: border-box;
  padding: 12px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

.dashboard-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.email-verify-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 32px;
  background: #fff6e0;
  border-bottom: 1px solid #f0d385;
  color: #7a5b00;
  font-size: 0.9rem;
}

.email-verify-banner button {
  border: 1px solid #d9a300;
  background: transparent;
  color: #7a5b00;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.email-verify-banner button:hover {
  background: #f0d385;
}

.email-verify-banner-status {
  font-size: 0.85rem;
  opacity: 0.85;
}

[data-requires-verified].verification-locked,
[data-requires-verified]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-links {
  flex-wrap: wrap;
}

.dashboard-section {
  padding: 0;
}

.dashboard-screen > .section-heading {
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.dashboard-screen > .section-heading h2 {
  margin-bottom: 6px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--ink);
}

.dashboard-screen > .section-heading p:last-child {
  max-width: 820px;
  font-size: 0.9rem;
  color: var(--muted);
}

.metric-card {
  min-height: 100px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-family: "Fraunces", serif;
  font-size: 2.8rem;
  line-height: 1;
  color: var(--ink);
}

.metric-card.metric-over-limit {
  border-color: #d97706;
  background: #fffbeb;
}

.metric-card.metric-over-limit mark {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d97706;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.security-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.security-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.security-mode-list {
  display: grid;
  gap: 10px;
}

.security-mode-list span {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--sage-dark);
  background: var(--mint);
  font-weight: 900;
}

.policy-box,
.mini-json {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.policy-box {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.policy-box p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mini-json {
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.tag-list,
.tag-row,
.queue-toolbar,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-list {
  margin: 14px 0;
}

.tag-pill,
.tag-row span {
  border: 1px solid rgba(47, 111, 94, 0.18);
  border-radius: 999px;
  color: var(--sage-dark);
  background: var(--mint);
  font-size: 0.84rem;
  font-weight: 900;
}

.tag-pill {
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
}

.tag-pill span {
  color: var(--coral);
}

.tag-row {
  margin: 12px 0;
}

.tag-row span {
  padding: 6px 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.domain-list,
.knowledge-list {
  display: grid;
  gap: 12px;
}

.knowledge-day-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.knowledge-day-group + .knowledge-day-group {
  margin-top: 12px;
}

.knowledge-day-group .knowledge-card {
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.knowledge-day-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.knowledge-day-summary::-webkit-details-marker {
  display: none;
}

.knowledge-day-summary::before {
  content: "▸";
  margin-right: 8px;
  transition: transform 0.15s ease;
}

.knowledge-day-group[open] .knowledge-day-summary::before {
  transform: rotate(90deg);
}

.domain-item,
.knowledge-card,
.empty-state {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.domain-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.domain-item > div {
  min-width: 0;
}

.domain-item strong,
.domain-item span {
  display: block;
}

.domain-item strong {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  word-break: normal;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.google-signin-container {
  display: flex;
  justify-content: center;
  margin: 12px 0 4px;
  min-height: 40px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 12px;
  color: var(--muted, #888);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line, #e2e2e2);
}

.link-button {
  border: 0;
  padding: 0;
  color: var(--sage-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  text-decoration: underline;
}

.auth-forgot-link {
  display: block;
  margin: -6px 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  padding: 24px 18px 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--sage-dark);
  text-decoration: underline;
}

.admin-user-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.admin-user-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.admin-user-row.active {
  border-color: var(--sage);
  background: var(--mint);
}

.admin-detail,
.admin-detail-grid {
  display: grid;
  gap: 10px;
}

.admin-detail h4 {
  margin: 12px 0 2px;
}

.admin-login-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 1fr) minmax(70px, auto);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.domain-item mark,
.knowledge-meta strong {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--sage-dark);
  background: var(--mint);
  font-size: 0.76rem;
  font-weight: 900;
}

.knowledge-card.high-risk {
  border-color: rgba(217, 108, 79, 0.55);
  background: #fff8f4;
}

.knowledge-card.approved-card {
  border-color: rgba(47, 111, 94, 0.25);
}

.knowledge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-actions {
  align-items: center;
}

.card-actions small {
  color: var(--coral);
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.72fr);
  align-items: center;
  gap: 40px;
  padding: 72px 0 30px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--sage);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Fraunces", serif;
  letter-spacing: 0;
  line-height: 0.98;
}

h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(3.35rem, 8vw, 7.9rem);
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
}

h3 {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.hero-lede,
.section-heading p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-actions,
.button-row,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.chip {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:disabled,
.chip:disabled {
  cursor: progress;
  opacity: 0.55;
  transform: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.button:hover,
.chip:hover {
  transform: translateY(-1px);
}

.primary {
  color: #fff;
  background: var(--sage);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  border-color: var(--sage-dark);
}

.primary:hover {
  background: var(--sage-dark);
}

.secondary,
.ghost,
.chip {
  color: var(--ink-2);
  background: var(--panel);
  border-color: var(--line);
}

.chip:hover {
  background: var(--paper);
  border-color: #d1d5db;
}

.full {
  width: 100%;
}

.hero-panel,
.price-card,
.code-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.hero-panel {
  padding: 22px;
}

.signal-card {
  display: grid;
  gap: 6px;
  min-height: 190px;
  padding: 24px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, var(--sage-dark), var(--blue));
}

.signal-card strong {
  align-self: center;
  font-family: "Fraunces", serif;
  font-size: 5.5rem;
  line-height: 1;
}

.signal-card small,
.signal-label {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.flow-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.flow-list span {
  padding: 14px;
  border-radius: 8px;
  background: var(--mint);
  font-weight: 800;
}

.section {
  padding: 64px 0;
}

.section-heading {
  margin-bottom: 24px;
}

.compact {
  max-width: 760px;
}

.reply-grid,
.api-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-heading p {
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.5;
}

.step {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--coral);
  font-weight: 900;
}

form,
label {
  display: grid;
  gap: 10px;
}

form {
  gap: 16px;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fffdf8;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(47, 111, 94, 0.12);
}

.knowledge-list,
.results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.knowledge-item,
.reply-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.knowledge-item header,
.reply-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.knowledge-item h4,
.reply-card h4 {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--sage-dark);
  background: var(--mint);
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.rejected {
  color: #8c3b29;
  background: #fae1d9;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--sage-dark);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.rating-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.price-card {
  padding: 20px;
  min-height: 230px;
}

.price-card strong {
  display: block;
  margin: 12px 0;
  font-family: "Fraunces", serif;
  font-size: 2.3rem;
}

.price-card p {
  color: var(--muted);
  line-height: 1.6;
}

.featured {
  border-color: rgba(217, 108, 79, 0.45);
  background: #fff7ef;
}

.api-grid {
  grid-template-columns: 0.85fr 1.15fr;
}

.extension-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.compact-flow {
  margin-top: 8px;
}

.key-line {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, monospace;
}

code {
  overflow-wrap: anywhere;
}

.code-card {
  min-height: 210px;
  margin: 0;
  padding: 20px;
  overflow: auto;
  color: #f7fbf8;
  background: #182622;
}

.code-card code {
  white-space: pre-wrap;
  word-break: break-word;
}

.copied {
  background: var(--gold) !important;
}

.landing-section {
  padding: 74px 0;
}

.landing-feature-grid .panel,
.price-card {
  min-height: 180px;
}

.import-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.import-type-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffdf8;
  color: var(--muted);
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.import-type-card.active,
.import-type-card:hover {
  border-color: var(--sage);
  background: var(--mint);
  color: var(--sage-dark);
}

.import-fields,
.approval-summary,
.admin-table {
  display: grid;
  gap: 10px;
}

/* === ADMIN ACCORDION TABLE === */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.admin-search-input,
.kb-search-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font-size: 0.875rem;
  color: var(--ink);
  outline: none;
}

.admin-search-input:focus,
.kb-search-input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.admin-plan-select {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font-size: 0.875rem;
  color: var(--ink);
  cursor: pointer;
}

.admin-select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}

.admin-user-table {
  display: grid;
  gap: 2px;
}

.admin-accordion {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  transition: border-color 0.15s;
}

.admin-accordion.expanded {
  border-color: var(--sage);
  box-shadow: 0 0 0 2px rgba(5,150,105,0.1);
}

.admin-accordion-header {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 90px 90px 100px 100px 100px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: default;
  font-size: 0.875rem;
}

.admin-accordion.expanded .admin-accordion-header {
  background: #f0fdf4;
  border-bottom: 1px solid var(--line);
}

.admin-cb {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--sage);
}

.admin-email {
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-stat {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
}

.admin-expand-btn {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}

.admin-expand-btn:hover {
  border-color: var(--sage);
  color: var(--sage-dark);
  background: var(--sage-light);
}

/* Plan badges */
.plan-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.plan-free { background: #f3f4f6; color: #6b7280; }
.plan-starter { background: #dbeafe; color: #1d4ed8; }
.plan-pro { background: #ede9fe; color: #6d28d9; }
.plan-agency { background: #fef3c7; color: #b45309; }

/* Admin accordion detail */
.admin-accordion-detail {
  padding: 20px 24px;
  background: #f8fafc;
}

.admin-detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

.admin-detail-group {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: baseline;
  gap: 12px;
  font-size: 0.85rem;
}

.detail-row span {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-row strong {
  color: var(--ink);
  font-weight: 600;
}

.detail-row code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}

.detail-section-title {
  margin: 16px 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-login-list {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.detail-login-row {
  display: grid;
  grid-template-columns: 150px 60px auto;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 0.82rem;
}

.detail-login-row strong {
  color: var(--ink);
  font-weight: 600;
}

.detail-login-row span {
  color: var(--muted);
  font-size: 0.75rem;
}

.detail-login-row code {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.muted-note {
  font-size: 0.82rem;
  color: var(--muted);
}

/* === KNOWLEDGE BASE SEARCH TOOLBAR === */
.kb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 4px;
}

.kb-date-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.kb-date-label input {
  padding: 7px 9px;
  font-size: 0.82rem;
  width: 140px;
}

.kb-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
}

.knowledge-edit-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7faf2;
}

.danger-chip {
  border-color: rgba(239, 68, 68, 0.35);
  color: #dc2626;
  background: #fef2f2;
}

.danger-chip:hover {
  background: #fee2e2;
}

.approval-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fafb;
}

.approval-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.approval-row strong {
  overflow-wrap: anywhere;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 900px) {
  .hero-grid,
  .workspace-grid,
  .reply-grid,
  .api-grid,
  .extension-grid,
  .pricing-grid,
  .admin-accordion-header,
  .admin-detail-cols {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .nav-links {
    display: none;
  }

  .language-control span {
    display: none;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-menu {
    position: static;
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-item {
    text-align: center;
  }
}

/* === Recipient picker for admin messages === */
.recipient-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.1s;
}

.recipient-item:hover {
  background: var(--mint);
}

.recipient-item input[type="checkbox"] {
  accent-color: var(--sage);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.recipient-item .recipient-email {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-item .recipient-status {
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
}

#messageSendForm label {
  display: flex;
  align-items: center;
  gap: 8px;
}

#messageSendForm label input[type="checkbox"] {
  accent-color: var(--sage);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }

  h1 {
    font-size: 3.1rem;
  }

  .hero-grid {
    padding-top: 42px;
  }

  .rating-row {
    grid-template-columns: 1fr;
  }

  .button-row,
  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

/* Login spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* To-Do list & usage log (customer follow-up tracking, reply generation log) */
.chip.active {
  background: var(--sage);
  color: #fff;
  border-color: var(--sage-dark);
}

.todo-status-badge {
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

.todo-status-open {
  background: #fef3c7;
  color: #92400e;
}

.todo-status-done {
  background: var(--sage-light);
  color: var(--sage-dark);
}

.todo-url {
  word-break: break-all;
}