/* Inbox Triage UI
   Single stylesheet, no build step. Light, warm-stone theme with one ink
   primary, one link blue, and semantic colors reserved for status.
   Status colors are deliberate and must stay legible at a glance:
     purple = demo data, green = connected / real credential,
     amber  = blocked / waiting on a human, red = error / destructive. */

:root {
  --bg: #f9f8f6;
  --surface: #ffffff;
  --surface-2: #f3f1ed;
  --surface-3: #ebe8e3;
  --border: #e6e3dd;
  --border-strong: #d4d0c8;
  --text: #1a1917;
  --text-2: #45423e;
  --text-muted: #77726b;
  --ink: #1a1917;
  --ink-hover: #2e2c29;
  --brand: #35578a;
  --brand-dark: #27426a;
  --brand-light: #eef2f8;
  --brand-border: #c9d6e8;
  --accent: #ee6c4d;
  --success: #1f7a45;
  --success-bg: #e8f5ec;
  --success-border: #bfe3cb;
  --warn: #9a5b00;
  --warn-bg: #fdf3e1;
  --warn-border: #f0d9a8;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --danger-border: #f3c5c1;
  --demo: #6941c6;
  --demo-bg: #f1ebfd;
  --demo-border: #d9c9f6;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(26, 25, 23, 0.04), 0 1px 1px rgba(26, 25, 23, 0.03);
  --shadow-md: 0 1px 2px rgba(26, 25, 23, 0.05), 0 8px 24px -8px rgba(26, 25, 23, 0.12);
  --ring: 0 0 0 3px rgba(53, 87, 138, 0.22);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Typography ---- */

h1, h2, h3, h4 { color: var(--text); margin: 0 0 0.5em; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: 2.1rem; letter-spacing: -0.03em; }
h2 { font-size: 1.4rem; margin-top: 0; }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
h4 { font-size: 0.9rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 600; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

code, pre, .mono { font-family: var(--mono); }

pre {
  background: var(--ink);
  color: #f2efe9;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 1em 0;
}

code:not(pre code) {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.86em;
  color: var(--text-2);
}

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* ---- Shell ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(249, 248, 246, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap,
.site-header .header-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.header-bar { position: relative; }
.header-end {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.015em;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .dot {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  background: var(--ink);
  background-image: radial-gradient(circle at 50% 50%, var(--accent) 0 4px, transparent 4.5px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: nowrap;
  margin-left: auto;
}
nav.main-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: color 120ms ease, background-color 120ms ease;
}
nav.main-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
nav.main-nav a.active { color: var(--text); background: var(--surface-3); }
.header-cta { white-space: nowrap; }
.header-end .btn-primary, .header-end .btn-primary:hover { color: #fff; background: var(--ink); }
.header-end .btn-primary:hover { background: var(--ink-hover); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  flex: none;
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
  transition: transform 140ms ease, opacity 140ms ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: color 120ms ease, background-color 120ms ease;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: " ▾"; font-size: 0.75em; }
.nav-dropdown summary:hover { color: var(--text); background: var(--surface-2); }
.nav-dropdown[open] summary { color: var(--text); background: var(--surface-3); }
.nav-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  z-index: 20;
}
.nav-dropdown .dropdown-menu a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.87rem;
  color: var(--text-2);
  font-weight: 500;
}
.nav-dropdown .dropdown-menu a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
main.wrap { min-height: 60vh; padding-bottom: 2rem; }
.narrow { max-width: 780px; }

section { padding: 2.5rem 0; }
section.tight { padding: 1.25rem 0; }
section + section { border-top: 0; }

/* ---- Table of contents (long docs pages) ---- */
.toc {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem;
  padding: 0.9rem 1.1rem; margin: 0.5rem 0 1.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.toc a {
  font-size: 0.85rem; font-weight: 500; color: var(--text-2); text-decoration: none;
  padding: 0.25rem 0.55rem; border-radius: 999px; background: var(--surface-2);
}
.toc a:hover { background: var(--brand-light); color: var(--brand-dark); text-decoration: none; }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.55rem 1.05rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--ink-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(0.94); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--text-muted); background: var(--surface); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger-border); }
.btn-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.btn-warn:hover { filter: brightness(0.97); }
.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.82rem; border-radius: 7px; }
.btn-block { width: 100%; }
form.inline { display: inline; margin: 0; }

