/* CloudPulse — global theme */

:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-soft: #0a1020;
  --panel: #0e1628;
  --panel-2: #121c32;
  --panel-3: #16223c;
  --text: #e8eefc;
  --muted: #94a3b8;
  --faint: #64748b;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --brand: #f97316;
  --brand-2: #38bdf8;
  --brand-3: #fb7185;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --ring: rgba(249, 115, 22, 0.4);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-soft: #eef2f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #eef2f8;
  --text: #0f172a;
  --muted: #52627a;
  --faint: #7c8ba1;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --ring: rgba(234, 88, 12, 0.3);
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    color-scheme: light;
    --bg: #f6f8fc;
    --bg-soft: #eef2f9;
    --panel: #ffffff;
    --panel-2: #f8fafc;
    --panel-3: #eef2f8;
    --text: #0f172a;
    --muted: #52627a;
    --faint: #7c8ba1;
    --border: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.18);
    --ring: rgba(234, 88, 12, 0.3);
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.16; letter-spacing: -0.025em; font-weight: 700; }
ul { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: rgba(249, 115, 22, 0.3); }

.page-glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 620px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(560px 320px at 18% 10%, rgba(249, 115, 22, 0.18), transparent 65%),
    radial-gradient(620px 340px at 82% 4%, rgba(56, 189, 248, 0.16), transparent 65%),
    radial-gradient(480px 300px at 50% 30%, rgba(251, 113, 133, 0.08), transparent 70%);
  filter: blur(10px);
}

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 22px; }
.icon { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.text-link { color: var(--brand-2); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; }
.text-link:hover { text-decoration: underline; }
.gradient-text { background: linear-gradient(100deg, var(--brand) 8%, var(--brand-3) 46%, var(--brand-2) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar-minimal { background: transparent; border-bottom: 0; backdrop-filter: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.03em; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), #fb7185 60%, #7c3aed);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.topnav { display: flex; align-items: center; gap: 14px; }
.topnav-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.topnav-link:hover { color: var(--text); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); }
.user-chip-name { font-size: 13px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg, rgba(249,115,22,.9), rgba(124,58,237,.85)); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; flex: none; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--border); background: var(--panel);
  cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--panel-3); }
.icon-btn:active { transform: scale(.96); }
.icon-btn.danger { color: var(--danger); background: transparent; }\n.icon-btn.is-copied { color: var(--success); border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); }
.icon-btn.danger:hover { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.4); }
.theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-dark { display: block; }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-icon-light { display: none; }
  html:not([data-theme]) .theme-icon-dark { display: block; }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; background: var(--panel-2); color: var(--text);
  font-weight: 650; font-size: 14px; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #fb5f3c);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.24), inset 0 1px 0 rgba(255,255,255,.24);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(249, 115, 22, 0.32); }
.btn-ghost { background: var(--panel); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--panel-3); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.danger-text { color: var(--danger); }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}
.hoverable { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.hoverable:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--border);
  letter-spacing: .02em;
}
.badge-role { text-transform: capitalize; }
.badge-admin { color: var(--brand-2); border-color: rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.08); }
.badge-admin .icon { stroke: var(--brand-2); }\n.badge-active { color: var(--success); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }\n.badge-pending { color: var(--warning); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.09); }\n.badge-muted { color: var(--muted); }\n.pending-panel { border-color: rgba(251, 191, 36, 0.28); }\n.stat-alert .stat-value { color: var(--warning); }

/* --------------------------------------------------------------- marketing */

.marketing-body .topbar { background: color-mix(in srgb, var(--bg) 64%, transparent); }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding-top: 74px; padding-bottom: 70px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(44px, 6.2vw, 76px); line-height: .96; letter-spacing: -0.055em; }
.hero-sub { color: var(--muted); font-size: 18px; max-width: 560px; margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 38px; color: var(--muted); font-size: 13px; }
.hero-proof strong { color: var(--text); font-size: 15px; display: block; }
.hero-demo {
  position: relative;
  padding: 26px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.015)), var(--panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}
