/* =====================================================================
   Xcojo Connect — Design System
   Clean Apple/macOS-inspired, translucent and teal-accented. EB Garamond for authority, a plain
   system sans for interface text (the way Apple pairs a display serif
   with San Francisco for controls). Every color is a CSS variable so
   Settings → Appearance can rewrite it live, per user, from SQL.
   ===================================================================== */

:root {
  /* ---- Brand base palette (light) -------------------------------- */
  --xco-porcelain:      #F5F7F8;   /* page background */
  --xco-porcelain-dim:  #E8EEF0;   /* secondary surface */
  --xco-ink:            #15191B;   /* primary text */
  --xco-ink-soft:       #5C676B;   /* secondary text */
  --xco-line:           #D7E0E3;   /* hairlines */
  --xco-accent:         #0F8B8D;   /* brass — user-customizable */
  --xco-accent-ink:     #FFFFFF;   /* text drawn on accent fills */
  --xco-success:        #16856B;
  --xco-warning:        #B56B00;
  --xco-danger:         #C43D4B;

  /* ---- Glass surfaces ---------------------------------------------- */
  --xco-glass-bg:      rgba(255, 255, 255, 0.72);
  --xco-glass-border:  rgba(255, 255, 255, 0.78);
  --xco-glass-blur:    20px;
  --xco-shadow:        0 18px 50px -28px rgba(20, 39, 43, 0.28);

  /* ---- Radii / spacing (Appearance → corner_radius rewrites these) - */
  --xco-radius-sm: 10px;
  --xco-radius-md: 18px;
  --xco-radius-lg: 28px;

  /* ---- Type ---------------------------------------------------------*/
  --xco-font-display: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
  --xco-font-accent:  'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --xco-font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --xco-text-scale: 1;   /* Accessibility → text_size rewrites this */
  --xco-motion: 1;        /* 0 when reduce_motion is on */
}

/* ---- Dark mode: explicit user choice or OS preference under "auto" - */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --xco-porcelain:     #111516;
    --xco-porcelain-dim: #1A2224;
    --xco-ink:           #F3EEE3;
    --xco-ink-soft:      #B5AA95;
    --xco-line:          #322C21;
    --xco-glass-bg:      rgba(24, 31, 33, 0.72);
    --xco-glass-border:  rgba(255, 255, 255, 0.08);
    --xco-shadow:        0 20px 60px -24px rgba(0, 0, 0, 0.65);
  }
}
:root[data-theme="dark"] {
  --xco-porcelain:     #111516;
  --xco-porcelain-dim: #1A2224;
  --xco-ink:           #F3EEE3;
  --xco-ink-soft:      #B5AA95;
  --xco-line:          #322C21;
  --xco-glass-bg:      rgba(24, 31, 33, 0.72);
  --xco-glass-border:  rgba(255, 255, 255, 0.08);
  --xco-shadow:        0 20px 60px -24px rgba(0, 0, 0, 0.65);
}

/* ---- Accessibility overrides (applied via <body> classes) ---------- */
body.xco-high-contrast {
  --xco-ink-soft: var(--xco-ink);
  --xco-line: currentColor;
  --xco-glass-bg: var(--xco-porcelain);
}
body.xco-reduce-transparency { --xco-glass-bg: var(--xco-porcelain-dim); }
body.xco-reduce-transparency .xco-glass { backdrop-filter: none; }
body.xco-bold-text { font-weight: 600; }
body.xco-underline-links a { text-decoration: underline; }
body.xco-text-small   { --xco-text-scale: 0.9; }
body.xco-text-large   { --xco-text-scale: 1.15; }
body.xco-text-xlarge  { --xco-text-scale: 1.35; }
body.xco-reduce-motion { --xco-motion: 0; }
body.xco-reduce-motion * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--xco-porcelain);
  color: var(--xco-ink);
  font-family: var(--xco-font-ui);
  font-size: calc(16px * var(--xco-text-scale));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color .35s ease, color .35s ease;
}

h1, h2, h3 {
  font-family: var(--xco-font-display);
  font-weight: 600;
  letter-spacing: 0.001em;
  margin: 0 0 .4em;
  color: var(--xco-ink);
}
h1 { font-size: calc(2.5rem * var(--xco-text-scale)); line-height: 1.1; }
h2 { font-size: calc(1.7rem * var(--xco-text-scale)); }
h3 { font-size: calc(1.25rem * var(--xco-text-scale)); }

