/* =====================================================================
 * Command Center — admin panel styling.
 * Design system adapted from the "Cursor Dark" concept: layered surfaces,
 * quiet chrome, muted borders, monospace accents.
 * ===================================================================== */

/* ---------- Theme tokens ------------------------------------------------ */
:root, [data-theme="cursor-dark"], .dark {
  --background:#181818;
  --foreground:#F0F0F0;
  --card:#181818;
  --popover:#1d1d1d;
  --primary:#F0F0F0;
  --primary-foreground:#191c22;
  --secondary:rgba(240,240,240,.12);
  --muted-foreground:rgba(240,240,240,.72);
  --border:rgba(240,240,240,.08);
  --sidebar:#141414;
  --focus-accent:#c8c8c8;
  --titlebar:#141414;
  --rail:#141414;
  --line:rgba(240,240,240,.08);
  --subtle:rgba(240,240,240,.04);
  --preview-bg:#181818;
  --danger:#e07070;
  --danger-bg:rgba(224,112,112,.10);
  --success:#7fcf9d;
  --radius:5px;
  color-scheme:dark;
}
[data-theme="dim"] {
  --background:#181818;
  --foreground:#e8e8e8;
  --card:#202020;
  --popover:#272727;
  --secondary:#313131;
  --border:#3c3c3c;
  --sidebar:#1d1d1d;
  --titlebar:#161616;
  --rail:#171717;
  --line:#333333;
  --preview-bg:#191919;
  --subtle:#2a2a2a;
}
[data-theme="light"] {
  --background:#f9f9f9;
  --foreground:#292929;
  --card:#ffffff;
  --popover:#ffffff;
  --primary:#383838;
  --primary-foreground:#ffffff;
  --secondary:#eaeaea;
  --muted-foreground:#6b6b6b;
  --border:#d9d9d9;
  --sidebar:#f3f3f3;
  --focus-accent:#6a6a6a;
  --titlebar:#efefef;
  --rail:#f0f0f0;
  --line:#e2e2e2;
  --preview-bg:#f6f6f6;
  --subtle:#f1f1f1;
  --danger:#d84a4a;
  --danger-bg:rgba(216,74,74,.08);
  color-scheme:light;
}

/* Legacy theme fallbacks — user's previous themes still work (they were
 * saved in localStorage). Map them all to Cursor Dark to avoid abrupt
 * broken states, but keep the accent hue tinted. */
[data-theme="midnight"], [data-theme="ocean"], [data-theme="sunset"],
[data-theme="emerald"], [data-theme="cyberpunk"] {
  --background:#181818; --foreground:#F0F0F0; --card:#181818;
  --secondary:rgba(240,240,240,.12); --muted-foreground:rgba(240,240,240,.72);
  --border:rgba(240,240,240,.08); --sidebar:#141414;
  --focus-accent:#c8c8c8; --line:rgba(240,240,240,.08); --subtle:rgba(240,240,240,.04);
  color-scheme:dark;
}

/* ---------- Base ------------------------------------------------------- */
* { box-sizing:border-box; border-color:var(--border); }
html, body { margin:0; padding:0; }
body {
  /* Geist Sans preferred (matches Astra); falls back to Inter, then the
   * OS system font. The preview screenshots you'll see are Segoe UI
   * because we're not shipping the Geist Sans woff files with this app;
   * see README for how to enable Geist. */
  font-family:'Geist Sans','Geist','Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-feature-settings:"cv11","ss01","ss03";
  background:var(--background);
  color:var(--foreground);
  font-size:14px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  min-height:100vh;
}
button, input, select, textarea { font:inherit; color:inherit; }
button { cursor:pointer; background:none; border:none; padding:0; color:inherit;
  transition:background .15s, color .15s, border-color .15s; }
a { color:inherit; text-decoration:none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:2px solid var(--focus-accent); outline-offset:2px;
}
svg { flex-shrink:0; }
kbd { font-family:'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size:11px; color:var(--muted-foreground); border:1px solid var(--border);
  border-radius:3px; padding:1px 5px; }

.skip-link { position:fixed; top:-60px; left:10px; z-index:100; padding:10px;
  background:var(--primary); color:var(--primary-foreground); border-radius:6px; }
.skip-link:focus { top:10px; }

/* ---------- Workspace shell ------------------------------------------- */
.workspace { min-height:100vh; display:flex; flex-direction:column; }
.workspace-body { display:flex; flex:1; min-height:100vh; }

/* ---------- Sidebar --------------------------------------------------- */
.project-sidebar {
  width:220px; flex-shrink:0;
  background:var(--sidebar);
  border-right:1px solid var(--line);
  padding:0 10px;
  display:flex; flex-direction:column;
  min-height:100vh;
}
.admin-brand {
  display:flex; align-items:center; gap:8px;
  padding:18px 6px 22px;
  font-size:14px; letter-spacing:-.2px;
}
.admin-brand-mark {
  width:26px; height:26px; display:grid; place-items:center;
  background:var(--subtle); border:1px solid var(--border);
  border-radius:5px; color:var(--foreground);
}
.admin-brand strong { font-weight:600; font-size:14px; }
.admin-brand small { color:var(--muted-foreground); font-size:11px; margin-left:auto; }

.sidebar-section-label {
  font-size:11px; font-weight:500; letter-spacing:.4px;
  color:var(--muted-foreground); padding:0 10px; margin:2px 0 8px;
}
.main-navigation { display:flex; flex-direction:column; gap:2px; list-style:none;
  padding:0; margin:0; }

.nav-button {
  display:flex; align-items:center; gap:10px;
  height:30px; padding:0 10px; border-radius:4px;
  font-size:13px; color:var(--muted-foreground);
  width:100%; text-align:left; cursor:pointer;
}
.nav-button svg { color:var(--muted-foreground); }
.nav-button:hover { background:var(--subtle); color:var(--foreground); }
.nav-button:hover svg { color:var(--foreground); }
.nav-button.active { background:var(--secondary); color:var(--foreground); }
.nav-button.active svg { color:var(--foreground); }
.nav-count {
  margin-left:auto; font-size:11px; padding:1px 6px;
  line-height:16px; border-radius:4px;
  background:var(--subtle); color:var(--muted-foreground);
  font-family:ui-monospace, Menlo, Consolas, monospace;
}
.nav-button.active .nav-count { background:rgba(0,0,0,.25); color:var(--foreground); }

.sidebar-bottom { margin-top:auto; padding:12px 0 14px; display:flex;
  flex-direction:column; gap:8px; }
.settings-link { }