.hero-demo::before {
  content: "";
  position: absolute; inset: -1px; border-radius: 23px; z-index: -1;
  background: linear-gradient(140deg, rgba(249,115,22,.4), rgba(56,189,248,.18), transparent 70%);
  filter: blur(18px); opacity: .55;
}
.demo-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.hero-demo h2 { font-size: 23px; margin-bottom: 20px; }
.demo-bars { display: grid; gap: 15px; }
.demo-bar-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
.demo-bar-row > span:first-child { font-size: 13px; color: var(--muted); }
.demo-bar-row strong { display: none; }
.demo-bar { height: 9px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.demo-bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-3)); }
.demo-bar-row:nth-child(2) .demo-bar-fill { background: linear-gradient(90deg, #fb7185, #f472b6); }
.demo-bar-row:nth-child(3) .demo-bar-fill { background: linear-gradient(90deg, #38bdf8, #818cf8); }
.demo-bar-row:nth-child(4) .demo-bar-fill { background: linear-gradient(90deg, #34d399, #22d3ee); }
.demo-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.avatar-stack { display: flex; }
.avatar-stack span {
  width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%;
  background: var(--panel-3); border: 2px solid var(--panel); font-size: 9px; font-weight: 800; margin-left: -7px;
}
.avatar-stack span:first-child { margin-left: 0; background: rgba(249,115,22,.85); }
.avatar-stack span:nth-child(2) { background: rgba(56,189,248,.8); }
.avatar-stack span:nth-child(3) { background: rgba(52,211,153,.8); }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .1em;
  color: var(--success); background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.25);
}
.live-pill.small { font-size: 10px; padding: 3px 8px; }
.live-pill.is-closed { color: var(--muted); background: var(--panel-2); border-color: var(--border); }
.live-pill.is-closed .live-dot { background: var(--muted); animation: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.45); } 70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 28px; }
.feature { padding: 26px; }
.feature-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--brand); background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.22); margin-bottom: 18px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14px; }
.steps { padding-top: 62px; padding-bottom: 62px; }
.steps-head { max-width: 640px; margin-bottom: 34px; }
.steps-head h2 { font-size: clamp(28px, 3.5vw, 42px); }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(160deg, rgba(255,255,255,.03), transparent); }
.step-num { font-family: var(--mono); font-size: 12px; color: var(--brand); font-weight: 700; letter-spacing: .08em; }
.step h3 { font-size: 19px; margin: 12px 0 8px; }
.step p { color: var(--muted); font-size: 14px; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 80px; padding: 36px; background: linear-gradient(120deg, rgba(249,115,22,.13), rgba(56,189,248,.08)), var(--panel); }
.cta-band h2 { font-size: 27px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--border); padding: 34px 0; margin-top: 20px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.footer-brand p { margin-top: 10px; font-size: 13px; max-width: 360px; }
.footer-links { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ------------------------------------------------------------------- auth */

.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 66px); }
.auth-aside { display: flex; align-items: center; padding: 60px 56px; border-right: 1px solid var(--border); background: linear-gradient(160deg, rgba(249,115,22,.08), transparent 45%), var(--bg-soft); }
.auth-aside-inner { max-width: 520px; }
.auth-aside h1 { font-size: clamp(30px, 3.5vw, 46px); margin-bottom: 20px; }
.auth-aside p { color: var(--muted); font-size: 16px; }
.auth-points { list-style: none; display: grid; gap: 12px; margin-top: 30px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.auth-points .icon { color: var(--success); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 24px; }
.auth-card { width: 100%; max-width: 430px; padding: 32px; box-shadow: var(--shadow); }
.auth-title { font-size: 27px; margin-bottom: 7px; }
.auth-sub { font-size: 14px; margin-bottom: 26px; }
.auth-switch { margin-top: 22px; font-size: 13.5px; text-align: center; }
.auth-switch a { color: var(--brand); font-weight: 650; text-decoration: none; }
.auth-foot { margin-top: 22px; font-size: 12px; }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; font-size: 13.5px; font-weight: 600; }
.field-hint { color: var(--faint); font-size: 12px; font-weight: 400; }
.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input:disabled { opacity: .6; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--brand); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.form-card { padding: 28px; }

/* --------------------------------------------------------------- app shell */