.xco-tagline {
  font-family: var(--xco-font-accent);
  font-style: italic;
  color: var(--xco-ink-soft);
  font-size: calc(1.05rem * var(--xco-text-scale));
}

p { color: var(--xco-ink-soft); max-width: 62ch; }

a { color: var(--xco-accent); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--xco-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- Ambient backdrop ------------------------------------------------ */
.xco-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 15% 10%, color-mix(in srgb, var(--xco-accent) 18%, transparent), transparent 60%),
    radial-gradient(50% 40% at 90% 80%, color-mix(in srgb, var(--xco-accent) 12%, transparent), transparent 65%),
    var(--xco-porcelain);
}

/* ---- Glass card / bento panels --------------------------------------- */
.xco-glass {
  background: var(--xco-glass-bg);
  border: 1px solid var(--xco-glass-border);
  backdrop-filter: blur(var(--xco-glass-blur));
  -webkit-backdrop-filter: blur(var(--xco-glass-blur));
  border-radius: var(--xco-radius-lg);
  box-shadow: var(--xco-shadow);
}

.xco-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.xco-bento {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(6, 1fr);
}
.xco-bento > * { grid-column: span 6; }
@media (min-width: 760px) {
  .xco-bento .span-2 { grid-column: span 2; }
  .xco-bento .span-3 { grid-column: span 3; }
  .xco-bento .span-4 { grid-column: span 4; }
}

.xco-panel { padding: 28px; }

/* ---- Buttons ----------------------------------------------------------*/
.xco-btn {
  font-family: var(--xco-font-ui);
  font-size: calc(0.95rem * var(--xco-text-scale));
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--xco-radius-sm);
  padding: 12px 22px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.xco-btn:active { transform: scale(0.97); }
.xco-btn-primary { background: var(--xco-accent); color: var(--xco-accent-ink); }
.xco-btn-primary:hover { box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--xco-accent) 70%, transparent); }
.xco-btn-secondary { background: transparent; border-color: var(--xco-line); color: var(--xco-ink); }
.xco-btn-secondary:hover { background: var(--xco-porcelain-dim); }
.xco-btn-block { width: 100%; }
.xco-btn[disabled] { opacity: .5; cursor: not-allowed; }

.xco-btn-oauth {
  background: var(--xco-porcelain);
  border: 1px solid var(--xco-line);
  color: var(--xco-ink);
  width: 100%;
}
.xco-btn-oauth img, .xco-btn-oauth svg { width: 18px; height: 18px; }

/* ---- Form controls ------------------------------------------------- */
.xco-field { margin-bottom: 18px; text-align: left; }
.xco-field label {
  display: block;
  font-size: calc(0.85rem * var(--xco-text-scale));
  color: var(--xco-ink-soft);
  margin-bottom: 6px;
}
.xco-field input,
.xco-field select {
  width: 100%;
  padding: 13px 14px;
  font-size: calc(1rem * var(--xco-text-scale));
  font-family: var(--xco-font-ui);
  color: var(--xco-ink);
  background: color-mix(in srgb, var(--xco-porcelain) 60%, white 10%);
  border: 1px solid var(--xco-line);
  border-radius: var(--xco-radius-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.xco-field input:focus, .xco-field select:focus {
  border-color: var(--xco-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--xco-accent) 22%, transparent);
  outline: none;
}
.xco-hint { font-size: calc(0.78rem * var(--xco-text-scale)); color: var(--xco-ink-soft); margin-top: 6px; }
.xco-hint.is-ok   { color: var(--xco-success); }
.xco-hint.is-bad  { color: var(--xco-danger); }

/* iOS-style toggle switch */
.xco-switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.xco-switch input { opacity: 0; width: 0; height: 0; }
.xco-switch .track {
  position: absolute; inset: 0; background: var(--xco-line);
  border-radius: 999px; transition: background-color .2s ease; cursor: pointer;
}
.xco-switch .track::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.xco-switch input:checked + .track { background: var(--xco-accent); }
.xco-switch input:checked + .track::before { transform: translateX(18px); }

/* Segmented control (theme mode, corner radius, etc.) */
.xco-segment {
  display: inline-flex;
  background: var(--xco-porcelain-dim);
  border: 1px solid var(--xco-line);
  border-radius: var(--xco-radius-sm);
  padding: 3px;
  gap: 3px;
}
.xco-segment button {
  border: none; background: transparent; padding: 8px 16px;
  border-radius: calc(var(--xco-radius-sm) - 3px);
  font-family: var(--xco-font-ui); font-size: calc(0.88rem * var(--xco-text-scale));
  color: var(--xco-ink-soft); cursor: pointer; transition: all .18s ease;
}
.xco-segment button.is-active { background: var(--xco-porcelain); color: var(--xco-ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 600; }

/* Swatch grid for accent color picker */
.xco-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.xco-swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease;
}
.xco-swatch.is-active { border-color: var(--xco-ink); transform: scale(1.12); }
.xco-swatch:hover { transform: scale(1.08); }

/* ---- macOS/iOS Settings-style layout --------------------------------- */
.xco-settings {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 760px) { .xco-settings { grid-template-columns: 1fr; } }

.xco-settings-nav { padding: 10px; }
.xco-settings-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--xco-radius-sm);
  color: var(--xco-ink); font-size: calc(0.94rem * var(--xco-text-scale));
  margin-bottom: 2px; transition: background-color .15s ease;
}
.xco-settings-nav a .xco-icon-dot {
  width: 28px; height: 28px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; color: white; font-size: 14px; flex-shrink: 0;
}
.xco-settings-nav a:hover { background: var(--xco-porcelain-dim); }
.xco-settings-nav a.is-active { background: color-mix(in srgb, var(--xco-accent) 16%, transparent); font-weight: 600; }