.admin-profile {
  display:flex; align-items:center; gap:9px;
  padding:8px 8px 8px 6px;
}
.admin-profile .avatar {
  width:26px; height:26px; border-radius:50%;
  display:grid; place-items:center;
  background:var(--secondary); color:var(--foreground);
  font-size:11px; font-weight:600;
  border:1px solid var(--border);
}
.admin-profile > div { display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.admin-profile strong { font-size:12px; font-weight:500; }
.admin-profile small { font-size:10px; color:var(--muted-foreground); }
.admin-logout { color:var(--muted-foreground); margin-left:auto; }
.admin-logout:hover { color:var(--foreground); }

/* Icon button */
.icon-button {
  display:grid; place-items:center;
  width:28px; height:28px; border-radius:4px;
  color:var(--muted-foreground);
}
.icon-button:hover { color:var(--foreground); background:var(--subtle); }

/* ---------- Main area ------------------------------------------------- */
.admin-main { flex:1; display:flex; flex-direction:column; min-width:0; }

.admin-topbar {
  height:40px; flex-shrink:0;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 20px 0 12px;
  background:var(--titlebar);
  border-bottom:1px solid var(--line);
  gap:20px;
}
.topbar-left { display:flex; align-items:center; gap:8px; }
.topbar-workspace { font-size:12px; color:var(--muted-foreground); }
.topbar-chevron { color:var(--muted-foreground); }
.topbar-left strong { font-size:12px; font-weight:500; }
.topbar-right { display:flex; align-items:center; gap:14px; }
.topbar-status {
  display:flex; align-items:center; gap:6px;
  font-size:11px; color:var(--muted-foreground);
  padding:4px 9px; border:1px solid var(--border);
  border-radius:5px; background:var(--subtle);
}
.topbar-status .status-dot { width:5px; height:5px; }
.topbar-status.disabled .status-dot { background:#8a8a8a; box-shadow:0 0 0 3px rgba(138,138,138,.15); }

.status-dot {
  display:inline-block; width:5px; height:5px; border-radius:50%;
  background:var(--focus-accent); flex-shrink:0;
  box-shadow:0 0 0 3px rgba(200,200,200,.10);
}

.main-content {
  flex:1; overflow-y:auto;
  max-width:1450px; width:100%;
  margin:0 auto; padding:34px 38px 40px;
}

/* Views */
.view { display:none; }
.view.active { display:block; }
.view-google-iframe.active {
  display: block;
  /* Break out of .main-content's max-width so the iframe fills the entire
   * area to the right of the sidebar and below the topbar. */
  position: fixed;
  left: 220px;              /* .project-sidebar width */
  right: 0;
  top: 40px;                /* .admin-topbar height */
  bottom: 0;
  margin: 0;
  padding: 0;
  height: auto;
  width: auto;
  z-index: 5;
}
.view-google-iframe iframe {
  width: 100%; height: 100%;
  border: 0; display: block;
  background: transparent;
}
@media (max-width: 900px) {
  .view-google-iframe.active { left: 0; }
}

/* Page heading */
.page-heading {
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:18px; margin-bottom:26px;
}
.page-heading h1 {
  font-size:27px; font-weight:550; letter-spacing:-.9px;
  line-height:1.2; margin:0;
}
.page-heading p {
  margin:7px 0 0; font-size:13px;
  color:var(--muted-foreground); line-height:1.5;
  max-width:640px;
}
.heading-actions {
  display:flex; align-items:center; gap:12px;
  padding-top:8px; flex-shrink:0;
}
.header-buttons { display:flex; gap:8px; }
.header-save-status {
  display:flex; align-items:center; gap:6px;
  font-size:11px; color:var(--muted-foreground);
}
.header-save-status svg { color:var(--focus-accent); }
.header-save-status.pending { color:#bebebe; }
.header-save-status.pending svg { display:none; }
.header-save-status.pending::before {
  content:''; width:5px; height:5px; border-radius:50%;
  background:#bdbdbd; display:inline-block;
}

/* Buttons */
.primary-button {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  height:32px; padding:0 12px;
  background:var(--primary); color:var(--primary-foreground);
  border:1px solid rgba(255,255,255,.08);
  border-radius:5px;
  font-size:12px; font-weight:600;
  white-space:nowrap;
}
.primary-button:hover { filter:brightness(.94); }
.primary-button:disabled { opacity:.55; cursor:default; }

.secondary-button {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  height:32px; padding:0 12px;
  background:var(--subtle); color:var(--foreground);
  border:1px solid var(--border);
  border-radius:5px;
  font-size:12px;
  white-space:nowrap;
}
.secondary-button:hover { background:var(--secondary); }
.secondary-button.danger-button { color:var(--danger); }
.secondary-button.danger-button:hover { background:var(--danger-bg); border-color:var(--danger); }

/* Legacy .btn.* classes — kept as aliases so dynamically-rendered
 * inline HTML in app.js keeps working without a search-and-replace pass. */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  height:32px; padding:0 12px;
  border-radius:5px; font-size:12px; white-space:nowrap;
  border:1px solid transparent; cursor:pointer;
}
.btn-primary {
  background:var(--primary); color:var(--primary-foreground);
  border-color:rgba(255,255,255,.08); font-weight:600;
}
.btn-primary:hover { filter:brightness(.94); }
.btn-secondary {
  background:var(--subtle); color:var(--foreground);
  border-color:var(--border);
}
.btn-secondary:hover { background:var(--secondary); }
.btn-danger {
  background:var(--danger-bg); color:var(--danger);
  border-color:transparent;
}
.btn-danger:hover { background:var(--danger); color:#fff; }
.btn-sm { height:28px; font-size:11px; padding:0 10px; }
.btn-small { height:24px; font-size:11px; padding:0 8px; }
.btn:disabled { opacity:.55; cursor:default; }
.flex-gap { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* ---------- Section headings ------------------------------------------ */
.section-heading {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:14px;
}
.section-heading h2 { font-size:14px; font-weight:550; margin:0; letter-spacing:-.15px; }
.section-heading > span {
  font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:10px; color:var(--muted-foreground);
  letter-spacing:.5px; opacity:.65;
}
.section-description {
  font-size:12px; color:var(--muted-foreground);
  margin:0 0 17px;
}
.section-footer {
  margin-top:24px; padding-top:16px;
  border-top:1px solid var(--line);
  display:flex; gap:8px; color:var(--muted-foreground);
  font-size:11px; align-items:center;
}
.section-footer svg { color:var(--focus-accent); }
.inline-note {
  display:flex; align-items:center; gap:8px;
  color:var(--muted-foreground); font-size:11px;
  margin-top:14px; line-height:1.5;
}

/* ---------- Config layout (grid: settings + optional preview) --------- */
.config-layout { display:grid; grid-template-columns:minmax(0, 760px) 280px; gap:30px; align-items:start; }
.config-layout.preview-hidden { grid-template-columns:minmax(0, 760px); }
.config-layout.preview-hidden .preview-column { display:none; }
.settings-column { min-width:0; }

/* ---------- Setting rows ---------------------------------------------- */
.settings-group {
  border:1px solid var(--border); border-radius:7px;
  overflow:hidden; background:var(--card);
}
.setting-row {
  display:flex; align-items:center; gap:12px;
  padding:14px 16px; min-height:52px;
  border-bottom:1px solid var(--line);
}
.setting-row:last-child { border-bottom:none; }
.setting-icon { color:var(--muted-foreground); }
.setting-copy { flex:1; min-width:0; }
.setting-copy h3 { font-size:13px; font-weight:500; line-height:1.4; margin:0; }
.setting-copy p { font-size:12px; color:var(--muted-foreground); line-height:1.45; margin:0; }

/* Native <select> styled as domain-select */
.domain-select {
  min-width:170px;
  height:30px;
  padding:0 26px 0 10px;
  font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:11px;
  background:var(--subtle);
  border:1px solid var(--border);
  border-radius:5px;
  color:var(--foreground);
  cursor:pointer;
  appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat;
  background-position:right 8px center;
  background-size:12px;
}
.domain-select:hover { background-color:var(--secondary); }
.domain-select:disabled { opacity:.6; cursor:not-allowed; }

/* ---------- Switch ---------------------------------------------------- */
.switch { position:relative; display:inline-block; }
.switch input { position:absolute; opacity:0; pointer-events:none; }
.switch .switch-slider {
  display:inline-block; width:32px; height:18px;
  background:var(--secondary); border:1px solid var(--border);
  border-radius:20px; position:relative;
  transition:background .18s, border-color .18s;
  cursor:pointer;
}
.switch .switch-slider::before {
  content:''; position:absolute; left:2px; top:1px;
  width:12px; height:12px; border-radius:50%;
  background:#c8c8c8;
  transition:transform .18s, background .18s;
}
.switch input:checked + .switch-slider {
  background:var(--success);
  border-color:var(--success);
}
.switch input:checked + .switch-slider::before {
  transform:translateX(14px);
  background:#ffffff;
}
/* Clean styled checkbox — green when checked. */
.check {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  user-select: none;
}
.check input {
  position: absolute; opacity: 0; pointer-events: none;
}
.check .check-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.check .check-box::after {
  content: '';
  width: 8px; height: 4px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg) translate(1px, -1px);
  transition: border-color .15s;
}
.check input:checked + .check-box {
  background: var(--success);
  border-color: var(--success);
}
.check input:checked + .check-box::after {
  border-left-color: #ffffff;
  border-bottom-color: #ffffff;
}
.check input:focus-visible + .check-box {
  box-shadow: 0 0 0 2px rgba(127,207,157,.35);
}
.check .check-text {
  font-size: 13px; color: var(--foreground);
}
.check-row { display: flex; align-items: center; }

/* ---------- Brand pills (control panel + detail modal) ---------------- */
.brand-pills {
  display:flex; flex-wrap:wrap; gap:6px;
  margin:0 0 12px;
  padding:6px; background:var(--subtle);
  border:1px solid var(--border); border-radius:6px;
  width:fit-content; max-width:100%;
}
.brand-pill {
  padding:5px 12px; border-radius:4px;
  font-size:12px; color:var(--muted-foreground);
  background:transparent; border:1px solid transparent;
  cursor:pointer;
}
.brand-pill:hover { color:var(--foreground); background:var(--subtle); }
.brand-pill.active {
  background:var(--card); color:var(--foreground);
  border-color:var(--border);
}

/* ---------- Destination grid (page cards) ----------------------------- */
.destination-grid, .page-cards {
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.destination-card, .page-card {
  display:flex; flex-direction:column; position:relative;
  border:1px solid var(--border); border-radius:7px;
  padding:14px 15px; min-height:88px;
  cursor:pointer; background:var(--card);
  transition:border-color .18s, background .18s;
}
.destination-card:hover, .page-card:hover {
  border-color:rgba(240,240,240,.25);
  background:var(--subtle);
}
.destination-card.active, .destination-card.selected, .page-card.active {
  background:linear-gradient(120deg, rgba(240,240,240,.06), rgba(240,240,240,.02)), var(--card);
  border-color:rgba(240,240,240,.35);
}
.page-card-text { display:flex; flex-direction:column; gap:3px; padding-right:20px; }
.page-card-name { font-size:13px; font-weight:500; }
.page-card-desc { font-size:11px; color:var(--muted-foreground); line-height:1.4; }
.page-card-chevron {
  position:absolute; right:13px; top:14px;
  font-size:14px; color:var(--muted-foreground);
  line-height:1;
}
.page-card.active .page-card-chevron { color:var(--focus-accent); font-weight:600; }

/* ---------- Tabs ------------------------------------------------------ */
.config-tabs { }
.section-tabbar {
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid var(--line);
  margin-bottom:24px; min-height:40px; gap:15px;
}
.section-tabs {
  display:flex; align-items:center; gap:22px;
  height:40px;
}
.tab-trigger {
  display:flex; align-items:center; gap:6px;
  color:var(--muted-foreground);
  font-size:12px;
  height:40px;
  padding:0 0 12px;
  border:none; background:transparent;
  position:relative;
  cursor:pointer;
}
.tab-trigger:hover { color:var(--foreground); }
.tab-trigger.active { color:var(--foreground); }
.tab-trigger.active::after {
  content:''; position:absolute; left:0; right:0; bottom:-1px;
  height:1px; background:var(--focus-accent);
}
.tab-trigger svg { width:13px; height:13px; }

.tab-content { display:none; }
.tab-content.active { display:block; }

/* ---------- View toolbar (submissions/domains list header) ------------ */
.view-toolbar {
  display:flex; justify-content:space-between; align-items:center;
  gap:18px; padding:0 0 14px; margin-bottom:18px;
  border-bottom:1px solid var(--line);
}
.view-toolbar > div {
  display:flex; align-items:center; gap:9px;
  font-size:13px;
}
.view-toolbar strong { font-size:13px; font-weight:500; }
.view-toolbar svg { color:var(--muted-foreground); }
.count-pill {
  padding:1px 7px; background:var(--secondary);
  border:1px solid var(--border);
  font-size:11px; border-radius:5px;
  color:var(--muted-foreground);
  font-family:ui-monospace, Menlo, Consolas, monospace;
}
.muted-label { font-size:12px; color:var(--muted-foreground); }

/* ---------- Data panel (submissions table) ---------------------------- */
.data-panel {
  border:1px solid var(--border); border-radius:8px;
  overflow:hidden; background:var(--card);
}
.data-table { width:100%; border-collapse:collapse; }
.data-table th {
  font-size:11px; font-weight:400;
  color:var(--muted-foreground);
  text-align:left; padding:12px 16px;
  background:var(--subtle);
  letter-spacing:.2px;
  border-bottom:1px solid var(--line);
}
.data-table td {
  padding:16px; font-size:13px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
}
.data-table tr:last-child td { border-bottom:none; }
.data-table tr.sub-row { cursor:pointer; transition:background .12s, opacity .25s ease, transform .25s ease; }
.data-table tr.sub-row:hover { background:var(--subtle); }
.data-table tr.sub-row-await { background:rgba(240,240,240,.02); }
.data-table tr.sub-row-pending { background:rgba(240,240,240,.02); }

.person-cell { display:flex; gap:10px; align-items:center; }
.person-cell > span.person-avatar {
  display:grid; place-items:center;
  width:30px; height:30px; border-radius:50%;
  border:1px solid var(--border);
  background:var(--subtle); font-size:10px;
  color:var(--focus-accent);
  font-family:ui-monospace, Menlo, Consolas, monospace;
}
.person-cell > div { display:flex; flex-direction:column; gap:3px; min-width:0; }
.person-cell strong { font-size:12px; font-weight:500;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:180px; }
.person-cell small { font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:10px; color:var(--muted-foreground); }

.subject-cell { min-width:0; }
.subject-title { font-size:13px; }
.subject-secondary { display:block; color:var(--muted-foreground);
  font-size:11px; margin-top:4px; }

.status-pill {
  display:inline-flex; align-items:center; gap:5px;
  border-radius:4px; font-size:11px; padding:3px 8px;
  border:1px solid transparent;
}
.status-pill i { width:4px; height:4px; border-radius:50%;
  background:currentColor; }
.status-pill.status-new     { background:rgba(240,240,240,.10); color:#dcdcdc; }
.status-pill.status-review  { background:var(--subtle); color:var(--muted-foreground); }
.status-pill.status-active  { background:rgba(127,207,157,.12); color:var(--success); }
.status-pill.status-offline { background:var(--subtle); color:var(--muted-foreground); }

.status-text {
  display:inline-flex; align-items:center; gap:5px;
  font-size:11px; font-weight:500;
}
.status-text i { width:5px; height:5px; border-radius:50%; background:currentColor; }
.status-text.status-new     { color:var(--muted-foreground); }
.status-text.status-review  { color:var(--muted-foreground); }
.status-text.status-active  { color:var(--success); }
.status-text.status-offline { color:var(--muted-foreground); }

.time-cell { font-size:12px; color:var(--muted-foreground);
  font-family:ui-monospace, Menlo, Consolas, monospace; }

.row-action-cell { text-align:right; white-space:nowrap; }
.row-action-cell .primary-button,
.row-action-cell .secondary-button { height:28px; font-size:11px; padding:0 10px; }

/* Empty state */
.empty-state {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:12px; padding:60px 20px;
  color:var(--muted-foreground); font-size:13px;
  border:1px dashed var(--border); border-radius:8px;
  background:var(--card);
}
.empty-inbox { display:flex; align-items:center; justify-content:center;
  gap:12px; padding:36px; color:var(--muted-foreground); font-size:13px; }

/* ---------- Domain cards ---------------------------------------------- */
.domain-list { display:grid; gap:10px; }
.domain-card {
  display:flex; align-items:center; gap:14px;
  padding:18px 20px;
  border:1px solid var(--border); border-radius:8px;
  background:var(--card);
}
.domain-card.is-primary { border-color:rgba(240,240,240,.28); }
.domain-card-icon {
  display:grid; place-items:center;
  width:40px; height:40px; flex-shrink:0;
  border:1px solid var(--border); border-radius:8px;
  color:var(--focus-accent); background:var(--subtle);
}
.domain-card > .domain-copy { flex:1; min-width:0; }
.domain-title { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.domain-title h2 {
  font-size:14px; font-family:ui-monospace, Menlo, Consolas, monospace;
  font-weight:400; margin:0;
  overflow-wrap:anywhere;
}
.environment-pill {
  font-size:10px; padding:2px 6px;
  border:1px solid var(--border); border-radius:4px;
  color:var(--muted-foreground);
}
.domain-card p { color:var(--muted-foreground); font-size:12px; margin-top:6px;
  margin-bottom:0; }
.domain-card-actions {
  display:flex; align-items:center; gap:8px;
  margin-left:auto; flex-shrink:0;
}
.active-domain {
  display:inline-flex; gap:5px; align-items:center;
  color:var(--focus-accent); font-size:12px;
  padding:6px 10px;
  border:1px solid rgba(240,240,240,.2); border-radius:5px;
  background:var(--subtle);
}
.domain-explainer {
  display:flex; gap:12px; align-items:flex-start;
  margin-top:30px; padding:20px 0 0;
  border-top:1px solid var(--line);
  color:var(--muted-foreground);
}
.domain-explainer svg { color:var(--focus-accent); margin-top:3px; }
.domain-explainer h3 { font-size:13px; color:var(--foreground); font-weight:500;
  margin:0; }
.domain-explainer p { font-size:12px; line-height:1.7; max-width:520px;
  margin-top:6px; margin-bottom:0; }

.add-domain-form {
  display:flex; gap:8px; align-items:center;
}
.add-domain-form input {
  flex:1; height:32px; padding:0 12px;
  background:var(--subtle); border:1px solid var(--border);
  border-radius:5px; color:var(--foreground);
  font-family:'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size:13px;
}
.add-domain-form input:focus { border-color:var(--focus-accent); outline:none; }

/* ---------- Forms ---------------------------------------------------- */
.form-group-panel {
  padding:16px 18px;
  display:flex; flex-direction:column; gap:16px;
}
.form-group { display:flex; flex-direction:column; gap:6px; }
.form-group label {
  font-size:12px; font-weight:500; color:var(--foreground);
}
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=email],
.form-group input[type=tel],
.form-group input[type=url],
.form-group input[type=number],
.form-group input:not([type]),
.form-group textarea {
  height:32px; padding:0 12px;
  background:var(--subtle); border:1px solid var(--border);
  border-radius:5px; color:var(--foreground);
  font-size:13px;
  font-family:'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  font: inherit;
  color: var(--muted-foreground);
  opacity: 0.55;
}
/* Same rule globally so Domains, cmdk, and any bare input outside a
 * .form-group also render placeholders with the input's own font
 * (monospace) at consistent muted color + opacity. */
input::placeholder, textarea::placeholder {
  font: inherit;
  color: var(--muted-foreground);
  opacity: 0.55;
}
.form-group select {
  height:32px; padding:0 26px 0 10px;
  background:var(--subtle); border:1px solid var(--border);
  border-radius:5px; color:var(--foreground);
  font-size:13px; font-family:'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  cursor:pointer; appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat; background-position:right 8px center; background-size:12px;
}
.form-group select:hover { background-color:var(--secondary); }
.form-group textarea { min-height:64px; padding:8px 12px; resize:vertical;
  line-height:1.5; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color:var(--focus-accent); outline:none;
}
.form-group .form-help { color:var(--muted-foreground); font-size:11px; line-height:1.5; }
.form-group-row { flex-direction:row; align-items:center; gap:8px; }
.form-group-row label { margin:0; cursor:pointer; }
.form-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding-top:4px; }

.status-msg { font-size:12px; color:var(--muted-foreground); transition: opacity .35s ease; }
.status-msg.status-ok { color:var(--success); }
.status-msg.status-error { color:var(--danger); }
.mt-sm { margin-top:8px; }

.caddy-preview {
  margin-top:12px; padding:12px;
  background:rgba(0,0,0,.25);
  border:1px solid var(--border); border-radius:6px;
  font-size:11px; color:#c3c3c3;
  max-height:280px; overflow:auto; white-space:pre-wrap;
  font-family:ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- Theme picker --------------------------------------------- */
.theme-grid {
  display:grid; grid-template-columns:repeat(3, 1fr); gap:12px;
}
.theme-option {
  border:1px solid var(--border); border-radius:8px;
  padding:10px; cursor:pointer;
  background:var(--card);
  transition:border-color .18s;
}
.theme-option:hover { border-color:rgba(240,240,240,.25); }
.theme-option.active {
  border-color:var(--focus-accent);
  box-shadow:0 0 0 1px var(--focus-accent);
}
.theme-preview {
  display:flex; height:88px; border-radius:5px;
  overflow:hidden;
  border:1px solid var(--border);
}
.theme-preview-sidebar { width:26%; }
.theme-preview-content { flex:1; padding:22px 12px 0; }
.theme-preview-bar, .theme-preview-bar2 {
  display:block; height:5px; margin-bottom:8px; border-radius:2px;
}
.theme-preview-bar { width:100%; }
.theme-preview-bar2 { width:60%; }
.theme-option-caption {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 2px 4px; font-size:12px;
}
.theme-option-caption strong { font-weight:500; }
.theme-option-caption small { color:var(--muted-foreground); font-size:10px; }

/* ---------- Modal (submission detail) -------------------------------- */
.modal-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,.5);
  display:none;
  z-index:80;
  align-items:center; justify-content:center;
  padding:20px;
}
.modal-overlay.active { display:flex; }
.modal {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:10px;
  width:100%; max-width:1080px;
  max-height:calc(100vh - 40px);
  display:flex; flex-direction:column;
  overflow:hidden;
  will-change:transform, opacity;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
}
.modal-session { max-width:1080px; }
.modal-wide { max-width:900px; }
.modal-header {
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:16px;
  padding:20px 22px 18px;
  border-bottom:1px solid var(--line);
}
.modal-header-copy { display:flex; flex-direction:column; gap:5px; min-width:0; }
.modal-eyebrow {
  font-size:10px; letter-spacing:1.2px;
  color:var(--muted-foreground); font-weight:500;
  text-transform:uppercase;
}
.modal-header h2 {
  font-size:20px; margin:0; letter-spacing:-.4px;
  font-weight:550;
}
.modal-close { flex-shrink:0; }
.modal-body {
  flex:1; overflow-y:auto;
  padding:20px 22px 22px;
}

/* Session detail inside modal */
.sess-header {
  display:flex; align-items:center; gap:12px;
  margin-bottom:20px;
}
.sess-status {
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 9px; border-radius:4px;
  font-size:11px;
}
.sess-status-await { background:rgba(240,240,240,.10); color:#dcdcdc; }
.sess-status-spacer { flex:1; }
.sess-actions { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }
.sess-actions .primary-button,
.sess-actions .secondary-button { height:30px; font-size:12px; padding:0 12px; }

.sess-grid {
  display:grid; grid-template-columns:minmax(0, 1fr) 300px;
  gap:24px; align-items:start;
}
.sess-left { min-width:0; }
.sess-right { min-width:0; }
.sess-left .section-heading, .sess-right .section-heading { margin-bottom:10px; }
.sess-left .section-heading h2, .sess-right .section-heading h2 { font-size:12px; }
.sess-heading {
  font-size:12px; font-weight:500; margin:0 0 12px;
  color:var(--muted-foreground);
  text-transform:uppercase; letter-spacing:.4px;
}
.sess-right .page-cards { grid-template-columns:1fr; gap:6px; }
.sess-right .page-card { min-height:56px; padding:10px 13px; }
.sess-right .brand-pills { margin-bottom:12px; }
.sess-right section { margin:0; }

/* Info table */
.info-table {
  width:100%; border-collapse:collapse;
  border:1px solid var(--border); border-radius:6px;
  overflow:hidden; margin-bottom:22px;
  background:var(--subtle);
}
.info-table th, .info-table td {
  padding:10px 12px; font-size:12px; vertical-align:top;
  border-bottom:1px solid var(--line);
}
.info-table th {
  text-align:left; font-weight:400; color:var(--muted-foreground);
  width:110px;
  background:transparent;
}
.info-table td {
  color:var(--foreground);
  word-break:break-word;
}
.info-table .ua-cell { font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:11px; color:var(--muted-foreground); }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom:none; }
.info-muted { color:var(--muted-foreground); }
.ip-inline { display:inline-flex; align-items:center; gap:7px; }

/* Session info rows (setting-row style inside detail modal) */
.sess-info-row {
  display:flex; align-items:center; gap:10px;
  padding:11px 14px; min-height:42px;
  border-bottom:1px solid var(--line);
  font-size:12px;
}
.sess-info-row:last-child { border-bottom:none; }
.sess-info-icon { color:var(--muted-foreground); flex-shrink:0; width:16px; display:grid; place-items:center; }
.sess-info-label { color:var(--muted-foreground); width:70px; flex-shrink:0; font-weight:400; }
.sess-info-value { flex:1; min-width:0; color:var(--foreground); word-break:break-word; }
.online-dot {
  display:inline-block; width:7px; height:7px; border-radius:50%;
  flex-shrink:0;
}
.online-dot.online { background:var(--success); box-shadow:0 0 0 2px rgba(127,207,157,.20); }
.online-dot.offline { background:#8a8a8a; box-shadow:0 0 0 2px rgba(138,138,138,.15); }

/* Captured inputs list */
.kv-list {
  border:1px solid var(--border); border-radius:6px;
  overflow:hidden; background:var(--card);
}
.kv-row {
  display:grid; grid-template-columns:130px 1fr;
  border-bottom:1px solid var(--line);
  font-size:12px;
}
.kv-row:last-child { border-bottom:none; }
.kv-key {
  padding:10px 12px; color:var(--muted-foreground);
  border-right:1px solid var(--line);
  background:var(--subtle);
  font-size:11px; font-weight:500;
}
.kv-val {
  padding:10px 12px;
  word-break:break-word;
  font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:12px;
  cursor:pointer;
  transition:background .12s;
}
.kv-val:hover { background:var(--subtle); }
.kv-val.kv-val-live { color:var(--success); position:relative; }
.kv-val.kv-val-live::before {
  content:'●'; margin-right:6px; color:var(--success);
  font-size:8px; vertical-align:middle;
  animation:pulse-live 1.4s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity:.4; }
  50%      { opacity:1; }
}
.kv-copied { color:var(--success) !important; }
.kv-empty {
  padding:22px; text-align:center;
  color:var(--muted-foreground); font-size:12px;
}

/* Config form inside modal (page config) */
.cfg-form { display:flex; flex-direction:column; gap:14px; }
.cfg-form .form-group { gap:5px; }
.detail-actions { display:flex; gap:8px; padding-top:4px; }

.action-list, .wallet-list { display:flex; flex-direction:column; gap:8px; }
.action-row, .wallet-row {
  display:flex; gap:6px;
  padding:8px; background:var(--subtle);
  border:1px solid var(--border); border-radius:6px;
}
.action-row-fields { display:flex; flex-direction:column; gap:6px; flex:1; }
.action-row-fields input, .wallet-row input, .wallet-row select {
  height:28px; padding:0 8px;
  background:var(--card); border:1px solid var(--border);
  border-radius:4px; color:var(--foreground);
  font-size:11px;
  font-family:ui-monospace, Menlo, Consolas, monospace;
}
.action-row-del {
  color:var(--muted-foreground); font-size:14px;
  align-self:flex-start; padding:4px 8px; border-radius:4px;
}
.action-row-del:hover { color:var(--danger); background:var(--danger-bg); }
.wallet-row { flex-wrap:wrap; align-items:center; }
.wallet-check { display:flex; align-items:center; gap:8px; min-width:0; width:100%; }
.wallet-check input[type="checkbox"] { flex-shrink:0; }
.wallet-check input[type="text"] { flex:1; min-width:0; }
.wallet-row input[data-w-field="desc"] { flex:1; min-width:120px; }
.wallet-row select { flex-shrink:0; }
.wallet-help { font-size:11px; color:var(--muted-foreground); }
.wallet-status-dd { flex-shrink:0; }

/* Wallet-connections editor (Binance/Kraken connections pages) */
.wc-list { display:flex; flex-direction:column; gap:10px; }
.wc-wallet {
  border:1px solid var(--border); border-radius:6px;
  padding:12px; background:var(--subtle);
}
.wc-wallet-head {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}
.wc-wallet-head .wallet-check { flex:1; min-width:120px; }
.wc-wallet-del {
  background:none; border:none; color:var(--muted-foreground);
  cursor:pointer; font-size:14px; padding:2px 6px; border-radius:4px;
  flex-shrink:0;
}
.wc-wallet-del:hover { color:var(--danger); background:var(--danger-bg); }
.wc-conn-label {
  font-size:11px; font-weight:600; color:var(--muted-foreground);
  margin:10px 0 6px 2px; text-transform:uppercase; letter-spacing:.04em;
}
.wc-conn-list { display:flex; flex-direction:column; gap:8px; }
.wc-conn-row {
  display:flex; flex-wrap:wrap; gap:5px; align-items:center;
  padding:8px; background:var(--card); border:1px solid var(--border);
  border-radius:5px; position:relative;
}
.wc-conn-row input {
  height:28px; padding:0 8px; font-size:12px;
  background:var(--subtle); border:1px solid var(--border);
  border-radius:4px; color:var(--foreground);
  font-family:inherit; outline:none; min-width:0;
}
.wc-conn-row input:focus { border-color:var(--focus-accent); }
.wc-conn-row input[data-c-field="name"] { flex:1 1 40%; }
.wc-conn-row input[data-c-field="type"] { flex:0 0 70px; }
.wc-conn-row input[data-c-field="url"] { flex:1 1 45%; }
.wc-conn-row input[data-c-field="permissions"] { flex:1 1 45%; }
.wc-conn-del {
  background:none; border:none; color:var(--muted-foreground);
  cursor:pointer; font-size:12px; padding:2px 4px; border-radius:3px;
  position:absolute; top:6px; right:6px;
}
.wc-conn-del:hover { color:var(--danger); }
.wc-add-conn { height:24px; font-size:11px; padding:0 10px; margin-top:6px; }
.wc-add-wallet { height:28px; font-size:11px; padding:0 12px; margin-top:8px; }
.wallet-status-dd .cc-dropdown-trigger { height:28px; font-size:11px; min-width:90px; }
.cfg-select {
  height:28px; padding:0 28px 0 8px;
  background:var(--subtle); border:1px solid var(--border);
  border-radius:5px; color:var(--foreground);
  font-size:12px; font-family:inherit;
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' width='12' height='12' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 8px center;
  cursor:pointer; outline:none;
}
.cfg-select:focus { border-color:var(--focus-accent); }
.wallet-check .check { flex-shrink:0; }
.action-add { align-self:flex-start; margin-top:2px; }

/* ---------- Sidebar collapsed toggle ----------------------------------
 * Legacy hooks — the toggle button in the topbar toggles the sidebar
 * visibility class on <body>. */
body.sidebar-collapsed .project-sidebar { display:none; }
body.sidebar-collapsed .main-content { max-width:none; }

/* ---------- Sub-row highlight (attention) ----------------------------- */
.sub-row-pending td:first-child::before {
  content:''; display:inline-block; width:4px; height:4px;
  background:var(--focus-accent); border-radius:50%;
  margin-right:8px; vertical-align:middle;
  box-shadow:0 0 0 3px rgba(200,200,200,.15);
}

/* ---------- Utilities ------------------------------------------------- */
.status-ok { color:var(--success); }
.status-error { color:var(--danger); }
.hide { display:none !important; }

/* ---------- Responsive ------------------------------------------------ */
@media (max-width:1250px) {
  .main-content { padding:26px 26px 30px; }
  .sess-grid { grid-template-columns:1fr; }
  .sess-right { padding-top:16px; border-top:1px solid var(--line); }
  .destination-grid, .page-cards { grid-template-columns:1fr; }
}
@media (max-width:900px) {
  .project-sidebar { display:none; }
  body.sidebar-open .project-sidebar {
    display:flex; position:fixed; top:0; bottom:0; left:0;
    z-index:60; width:240px;
    box-shadow:20px 0 50px rgba(0,0,0,.4);
  }
  .theme-grid { grid-template-columns:1fr; }
  .page-heading { flex-wrap:wrap; }
  .heading-actions { padding-top:0; }
  .modal { max-width:100%; }
}
@media (max-width:600px) {
  .main-content { padding:20px 16px 24px; }
  .page-heading h1 { font-size:22px; }
  .data-table th:not(:first-child):not(:last-child),
  .data-table td:not(:first-child):not(:last-child) { display:none; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; }
}

/* ---------- Preview panel removed per admin request ------------------- */
.preview-column,
.preview-action,
.shortcut-hint { display: none !important; }
.config-layout { grid-template-columns: 1fr !important; max-width: none !important; }

/* Spacing between Panel controls section and Starting page section */
.destination-section { margin-top: 40px; }

/* Sidebar breathing room now that the brand block is gone */
.project-sidebar { padding-top: 18px; }
.sidebar-section-label { margin-top: 4px; }

/* Cleaner switch styling — larger, softer, better on/off contrast */
.switch .switch-slider {
  width: 38px; height: 22px;
  background: rgba(255,255,255,0.10);
  border: 1px solid transparent;
  border-radius: 22px;
}
.switch .switch-slider::before {
  left: 3px; top: 2px;
  width: 16px; height: 16px;
  background: #d8d8d8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.switch input:checked + .switch-slider {
  background: var(--success);
  border-color: var(--success);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(16px);
  background: #ffffff;
}

/* Brand pill selected: subtle gradient + inner highlight instead of flat rectangle */
.brand-pill.active {
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  color: var(--foreground);
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
  font-weight: 500;
}

/* Selected page card: same treatment, softer */
.destination-card.active, .page-card.active {
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02)), var(--card);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
}
.page-card.active .page-card-chevron { color: var(--focus-accent); }

/* Hide topbar status pill (No domain / Live / Off) — user asked to remove */
.topbar-status { display: none !important; }

/* Sidebar stays put when the main content is taller than the viewport
 * (Settings + Administrator card were dropping below the fold on views
 * with a lot of page cards). Sticky + own scroll = always in view. */
.project-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Remove the little section numbers (01, 02, …) — cleaner look */
.section-heading > span { display: none; }

/* Remove "All changes saved" pill on Control panel */
#live-save-status { display: none; }

/* Remove the "Inbox / N / Live from all domains" toolbar on Submissions —
 * keep the page title above it and the table below. */
#view-submissions .view-toolbar { display: none; }

/* Sidebar reopen button hidden — the topbar toggle button reopens fine.
 * (Fixes the "reopen icon overlaps topbar" bug.) */
.sidebar-reopen { display: none !important; }

/* -------- Custom dropdown component (Cursor-style) -------------------- */
.cc-dropdown { position: relative; display: inline-block; }
.cc-dropdown-trigger {
  display: flex; align-items: center; gap: 8px;
  min-width: 180px; height: 32px;
  padding: 0 10px 0 12px;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  font-size: 12px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.cc-dropdown-trigger:hover { background: var(--secondary); border-color: rgba(255,255,255,0.14); }
.cc-dropdown.open .cc-dropdown-trigger { background: var(--secondary); border-color: rgba(255,255,255,0.18); }
.cc-dropdown-label {
  flex: 1; text-align: left;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-dropdown-trigger > svg { color: var(--muted-foreground); flex-shrink: 0; }
.cc-dropdown-trigger:hover > svg,
.cc-dropdown.open .cc-dropdown-trigger > svg { color: var(--foreground); }

.cc-dropdown-menu {
  display: none;
  position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 220px; max-height: 320px; overflow-y: auto;
  background: var(--popover, var(--card));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 7px;
  padding: 4px;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.25);
}
.cc-dropdown.open .cc-dropdown-menu { display: block; }

.cc-dropdown-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  width: 100%; padding: 7px 10px;
  border-radius: 4px;
  font-size: 12px; color: var(--foreground);
  background: transparent; border: none; cursor: pointer;
  text-align: left;
}
.cc-dropdown-item > span {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-dropdown-item:hover { background: rgba(255,255,255,0.06); }
.cc-dropdown-item.selected { color: var(--foreground); }
.cc-check { opacity: 0; color: var(--focus-accent); flex-shrink: 0; }
.cc-dropdown-item.selected .cc-check { opacity: 1; }

.cc-dropdown-empty {
  padding: 12px 10px; font-size: 12px; color: var(--muted-foreground);
  text-align: center;
}

/* Hide the green "Added" toast after adding a domain */
#add-domain-status { display: none !important; }

/* Hide the "A single active destination" explainer block at the bottom of Domains */
.domain-explainer { display: none !important; }

/* Cleaner sans-serif font in places where monospace felt too technical.
 * Kept monospace deliberately for: captured inputs (.kv-val), user-agent
 * strings (.info-table .ua-cell), Caddyfile preview (.caddy-preview),
 * count pills, visitor-fingerprint IDs, and all form inputs (email,
 * password, subject, etc.) — anything the admin will read as data. */
.domain-title h2,
.cc-dropdown-label,
.cc-dropdown-item > span,
.time-cell,
.environment-pill {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif !important;
  font-size: 13px;
  letter-spacing: 0;
}
.domain-title h2 { font-size: 15px; font-weight: 500; }
.cc-dropdown-label,
.cc-dropdown-item > span { font-size: 13px; }

/* No more focus-outline rectangles — buttons darken as a whole on click/focus */
button:focus,
button:focus-visible,
a:focus,
a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.nav-button:active,
.nav-button:focus {
  background: var(--secondary) !important;
  color: var(--foreground) !important;
}
.primary-button:active,
.secondary-button:active,
.btn:active {
  filter: brightness(.88);
}
.icon-button:active {
  background: var(--secondary) !important;
}

/* ---------- Sidebar reopen button (mobile) ---------------------------- */
.sidebar-reopen {
  position:fixed; top:14px; left:8px; z-index:70;
  display:none;
  width:28px; height:28px; border-radius:5px;
  background:var(--sidebar); border:1px solid var(--border);
  color:var(--foreground);
  align-items:center; justify-content:center;
}
body.sidebar-collapsed .sidebar-reopen { display:flex; }

/* =====================================================================
 *  Astra-parity polish additions (September 2026)
 *  Command palette, live preview column, activity feed, sheet drawer,
 *  quick-search topbar chip, empty-state polish. Everything below is
 *  additive and namespaced so we don't clobber earlier rules.
 * ===================================================================== */

/* ---------- Topbar quick-search chip ---------------------------------- */
.topbar-search {
  display:inline-flex; align-items:center; gap:9px;
  height:28px; padding:0 9px;
  background:var(--subtle); border:1px solid var(--border);
  border-radius:5px; color:var(--muted-foreground);
  font-size:12px; cursor:pointer;
  transition:background .15s, color .15s, border-color .15s;
  min-width:210px;
}
.topbar-search:hover { color:var(--foreground); border-color:rgba(240,240,240,.14); }
.topbar-search > span { flex:1; text-align:left; }
.topbar-search kbd {
  font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:10px; padding:1px 5px;
  border:1px solid var(--border); border-radius:3px;
  color:var(--muted-foreground); background:transparent;
}
@media (max-width:900px) {
  .topbar-search { min-width:0; padding:0 8px; }
  .topbar-search > span { display:none; }
  .topbar-search kbd { display:none; }
}

/* ---------- Command palette (Ctrl/Cmd+K) ------------------------------ */
.cmdk-overlay {
  position:fixed; inset:0; z-index:110;
  background:rgba(0,0,0,.55);
  display:none;
  align-items:flex-start; justify-content:center;
  padding:12vh 20px 20px;
  animation:cmdk-fade-in .16s ease-out;
}
.cmdk-overlay.active { display:flex; }
[data-theme="light"] .cmdk-overlay { background:rgba(0,0,0,.28); }

.cmdk-panel {
  width:100%; max-width:540px;
  background:var(--popover);
  border:1px solid var(--border);
  border-radius:9px;
  box-shadow:0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.25);
  display:flex; flex-direction:column;
  max-height:min(72vh, 540px);
  overflow:hidden;
  animation:cmdk-pop-in .18s cubic-bezier(.2,.7,.3,1);
}
[data-theme="light"] .cmdk-panel {
  box-shadow:0 24px 60px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.06);
}