.app-body { background: var(--bg); }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; padding-top: 28px; padding-bottom: 60px; }
.sidebar { position: sticky; top: 92px; align-self: start; display: flex; flex-direction: column; gap: 18px; }
.side-workspace { padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); }
.side-kicker { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 700; margin-bottom: 6px; }
.side-workspace-name { display: block; font-size: 14.5px; line-height: 1.3; }
.side-slug { display: block; color: var(--faint); font-size: 11.5px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; transition: background .15s, color .15s; }
.side-link:hover { background: var(--panel); color: var(--text); }
.side-link.is-active { background: linear-gradient(90deg, rgba(249,115,22,.16), rgba(249,115,22,.04)); color: var(--text); border: 1px solid rgba(249,115,22,.2); }
.side-link.is-active .icon { color: var(--brand); }
.side-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.main { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { font-size: clamp(26px, 3vw, 34px); }
.page-actions { display: flex; gap: 8px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); margin-bottom: 18px; font-size: 14px; }
.flash-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.flash-success { border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.flash-success .flash-dot { background: var(--success); }
.flash-error { border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }
.flash-error .flash-dot { background: var(--danger); }
.flash-info { border-color: rgba(56,189,248,.35); background: rgba(56,189,248,.08); }
.flash-info .flash-dot { background: var(--brand-2); }
.flash.fade { opacity: 0; transform: translateY(-4px); transition: opacity .4s, transform .4s; }

/* ------------------------------------------------------------------ grids */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.workspace-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.workspace-card { display: flex; flex-direction: column; text-decoration: none; min-height: 178px; }
.workspace-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.workspace-avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(140deg, rgba(249,115,22,.85), rgba(124,58,237,.8)); color: #fff; font-weight: 800; font-size: 13px; }
.workspace-card h3 { font-size: 18px; }
.workspace-card p { margin-top: 4px; }
.workspace-meta { display: flex; gap: 16px; margin-top: auto; padding-top: 18px; color: var(--faint); font-size: 12.5px; }
.workspace-meta span { display: inline-flex; align-items: center; gap: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px; }
.stat-label { display: block; font-size: 12px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.stat-value { display: block; font-size: 28px; margin: 6px 0 2px; letter-spacing: -.04em; overflow: hidden; text-overflow: ellipsis; }
.stat-foot { font-size: 12px; color: var(--muted); }
.split { display: grid; grid-template-columns: 1.35fr .9fr; gap: 18px; align-items: start; }
.split-wide { grid-template-columns: 1.25fr 1fr; }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2, .panel-title { font-size: 18px; }
.panel-head-sub { margin-top: 24px; margin-bottom: 10px; }
.panel-head-sub h3 { font-size: 14px; color: var(--muted); }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover .list-row-meta { color: var(--brand); }
.list-row-main { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.list-row-main strong { display: block; font-size: 14px; font-weight: 650; line-height: 1.35; }
.list-row-main span { display: block; font-size: 12px; margin-top: 2px; }
.list-row-main .icon { margin-top: 3px; }
.list-row-meta { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 12px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--muted); flex: none; }
.status-dot.is-open { background: var(--success); box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.status-dot.is-closed { background: var(--faint); }
.activity-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.activity-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.activity-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); color: var(--muted); font-size: 10px; font-weight: 800; flex: none; }
.activity-row strong { font-weight: 650; }
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty.compact { padding: 26px 10px; }
.empty-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border); color: var(--brand); margin-bottom: 4px; }
.empty h3 { font-size: 17px; }
.empty p { max-width: 360px; font-size: 13.5px; }
.empty .btn { margin-top: 8px; }
.narrow { max-width: 640px; }
.note-card { margin-top: 18px; }
.note-card h3 { font-size: 15px; margin-bottom: 6px; }
.note-card p { font-size: 13px; }

/* ------------------------------------------------------------------ polls */

.poll-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.poll-card { display: flex; flex-direction: column; min-height: 220px; }
.poll-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.poll-card h3 { font-size: 18px; line-height: 1.3; }
.poll-desc { font-size: 13px; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poll-meta { display: flex; gap: 15px; color: var(--faint); font-size: 12px; margin-top: 16px; }
.poll-meta span { display: inline-flex; align-items: center; gap: 5px; }
.poll-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 18px; }
.option-editor { display: grid; gap: 8px; }
.option-row { display: flex; align-items: center; gap: 8px; }
.option-index { width: 24px; text-align: center; color: var(--faint); font-size: 12px; font-weight: 700; flex: none; }
.add-option { justify-self: start; margin-top: 4px; }

/* ----------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 700; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .row-actions { white-space: nowrap; }
.compact-table td, .compact-table th { padding: 8px 8px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.person strong { display: block; font-size: 13.5px; }
.person .muted { display: block; font-size: 11.5px; }
.select-sm { min-height: 32px; padding: 4px 8px; width: auto; font-size: 12.5px; }

/* ---------------------------------------------------------------- results */