.xco-settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px; border-bottom: 1px solid var(--xco-line);
  gap: 20px;
}
.xco-settings-row:last-child { border-bottom: none; }
.xco-settings-row .xco-row-label { font-weight: 600; }
.xco-settings-row .xco-row-desc { font-size: calc(0.84rem * var(--xco-text-scale)); color: var(--xco-ink-soft); margin-top: 2px; }

/* ---- Wizard step dots -------------------------------------------------*/
.xco-steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 28px; }
.xco-steps span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--xco-line);
  transition: background-color .25s ease, transform .25s ease;
}
.xco-steps span.is-done { background: var(--xco-accent); }
.xco-steps span.is-active { background: var(--xco-accent); transform: scale(1.4); }

/* ---- Utility ----------------------------------------------------------*/
.xco-center { text-align: center; }
.xco-muted { color: var(--xco-ink-soft); }
.xco-stack { display: flex; flex-direction: column; gap: 14px; }
.xco-row { display: flex; gap: 14px; }
.xco-row > * { flex: 1; }
.xco-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--xco-line); }
.xco-divider-text {
  display: flex; align-items: center; gap: 12px; color: var(--xco-ink-soft);
  font-size: calc(0.82rem * var(--xco-text-scale)); margin: 18px 0;
}
.xco-divider-text::before, .xco-divider-text::after { content: ""; flex: 1; height: 1px; background: var(--xco-line); }