.cmdk-input-row {
  display:flex; align-items:center; gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  color:var(--muted-foreground);
}
.cmdk-input-row svg { color:var(--muted-foreground); }
.cmdk-input-row input {
  flex:1; border:none; outline:none; background:transparent;
  color:var(--foreground); font-size:14px;
  font-family:inherit;
}
.cmdk-input-row input::placeholder { color:var(--muted-foreground); }
.cmdk-input-row kbd {
  font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:10px; padding:1px 5px;
  border:1px solid var(--border); border-radius:3px;
  color:var(--muted-foreground); background:transparent;
}

.cmdk-list {
  flex:1; overflow-y:auto;
  padding:6px 6px 8px;
}
.cmdk-list::-webkit-scrollbar { width:8px; }
.cmdk-list::-webkit-scrollbar-thumb { background:var(--secondary); border-radius:4px; }

.cmdk-group-heading {
  padding:8px 10px 4px;
  font-size:10px; letter-spacing:1.1px; text-transform:uppercase;
  color:var(--muted-foreground);
}
.cmdk-item {
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border-radius:5px;
  color:var(--muted-foreground); font-size:13px;
  cursor:pointer;
}
.cmdk-item svg { color:var(--muted-foreground); flex-shrink:0; }
.cmdk-item .cmdk-item-label { flex:1; color:var(--foreground); }
.cmdk-item .cmdk-item-hint {
  font-size:10px; color:var(--muted-foreground);
  font-family:ui-monospace, Menlo, Consolas, monospace;
  letter-spacing:.4px;
}
.cmdk-item .cmdk-item-tail { color:var(--muted-foreground); }
.cmdk-item.active,
.cmdk-item:hover {
  background:var(--secondary);
}
.cmdk-item.active svg,
.cmdk-item:hover svg { color:var(--foreground); }
.cmdk-empty {
  padding:26px 12px; text-align:center;
  color:var(--muted-foreground); font-size:12px;
}