.results-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); gap: 18px; align-items: start; }
.results-main { padding: 26px; }
.results-head h2 { font-size: clamp(24px, 3vw, 34px); margin: 15px 0 8px; }
.results-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.results-metrics { display: flex; gap: 36px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.metric-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.results-metrics strong { font-size: 25px; letter-spacing: -.03em; }
.result-list { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.result-row { display: flex; flex-direction: column; gap: 8px; }
.result-top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.result-label { font-weight: 650; font-size: 15px; }
.result-count { font-size: 13px; white-space: nowrap; }
.result-count strong { font-size: 17px; }
.result-bar { height: 12px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.result-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-3)); transition: width .5s cubic-bezier(.22,.8,.3,1); }
.result-row:nth-child(2) .result-fill { background: linear-gradient(90deg, #fb7185, #f472b6); }
.result-row:nth-child(3) .result-fill { background: linear-gradient(90deg, #38bdf8, #818cf8); }
.result-row:nth-child(4) .result-fill { background: linear-gradient(90deg, #34d399, #22d3ee); }
.result-row:nth-child(5) .result-fill { background: linear-gradient(90deg, #fbbf24, #f97316); }
.results-actions { display: flex; gap: 8px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.results-side { display: flex; flex-direction: column; gap: 16px; }
.share-card h3 { font-size: 16px; margin-bottom: 5px; }
.share-card > .text-link { margin-top: 12px; }
.copy-row { display: flex; gap: 7px; margin-top: 14px; }
.copy-row .input { font-family: var(--mono); font-size: 11.5px; min-height: 38px; }
.result-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.tips { list-style: none; display: grid; gap: 9px; margin-top: 10px; }
.tips li { position: relative; padding-left: 16px; font-size: 13px; color: var(--muted); }
.tips li::before { content: ""; position: absolute; left: 1px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
#results-page.is-presenting { position: fixed; inset: 0; z-index: 100; background: var(--bg); padding: 32px; overflow: auto; grid-template-columns: 1fr; }
#results-page.is-presenting .results-side { display: none; }
#results-page.is-presenting .results-main { min-height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: center; max-width: 1100px; margin: 0 auto; width: 100%; }
#results-page.is-presenting .result-label { font-size: 20px; }
#results-page.is-presenting .result-count strong { font-size: 24px; }
#results-page.is-presenting .result-bar { height: 18px; }

/* ------------------------------------------------------------ public vote */

.vote-body .page-glow { height: 500px; }
.vote-shell { width: 100%; max-width: 720px; margin: 0 auto; padding: 22px 20px 50px; }
.vote-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.vote-card { padding: 34px; box-shadow: var(--shadow); }
.vote-head { text-align: center; margin-bottom: 26px; }
.vote-head .badge { margin-bottom: 14px; }
.vote-head h1 { font-size: clamp(26px, 4.5vw, 38px); letter-spacing: -.04em; }
.vote-head p { margin-top: 10px; font-size: 15px; }
.vote-form { display: grid; gap: 20px; }
.vote-options { display: grid; gap: 10px; }
.vote-option { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.vote-option:hover { border-color: var(--border-strong); background: var(--panel-2); }
.vote-option input { position: absolute; opacity: 0; pointer-events: none; }
.vote-key { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-3); border: 1px solid var(--border); font-size: 12px; font-weight: 800; color: var(--muted); flex: none; transition: background .15s, color .15s, border-color .15s; }
.vote-text { flex: 1; font-weight: 600; font-size: 15.5px; }
.vote-check { color: transparent; transition: color .15s; }
.vote-option:has(input:checked) { border-color: var(--brand); background: rgba(249,115,22,.08); box-shadow: 0 0 0 3px var(--ring); }
.vote-option:has(input:checked) .vote-key { background: var(--brand); border-color: var(--brand); color: #fff; }
.vote-option:has(input:checked) .vote-check { color: var(--brand); }
.vote-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.vote-note { text-align: center; font-size: 12px; }
.vote-state { text-align: center; padding: 22px 0 6px; }
.state-icon { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: rgba(56,189,248,.12); color: var(--brand-2); border: 1px solid rgba(56,189,248,.3); }
.state-icon.is-success { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.3); }
.vote-state h2 { font-size: 23px; margin-bottom: 8px; }
.public-results { margin-top: 18px; padding: 24px; }
.public-results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.public-results-head h3 { font-size: 16px; }
.public-results .result-list { margin-top: 0; }
.vote-footer { text-align: center; margin-top: 24px; font-size: 12px; }

/* ------------------------------------------------------------------ error */

.error-shell { min-height: calc(100vh - 200px); display: grid; place-items: center; padding: 60px 22px; }
.error-card { text-align: center; max-width: 480px; padding: 40px; }
.error-code { font-family: var(--mono); font-size: 13px; color: var(--brand); font-weight: 700; letter-spacing: .12em; }
.error-card h1 { font-size: 30px; margin: 12px 0 10px; }
.error-card .form-actions { justify-content: center; margin-top: 24px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 50px; }
  .feature-grid, .step-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .split-wide, .results-layout { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .shell { grid-template-columns: 1fr; gap: 18px; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .side-workspace { flex: 1 1 200px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-link { padding: 7px 10px; font-size: 13px; }
  .side-bottom { display: none; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .topbar-inner { min-height: 60px; }
  .user-chip-name { display: none; }
  .topnav { gap: 8px; }
  .topnav-link { display: none; }
  .hero h1 { font-size: 44px; }
  .hero-sub { font-size: 16px; }
  .hero-demo { padding: 20px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .stat-grid { gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 23px; }
  .card { padding: 18px; }
  .vote-card { padding: 24px 18px; }
  .vote-option { padding: 14px; }
  .results-main { padding: 18px; }
  .results-metrics { gap: 22px; }
  .footer-inner { flex-direction: column; }
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
  .copy-row .input { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