.xco-fade-in { animation: xco-fade-up .5s ease both; }
@keyframes xco-fade-up {
  from { opacity: 0; transform: translateY(10px) scale(calc(1 - 0.005 * var(--xco-motion))); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Xcojo Account / macOS System Settings layer --------------------- */
.xco-settings-shell { max-width: 1180px; }
.xco-settings-header { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; margin-bottom:26px; }
.xco-back-link { display:inline-flex; align-items:center; gap:8px; color:var(--xco-ink); font-weight:600; justify-self:start; }
.xco-back-icon { width:28px; height:28px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--xco-porcelain-dim); font-size:25px; line-height:1; }
.xco-settings-title { font-weight:700; letter-spacing:-.02em; }
.xco-signout-btn { justify-self:end; }
.xco-settings-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:22px; align-items:start; }
.xco-settings-nav { padding:10px; position:sticky; top:20px; }
.xco-settings-nav-group-label { padding:12px 12px 7px; color:var(--xco-ink-soft); font-size:.68rem; font-weight:800; letter-spacing:.09em; }
.xco-settings-nav a { position:relative; }
.xco-nav-count { margin-left:auto; min-width:22px; text-align:center; font-size:.72rem; color:var(--xco-ink-soft); }
.xco-settings-icon,.xco-card-icon { width:30px; height:30px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; color:#fff; font-weight:800; flex:none; }
.xco-icon-teal { background:#0F8B8D !important; }
.xco-icon-blue { background:#087FDE !important; }
.xco-icon-indigo { background:#5856D6 !important; }
.xco-icon-purple { background:#AF52DE !important; }
.xco-icon-gray { background:#7B8588 !important; }
.xco-settings-content { min-width:0; display:grid; gap:18px; }
.xco-settings-hero { display:grid; grid-template-columns:auto 1fr auto; gap:18px; align-items:center; padding:22px 24px; }
.xco-account-avatar-wrap,.xco-profile-avatar-wrap { position:relative; width:78px; height:78px; }
.xco-account-avatar { width:78px; height:78px; border-radius:50%; object-fit:cover; border:1px solid var(--xco-line); display:block; }
.xco-avatar-initials { background:var(--xco-accent); color:var(--xco-accent-ink); display:flex; align-items:center; justify-content:center; font-size:1.65rem; font-weight:700; }
.xco-avatar-edit { position:absolute; right:-3px; bottom:-3px; width:30px; height:30px; border-radius:50%; border:2px solid var(--xco-porcelain); background:var(--xco-accent); color:#fff; cursor:pointer; font-size:19px; line-height:1; }
.xco-overline { color:var(--xco-ink-soft); font-size:.68rem; font-weight:800; letter-spacing:.1em; margin-bottom:5px; }
.xco-hero-edit { justify-self:end; }
.xco-pane-heading,.xco-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:10px; }
.xco-pane-heading p,.xco-section-heading p { margin:0; }
.xco-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px 18px; }
.xco-field-full { grid-column:1/-1; }
.xco-readonly-field { width:100%; padding:13px 14px; border:1px solid var(--xco-line); border-radius:var(--xco-radius-sm); color:var(--xco-ink-soft); background:var(--xco-porcelain-dim); word-break:break-all; }
.xco-form-actions { display:flex; justify-content:flex-end; margin-top:4px; }
.xco-settings-card-list { display:grid; gap:1px; border:1px solid var(--xco-line); border-radius:var(--xco-radius-md); overflow:hidden; }
.xco-settings-card { min-height:70px; padding:16px; display:flex; align-items:center; justify-content:space-between; gap:18px; background:color-mix(in srgb,var(--xco-porcelain) 58%,transparent); border-bottom:1px solid var(--xco-line); }
.xco-settings-card:last-child { border-bottom:none; }
.xco-status-pill,.xco-current-badge { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:5px 9px; background:var(--xco-porcelain-dim); color:var(--xco-ink-soft); font-size:.72rem; white-space:nowrap; }
.xco-status-good { color:var(--xco-success); }
.xco-danger-card { border-color:color-mix(in srgb,var(--xco-danger) 35%,var(--xco-line)); }
.xco-btn-danger { background:color-mix(in srgb,var(--xco-danger) 10%,transparent); border:1px solid color-mix(in srgb,var(--xco-danger) 35%,var(--xco-line)); color:var(--xco-danger); }
.xco-subsection { margin-top:28px; }
.xco-subsection h3 { font-size:1.1rem; margin-bottom:10px; }
.xco-activity-row { display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--xco-line); }
.xco-activity-row:last-child { border-bottom:none; }
.xco-activity-dot { width:9px; height:9px; margin-top:7px; border-radius:50%; background:var(--xco-accent); flex:none; }
.xco-activity-main { display:flex; flex-direction:column; gap:2px; }
.xco-activity-main span { color:var(--xco-ink-soft); font-size:.78rem; }
.xco-device-list { display:grid; gap:1px; border:1px solid var(--xco-line); border-radius:var(--xco-radius-md); overflow:hidden; }
.xco-device-row { display:grid; grid-template-columns:46px minmax(0,1fr) auto; align-items:center; gap:14px; padding:17px; background:color-mix(in srgb,var(--xco-porcelain) 58%,transparent); border-bottom:1px solid var(--xco-line); }
.xco-device-row:last-child { border-bottom:none; }
.xco-device-icon,.xco-mini-device-icon { width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; background:var(--xco-porcelain-dim); color:var(--xco-accent); font-size:19px; }
.xco-device-title { display:flex; align-items:center; gap:8px; font-weight:700; }
.xco-device-meta,.xco-mini-device span { display:block; color:var(--xco-ink-soft); font-size:.78rem; margin-top:2px; }
.xco-device-signout { white-space:nowrap; }
.xco-empty-state { padding:24px; text-align:center; color:var(--xco-ink-soft); border:1px dashed var(--xco-line); border-radius:var(--xco-radius-md); }
.xco-settings-message { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); z-index:20; max-width:min(92vw,560px); padding:12px 18px; border-radius:999px; background:var(--xco-ink); color:var(--xco-porcelain); box-shadow:var(--xco-shadow); }
.xco-settings-message.is-bad { background:var(--xco-danger); }
.xco-account-header { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:26px; }
.xco-header-actions { display:flex; gap:9px; flex-wrap:wrap; }
.xco-account-alert { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:18px; border-color:color-mix(in srgb,var(--xco-accent) 35%,var(--xco-line)); }
.xco-account-alert h2 { margin-bottom:2px; }
.xco-account-alert p { margin:0; }
.xco-account-profile { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:18px; align-items:center; margin-bottom:18px; }
.xco-profile-copy h2 { margin-bottom:0; }
.xco-profile-copy p { margin:2px 0 0; }
.xco-account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:18px; }
.xco-account-card { min-height:120px; padding:20px; display:grid; grid-template-columns:auto 1fr auto; align-items:start; gap:14px; color:inherit; transition:transform .18s ease, border-color .18s ease, background .18s ease; }
.xco-account-card:hover { transform:translateY(-2px); border-color:color-mix(in srgb,var(--xco-accent) 35%,var(--xco-line)); }
.xco-account-card h3 { font-size:1.15rem; margin-bottom:3px; }
.xco-account-card p { margin:0; font-size:.86rem; }
.xco-chevron { color:var(--xco-ink-soft); font-size:1.8rem; line-height:1; }
.xco-device-preview { margin-bottom:18px; }
.xco-mini-devices { display:grid; border:1px solid var(--xco-line); border-radius:var(--xco-radius-md); overflow:hidden; }
.xco-mini-device { display:flex; align-items:center; gap:12px; padding:13px 14px; border-bottom:1px solid var(--xco-line); }
.xco-mini-device:last-child { border-bottom:none; }
.xco-mini-device > div { min-width:0; flex:1; }
.xco-account-footer { display:flex; justify-content:space-between; gap:12px; color:var(--xco-ink-soft); font-size:.76rem; padding:4px 4px 20px; }
.xco-modal { position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:20px; }
.xco-modal[hidden] { display:none; }
.xco-modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.35); backdrop-filter:blur(8px); }
.xco-modal-card { position:relative; width:min(100%,520px); padding:28px; z-index:1; }
.xco-modal-close { position:absolute; top:13px; right:15px; width:34px; height:34px; border:0; border-radius:50%; background:var(--xco-porcelain-dim); color:var(--xco-ink); font-size:24px; cursor:pointer; }