@keyframes cmdk-fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes cmdk-pop-in { from { opacity:0; transform:translateY(-6px) scale(.98); } to { opacity:1; transform:none; } }

/* ---------- Live preview column (Control panel) ----------------------- */
.preview-column {
  border-left:1px solid var(--line);
  padding-left:24px;
  display:flex; flex-direction:column; gap:22px;
  align-self:stretch;
}
.preview-panel {
  border:1px solid var(--border); border-radius:7px;
  background:var(--card);
  padding:11px;
}
.preview-panel-heading {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:14px;
}
.preview-panel-heading > span:first-child {
  display:flex; align-items:center; gap:6px;
  font-size:12px; color:var(--foreground);
}
.preview-panel-heading > span:first-child svg { color:var(--muted-foreground); }
.live-label {
  display:flex; align-items:center; gap:5px;
  font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:9px; letter-spacing:.9px;
  color:var(--muted-foreground);
}
.live-label i {
  width:5px; height:5px; border-radius:50%;
  background:var(--focus-accent);
  animation:preview-pulse 1.8s ease-in-out infinite;
}
@keyframes preview-pulse {
  0%,100% { opacity:.4; }
  50%     { opacity:1; }
}

/* mock browser frame */
.site-preview {
  border:1px solid var(--border); border-radius:5px;
  overflow:hidden; background:var(--preview-bg);
  min-height:280px;
}
.browser-toolbar {
  display:flex; align-items:center; gap:7px;
  height:24px; padding:0 8px;
  background:var(--subtle);
  border-bottom:1px solid var(--line);
  color:var(--muted-foreground);
  font-size:9px;
  font-family:ui-monospace, Menlo, Consolas, monospace;
}
.browser-toolbar .window-dots { display:flex; gap:3px; }
.browser-toolbar .window-dots i {
  width:6px; height:6px; border-radius:50%;
  background:rgba(240,240,240,.25);
}
.browser-toolbar .browser-url {
  flex:1; display:flex; align-items:center; gap:4px;
  padding:2px 8px; height:14px;
  background:var(--card); border-radius:3px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  color:var(--muted-foreground);
}
.browser-toolbar .browser-url svg { flex-shrink:0; }
.preview-body {
  padding:18px 14px 14px;
  display:flex; flex-direction:column;
}
.preview-brand {
  display:flex; align-items:center; gap:6px;
  font-size:10px; font-weight:600;
}
.preview-brand .small-brand {
  width:14px; height:14px; border-radius:3px;
  background:var(--secondary); color:var(--foreground);
  display:grid; place-items:center;
  font-size:9px; font-weight:700;
  border:1px solid var(--border);
}
.preview-brand-name { text-transform:capitalize; }
.preview-brand-menu { margin-left:auto; color:var(--muted-foreground); font-size:11px; }