/* ---- Page heads ---- */

.page-head { padding: 2.25rem 0 1.25rem; }
.page-head h1 { margin-bottom: 0.4rem; }
.page-head .lede, .page-head p { color: var(--text-muted); font-size: 1.05rem; max-width: 42em; margin: 0; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.page-head-row > * { min-width: 0; }
.page-head.compact { padding-top: 1.5rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 0.9rem;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.backlink { display: inline-flex; align-items: center; gap: 0.35em; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; margin-bottom: 0.9rem; }
.backlink:hover { color: var(--text); text-decoration: none; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.section-head p { color: var(--text-muted); font-size: 0.92rem; margin: 0.25rem 0 0; max-width: 48em; }
.section-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---- Hero (home) ---- */

.hero { position: relative; text-align: center; padding: 4.5rem 0 2.5rem; }
.hero::before {
  content: ""; position: absolute; inset: -2rem 0 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(53, 87, 138, 0.10), transparent 70%),
    radial-gradient(35% 40% at 80% 20%, rgba(238, 108, 77, 0.07), transparent 70%);
}
.hero h1 { font-size: 3.1rem; line-height: 1.05; margin: 0 auto 1rem; max-width: 14em; letter-spacing: -0.035em; }
.hero p.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 44em; margin: 0 auto 1.8rem; }
.hero .cta-row { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
.hero .cta-row .btn { padding: 0.7rem 1.3rem; font-size: 0.95rem; }
.hero-note { margin: 1.4rem auto 0; font-size: 0.85rem; color: var(--text-muted); max-width: 44em; }
.hero-note a { color: var(--text-2); font-weight: 500; }

.provider-strip {
  display: flex; justify-content: center; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin: 2.2rem auto 0; font-size: 0.82rem; color: var(--text-muted);
}
.provider-strip .label { margin-right: 0.4rem; }

.chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.28em 0.7em; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
/* Provider labels come from PROVIDER_LABEL (e.g. iCloud) — do not capitalize. */
.chip-provider { text-transform: none; }

.folder-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.9rem 0; }
.folder-tab { text-decoration: none; cursor: pointer; }
.folder-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.folder-chip { font-size: 0.72rem; padding: 0.18em 0.55em; }

/* Agent transcript panel on the home page */
.agent-panel {
  margin: 2.5rem auto 0; max-width: 680px; text-align: left;
  background: var(--ink); color: #e9e5de; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(26,25,23,0.9);
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.7; overflow: hidden;
}
.agent-panel .bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.9rem; background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.08); font-family: var(--sans); font-size: 0.75rem; color: rgba(255,255,255,0.55); }
.agent-panel .bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.14); display: inline-block; }
.agent-panel .bar span { margin-left: 0.4rem; }
.agent-panel .lines { padding: 0.9rem 1.1rem 1rem; }
.agent-panel .call { color: #fff; }
.agent-panel .call::before { content: "› "; color: var(--accent); }
.agent-panel .ok { color: #9dd7b2; padding-left: 1.1em; }
.agent-panel .ok::before { content: "✓ "; }
.agent-panel .demo-tag { color: #c9b4f5; }
.agent-panel .conn-tag { color: #9dd7b2; }

/* ---- Cards / grid ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 0.4rem; }
.card p.muted { font-size: 0.93rem; }
.card ul { margin: 0; padding-left: 1.1em; }
.card ul li { color: var(--text-2); font-size: 0.93rem; }

.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.feature-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.feature-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Pricing ---- */

.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; align-items: stretch; margin-top: 1rem; }
.plan-card { display: flex; flex-direction: column; position: relative; padding: 1.6rem 1.5rem 1.5rem; }
.plan-card.featured { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow-md); }
.plan-badge {
  position: absolute; top: -0.7rem; left: 1.4rem;
  background: var(--ink); color: #fff; font-size: 0.68rem; font-weight: 700;
  padding: 0.25em 0.7em; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em;
}
.plan-name { font-weight: 650; font-size: 1rem; margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.plan-price { font-size: 2.4rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1; margin: 0.1rem 0 0.35rem; display: flex; align-items: baseline; gap: 0.3rem; }
.plan-price span { font-size: 0.9rem; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
.plan-note { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 1.5rem; flex: 1; }
.plan-card li { position: relative; padding: 0.3rem 0 0.3rem 1.5rem; font-size: 0.9rem; color: var(--text-2); margin: 0; }
.plan-card li::before {
  content: ""; position: absolute; left: 0; top: 0.62rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--success-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f7a45' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 9px no-repeat;
}
.plan-card li.soft { color: var(--text-muted); }
.plan-card li.soft::before { background-color: var(--surface-2); background-image: none; }
.plan-card form, .plan-card .btn { margin-top: auto; }
.plan-card .btn { width: 100%; }
.plan-ladder { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1.4rem; }
.plan-ladder span {
  font-size: 0.78rem; padding: 0.22em 0.6em; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap;
}
.plan-ladder span strong { color: var(--text); font-weight: 650; margin-right: 0.2em; }

/* Add-on strip below the plan cards: name/price | includes | CTA */
.addon-card {
  display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 1.75rem; align-items: center;
  margin-top: 1.25rem; padding: 1.4rem 1.5rem;
}
.addon-card .plan-name { margin-bottom: 0.3rem; }
.addon-card .plan-price { font-size: 1.7rem; margin: 0 0 0.5rem; }
.addon-card ul { list-style: none; margin: 0; padding: 0; }
.addon-card li { position: relative; padding: 0.3rem 0 0.3rem 1.5rem; font-size: 0.9rem; color: var(--text-2); }
.addon-card li::before {
  content: ""; position: absolute; left: 0; top: 0.62rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--success-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f7a45' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 9px no-repeat;
}
.addon-cta { min-width: 11rem; text-align: right; }
.addon-cta .btn { width: 100%; }

/* Collapsible secondary form section (no JS) */
.form-details { margin: 0.25rem 0 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 0.7rem 0.9rem; }
.form-details summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.form-details summary::-webkit-details-marker { display: none; }
.form-details summary::before { content: "\25B8"; font-size: 0.8em; color: var(--text-muted); }
.form-details[open] summary::before { content: "\25BE"; }
.form-details .field-hint { margin-top: 0.5rem; }
td.actions .action-row { flex-wrap: nowrap; }

/* ---- Badges / status ---- */

.badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.18em 0.6em 0.18em 0.5em; border-radius: 999px;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.01em; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap; vertical-align: middle;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-demo { background: var(--demo-bg); color: var(--demo); border-color: var(--demo-border); }
.badge-connected { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-blocked { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-pending { background: var(--surface-2); color: var(--text-muted); border-color: var(--border-strong); }
.badge-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.badge-syncing::before { content: none; }

/* ---- Sync-in-progress spinner (Sync now button + syncing badge) ---- */
.spinner {
  display: inline-block; width: 0.85em; height: 0.85em; vertical-align: -0.15em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite; flex: none;
}
button[disabled] .spinner, .badge-syncing .spinner { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.6s; }
}

.callout {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
}
.callout strong { font-weight: 650; }
.callout a { font-weight: 500; }
.callout-demo { background: var(--demo-bg); border-color: var(--demo-border); color: #3f2a78; }
.callout-demo a { color: var(--demo); }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-border); color: #5e3a00; }
.callout-info { background: var(--brand-light); border-color: var(--brand-border); color: var(--brand-dark); }
.callout-success { background: var(--success-bg); border-color: var(--success-border); color: #14502d; }
.callout-error { background: var(--danger-bg); border-color: var(--danger-border); color: #7a1a12; }
.callout-error a { color: var(--danger); }

.faq-list { display: flex; flex-direction: column; gap: 0.6rem; }
.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0;
}
.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--text-muted); font-weight: 400; font-size: 1.15rem; flex: none; }
.faq-list details[open] summary::after { content: "\2013"; }
.faq-list details p { margin: 0 1.1rem 1rem; color: var(--text-2); font-size: 0.93rem; }
section.callout { padding: 0.9rem 1.1rem; margin: 1.5rem 0; }

/* ---- Tables ---- */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
thead th, tr:first-child th { background: var(--surface-2); border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fcfbfa; }
td.actions { white-space: nowrap; vertical-align: middle; }
/* Inbox rows: center status and name on the same line as the action buttons. */
.inbox-table td { vertical-align: middle; }
td.num { font-variant-numeric: tabular-nums; }
.table-wrap .empty td { color: var(--text-muted); text-align: center; padding: 2rem 1rem; }
/* Connect/Repair, View messages, Sync now, Disconnect: one consistent row —
   same button size (.btn-sm on every action), no stretching, wraps on
   narrow/mobile (card-stack) instead of clipping off-screen. */
.action-row { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.action-row form { margin: 0; }
.action-row .btn { flex: 0 0 auto; }
.truncate { display: block; max-width: 34em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Content-page tables (Security, docs) — same treatment without a wrapper */
section > table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
section > table td:first-child { font-weight: 600; white-space: nowrap; }

/* ---- Message list ---- */

.msg-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.msg-list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted); font-weight: 500;
}
.msg-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background-color 100ms ease;
}
.msg-item:last-child { border-bottom: none; }
.msg-item:hover { background: #fcfbfa; text-decoration: none; }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin: 0 auto; }
.msg-item.unread .msg-dot { background: var(--brand); }
.msg-main { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.msg-subject { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.msg-item.unread .msg-subject { font-weight: 650; }
.msg-from { font-size: 0.84rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item.unread .msg-from { color: var(--text-2); }
.msg-side { display: flex; align-items: center; gap: 0.7rem; font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.msg-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.92rem; }

.msg-toolbar { margin: 0.75rem 0 0.6rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.msg-search {
  width: 100%; max-width: 28rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 0.92rem;
}
.msg-search:focus { outline: 2px solid var(--brand-border); outline-offset: 1px; border-color: var(--brand); }
.msg-search-hint { white-space: nowrap; }
.msg-list-syncing { opacity: 0.72; }

.sync-progress {
  display: flex; align-items: flex-start; gap: 0.85rem;
  margin: 0.85rem 0 1rem;
}
.sync-progress .spinner { width: 1.1em; height: 1.1em; margin-top: 0.15rem; flex: none; }
.sync-progress p { margin: 0.25rem 0 0; }


/* ---- Message detail ---- */

.message { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 1.5rem; }
.message-head { padding: 1.5rem 1.75rem 1.25rem; border-bottom: 1px solid var(--border); }
.message-head h1 { font-size: 1.5rem; margin: 0 0 0.9rem; letter-spacing: -0.025em; }
.message-head .title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.message-meta { display: flex; align-items: center; gap: 0.8rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--brand-light); color: var(--brand); border: 1px solid var(--brand-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 0.9rem; text-transform: uppercase;
}
.message-meta .who { min-width: 0; font-size: 0.9rem; line-height: 1.4; }
.message-meta .who .from { font-weight: 600; color: var(--text); }
.message-meta .who .to { color: var(--text-muted); font-size: 0.84rem; overflow-wrap: anywhere; }
.message-meta time { margin-left: auto; font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; align-self: flex-start; }
.message-body {
  padding: 1.5rem 1.75rem 1.75rem;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 72ch;
}
.message-body-text { white-space: pre-wrap; }
.message-body-html { max-width: none; padding-bottom: 1rem; }
.message-html-frame {
  display: block; width: 100%; min-height: 16rem; height: 28rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff;
}
.message-text-fallback { margin: 0.6rem 1.75rem 0; }
.message-text-fallback summary { cursor: pointer; font-size: 0.85rem; color: var(--text-muted); }
.message-text-fallback .message-body-text { padding: 0.75rem 0; }

.attachment-list {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 0 1.75rem 1.5rem;
}
.attachment-chip { background: var(--surface-2); }
.attachment-icon { font-size: 0.9em; }
.attachment-name { font-weight: 500; color: var(--text); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { font-size: 0.85em; }
.msg-attachment-count { display: inline-flex; align-items: center; gap: 0.25em; }

.draft-panel { margin-top: 1.5rem; }
.draft-panel .section-head { margin-bottom: 0.25rem; }
.draft-note { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }

/* ---- Forms ---- */

form.stacked label, .field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-2); margin: 0 0 0.35rem; }
form.stacked > label { margin-top: 1rem; }
form.stacked input[type=text],
form.stacked input[type=email],
form.stacked input[type=password],
form.stacked input[type=number],
form.stacked textarea,
form.stacked select,
.input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 0.93rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
form.stacked input::placeholder, form.stacked textarea::placeholder { color: #a39e96; }
form.stacked input:focus, form.stacked textarea:focus, form.stacked select:focus, .input:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--ring);
}
form.stacked textarea { min-height: 9rem; resize: vertical; line-height: 1.55; }
.field-hint { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.4rem; line-height: 1.5; }
.form-actions { margin-top: 1.25rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.1rem; }
.form-grid .field { margin: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { margin-bottom: 0.9rem; }
.inline-form { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.inline-form .field { flex: 1 1 18rem; margin: 0; }
.inline-form .btn { flex: none; }

/* ---- Triage preferences (defaults editor / per-inbox override / setup wizard) ---- */
.triage-section { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.triage-section:first-of-type { border-top: none; padding-top: 0; }
.triage-section h3 { margin: 0 0 0.3rem; }
.check-list, .radio-row { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0 0.9rem; }
.check-list label, .radio-row label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; font-size: 0.92rem; color: var(--text); }
.inherit-toggle { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted); margin: 0.3rem 0 0.8rem; font-weight: 500; }
.setup-steps .triage-section { border-top: none; padding: 0; }

.key-reveal {
  background: var(--ink); color: #f2efe9; padding: 0.9rem 1.1rem; border-radius: var(--radius);
  font-family: var(--mono); font-size: 0.9rem; word-break: break-all; margin: 0.8rem 0; user-select: all;
}

/* ---- Key/value ---- */

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.5rem; font-size: 0.92rem; margin: 0 0 1.1rem; }
.kv dt { color: var(--text-muted); font-weight: 500; margin: 0; }
.kv dd { margin: 0; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ---- Steps ---- */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.35rem 0 1rem 2.6rem;
  margin: 0;
  color: var(--text-2);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 0.85rem; top: 2.3rem; bottom: 0.2rem; width: 1px; background: var(--border); }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.3rem;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 0.78rem; font-weight: 650; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}
.steps li strong { color: var(--text); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }

/* ---- Footer ---- */

.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 2.5rem 0 3rem; color: var(--text-muted); font-size: 0.88rem; background: var(--surface); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.footer-cols { display: flex; gap: 3.5rem; flex-wrap: wrap; }
.footer-cols h4 { margin: 0 0 0.7rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: 0.45rem; }

/* ---- Utilities ---- */

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 1rem; }
.danger-text { color: var(--danger); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 30rem; margin-left: auto; margin-right: auto; }
  .plan-card.featured { order: -1; }
  .addon-card { grid-template-columns: 1fr; gap: 1rem; max-width: 30rem; margin-left: auto; margin-right: auto; }
  .addon-cta { text-align: left; }
}

@media (max-width: 800px) {
  .site-header .wrap,
  .site-header .header-bar {
    flex-wrap: nowrap;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    min-height: var(--header-h);
  }
  .nav-toggle { display: inline-flex; }
  .header-end { margin-left: auto; }
  nav.main-nav {
    display: none;
    margin-left: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.75rem 1rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 40;
  }
  nav.main-nav.is-open { display: flex; }
  nav.main-nav > a,
  nav.main-nav > .nav-dropdown {
    width: 100%;
  }
  nav.main-nav > a {
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    border-radius: 8px;
  }
  .nav-dropdown { display: block; }
  .nav-dropdown summary {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
  }
  .nav-dropdown .dropdown-menu {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 0.15rem;
    box-shadow: none;
    border: 1px solid var(--border);
    background: var(--surface-2);
  }
  .nav-dropdown .dropdown-menu a {
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
  }
  body.nav-open { overflow: hidden; }
  .wrap { padding: 0 1rem; }
  .hero { padding-top: 3rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero p.lede { font-size: 1.02rem; }
  .grid-3, .grid-2, .two-col, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .msg-side time { display: none; }
  .message-head, .message-body { padding-left: 1.1rem; padding-right: 1.1rem; }
  .message-meta time { display: none; }
  .truncate { max-width: 18em; }

  /* Card-stack tables (account inboxes/API keys) — one card per row instead of horizontal scroll */
  .table-wrap.card-stack { overflow-x: visible; }
  .table-wrap.card-stack table, .table-wrap.card-stack tbody, .table-wrap.card-stack tr, .table-wrap.card-stack td { display: block; width: 100%; }
  .table-wrap.card-stack thead { display: none; }
  .table-wrap.card-stack tr { padding: 0.9rem; border-bottom: 1px solid var(--border); }
  .table-wrap.card-stack tr:last-child { border-bottom: none; }
  .table-wrap.card-stack td { padding: 0.3rem 0; border-bottom: none; }
  .table-wrap.card-stack td::before {
    content: attr(data-label);
    display: block; margin-bottom: 0.2rem;
    color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .table-wrap.card-stack tr.empty td { text-align: center; padding: 2rem 1rem; }
  .table-wrap.card-stack tr.empty td::before { content: none; }
  /* Inbox/API action buttons: wrap on narrow cards (Disconnect was clipping off-screen) */
  .table-wrap.card-stack td.actions { white-space: normal; }
  .table-wrap.card-stack td.actions .action-row {
    flex-wrap: wrap;
    row-gap: 0.4rem;
    max-width: 100%;
  }
  .table-wrap.card-stack td.actions .action-row .btn {
    flex: 0 1 auto;
  }
}

@media (max-width: 560px) {
  h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 1.9rem; }
  .agent-panel { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}


/* Inbox detail heading + inline rename form */
.inbox-title-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; min-width: 0; }
.rename-form { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; min-width: 0; }
.rename-form input[type="text"] {
  flex: 1 1 10rem; min-width: 0; max-width: 14rem;
  padding: 0.3rem 0.55rem; border: 1px solid var(--border-strong); border-radius: 6px;
  font-size: 0.85rem; font-family: inherit;
}

/* Account inbox name → messages */
a.inbox-name-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}
a.inbox-name-link:hover strong {
  text-decoration: underline;
}
a.inbox-name-link:hover .muted {
  color: var(--text, #334);
}

/* Add to my agent / Claude setup */
.claude-setup-card {
  border: 1px solid color-mix(in srgb, var(--accent, #5b5bd6) 35%, transparent);
  background: color-mix(in srgb, var(--accent, #5b5bd6) 6%, var(--card, #fff));
}
.claude-steps {
  margin: 0.75rem 0 1rem;
}
.claude-copy-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .claude-copy-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.claude-copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.claude-copy-head label {
  margin: 0;
  font-weight: 600;
}
.claude-copy-box {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border, #ddd);
  background: var(--bg, #fafafa);
  color: inherit;
  resize: vertical;
  white-space: pre;
}

/* ---- App IA: activity + settings advanced ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.activity-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.activity-search input[type="search"] {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.activity-event {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.activity-event > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(9.5rem, 12rem) minmax(8rem, 14rem) 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.85rem 1rem;
}
.activity-event > summary::-webkit-details-marker { display: none; }
.activity-event > summary::after {
  content: "▸";
  color: var(--text-muted);
  font-size: 0.8rem;
  justify-self: end;
  align-self: center;
}
.activity-event[open] > summary::after { content: "▾"; }
.activity-event > summary:hover { background: var(--surface-2); }
.activity-when time { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.activity-type { font-weight: 600; font-size: 0.92rem; }
.activity-summary { min-width: 0; }
.activity-panel {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.audit-detail-grid {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0;
}
.audit-kv { display: contents; }
.audit-detail-grid dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0.15rem;
}
.audit-detail-grid dd {
  margin: 0;
  word-break: break-word;
}
.advanced-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0;
}
.advanced-block > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.1rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.advanced-block > summary::-webkit-details-marker { display: none; }
.advanced-block > summary::before {
  content: "▸";
  color: var(--text-muted);
  font-size: 0.85em;
}
.advanced-block[open] > summary::before { content: "▾"; }
.advanced-block > summary:hover { background: var(--surface-2); }
.advanced-body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--border);
}
.advanced-body > section.tight { padding-top: 1rem; padding-bottom: 0; }
@media (max-width: 800px) {
  .activity-event > summary {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .activity-event > summary::after {
    position: absolute;
    right: 1rem;
    top: 1rem;
  }
  .activity-event { position: relative; }
}

/* ---- Sign in and sign up (src/web/views/auth.js) ---- */
.auth-body { background: var(--bg); margin: 0; }
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 3.5rem 1rem 2rem; box-sizing: border-box; }
.auth-logo { width: 52px; height: 52px; display: block; margin: 0 auto 1rem; }
.auth-title { font-size: 1.75rem; font-weight: 650; text-align: center; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.auth-sub { text-align: center; color: var(--text-muted); margin: 0 0 1.5rem; font-size: 0.95rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; box-sizing: border-box; }
.auth-card label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0 0 0.4rem; }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text] { width: 100%; box-sizing: border-box; padding: 0.7rem 0.85rem; border: 1px solid var(--border-strong); border-radius: 10px; font: inherit; font-size: 0.97rem; margin: 0 0 1rem; background: #fff; }
.auth-card form { margin: 0; }
.auth-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0.75rem 1rem; border-radius: 10px; font: inherit; font-weight: 600; font-size: 0.97rem; cursor: pointer; text-decoration: none; box-sizing: border-box; line-height: 1.2; }
.auth-btn:hover { text-decoration: none; }
.auth-btn-primary { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.auth-btn-primary:hover { background: var(--ink-hover); }
.auth-btn-google { background: #ffffff; color: #1f1f1f; border: 1px solid #747775; font-weight: 500; }
.auth-btn-google:hover { background: #f8f9fa; }
.auth-btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border-strong); }
.auth-btn + .auth-btn, form + .auth-btn, .auth-btn + form { margin-top: 0.6rem; }
.auth-divider { display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted); font-size: 0.8rem; margin: 1.25rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-switch { text-align: center; margin: 1.25rem 0 0; font-size: 0.92rem; color: var(--text-muted); }
.auth-switch a { color: var(--text); font-weight: 600; }
.auth-email-chip { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; background: var(--surface-2, #f4f2ee); border-radius: 10px; padding: 0.6rem 0.85rem; margin: 0 0 1rem; font-size: 0.92rem; overflow-wrap: anywhere; }
.auth-email-chip a { font-size: 0.85rem; flex-shrink: 0; }
.auth-row { display: flex; justify-content: flex-end; margin: -0.5rem 0 1rem; font-size: 0.85rem; }
.auth-row-center { justify-content: center; margin: 1rem 0 0; }
.auth-check { display: flex !important; gap: 0.6rem; align-items: flex-start; font-weight: 400 !important; font-size: 0.88rem !important; color: var(--text-muted); margin: 0 0 1.1rem !important; }
.auth-check input { margin-top: 0.2rem; }
.auth-text { color: var(--text-muted); font-size: 0.93rem; margin: 0 0 1.1rem; }
.auth-note { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin: 1rem 0 0; }
.auth-error { background: var(--danger-bg); color: var(--danger); border-radius: 10px; padding: 0.65rem 0.85rem; margin: 0 0 1rem; font-size: 0.9rem; }
.auth-notice { background: var(--brand-light); color: var(--brand-dark); border-radius: 10px; padding: 0.65rem 0.85rem; margin: 0 0 1rem; font-size: 0.9rem; }
.auth-welcome h2 { font-size: 1.15rem; margin: 0 0 0.4rem; overflow-wrap: anywhere; }
.auth-footer { margin-top: auto; padding-top: 2.5rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-footer a { color: var(--text-muted); }
@media (max-width: 480px) { .auth-page { padding-top: 2rem; } .auth-card { padding: 1.5rem; } }

/* Square icon-only button (the inbox row's refresh control). */
.icon-btn { padding: 0.32rem 0.45rem; line-height: 1; }
.icon-btn svg { display: block; }
.inbox-sub { margin-top: 0.15rem; }
.inbox-state { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* "Where does your agent run" picker on the Connect card. */
.agent-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0.9rem; }
.agent-picker .btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.agent-panel .steps { margin-top: 0; }

/* One row of buttons along a card's bottom edge: the same place on every card. */
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.card-actions form { margin: 0; }
.card-actions .btn { flex: 0 0 auto; }

/* VIP tag on a message row: someone the agent must check with you about. */
.chip-vip { border-color: var(--accent); color: var(--accent); font-weight: 600; }