@media (max-width: 900px) {
  .xco-settings-layout { grid-template-columns:1fr; }
  .xco-settings-nav { position:static; display:flex; gap:4px; overflow:auto; padding:8px; }
  .xco-settings-nav-group-label { display:none; }
  .xco-settings-nav a { white-space:nowrap; }
  .xco-settings-nav a .xco-nav-count { display:none; }
}
@media (max-width: 700px) {
  .xco-shell { padding:28px 16px 55px; }
  .xco-settings-header { grid-template-columns:auto 1fr auto; }
  .xco-settings-title { justify-self:center; }
  .xco-settings-hero,.xco-account-profile { grid-template-columns:auto 1fr; }
  .xco-hero-edit,.xco-account-profile > .xco-btn { grid-column:1/-1; justify-self:start; }
  .xco-form-grid,.xco-account-grid { grid-template-columns:1fr; }
  .xco-device-row { grid-template-columns:42px minmax(0,1fr); }
  .xco-device-signout { grid-column:2; justify-self:start; }
  .xco-account-header,.xco-account-alert,.xco-section-heading,.xco-pane-heading { align-items:flex-start; flex-direction:column; }
  .xco-account-footer { flex-direction:column; }
  .xco-settings-row { align-items:flex-start; flex-direction:column; }
}