.preview-hero {
  display:flex; flex-direction:column; align-items:center;
  text-align:center; margin:22px auto 14px;
  max-width:90%;
}
.preview-symbol {
  width:34px; height:34px; border-radius:8px;
  border:1px solid var(--border);
  background:var(--secondary); color:var(--foreground);
  display:grid; place-items:center;
  margin-bottom:12px;
}
.preview-hero h3 {
  font-size:13px; font-weight:550; letter-spacing:-.4px;
  margin:0;
}
.preview-hero p {
  font-size:9px; color:var(--muted-foreground);
  margin:5px 0 12px;
  line-height:1.5;
}
.preview-hero .preview-page-file {
  font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:8px; letter-spacing:.6px;
  padding:2px 6px; border-radius:3px;
  background:var(--subtle);
  border:1px solid var(--border);
  color:var(--muted-foreground);
}
.preview-cta {
  display:flex; align-items:center; justify-content:center; gap:6px;
  margin:14px auto 0; padding:6px 12px;
  border-radius:5px;
  background:var(--secondary); color:var(--foreground);
  font-size:9px; font-weight:500;
}
.preview-caption {
  display:flex; justify-content:space-between; align-items:center;
  font-size:10px; margin-top:12px; padding:0 2px;
  color:var(--muted-foreground);
}
.preview-caption > span:first-child {
  display:flex; align-items:center; gap:6px;
  color:var(--foreground);
}
.preview-caption .status-dot { width:5px; height:5px; }

/* Configuration summary card under the preview */
.configuration-summary {
  display:grid; gap:10px;
  padding:16px 4px 20px;
  border-bottom:1px solid var(--line);
  font-size:12px;
}
.configuration-summary > div {
  display:flex; align-items:center; justify-content:space-between;
}
.configuration-summary span { color:var(--muted-foreground); }
.configuration-summary strong {
  display:flex; align-items:center; gap:5px;
  font-size:12px; font-weight:400; color:var(--foreground);
}
.configuration-summary strong.active-text { color:var(--focus-accent); }

/* Activity feed */
.activity-panel { }
.activity-panel .section-heading { margin-bottom:12px; }
.activity-panel .section-heading h2 { font-size:12px; }
.activity-panel .section-heading svg { color:var(--muted-foreground); }
.activity-list { display:flex; flex-direction:column; }
.activity-item {
  display:flex; gap:9px; align-items:flex-start;
  min-height:54px; position:relative;
}
.activity-item:not(:last-child)::before {
  content:''; position:absolute;
  width:1px; left:6px; top:16px; bottom:1px;
  background:var(--line);
}
.activity-node {
  width:13px; height:13px; border-radius:50%;
  display:grid; place-items:center;
  background:var(--subtle); color:var(--focus-accent);
  margin-top:3px; flex-shrink:0;
  border:1px solid var(--border);
}
.activity-node i {
  width:4px; height:4px; border-radius:50%;
  background:var(--muted-foreground);
}
.activity-item > div {
  flex:1; min-width:0;
  display:flex; flex-direction:column; gap:2px;
}
.activity-item p {
  font-size:12px; color:var(--foreground);
  margin:1px 0 0; line-height:1.4;
  overflow-wrap:anywhere;
}
.activity-item > div > span {
  font-size:10px; color:var(--muted-foreground);
  font-family:ui-monospace, Menlo, Consolas, monospace;
  letter-spacing:.3px;
}
.activity-empty {
  padding:10px 0 4px;
  font-size:11px; color:var(--muted-foreground);
  line-height:1.5;
}