/* ---- Authentication / Account gateway -------------------------------- */
.xco-auth-page { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:28px 18px; }
.xco-auth-shell { width:min(100%, 520px); margin:0 auto; }
.xco-auth-card,.xco-login-card { width:100%; padding:34px; }
.xco-auth-card { text-align:center; }
.xco-brand-lockup,.xco-auth-brand { display:flex; align-items:center; gap:12px; text-align:left; color:inherit; text-decoration:none; }
.xco-brand-lockup > div:last-child,.xco-auth-brand > span:last-child { display:flex; flex-direction:column; gap:1px; }
.xco-brand-lockup strong,.xco-auth-brand strong { font-size:1.02rem; }
.xco-brand-lockup span,.xco-auth-brand small { color:var(--xco-ink-soft); font-size:.78rem; }
.xco-brand-mark { width:42px; height:42px; border-radius:13px; display:inline-flex; align-items:center; justify-content:center; background:var(--xco-accent); color:var(--xco-accent-ink); font-weight:800; font-size:1.35rem; box-shadow:0 8px 20px color-mix(in srgb,var(--xco-accent) 22%,transparent); flex:none; }
.xco-auth-copy { margin:42px 0 28px; }
.xco-auth-copy h1 { margin-bottom:8px; }
.xco-auth-copy p,.xco-login-heading p { color:var(--xco-ink-soft); margin:0; }
.xco-auth-actions { display:grid; gap:10px; }
.xco-auth-features { margin-top:28px; padding-top:22px; border-top:1px solid var(--xco-line); display:grid; gap:14px; text-align:left; }
.xco-auth-features > div { display:flex; gap:12px; align-items:flex-start; }
.xco-auth-features > div > span { color:var(--xco-accent); font-weight:800; }
.xco-auth-features p { margin:0; display:flex; flex-direction:column; gap:2px; }
.xco-auth-features small { color:var(--xco-ink-soft); }
.xco-auth-footer { text-align:center; color:var(--xco-ink-soft); font-size:.76rem; margin-top:16px; }
.xco-login-shell { max-width:470px; }
.xco-login-card { padding:30px; }
.xco-login-heading { margin:30px 0 22px; }
.xco-login-heading h1 { margin-bottom:6px; }
.xco-login-providers { display:grid; gap:10px; }
.xco-login-providers .xco-btn-oauth { min-height:48px; }
.xco-label-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.xco-label-row a { font-size:.78rem; font-weight:600; }
.xco-password-field { position:relative; }
.xco-password-field input { padding-right:64px; }
.xco-password-toggle { position:absolute; right:9px; top:50%; transform:translateY(-50%); border:0; background:transparent; color:var(--xco-accent); font-weight:700; cursor:pointer; padding:6px; }
.xco-auth-switch { text-align:center; color:var(--xco-ink-soft); font-size:.88rem; margin:20px 0 0; }
.xco-alert { border:1px solid var(--xco-line); border-radius:12px; padding:11px 13px; margin-bottom:16px; font-size:.84rem; }
.xco-alert.is-bad { color:var(--xco-danger); border-color:color-mix(in srgb,var(--xco-danger) 30%,var(--xco-line)); background:color-mix(in srgb,var(--xco-danger) 7%,transparent); }
.xco-alert.is-good { color:var(--xco-success); border-color:color-mix(in srgb,var(--xco-success) 30%,var(--xco-line)); background:color-mix(in srgb,var(--xco-success) 7%,transparent); }
.xco-dev-reset { margin:0 0 16px; padding:12px 14px; border:1px dashed var(--xco-accent); border-radius:12px; display:flex; flex-direction:column; gap:5px; }
.xco-dev-reset a { font-weight:700; }
.xco-btn.is-loading { opacity:.7; cursor:wait; }
.xco-settings-nav { max-height:calc(100vh - 100px); overflow:auto; scrollbar-width:thin; }
.xco-settings-nav a { display:flex; align-items:center; gap:10px; min-height:46px; padding:7px 9px; border-radius:11px; text-decoration:none; color:var(--xco-ink); font-size:.86rem; font-weight:600; }
.xco-settings-nav a:hover { background:var(--xco-porcelain-dim); }
.xco-settings-nav a.is-active { background:color-mix(in srgb,var(--xco-accent) 12%,var(--xco-porcelain)); color:var(--xco-accent); }
.xco-nav-status { margin-left:auto; font-size:.7rem; color:var(--xco-ink-soft); font-weight:500; }
.xco-icon-red { background:#FF375F !important; }
.xco-inline-select { min-width:150px; border:1px solid var(--xco-line); background:var(--xco-porcelain-dim); color:var(--xco-ink); border-radius:9px; padding:9px 11px; font:inherit; }
.xco-settings-card select:focus { outline:2px solid color-mix(in srgb,var(--xco-accent) 30%,transparent); }
@media (max-width:700px) {
  .xco-auth-page { align-items:flex-start; padding:18px 12px; }
  .xco-auth-card,.xco-login-card { padding:24px 20px; }
  .xco-auth-copy { margin:32px 0 24px; }
  .xco-settings-nav { max-height:none; }
}