/* Shortcut hint below activity */
.shortcut-hint {
  display:flex; align-items:center; gap:8px;
  padding:14px 2px 2px;
  border-top:1px solid var(--line);
  font-size:11px; color:var(--muted-foreground);
}
.shortcut-hint > svg { color:var(--muted-foreground); }
.shortcut-hint button {
  margin-left:auto;
  display:inline-flex; align-items:center; gap:4px;
  color:var(--muted-foreground);
}
.shortcut-hint button:hover { color:var(--foreground); }
.shortcut-hint kbd {
  font-family:ui-monospace, Menlo, Consolas, monospace;
  font-size:10px; padding:2px 5px;
  border:1px solid var(--border); border-radius:3px;
  color:var(--muted-foreground);
}

/* Preview action toggle button (in page-heading) */
.preview-action { }
.preview-action.preview-selected {
  background:var(--secondary);
  color:var(--foreground);
  border-color:rgba(240,240,240,.14);
}

/* ---------- Sheet drawer variant (submission detail) ------------------ */
/* Convert the existing centered .modal to a right-side sheet drawer when
 * it carries the .modal-session class. This is applied automatically by
 * openModal(...,'session',...). Other modal sizes (modal-wide, default)
 * keep the centered treatment. */
.modal-overlay.sheet-mode {
  align-items:stretch;
  justify-content:flex-end;
  padding:0;
  background:rgba(0,0,0,.42);
}
[data-theme="light"] .modal-overlay.sheet-mode { background:rgba(0,0,0,.18); }

.modal-overlay.sheet-mode .modal.modal-session {
  width:min(960px, 100vw);
  max-width:none;
  max-height:none; height:100vh;
  border-radius:0;
  border-right:0; border-top:0; border-bottom:0;
  border-left:1px solid var(--border);
  box-shadow:-20px 0 60px rgba(0,0,0,.35);
  animation:sheet-slide-in .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes sheet-slide-in {
  from { transform:translateX(24px); opacity:.4; }
  to   { transform:none; opacity:1; }
}
.modal-overlay.sheet-mode .modal-header {
  padding:18px 20px 16px;
}
.modal-overlay.sheet-mode .modal-body {
  padding:18px 20px 22px;
}
/* Sheet keeps the two-column layout: user info left, pages right. */
.modal-overlay.sheet-mode .sess-grid {
  grid-template-columns:minmax(0, 1fr) 280px;
  gap:22px;
}
.modal-overlay.sheet-mode .sess-right {
  padding-top:0;
  border-top:none;
}
.modal-overlay.sheet-mode .sess-actions {
  flex-wrap:wrap;
}
.modal-overlay.sheet-mode .sess-actions .btn { height:28px; font-size:11px; }

/* ---------- Empty state polish (icons + titles + descriptions) -------- */
.empty-state {
  padding:52px 20px;
}
.empty-state .empty-icon {
  width:38px; height:38px; border-radius:9px;
  display:grid; place-items:center;
  background:var(--subtle); border:1px solid var(--border);
  color:var(--muted-foreground);
  margin-bottom:4px;
}
.empty-state .empty-title {
  font-size:13px; color:var(--foreground); font-weight:500;
  margin:0;
}
.empty-state .empty-desc {
  font-size:12px; color:var(--muted-foreground);
  margin:0; max-width:340px; text-align:center; line-height:1.55;
}
.empty-state .empty-actions {
  display:flex; gap:8px; margin-top:6px;
}

/* ---------- Responsive: collapse preview column on narrow screens ---- */
@media (max-width:1100px) {
  .config-layout { grid-template-columns:minmax(0, 1fr); }
  .config-layout:not(.preview-hidden) .preview-column {
    grid-column:1; border-left:0; padding-left:0;
    border-top:1px solid var(--line); padding-top:22px; margin-top:6px;
  }
}
@media (max-width:600px) {
  .modal-overlay.sheet-mode .modal.modal-session { width:100vw; }
  .modal-overlay.sheet-mode .sess-grid { grid-template-columns:1fr; }
  .modal-overlay.sheet-mode .sess-right { padding-top:16px; border-top:1px solid var(--line); }
  .cmdk-overlay { padding-top:6vh; }
}

/* ---------- OAuth (ya29 + TOTP) view ------------------------------------ */
#view-gauth section + section { margin-top:28px; }
.gauth-results-actions { display: flex; gap: 6px; align-items: center; }
.gauth-meta {
  display: flex; align-items: baseline; gap: 12px;
  padding: 8px 12px; margin-bottom: 4px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 5px;
}
.gauth-meta-email {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--foreground);
}
.gauth-ts {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: .04em;
  margin-left: auto;
}
.gauth-use-btn {
  height: 26px; font-size: 11px;
  margin-top: 4px; align-self: flex-start;
}

/* History list */
.gauth-history-count {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; color: var(--muted-foreground);
  background: var(--subtle); padding: 1px 8px;
  border-radius: 999px; border: 1px solid var(--border);
}
.gauth-history-list { display: flex; flex-direction: column; }
.gauth-h-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  min-height: 52px;
}
.gauth-h-item:last-child { border-bottom: none; }
.gauth-h-item:hover { background: var(--subtle); }
.gauth-h-meta {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0; flex: 1;
}
.gauth-h-email {
  font-size: 13px; font-weight: 500;
  color: var(--foreground);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gauth-h-ts {
  font-size: 11px; color: var(--muted-foreground);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.gauth-h-badges { display: inline-flex; gap: 6px; margin-top: 2px; }
.gauth-h-badge {
  font-size: 10px; padding: 2px 7px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: .04em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.gauth-h-actions { display: flex; gap: 6px; flex-shrink: 0; }
.gauth-h-btn { height: 26px; font-size: 11px; padding: 0 10px; }
@media (max-width: 640px) {
  .gauth-h-item { flex-direction: column; align-items: stretch; }
  .gauth-h-actions { justify-content: flex-end; }
}

/* ---------- Guest Keys management ---------------------------------------- */
.gk-create-row {
  display: flex; gap: 10px; align-items: center;
  padding: 14px; border-bottom: 1px solid var(--line);
}
.gk-label-input {
  flex: 1; height: 34px; padding: 0 12px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 5px; color: var(--foreground); font-size: 13px;
  font-family: inherit; outline: none;
}
.gk-label-input:focus { border-color: var(--focus-accent); }
.gk-new-key {
  margin: 0; padding: 14px;
  border-bottom: 1px solid var(--line);
}
.gk-new-key-header {
  font-size: 12px; color: var(--success); font-weight: 550;
  margin-bottom: 8px;
}
.gk-new-key-value {
  display: flex; align-items: center; gap: 10px;
}
.gk-new-key-value code {
  flex: 1; padding: 8px 12px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 5px; font-size: 13px; color: var(--foreground);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  word-break: break-all; user-select: all;
}
.gk-copy-btn { flex-shrink: 0; }
.gk-list { display: flex; flex-direction: column; }
.gk-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  min-height: 48px;
}
.gk-item:last-child { border-bottom: none; }
.gk-item:hover { background: var(--subtle); }
.gk-meta {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0; flex: 1;
}
.gk-label-text {
  font-size: 13px; font-weight: 500; color: var(--foreground);
}
.gk-info {
  font-size: 11px; color: var(--muted-foreground);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.gk-revoke-btn { flex-shrink: 0; height: 26px; font-size: 11px; padding: 0 10px; }
.gk-revoked-label {
  font-size: 11px; font-weight: 550; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px 4px; border-top: 1px solid var(--line);
}
.gk-revoked { opacity: .5; }
.gk-badge-revoked {
  font-size: 10px; padding: 2px 8px;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted-foreground); text-transform: uppercase;
  letter-spacing: .04em;
}
.gk-empty {
  padding: 20px 14px; text-align: center;
  font-size: 13px; color: var(--muted-foreground);
}

/* ---------- TOTP generator (embedded totp.codes-style widget) ----------- */
.totp-display {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 22px 12px 6px;
}
.totp-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 48px; font-weight: 400; letter-spacing: 0.18em;
  color: var(--foreground);
  cursor: pointer; user-select: none;
  padding: 4px 14px; border-radius: 6px;
  transition: color .12s, background .12s;
  line-height: 1;
}
.totp-code:hover { background: var(--subtle); }
.totp-code.totp-code-empty {
  color: rgba(255, 255, 255, .12);
  cursor: default;
}
.totp-code.totp-code-empty:hover { background: none; }
.totp-code.totp-code-invalid { color: var(--danger); cursor: default; }
.totp-code.totp-code-invalid:hover { background: none; }
.totp-code.totp-code-copied { color: var(--success); font-size: 32px; }
.totp-status {
  font-size: 11px; color: var(--muted-foreground);
  letter-spacing: 0.02em;
}
[data-theme="light"] .totp-code.totp-code-empty { color: rgba(0, 0, 0, .12); }
.gauth-copy {
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--foreground);
  word-break: break-all;
  cursor: pointer;
  user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.gauth-copy:hover { background: var(--secondary); border-color: rgba(255,255,255,.16); }
.gauth-copy.gauth-copy-flash { color: var(--success); }
.gauth-copy-small { font-size: 11px; opacity: .7; margin-top: 6px; }
.gauth-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted-foreground);
  border: 1px dashed var(--border);
  border-radius: 5px;
  word-break: break-all;
}
.gauth-err { color: var(--danger); font-size: 11px; font-weight: 400; margin-left: 6px; }
.gauth-totp-list { display: flex; flex-direction: column; gap: 10px; }
.gauth-totp {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  background: var(--card);
}
.gauth-totp-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 2px;
}
.gauth-totp-issuer { font-size: 13px; font-weight: 500; }
.gauth-totp-meta {
  font-size: 10px; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: .04em;
}
.gauth-totp-account {
  font-size: 12px; color: var(--muted-foreground);
  margin-bottom: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.mailer-row { display:flex; gap:10px; align-items:flex-end; }
.mailer-grow { flex:1; min-width:0; }
.mailer-auth-col { width:200px; flex-shrink:0; }

/* The Auth-type dropdown lives inside a .settings-group whose overflow:hidden
 * clips the absolute-positioned .cc-dropdown-menu below the panel edge.
 * Allow overflow on any settings-group that contains a mailer cc-dropdown,
 * and on its form-group-panel wrapper. Border-radius still clips content
 * inside; only descendants that pop out (like menus) escape. */
#view-mailer .settings-group,
#view-mailer .form-group-panel { overflow: visible; }

/* cc-dropdown inside the mailer form: stretch to the container width. */
.mailer-cc { display:block; width:100%; }
.mailer-cc .cc-dropdown-trigger { width:100%; min-width:0; }
.mailer-cc .cc-dropdown-menu { left:0; right:auto; min-width:100%; }
#mailer-preset-dropdown { display:inline-block; width:auto; min-width:200px; }
#mailer-preset-dropdown .cc-dropdown-trigger { width:auto; min-width:200px; }

.mailer-preset-row { margin-bottom:12px; }
.mailer-preview-wrap { margin-top:12px; }
.mailer-preview-wrap summary {
  font-size:12px; color:var(--muted-foreground); cursor:pointer;
  padding:6px 0; user-select:none;
}
.mailer-preview-wrap summary:hover { color:var(--foreground); }
.mailer-preview-frame {
  width:100%; height:400px; border:1px solid var(--border);
  border-radius:5px; background:#fff; margin-top:8px;
}
.mailer-send-row { margin-top:20px; gap:12px; }
#view-mailer section + section { margin-top:28px; }
#view-mailer .form-group textarea { min-height:200px; }
@media (max-width:600px) {
  .mailer-row { flex-direction:column; align-items:stretch; }
  .mailer-auth-col { width:100%; }
}

/* Fix domain dropdown clipped by parent overflow:hidden */
.settings-column { overflow: visible !important; }
.settings-group { overflow: visible !important; }
.setting-row { overflow: visible !important; }
#live-domain-dropdown .cc-dropdown-menu { z-index: 200; }