:root {
  --bg: #000000;
  --bg2: #07070C;
  --panel: #0E0E16;
  --panel2: #161622;
  --elevated: #1A1A28;
  --card: #1F1F30;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #FFFFFF;
  --fg: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.86);
  --muted2: rgba(255, 255, 255, 0.78);
  --accent: #7C3AED;
  --accent-hover: #8B5CF6;
  --accent-soft: rgba(124, 58, 237, 0.18);
  --accent2: #A78BFA;
  --hot: #DB2777;
  --cyan: #818CF8;
  --lime: var(--accent);
  --gradient: linear-gradient(110deg, #7C3AED 0%, #4F46E5 48%, #DB2777 115%);
  --gradient-btn: linear-gradient(105deg, #7C3AED 0%, #DB2777 100%);
  --mesh:
    radial-gradient(920px 520px at 10% -12%, rgba(124, 58, 237, 0.26), transparent 58%),
    radial-gradient(760px 460px at 100% 0%, rgba(219, 39, 119, 0.18), transparent 52%),
    radial-gradient(640px 400px at 70% 105%, rgba(37, 99, 235, 0.14), transparent 50%);
  --success: #4ade80;
  --success-text: #86EFAC;
  --danger: #fb7185;
  --warn: #fbbf24;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-accent: 0 4px 12px rgba(124, 58, 237, 0.22);
  --space: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --pad: clamp(.85rem, 1.6vw, 1.35rem);
  --max: 1180px;
  --font: "Manrope", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --display: "Plus Jakarta Sans", "Manrope", ui-sans-serif, system-ui, sans-serif;
  --text-caption: 0.8125rem;
  --text-sm: 0.875rem;
  --text-body: 1rem;
  --text-h2: 1.25rem;
  --text-h1: 1.75rem;
  --text-display: 2.5rem;
  --weight-body: 450;
  --weight-ui: 600;
  --weight-title: 700;
  --bp-sm: 560px;
  --bp-md: 800px;
  --bp-lg: 980px;
  --touch: 44px;
  --rail-bg: #000000;
  --rail-line: rgba(255, 255, 255, 0.1);
  --rail-item: #E8E8EF;
  --rail-item-hover-bg: rgba(255, 255, 255, 0.09);
  --rail-item-hover: #FFFFFF;
  --rail-active-bg: #8B5CF6;
  --rail-active-shadow: none;
}

[data-theme="light"] {
  --bg: #F7F7F8;
  --bg2: #ffffff;
  --panel: #ffffff;
  --panel2: #F1F5F9;
  --elevated: #E2E8F0;
  --card: #FFFFFF;
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.2);
  --text: #0F172A;
  --fg: #0F172A;
  --muted: #475569;
  --muted2: #64748B;
  --accent: #6D28D9;
  --accent-hover: #5B21B6;
  --accent-soft: rgba(109, 40, 217, 0.12);
  --accent2: #5B21B6;
  --hot: #BE185D;
  --cyan: #4338CA;
  --lime: var(--accent);
  --gradient: linear-gradient(110deg, #6D28D9 0%, #4338CA 55%, #BE185D 115%);
  --gradient-btn: linear-gradient(105deg, #6D28D9 0%, #BE185D 100%);
  --mesh: none;
  --shadow: 0 16px 40px rgba(15, 15, 35, 0.08);
  --shadow-sm: 0 4px 12px rgba(15, 15, 35, 0.08);
  --shadow-accent: 0 8px 20px rgba(109, 40, 217, 0.18);
  --success: #15803D;
  --success-text: #166534;
  --rail-bg: #EEEEF0;
  --rail-line: rgba(17, 17, 17, 0.12);
  --rail-item: #18181B;
  --rail-item-hover-bg: rgba(109, 40, 217, 0.08);
  --rail-item-hover: #111111;
  --rail-active-bg: #6D28D9;
  --rail-active-shadow: none;
}

* { box-sizing: border-box; }
html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}
html, body { margin: 0; min-height: 100%; }
/* Logged-in shell: page does not scroll; .main / .comet-body are the scrollports */
html:has(.shell),
body:has(.shell) {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
/* App shell: flat bg — mesh reserved for marketing */
.shell, #app:has(.shell) {
  background: var(--bg) !important;
}
#app:has(.shell) {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
#app:has(.shell) > .shell {
  flex: 1;
  min-height: 0;
}
body {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--mesh), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  line-height: 1.45;
}

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

button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: #FFFFFF; font-weight: var(--weight-ui);
  padding: .55rem 1.05rem;
  font-size: var(--text-sm);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: none;
}
button:hover { filter: brightness(1.06); background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button.secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-strong); font-weight: var(--weight-ui);
  box-shadow: none;
}
button.secondary:hover { background: var(--elevated); filter: none; }
button.secondary:active { background: var(--panel2); filter: none; transform: translateY(1px); }
button.ghost { background: transparent; color: var(--muted); font-weight: var(--weight-ui); box-shadow: none; }
button.ghost:hover { color: var(--text); background: transparent; filter: none; }
button.ghost:active { color: var(--text); background: var(--elevated); filter: none; }
button.danger { background: rgba(251, 113, 133, 0.16); color: var(--danger); box-shadow: none; }
button.primary-wide { width: 100%; border-radius: var(--radius-sm); padding: .95rem 1rem; font-size: var(--text-body); color: #FFFFFF; background: var(--accent); }
button.pill { border-radius: var(--radius-pill); }
/* Marketing-only gradient CTA (landing keeps its own .lp-btn) */
button.btn-gradient {
  background: var(--gradient-btn);
  border-radius: var(--radius-pill);
  font-weight: var(--weight-title);
}
button:disabled,
button[disabled] {
  opacity: 1;
  cursor: not-allowed;
  filter: none !important;
  transform: none !important;
  background: var(--elevated) !important;
  color: var(--muted2) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}

/* Post-login shell: secondary/ghost must never inherit white-on-white from the gradient button base */
.main button.secondary,
.main button.ghost,
.topbar button.secondary,
.topbar button.ghost,
.feat-page button.secondary,
.panel button.secondary,
.modal button.secondary,
.modal button.ghost {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--line-strong) !important;
  box-shadow: none !important;
  filter: none !important;
}
.main button.ghost,
.topbar button.ghost,
.modal button.ghost {
  border-color: transparent !important;
  color: var(--muted) !important;
}
.main button.ghost:hover,
.topbar button.ghost:hover,
.modal button.ghost:hover {
  color: var(--text) !important;
  background: var(--elevated) !important;
}
.main button.secondary:hover,
.topbar button.secondary:hover,
.feat-page button.secondary:hover,
.panel button.secondary:hover,
.modal button.secondary:hover {
  background: var(--elevated) !important;
  filter: none !important;
}
.main button.secondary:active,
.topbar button.secondary:active,
.feat-page button.secondary:active,
.panel button.secondary:active,
.modal button.secondary:active {
  background: var(--panel2) !important;
  filter: none !important;
}
.main button.secondary:focus-visible,
.main button.ghost:focus-visible,
.topbar button.secondary:focus-visible,
.topbar button.ghost:focus-visible,
.modal button.secondary:focus-visible,
.modal button.ghost:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
}
.main button.danger,
.feat-page button.danger,
.panel button.danger {
  background: rgba(251, 113, 133, 0.16) !important;
  color: var(--danger) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

a.secondary,
a.bill-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius);
  font-weight: 700;
  padding: .5rem .85rem;
  font-size: .84rem;
  text-decoration: none !important;
  box-sizing: border-box;
}
a.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
  font-weight: 600;
}
a.secondary:hover {
  background: var(--elevated);
  text-decoration: none !important;
}
a.bill-cta-primary {
  background: var(--gradient-btn) !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: var(--radius-pill) !important;
}
a.bill-cta-primary:hover { filter: brightness(1.06); }

input, select, textarea {
  width: 100%;
  background: color-mix(in srgb, var(--bg2) 80%, #000 20%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  font-size: .92rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea { background: #fff; }

/* Native select chrome is OS-specific and clashes with the styled inputs beside
   it, so every select draws its own chevron. --sel-caret keeps it theme-aware. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.1rem;
  /* !important: dozens of scoped rules set the `background` shorthand on selects,
     which silently resets the caret image. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right .75rem center !important;
  background-size: 10px 7px !important;
  cursor: pointer;
}
select::-ms-expand { display: none; }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted2); }
textarea { min-height: 120px; resize: vertical; }
label {
  display: block; font-size: .88rem; font-weight: 700;
  color: var(--text); margin-bottom: .45rem;
}
.field { margin-bottom: 1.05rem; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 500; }

/* ——— Brand mark ——— */
.brand-mark {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font);
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
}
.brand-mark:hover { text-decoration: none; }
.brand-mark .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: #12060A; color: inherit;
  display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; line-height: 1;
  box-shadow: none;
  overflow: hidden;
}
.brand-mark .mark img {
  width: 100%; height: 100%; display: block; object-fit: contain;
  padding: 1px;
}
[data-theme="light"] .brand-mark .mark { color: #fff; }
.grad-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; font-weight: 800;
}

/* ——— Auth / landing (Postiz-style split) ——— */
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr;
  background: var(--bg);
}
@media (max-width: 720px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-proof { display: none; }
}

.auth-pane {
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: var(--shadow);
  animation: rise .45s ease both;
}
.auth-card h1 {
  margin: 1.1rem 0 .9rem;
  font-family: var(--display);
  font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em;
  color: #FFFFFF;
}
.auth-social-label {
  font-size: .85rem; color: rgba(255,255,255,0.78); font-weight: 700; margin-bottom: .55rem;
}
.auth-social {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin-bottom: 1rem;
}
.auth-social a.social-btn,
.auth-social button.social-btn,
.auth-card .auth-social button {
  background: linear-gradient(135deg, rgba(124,58,237,.22), rgba(219,39,119,.16)) !important;
  color: #FFFFFF !important;
  border-radius: 12px;
  padding: .7rem .5rem; font-size: .82rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid rgba(167,139,250,.45) !important;
  box-shadow: 0 8px 20px rgba(124,58,237,.2);
  text-decoration: none !important;
  font-family: var(--display);
}
.auth-social a.social-btn:hover,
.auth-social button.social-btn:hover {
  background: linear-gradient(135deg, rgba(124,58,237,.38), rgba(219,39,119,.28)) !important;
  border-color: rgba(196,181,253,.7) !important;
}
.auth-social svg { width: 15px; height: 15px; flex-shrink: 0; }
.or-row {
  display: flex; align-items: center; gap: .75rem;
  color: rgba(255,255,255,0.62); font-size: .78rem; font-weight: 800;
  letter-spacing: .08em; margin: 1rem 0 1.15rem;
}
.or-row::before, .or-row::after {
  content: ""; flex: 1; height: 1px; background: var(--line-strong);
}
.auth-footer {
  margin-top: 1.1rem; font-size: .92rem; color: rgba(255,255,255,0.78);
  display: flex; flex-direction: column; gap: .55rem;
}
.auth-footer a { color: #C4B5FD; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.auth-footer .forgot { color: rgba(255,255,255,0.72); font-weight: 700; text-decoration: underline; }

.auth-proof {
  padding: 2.5rem 2rem 2rem;
  display: flex; flex-direction: column; align-items: center;
  overflow: hidden;
  background: var(--mesh), var(--bg);
}
.auth-proof h2 {
  margin: 0 0 1.25rem;
  text-align: center;
  font-family: var(--font);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  max-width: 18ch;
  line-height: 1.2;
}
.testimonials {
  display: columns; columns: 3 220px; gap: .85rem;
  width: min(920px, 100%);
  max-height: calc(100vh - 8rem);
  overflow: hidden;
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.testimonial {
  break-inside: avoid;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.05rem;
  margin-bottom: .85rem;
  animation: rise .5s ease both;
  backdrop-filter: blur(8px);
}
.testimonial .who {
  display: flex; align-items: center; gap: .65rem; margin-bottom: .65rem;
}
.testimonial .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient);
  display: grid; place-items: center;
  font-size: .75rem; font-weight: 800; color: #fff;
}
.testimonial .name { font-weight: 700; font-size: .92rem; }
.testimonial .role { color: var(--muted); font-size: .78rem; }
.testimonial p {
  margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; font-weight: 500;
}
[data-theme="dark"] .testimonial p { color: #d8d4e8; }

/* ——— Pricing / trial (checkout-inspired) ——— */
.pricing-screen {
  min-height: 100vh; background: var(--mesh), var(--bg); color: var(--text);
  display: flex; flex-direction: column;
}
.pricing-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.pricing-top .utils { display: flex; gap: .5rem; align-items: center; }
.topbar-utils { gap: .45rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pricing-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2rem;
  padding: 1.75rem 1.75rem 6.5rem;
  width: min(1100px, 100%);
  margin: 0 auto;
}
@media (max-width: 900px) {
  .pricing-body { grid-template-columns: 1fr; padding-bottom: 7.5rem; }
}
.pricing-hero {
  font-family: var(--font);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
  margin: 0 0 1.25rem; max-width: 18ch;
}
.trust-row {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1.75rem;
}
.trust-item {
  display: flex; align-items: center; gap: .5rem;
  font-size: .9rem; font-weight: 600; color: var(--text);
}
.trust-item strong { color: var(--text); }
.trust-item .check {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(34, 197, 94, 0.15); color: var(--success);
  display: grid; place-items: center; font-size: .75rem; font-weight: 800;
}
[data-theme="light"] .trust-item .check {
  background: rgba(22, 163, 74, 0.14); color: #16a34a;
}
.plan-toggle {
  display: inline-flex; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: .25rem; margin-bottom: 1rem; gap: .15rem;
}
.plan-toggle button,
.main .plan-toggle button,
.main button.plan-toggle-btn {
  background: transparent !important;
  color: var(--muted) !important;
  border: none !important;
  border-radius: var(--radius-pill) !important;
  padding: .45rem .9rem;
  font-size: .85rem;
  font-weight: 700;
  box-shadow: none !important;
  filter: none !important;
}
.plan-toggle button.on,
.main .plan-toggle button.on {
  background: var(--accent) !important;
  color: #fff !important;
}
.plan-toggle button.on:hover { background: var(--accent-hover) !important; }
.badge-off {
  display: inline-block; margin-left: .35rem;
  background: var(--accent); color: #fff; font-size: .65rem;
  padding: .15rem .4rem; border-radius: 6px; vertical-align: middle;
}
.plan-toggle button.on .badge-off {
  background: rgba(255, 255, 255, 0.22);
}
.plan-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem;
}
.plan-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.05rem 1.1rem; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
.plan-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.plan-card.selected {
  border-color: transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    var(--gradient) border-box;
  border: 2px solid transparent;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.18);
}
[data-theme="light"] .plan-card {
  background: #fff;
  box-shadow: 0 1px 2px rgba(76, 29, 149, 0.05);
}
[data-theme="light"] .plan-card.selected {
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--gradient) border-box;
  box-shadow: 0 10px 28px rgba(109, 40, 217, 0.14);
}
.plan-card .pname { font-weight: 700; font-size: .95rem; margin-bottom: .35rem; color: var(--text); }
.plan-card .pprice { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.plan-card .pprice span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.feature-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .9rem;
  margin: 1rem 0 1.5rem;
}
.feature-list li {
  list-style: none; display: flex; gap: .5rem; align-items: flex-start;
  font-size: .88rem; font-weight: 500; color: var(--text);
}
.feature-list .tick {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--text);
  color: var(--text);
  display: grid; place-items: center; font-size: .65rem; flex-shrink: 0; margin-top: 1px;
}
.faq-list { display: flex; flex-direction: column; gap: .65rem; }
.faq-item {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: .9rem 1rem;
}
[data-theme="light"] .faq-item,
[data-theme="light"] .order-box {
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.faq-item summary {
  cursor: pointer; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin: .65rem 0 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.order-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.15rem;
}
.order-box h3 { margin: 0 0 .85rem; font-size: 1.1rem; font-weight: 800; color: var(--text); }
.order-line {
  display: flex; justify-content: space-between; margin-bottom: .55rem;
  font-weight: 600; color: var(--text);
}
.order-line.due { font-size: 1.05rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.pricing-pay-brand { color: var(--accent2); font-weight: 700; }
[data-theme="light"] .pricing-pay-brand { color: #0C2454; }
.pricing-footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1.5rem;
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 40;
}
[data-theme="dark"] .pricing-footer {
  background: rgba(10, 10, 10, 0.92);
}
[data-theme="light"] .pricing-footer {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.06);
}
.pricing-footer .hint { color: var(--muted); }
.pricing-footer .cta {
  border-radius: var(--radius-pill);
  padding: .9rem 1.5rem;
  white-space: nowrap;
  background: var(--gradient-btn);
  color: #fff;
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.35);
}
.pricing-footer .cta:hover { filter: brightness(1.06); background: var(--gradient-btn); }

/* ——— App shell (Postiz-style: icon rail + channels + workspace) ——— */
.shell {
  display: grid;
  grid-template-columns: 200px 240px minmax(0, 1fr);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  align-items: stretch;
  transition: grid-template-columns .2s ease;
}
.shell.no-channels { grid-template-columns: 200px minmax(0, 1fr); }
.shell.shell-calendar,
.shell.shell-calendar.no-channels {
  grid-template-columns: 200px minmax(0, 1fr);
}
.shell.rail-collapsed { grid-template-columns: 88px 240px minmax(0, 1fr); }
.shell.rail-collapsed.no-channels,
.shell.rail-collapsed.shell-calendar,
.shell.rail-collapsed.shell-calendar.no-channels {
  grid-template-columns: 88px minmax(0, 1fr);
}
/* Comet legacy (non-unified): full-bleed content, hide Social rail */
.shell.shell-comet:not(.shell-unified),
.shell.shell-comet:not(.shell-unified).no-channels,
.shell.shell-comet:not(.shell-unified).rail-collapsed,
.shell.shell-comet:not(.shell-unified).rail-collapsed.no-channels {
  grid-template-columns: minmax(0, 1fr);
}
.shell.shell-comet:not(.shell-unified) .rail,
.shell.shell-comet:not(.shell-unified) .mobile-nav-toggle,
.shell.shell-comet:not(.shell-unified) .mobile-nav-backdrop {
  display: none !important;
}
/* Unified shell: keep Social|Comet rail beside Comet content */
.shell.shell-unified.shell-comet,
.shell.shell-unified.shell-comet.no-channels {
  grid-template-columns: 200px minmax(0, 1fr);
}
.shell.shell-unified.shell-comet.rail-collapsed,
.shell.shell-unified.shell-comet.rail-collapsed.no-channels {
  grid-template-columns: 88px minmax(0, 1fr);
}
/* Comet rail items MUST match Social — never shrink type */
.shell.shell-unified.shell-comet .rail .rail-item {
  font-size: var(--rail-item-size, 0.9375rem);
  font-weight: var(--weight-ui, 600);
  padding: 0.6rem 0.85rem;
  gap: 0.65rem;
  min-height: var(--touch, 44px);
  line-height: 1.25;
}
.shell.shell-unified.shell-comet .rail .rail-item span {
  white-space: nowrap;
  font-size: inherit;
  font-weight: inherit;
}
.shell.shell-unified.shell-comet .rail .rail-item svg {
  width: 20px;
  height: 20px;
}
.shell.shell-unified.shell-comet .rail {
  display: flex !important;
  flex-direction: column;
  width: auto;
  max-width: none;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.shell.shell-unified.shell-comet .rail .rail-nav-scroll {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: .28rem;
}
.mobile-nav-toggle,
.mobile-nav-backdrop { display: none; }
@media (max-width: 980px) {
  .shell, .shell.no-channels, .shell.shell-calendar, .shell.shell-calendar.no-channels,
  .shell.shell-unified.shell-comet,
  .shell.shell-unified.shell-comet.no-channels,
  .shell.shell-unified.shell-comet.rail-collapsed,
  .shell.shell-unified.shell-comet.rail-collapsed.no-channels {
    grid-template-columns: 1fr;
    height: 100dvh;
    max-height: 100dvh;
  }
  .channels-pane { display: none; }
  .mobile-nav-toggle {
    display: grid; place-items: center;
    position: fixed; top: .75rem; left: .75rem; z-index: 60;
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--panel) !important; color: var(--text) !important;
    border: 1px solid var(--line-strong) !important;
    box-shadow: var(--shadow) !important;
    font-size: 1.15rem; padding: 0;
  }
  .mobile-nav-backdrop.show {
    display: block; position: fixed; inset: 0; z-index: 48;
    background: rgba(11, 18, 32, 0.55); border: 0;
  }
  /* Clear the fixed hamburger, which otherwise sits on top of the first row of
     page content (the demo chip, the page title). */
  .main,
  .shell.shell-calendar .main.main-calendar,
  .shell.shell-comet .main.main-comet { padding-top: 4.25rem; }
  .rail {
    display: flex;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 55;
    width: min(78vw, 240px);
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  .rail.open { transform: translateX(0); }
  .shell .main { padding-top: 3.25rem; }
}

/* Unified sidebar menu — same layout in light + dark */
.rail {
  background: var(--rail-bg);
  border-right: 1px solid var(--rail-line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1rem .7rem 1.1rem;
  gap: .28rem;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  width: 100%;
  align-self: stretch;
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  margin-bottom: .35rem;
  flex-shrink: 0;
}
.rail-collapse-btn {
  flex-shrink: 0;
  width: var(--touch);
  height: var(--touch);
  min-width: var(--touch);
  min-height: var(--touch);
  border-radius: var(--radius-sm);
  border: 1px solid var(--rail-line);
  background: transparent !important;
  color: var(--rail-item);
  line-height: 0;
  padding: 0;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  box-shadow: none !important;
  filter: none !important;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.rail-collapse-btn .nav-collapse-ico {
  display: block;
  transition: transform .18s ease;
}
.rail-collapse-btn.is-collapsed .nav-collapse-ico {
  transform: scaleX(-1);
}
.rail-collapse-btn:hover {
  color: var(--rail-item-hover);
  background: var(--rail-item-hover-bg) !important;
  border-color: color-mix(in srgb, var(--rail-item-hover) 22%, var(--rail-line));
  box-shadow: none !important;
  filter: none !important;
}
.rail-collapse-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.rail-group {
  display: flex;
  flex-direction: column;
  gap: .22rem;
  margin-top: .35rem;
}
.rail-group:first-of-type { margin-top: 0; }
.rail-group-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted2);
  padding: .5rem .85rem .25rem;
  user-select: none;
}
.rail-more {
  margin-top: .35rem;
  border: 0;
  padding: 0;
}
.rail-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: var(--rail-item-size, 0.9375rem);
  font-weight: var(--weight-ui, 600);
  letter-spacing: 0;
  text-transform: none;
  color: var(--rail-item);
  padding: .6rem .85rem;
  min-height: var(--touch, 44px);
  display: flex;
  align-items: center;
  border-radius: 12px;
}
.rail-more > summary:hover {
  background: var(--rail-item-hover-bg);
  color: var(--rail-item-hover);
}
.rail-more .rail-item {
  font-size: var(--rail-item-size, 0.9375rem) !important;
  padding: .6rem .85rem !important;
  min-height: var(--touch, 44px);
}
.rail-more > summary::-webkit-details-marker { display: none; }
.rail-more > summary::after {
  content: " ▾";
  font-size: .7em;
  opacity: .7;
}
.rail-more[open] > summary::after { content: " ▴"; }
.rail-more .rail-item { margin-top: .15rem; }
.shell.rail-collapsed .rail-group-label,
.shell.rail-collapsed .rail-more > summary {
  display: none;
}
.shell.rail-collapsed .rail {
  padding: .85rem .4rem 1rem;
  align-items: stretch;
}
.shell.rail-collapsed .rail-head {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
  width: 100%;
  margin-bottom: .55rem;
  padding: 0 .1rem;
}
.shell.rail-collapsed .rail .rail-logo,
.shell.rail-collapsed .rail-head .rail-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  margin: 0;
  flex-shrink: 0;
}
.shell.rail-collapsed .rail-collapse-btn {
  width: var(--touch);
  height: var(--touch);
  margin: 0;
  flex-shrink: 0;
}
.shell.rail-collapsed .rail .rail-item {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  justify-content: center;
  align-items: center;
  padding: .55rem 0;
  gap: 0;
  border-radius: 12px;
  overflow: visible;
}
.shell.rail-collapsed .rail .rail-item svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  display: block;
  opacity: 1;
  flex-shrink: 0;
  color: currentColor;
  stroke: currentColor;
}
.shell.rail-collapsed .rail .rail-item.active {
  border-radius: 12px;
}
.shell.rail-collapsed .rail .rail-item.active svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
  opacity: 1 !important;
}
.shell.rail-collapsed .rail .rail-item span,
.shell.rail-collapsed .rail a.rail-logout {
  display: none;
}
@media (max-width: 980px) {
  .rail-collapse-btn { display: none; }
}
.rail .rail-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: #12060A;
  color: #FFFFFF;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem;
  margin: .15rem .15rem .65rem;
  box-shadow: none;
  text-decoration: none;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
}
.rail .rail-logo img {
  width: 100%; height: 100%; display: block; object-fit: contain;
  padding: 2px;
}
.rail-head .rail-logo { margin: .15rem 0 .15rem .15rem; }
.rail .rail-item {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: .65rem;
  padding: .6rem .85rem;
  min-height: var(--touch, 44px);
  border-radius: 12px;
  color: var(--rail-item);
  text-decoration: none;
  font-family: var(--font);
  font-size: var(--rail-item-size, 0.9375rem);
  font-weight: var(--weight-ui, 600);
  letter-spacing: 0;
  line-height: 1.25;
  text-align: left;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  filter: none;
  transform: none;
}
.rail button.rail-item {
  appearance: none;
  -webkit-appearance: none;
}
/* Defeat global `button { background: linear-gradient... }` for rail nav only */
.shell .rail button.rail-item:not(.active) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  color: var(--rail-item) !important;
}
.shell .rail button.rail-item:not(.active):hover {
  background: var(--rail-item-hover-bg) !important;
  color: var(--rail-item-hover) !important;
}
.shell .rail button.rail-item.active {
  background: var(--rail-active-bg) !important;
  color: #FFFFFF !important;
  box-shadow: var(--rail-active-shadow) !important;
  filter: none !important;
}
.rail .rail-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  padding: 0;
  -webkit-line-clamp: unset;
}
.rail .rail-item svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
  opacity: .95;
  stroke-width: 1.85;
  color: currentColor;
  stroke: currentColor;
}
.rail .rail-item:hover {
  color: var(--rail-item-hover);
  background: var(--rail-item-hover-bg);
  text-decoration: none;
  transform: none;
}
.rail .rail-item.active {
  background: var(--rail-active-bg);
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: var(--rail-active-shadow);
}
.rail .rail-item.active svg { opacity: 1; color: #FFFFFF; stroke: currentColor; }
.rail-spacer { flex: 0 0 0.5rem; min-height: 0.5rem; }
.rail a.rail-logout {
  font-family: var(--display);
  color: #fb7185;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  margin: .35rem .15rem 0;
  padding: .45rem .8rem;
  border-radius: 999px;
}
.rail a.rail-logout:hover {
  text-decoration: none;
  background: rgba(251, 113, 133, 0.12);
}
[data-theme="light"] .rail a.rail-logout {
  color: #BE123C;
}

.channels-pane {
  background: var(--bg2);
  border-right: 1px solid var(--line);
  padding: .9rem .85rem;
  display: flex; flex-direction: column; gap: .75rem;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-self: stretch;
}
[data-theme="dark"] .channels-pane { background: #0A0A0A; }
[data-theme="light"] .channels-pane {
  background: var(--card);
  border-right-color: var(--line-strong);
}
[data-theme="light"] .channels-pane .cp-title,
[data-theme="light"] .channels-pane .cname {
  color: var(--fg);
}
[data-theme="light"] .channels-pane .cprov,
[data-theme="light"] .channels-pane .channel-group h4,
[data-theme="light"] .channels-pane .muted {
  color: var(--muted);
}
[data-theme="light"] .btn-add-channel {
  color: var(--fg) !important;
  border-color: var(--line-strong) !important;
}
.channels-pane .cp-title {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--display);
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em;
  color: var(--text);
}
.btn-add-channel {
  width: 100%; background: transparent !important; color: var(--text) !important;
  border: 1px dashed var(--line-strong) !important; font-weight: 700;
  border-radius: 12px; padding: .75rem; box-shadow: none !important;
}
.btn-create-row { display: flex; gap: .5rem; align-items: stretch; }
.btn-create-post {
  flex: 1;
  background: var(--gradient-btn) !important;
  color: #FFFFFF !important; font-weight: 800; border-radius: 999px; padding: .7rem 1rem; font-size: .92rem;
  border: 0 !important;
  box-shadow: var(--shadow-accent) !important;
  font-family: var(--display);
}
.btn-ai-spark {
  width: 46px; background: linear-gradient(135deg, var(--hot), #171717) !important;
  border-radius: 999px; border: 0 !important; color: #fff !important; font-size: 1.15rem;
  box-shadow: var(--shadow-sm) !important;
}
.channel-group { margin-top: .35rem; }
.channel-group h4 {
  margin: .65rem 0 .45rem; color: var(--muted); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 800;
  font-family: var(--display);
}
.channel-item {
  display: flex; align-items: center; gap: .7rem;
  width: 100%;
  text-align: left;
  padding: .55rem .6rem; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  box-shadow: none !important;
  filter: none !important;
  transition: background .15s ease, border-color .15s ease;
  min-height: var(--touch);
}
.channel-item:hover { background: var(--elevated); }
.channel-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.channel-item.on {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.channel-avatar {
  width: 38px; height: 38px; border-radius: 50%; position: relative;
  background: var(--gradient);
  display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.channel-avatar .badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  /* Must not inherit the avatar's white ink — that made badges look like empty notches. */
  background: var(--panel);
  border: 1.5px solid var(--line-strong);
  color: var(--text);
  font-size: .55rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
}
[data-theme="light"] .channel-avatar .badge {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}
.channel-item > div:last-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.channel-item .cname,
.channel-item .cprov {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-item .cname { font-weight: 700; font-size: .82rem; line-height: 1.2; }
.channel-item .cprov { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: capitalize; }

.main {
  padding: var(--pad) var(--pad) 2.25rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--mesh), var(--bg);
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: 100%;
  align-self: stretch;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.topbar h1 {
  margin: 0; font-family: var(--font);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem); font-weight: 800; letter-spacing: -0.02em;
}
.row { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 1rem; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.2rem;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
  transition: border-color .15s ease, transform .15s ease;
}
.stat:hover, .panel:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong));
  transform: translateY(-1px);
}
.stat .n {
  font-family: var(--font); font-size: 1.25rem; font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .l { color: var(--muted); font-size: .85rem; font-weight: 600; margin-top: .25rem; }

.metric-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.1rem 1.15rem; min-height: 148px;
  position: relative; overflow: hidden;
  min-width: 0;
}
.grid.cols-3.analytics-cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.metric-card .mt,
.metric-card .mv {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.metric-card::after {
  content: ""; position: absolute; inset: auto -20% -40% auto; width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 70%);
  pointer-events: none;
}
.metric-card .mt { font-size: .85rem; font-weight: 600; color: var(--muted); }
.metric-card .mv {
  font-family: var(--font);
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin: .3rem 0 .45rem;
}
.spark {
  height: 48px; width: 100%;
  background: linear-gradient(180deg, rgba(124, 58, 237, .4), rgba(79,70,229,.1), transparent);
  border-bottom: 2px solid var(--cyan);
  border-radius: 4px 4px 0 0;
  clip-path: polygon(0 70%, 12% 55%, 24% 62%, 38% 40%, 52% 48%, 66% 28%, 80% 35%, 100% 18%, 100% 100%, 0 100%);
}

.cal-toolbar {
  display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; flex-wrap: wrap;
}
.cal-toolbar .cal-title {
  font-family: var(--font);
  font-weight: 800; font-size: .95rem; min-width: 9rem;
}
.btn-today {
  background: transparent !important; border: 1px solid var(--line-strong) !important;
  color: var(--text) !important; border-radius: 10px; padding: .45rem .8rem; font-weight: 700; font-size: .85rem;
  box-shadow: none !important;
}

/* ——— Soft “This week on Postix” calendar board (theme-aware) ——— */
.shell.shell-calendar .main.main-calendar {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: var(--pad);
  box-sizing: border-box;
}
.shell.shell-calendar .main.main-calendar,
.shell.shell-calendar .main-body {
  background: transparent;
}
.shell.shell-calendar .main.main-calendar .main-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.shell.shell-calendar .main.main-calendar .main-body:has(.week-board) {
  overflow: hidden;
}
.shell.shell-calendar .discord-fab { display: none; }

.week-board {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.week-board > .onboard-banner {
  flex-shrink: 0;
  margin-bottom: .65rem;
}
.week-board-hero {
  margin: 0 0 .65rem;
  padding: 0 .1rem;
  flex-shrink: 0;
}
.week-board-eyebrow {
  margin: 0 0 .3rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #A78BFA;
}
.week-board-hero-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.week-board-frame {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
}
.week-board-chrome {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: .85rem;
  padding: .1rem .1rem .7rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.week-board-dots { display: none !important; }
.week-board-dots span { display: none !important; }
.week-board-title {
  margin: 0;
  flex: 1;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.week-board-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .38rem .95rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  background: linear-gradient(105deg, #7C3AED 0%, #DB2777 100%);
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.35);
}
.week-board-utils { display: flex; align-items: center; gap: .35rem; }
.week-board-tools {
  margin-bottom: .75rem;
  opacity: .92;
  flex-shrink: 0;
}
.week-board-tools .cal-title.sr-only,
.week-board-tools #calLabel:empty {
  display: none;
  min-width: 0;
}
.week-board-footer {
  margin-top: .85rem;
  padding: .7rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  flex-shrink: 0;
}

.calendar.week-board-grid,
.calendar.week.week-board-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .65rem;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  flex: 1;
  min-height: 280px;
  height: 100%;
  box-shadow: none;
  align-content: stretch;
}
.calendar.week-board-grid .cal-head { display: none; }
.calendar.week-board-grid .cal-day {
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  padding: 1rem .85rem;
  display: flex;
  flex-direction: column;
}
.calendar.week-board-grid .cal-day:nth-child(7n) { border-right-width: 1px; }
.calendar.week-board-grid .cal-day .d {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .4rem;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: .85rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.calendar.week-board-grid .cal-day .cal-day-num {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}
.calendar.week-board-grid .cal-day.is-today .cal-day-num {
  display: grid;
  place-items: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
/* Empty days still need a target: a bare column reads as a rendering failure. */
.calendar.week-board-grid .cal-day-empty {
  width: 100%;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  padding: .5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, border-color .15s ease, color .15s ease;
}
.calendar.week-board-grid .cal-day:hover .cal-day-empty,
.calendar.week-board-grid .cal-day-empty:focus-visible { opacity: 1; }
.calendar.week-board-grid .cal-day-empty:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.calendar.week-board-grid .cal-day-posts {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.calendar.week-board-grid .cal-day-weekend {
  grid-column: span 1;
  min-height: 140px;
  opacity: .92;
}
@media (max-width: 900px) {
  .calendar.week-board-grid,
  .calendar.week.week-board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: auto;
  }
  .calendar.week-board-grid .cal-day { min-height: 200px; height: auto; }
}
@media (max-width: 560px) {
  .calendar.week-board-grid,
  .calendar.week.week-board-grid {
    grid-template-columns: 1fr;
  }
  .week-board-dots { display: none; }
  .week-board-frame { padding: .75rem; }
}

/* Soft platform pills — quiet chips */
.cal-event.soft-pill {
  border: 1px solid var(--line) !important;
  border-left: 3px solid var(--accent) !important;
  border-radius: 10px !important;
  padding: 0;
  margin: 0 0 .35rem;
  color: var(--text) !important;
  text-shadow: none;
  background: var(--panel2) !important;
  box-shadow: none;
}
.cal-event.soft-pill .cal-event-body {
  padding: .4rem .55rem;
  justify-content: flex-start;
}
.cal-event.soft-pill .cal-text {
  color: var(--text) !important;
  font-weight: var(--weight-ui);
  font-size: var(--text-caption);
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] .cal-event.soft-pill,
[data-theme="dark"] .cal-event {
  background: rgba(255,255,255,0.06) !important;
  color: #F8FAFC !important;
}
[data-theme="dark"] .cal-event.soft-pill .cal-text {
  color: #F8FAFC !important;
}
.cal-event.soft-pill .cal-event-actions {
  border-radius: 10px 10px 0 0;
}
.cal-event.soft-pill[data-platform="linkedin"],
.cal-event.soft-pill[data-platform="linkedin_page"],
.cal-event.soft-pill[data-platform="facebook"] { border-left-color: #2563EB !important; }
.cal-event.soft-pill[data-platform="instagram"],
.cal-event.soft-pill[data-platform="instagram_standalone"],
.cal-event.soft-pill[data-platform="pinterest"] { border-left-color: #DB2777 !important; }
.cal-event.soft-pill[data-platform="youtube"],
.cal-event.soft-pill[data-platform="reddit"] { border-left-color: #EA580C !important; }
.cal-event.soft-pill[data-platform="x"],
.cal-event.soft-pill[data-platform="twitter"] { border-left-color: #6366F1 !important; }
.cal-event.soft-pill[data-platform="tiktok"],
.cal-event.soft-pill[data-platform="bluesky"],
.cal-event.soft-pill[data-platform="threads"],
.cal-event.soft-pill[data-platform="telegram"],
.cal-event.soft-pill[data-platform="discord"],
.cal-event.soft-pill[data-platform="slack"] { border-left-color: #0891B2 !important; }
.cal-event.soft-pill.draft { filter: none; opacity: .92; }
.cal-event.soft-pill.failed { border-left-color: var(--danger) !important; }



/* —— Dark theme calendar board —— */
[data-theme="dark"] .shell.shell-calendar {
  background: #050505;
}
[data-theme="dark"] .shell.shell-calendar .main {
  background:
    radial-gradient(820px 420px at 8% -12%, rgba(124, 58, 237, 0.18), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(219, 39, 119, 0.1), transparent 50%),
    #050505;
}
[data-theme="dark"] .week-board-frame {
  background: #0A0A0A;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] .week-board-chrome {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .week-board-title,
[data-theme="dark"] .week-board-hero-title {
  color: #FFFFFF;
}
[data-theme="dark"] .calendar.week-board-grid .cal-day {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}
[data-theme="dark"] .calendar.week-board-grid .cal-day .d {
  color: #FFFFFF;
}
[data-theme="dark"] .week-board-footer {
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.02);
}
[data-theme="dark"] .week-board-tools .btn-today,
[data-theme="dark"] .week-board-tools .secondary,
[data-theme="dark"] .week-board-tools select {
  background: #121212 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #FFFFFF !important;
}

/* —— Light theme calendar board —— */
[data-theme="light"] .shell.shell-calendar {
  background: var(--bg);
}
[data-theme="light"] .shell.shell-calendar .main {
  background:
    radial-gradient(720px 380px at 12% -10%, rgba(124, 58, 237, 0.1), transparent 55%),
    radial-gradient(640px 360px at 100% 0%, rgba(219, 39, 119, 0.07), transparent 50%),
    var(--bg);
}
[data-theme="light"] .week-board-frame {
  background: var(--card);
  border-color: var(--line-strong);
  box-shadow: 0 16px 40px rgba(15, 15, 35, 0.1);
}
[data-theme="light"] .week-board-title,
[data-theme="light"] .week-board-hero-title {
  color: var(--fg) !important;
}
[data-theme="light"] .week-board-eyebrow {
  color: var(--accent);
  font-weight: 800;
}
[data-theme="light"] .calendar.week-board-grid .cal-day {
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 20px rgba(15, 15, 35, 0.06);
}
[data-theme="light"] .calendar.week-board-grid .cal-day .d {
  color: var(--fg);
  font-weight: 800;
}
[data-theme="light"] .cal-head {
  color: var(--fg);
  background: var(--elevated);
  border-color: var(--line-strong);
}
[data-theme="light"] .cal-day {
  background: var(--card);
  border-color: var(--line);
}
[data-theme="light"] .cal-day .d { color: var(--fg); }
[data-theme="light"] .cal-day.muted-day .d { color: var(--muted2); }
[data-theme="light"] .week-board-footer {
  border-color: var(--line-strong);
  color: var(--muted);
  font-weight: 600;
}
[data-theme="light"] .week-board-tools {
  opacity: 1;
}
[data-theme="light"] .week-board-tools .btn-today,
[data-theme="light"] .week-board-tools .secondary,
[data-theme="light"] .week-board-tools select,
[data-theme="light"] .week-board-tools a,
[data-theme="light"] .cal-toolbar .btn-today,
[data-theme="light"] .cal-toolbar .secondary,
[data-theme="light"] .cal-toolbar select,
[data-theme="light"] .cal-toolbar a {
  background: var(--card) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--fg) !important;
  box-shadow: none !important;
  font-weight: 700;
}
[data-theme="light"] .cal-toolbar .cal-title,
[data-theme="light"] .week-board-tools .cal-title {
  color: var(--fg) !important;
}
[data-theme="light"] .week-board-utils .theme-toggle {
  color: var(--fg) !important;
  border-color: var(--line-strong) !important;
}
[data-theme="light"] .rail .rail-item {
  color: var(--rail-item);
  font-weight: 700;
}
/* Active item must keep white ink — the light-theme rule above matches .active
   at equal specificity and was painting dark zinc over the purple chip. */
[data-theme="light"] .rail .rail-item.active,
[data-theme="light"] .rail a.rail-item.active,
[data-theme="light"] .rail button.rail-item.active {
  color: #FFFFFF !important;
}
[data-theme="light"] .rail .rail-item.active svg,
[data-theme="light"] .rail a.rail-item.active svg,
[data-theme="light"] .rail button.rail-item.active svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
  opacity: 1 !important;
}
[data-theme="light"] .rail .rail-item svg {
  color: currentColor;
  stroke: currentColor;
  opacity: 1;
}
[data-theme="light"] .rail-group-label,
[data-theme="light"] .rail-more > summary {
  color: var(--muted);
}

.calendar {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0;
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: var(--panel);
}
.cal-head {
  text-align: center; color: var(--text); font-size: .82rem;
  font-weight: 800; padding: .75rem .4rem; text-transform: capitalize;
  border-bottom: 1px solid var(--line); background: var(--panel2);
  font-family: var(--display); letter-spacing: -0.01em;
}
.cal-day {
  min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: .5rem;
  background: var(--bg2);
  min-width: 0;
}
[data-theme="dark"] .cal-day {
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 6px, rgba(255,255,255,.02) 6px, rgba(255,255,255,.02) 7px),
    #12101a;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day .d {
  font-size: .85rem;
  color: var(--text);
  margin-bottom: .4rem;
  font-weight: 800;
  font-family: var(--display);
}
[data-theme="dark"] .cal-day .d { color: #FFFFFF; }
.cal-day.muted-day .d { color: var(--muted2); }
.cal-event {
  font-size: var(--text-caption); padding: 0; border-radius: 10px; margin-bottom: .35rem;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent); cursor: grab;
  font-weight: var(--weight-ui); color: var(--text);
  display: flex; flex-direction: column; gap: 0;
  position: relative; overflow: hidden;
  font-family: var(--font);
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: none;
}
.cal-event .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.cal-event-actions {
  display: none; align-items: center; justify-content: flex-end; gap: .15rem;
  background: var(--accent); padding: .28rem .35rem; margin: 0;
}
.cal-event:hover .cal-event-actions,
.cal-event:focus-within .cal-event-actions { display: flex; }
.cal-event .cea {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: transparent !important; color: #fff !important;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: none !important;
}
.cal-event .cea:hover { background: rgba(255,255,255,.18) !important; }
.cal-event .cea:disabled { opacity: .35; cursor: not-allowed; }
.cal-event .cea svg { width: 14px; height: 14px; }
.cal-event-body {
  display: flex; align-items: center; gap: .4rem;
  padding: .4rem .45rem .45rem;
}
.cal-av {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff; font-size: .55rem; font-weight: 700;
  display: grid; place-items: center;
}
.cal-av.lg { width: 36px; height: 36px; font-size: .75rem; }
.cal-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-event.failed { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--panel2)); }
.cal-event.published { border-left-color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--panel2)); }
.cal-event.draft { border-left-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, var(--panel2)); }

/* Channel accent = left border only */
.cal-event[data-platform="x"] { border-left-color: #6366F1; }
.cal-event[data-platform="linkedin"],
.cal-event[data-platform="linkedin_page"] { border-left-color: #2563EB; }
.cal-event[data-platform="instagram"],
.cal-event[data-platform="instagram_standalone"] { border-left-color: #DB2777; }
.cal-event[data-platform="youtube"] { border-left-color: #DC2626; }
.cal-event[data-platform="tiktok"] { border-left-color: #0891B2; }
.cal-event[data-platform="facebook"],
.cal-event[data-platform="threads"] { border-left-color: #1D4ED8; }
.cal-event[data-platform="bluesky"] { border-left-color: #0284C7; }
.cal-event[data-platform="reddit"] { border-left-color: #EA580C; }
.cal-event[data-platform="pinterest"] { border-left-color: #BE185D; }
.cal-event[data-platform="telegram"],
.cal-event[data-platform="discord"],
.cal-event[data-platform="slack"] { border-left-color: var(--accent); }
.calendar.week { min-height: 320px; }
.calendar.week .cal-day { min-height: 180px; }

/* Light theme calendar: neutral board, quiet events */
[data-theme="light"] .calendar {
  background: #FFFFFF;
  border-color: rgba(17, 17, 17, 0.1);
  box-shadow: none;
}
[data-theme="light"] .cal-head {
  color: #111111;
  background: #F0F0F2;
  border-bottom-color: rgba(17, 17, 17, 0.1);
}
[data-theme="light"] .cal-day {
  background: #FAFAFA;
  border-color: rgba(17, 17, 17, 0.08);
}
[data-theme="light"] .cal-day .d { color: #111111; }
[data-theme="light"] .cal-day.muted-day { background: #F0F0F2; }
[data-theme="light"] .cal-day.muted-day .d { color: var(--muted2); }
[data-theme="light"] .cal-toolbar .cal-title,
[data-theme="light"] .topbar h1 { color: #111111; }
[data-theme="light"] .cal-event,
[data-theme="light"] .cal-event.draft,
[data-theme="light"] .cal-event.published,
[data-theme="light"] .cal-event.failed {
  color: var(--text) !important;
  text-shadow: none;
  background: var(--panel2) !important;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-left-style: solid;
}
[data-theme="light"] .cal-event .cal-text,
[data-theme="light"] .cal-event .cal-av { color: var(--text) !important; }
[data-theme="light"] .cal-event .cal-av { background: var(--accent); color: #fff !important; }
[data-theme="light"] .cal-event-actions { background: var(--accent); }
[data-theme="light"] .cal-list th { color: #52525B; }
[data-theme="light"] .cal-list td { color: #18181B; }
[data-theme="light"] .stat,
[data-theme="light"] .panel {
  box-shadow: none;
}

.metric-card.tone-purple .tone-dot,
.metric-card.tone-purple .mt .tone-dot { background: #A78BFA; }
.metric-card.tone-green .tone-dot { background: #34d399; }
.metric-card.tone-blue .tone-dot { background: #60a5fa; }
.tone-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: .4rem; vertical-align: middle;
}
.metric-card .delta {
  font-size: .75rem; font-weight: 700; margin-bottom: .35rem;
}
.metric-card .delta.up { color: #34d399; }
.metric-card .delta.down { color: #f87171; }
.metric-card .delta.is-none { color: var(--muted2); font-weight: 600; }
/* Nothing measured yet: drop the decorative glow so the card reads as pending
   rather than as a chart that failed to draw. */
.metric-card.is-awaiting { min-height: 118px; }
.metric-card.is-awaiting::after { display: none; }
.metric-card.is-awaiting .mv { color: var(--muted); }
.spark.flat {
  height: 36px;
  background: linear-gradient(180deg, rgba(124, 58, 237, .25), transparent);
  border-bottom: 2px solid currentColor;
  clip-path: none;
  opacity: .55;
}
.metric-card.tone-purple .spark.flat { color: #A78BFA; border-bottom-color: #A78BFA; }
.metric-card.tone-green .spark.flat { color: #34d399; border-bottom-color: #34d399; }
.metric-card.tone-blue .spark.flat { color: #60a5fa; border-bottom-color: #60a5fa; }
.metric-card.mini { min-height: auto; padding: .85rem 1rem; flex: 1; min-width: 120px; }
.metric-card.mini::after { display: none; }
.analytics-cards { margin-bottom: .25rem; }
.stats-grid { gap: .85rem; }
.stats-table thead th { background: rgba(13,148,136,.35); color: #fff; }
.preview-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 1rem;
}
.preview-body { font-size: .95rem; line-height: 1.5; word-break: break-word; }
.stats-modal { max-width: 720px; }
.modal .secondary svg { width: 16px; height: 16px; display: block; }

.shortlink-opt {
  display: inline-flex; align-items: center; gap: .55rem;
  margin: .35rem 0 .85rem; font-size: .88rem; font-weight: 600; color: var(--muted);
  cursor: pointer; user-select: none;
}
.shortlink-opt input { width: 16px; height: 16px; accent-color: var(--accent); }
.shortlink-list {
  margin: 0; padding-left: 1.1rem; font-size: .85rem; color: var(--text);
  max-height: 140px; overflow: auto;
}
.shortlink-list li { margin: .25rem 0; word-break: break-all; }

.gen-posts-modal {
  max-width: 520px;
  padding: 1.35rem 1.35rem 1.2rem;
}
.gen-posts-modal .gen-title {
  margin: 0 0 1.1rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.gen-posts-modal .gen-field {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-bottom: .95rem;
}
.gen-posts-modal .gen-field > span {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}
.gen-posts-modal textarea,
.gen-posts-modal select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: .85rem .95rem;
  font: inherit;
}
.gen-posts-modal textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.45;
}
.gen-posts-modal select {
  padding-right: 2.4rem;
}
.gen-check {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin: .15rem 0 1.1rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.gen-check input {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--line-strong);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.gen-check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.gen-check input:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.gen-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  margin-top: .35rem;
}
.gen-actions #genRun {
  min-width: 120px;
  background: var(--gradient-btn) !important;
  border: 0 !important;
  border-radius: 10px;
  font-weight: 800;
  padding: .7rem 1.15rem;
}

.tp-page { min-height: 40vh; }
.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.tp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 220px;
}
.tp-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.tp-card p {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}
.tp-card button {
  width: 100%;
  border-radius: 10px;
  font-weight: 800;
}
.tp-card .row button { width: auto; flex: 1; }
.tp-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 900; font-size: .85rem; color: #fff;
  background: linear-gradient(135deg, #7C3AED, #DB2777);
}
.tp-icon.tone-heygen { background: linear-gradient(135deg, #22d3ee, #a855f7, #f97316); }
.tp-icon.tone-reelfarm { background: linear-gradient(135deg, #111, #333); color: #fff; }
.tp-icon.tone-openai { background: linear-gradient(135deg, #10a37f, #0d8f6e); }
.tp-icon.tone-dub { background: linear-gradient(135deg, #000, #333); }
.tp-icon.tone-eleven { background: linear-gradient(135deg, #f43f5e, #fb7185); }
.tp-icon.tone-runway { background: linear-gradient(135deg, #111827, #4b5563); }
.tp-icon.tone-zapier { background: linear-gradient(135deg, #ff4a00, #ff8a3d); }
.tp-icon.tone-make { background: linear-gradient(135deg, #6d00cc, #9b4dff); }
.tp-icon.tone-cursor { background: linear-gradient(135deg, #1a1a1a, #3d3d3d); color: #fff; }
.tp-icon.tone-claude { background: linear-gradient(135deg, #d4a574, #c47a4a); }
.tp-icon.tone-gemini { background: linear-gradient(135deg, #4285f4, #9b72cb, #d96570); }
.tp-icon.tone-groq { background: linear-gradient(135deg, #f55036, #f97316); }
.tp-icon.tone-stability { background: linear-gradient(135deg, #7C3AED, #DB2777); }
.tp-icon.tone-fal { background: linear-gradient(135deg, #0ea5e9, #6366f1); }

.tp-pricing-banner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.tp-pricing-banner strong { font-size: 0.95rem; }
.tp-pricing-banner span { font-size: 0.85rem; opacity: 0.85; line-height: 1.4; }
.tp-section { margin-bottom: 1.75rem; }
.tp-section-head h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.tp-section-head p { margin: 0 0 0.85rem; }
.tp-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.tp-byok-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.18);
  color: #059669;
  white-space: nowrap;
}
.tp-caps { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0 0 0.75rem; }
.tp-caps span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.06);
  opacity: 0.8;
}
.tp-byok-modal-note {
  font-size: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  margin: 0 0 0.85rem;
}
.gen-byok-note { font-size: 0.82rem; margin: 0 0 0.85rem; line-height: 1.4; }

.ai-media-modal { max-width: 520px; }
.ai-media-modal textarea, .ai-media-modal select, .ai-media-modal input[type="number"] {
  width: 100%;
}
.compose-media-row {
  display: flex; flex-wrap: wrap; gap: .5rem; margin: .55rem 0 .15rem;
}
.compose-media-thumb {
  position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg2);
}
.compose-media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.compose-media-x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0;
  border-radius: 50%; background: rgba(0,0,0,.65) !important; color: #fff !important;
  border: 0 !important; font-size: .85rem; line-height: 1; box-shadow: none !important;
}
.compose-media-badge {
  position: absolute; left: 4px; bottom: 4px; font-size: .65rem; font-weight: 800;
  background: rgba(13,148,136,.9); color: #fff; padding: .1rem .35rem; border-radius: 6px;
}
/* Opens the CE.SDK editor; only rendered when ENABLE_VISUAL_EDITOR is on. */
.compose-media-edit {
  position: absolute; left: 2px; top: 2px; height: 20px; padding: 0 .4rem;
  border-radius: 6px; background: rgba(0,0,0,.65) !important; color: #fff !important;
  border: 0 !important; font-size: .65rem; font-weight: 700; line-height: 1;
  box-shadow: none !important; opacity: .82; transition: opacity .15s ease;
}
.compose-media-thumb:hover .compose-media-edit,
.compose-media-edit:focus-visible { opacity: 1; }
.preview-media {
  margin-top: .65rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  position: relative; background: var(--bg2);
}
.preview-media img { width: 100%; max-height: 280px; object-fit: cover; display: block; }
.preview-media-tag {
  position: absolute; left: .55rem; bottom: .55rem;
  background: rgba(0,0,0,.7); color: #fff; font-size: .72rem; font-weight: 700;
  padding: .25rem .5rem; border-radius: 8px;
}
.media-pick {
  padding: 0 !important; border-radius: 12px !important; overflow: hidden;
  background: var(--panel) !important; border: 1px solid var(--line) !important;
  aspect-ratio: 1; box-shadow: none !important;
}
.media-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }

.compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 1.25rem;
  align-items: start;
  min-height: calc(100vh - 8rem);
}
@media (max-width: 980px) { .compose-layout { grid-template-columns: 1fr; } }
.compose-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding-bottom: 1.5rem;
}
.account-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.channel-extras {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: flex-end;
  margin: 0;
}
.channel-extras[hidden] { display: none !important; }
.channel-extra-field {
  flex: 1 1 200px;
  margin: 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.channel-extra-field > span {
  font-size: .78rem;
  font-weight: 650;
  color: var(--muted);
}
.channel-extra-field select,
.channel-extra-field input {
  min-height: 40px;
  width: 100%;
  box-sizing: border-box;
}
.account-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.acct-av {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid transparent;
  background: linear-gradient(135deg, #0F766E, #0891B2);
  display: grid; place-items: center; font-size: .7rem; font-weight: 800; cursor: pointer;
  position: relative; color: #fff;
}
.acct-av.on { border-color: var(--accent2); box-shadow: 0 0 0 2px var(--accent-soft); }
.acct-av .badge {
  position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px;
  border-radius: 50%; background: #111; font-size: .5rem; display: grid; place-items: center;
}
.acct-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .35rem .7rem .35rem .45rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  box-shadow: none !important;
  filter: none !important;
}
.acct-chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.acct-chip.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.acct-chip .acct-prov-ico {
  width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; object-fit: contain;
  background: #fff;
}
.acct-chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.acct-chip-name {
  font-size: .8rem; font-weight: 700; max-width: 9.5rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-chip-prov { font-size: .68rem; color: var(--muted); text-transform: capitalize; }
[data-theme="light"] .acct-chip { background: #fff; }
[data-theme="light"] .acct-chip .acct-prov-ico { background: #F8FAFC; border: 1px solid var(--line); }
.thread-row {
  display: grid; grid-template-columns: 1fr auto; gap: .55rem; align-items: stretch;
}
.thread-block {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: .85rem;
}
.thread-block textarea {
  border: 0; background: transparent; min-height: 110px; padding: .35rem;
  box-shadow: none !important; width: 100%; resize: vertical;
  color: var(--text);
}
.thread-toolbar {
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
  border-top: 1px solid var(--line); padding-top: .65rem; margin-top: .35rem;
}
.thread-toolbar button {
  background: transparent !important; border: 1px solid var(--line) !important;
  color: var(--muted) !important; font-size: .75rem; font-weight: 700;
  padding: .4rem .55rem; border-radius: 8px;
  min-height: 32px;
}
.thread-toolbar .fmt-group {
  display: inline-flex; gap: .2rem; margin-left: .15rem;
}
.thread-toolbar .fmt-group button {
  min-width: 28px; padding: .35rem .4rem; font-family: inherit;
}
.thread-toolbar .ok-pill {
  margin-left: auto; color: var(--success) !important; border-color: rgba(34,197,94,.35) !important;
  font-size: .7rem;
}
.thread-side {
  display: flex; flex-direction: column; gap: .3rem; padding-top: .35rem;
}
.thread-side button {
  width: 34px; height: 34px; border-radius: 8px; padding: 0;
  background: var(--panel) !important; border: 1px solid var(--line) !important;
  color: var(--muted) !important; font-size: .85rem; line-height: 1;
}
.thread-side .danger-ico { color: #f87171 !important; }
.thread-side .clock-ico { color: #e879f9 !important; border-color: rgba(232,121,249,.35) !important; }
.btn-add-part {
  width: fit-content;
  min-height: 40px;
  border-radius: 999px !important;
  font-weight: 700;
}
.btn-add-part.secondary {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--line-strong) !important;
}
.btn-add-part.secondary:hover {
  background: var(--elevated) !important;
  filter: none !important;
}

/* Schedule / publish controls — own section, never sticky-mixed with extras */
.compose-schedule {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: .85rem 0 0;
  border-top: 1px solid var(--line);
}
.compose-schedule-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}
.compose-schedule-row > button,
.compose-schedule-row > select,
.compose-schedule-row > input[type="datetime-local"] {
  min-height: 40px;
  height: 40px;
  box-sizing: border-box;
}
.compose-schedule-row > select,
.compose-schedule-row > input[type="datetime-local"] {
  max-width: 100%;
  flex: 1 1 10rem;
  min-width: 9.5rem;
}
.compose-schedule-row > #repeatEvery { flex: 1 1 11rem; max-width: 14rem; }
.compose-schedule-row > #postType { flex: 1 1 9rem; max-width: 12rem; }
.compose-schedule-row > #when { flex: 1 1 12rem; max-width: 15rem; }
.compose-schedule-opt {
  margin: 0 !important;
  align-self: flex-start;
}

.compose-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  padding: 1rem 0 0;
  margin-top: .15rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.compose-actions #savePost {
  min-height: 44px;
  padding: .55rem 1.2rem;
  background: var(--accent) !important;
  border: none !important;
  color: #FFFFFF !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
}
.compose-actions #saveDraft {
  min-height: 44px;
}

.compose-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  position: sticky;
  top: 1rem;
  min-width: 0;
}
.compose-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .8rem;
}
.preview-thread { display: flex; flex-direction: column; gap: 0; }
.preview-item { display: flex; gap: .7rem; }
.preview-rail {
  display: flex; flex-direction: column; align-items: center; width: 36px; flex-shrink: 0;
}
.preview-rail .av {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #7C3AED, #DB2777);
}
.preview-rail .line { flex: 1; width: 2px; background: var(--line-strong); min-height: 24px; margin: .25rem 0; }
.preview-body { flex: 1; padding-bottom: .9rem; }
.preview-body .who { font-weight: 800; font-size: .9rem; color: var(--text); }
.preview-body .txt {
  color: var(--muted);
  font-size: .9rem; margin-top: .25rem; line-height: 1.4; white-space: pre-wrap;
}

/* Legacy sticky footer — keep harmless if referenced elsewhere */
.compose-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .75rem;
  padding: .85rem 0;
}

.plug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.plug-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.15rem;
}
.plug-card h3 { margin: 0 0 .55rem; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; }
.plug-card p { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0 0 1rem; }
.toggle {
  width: 42px; height: 24px; border-radius: 999px; background: #333; position: relative;
  border: 0; padding: 0; cursor: pointer;
  transition: background-color .15s ease;
}
.toggle.on { background: var(--accent); }
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .15s ease;
}
.toggle.on::after { left: 21px; }

.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 1.25rem; }
@media (max-width: 800px) { .settings-layout { grid-template-columns: 1fr; } }
.settings-nav a {
  display: block; padding: .55rem .7rem; border-radius: 8px; color: var(--muted);
  text-decoration: none; font-weight: 700; font-size: .9rem; margin-bottom: .15rem;
}
.settings-nav a:hover { color: var(--text); text-decoration: none; background: var(--elevated); }
.settings-nav a.active {
  color: var(--text); background: var(--elevated);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Fill the scroll container rather than guessing at viewport chrome — the old
   calc(100vh - 6rem) pushed the input row below the fold. */
.main:has(.agent-wrap) {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.main:has(.agent-wrap) .main-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.agent-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.agent-wrap .chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.agent-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  height: 100%;
  min-height: 260px;
  padding: 2rem 1rem;
  text-align: center;
}
.agent-intro-mark {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 1.3rem;
}
.agent-intro h2 { margin: .35rem 0 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.agent-intro p { margin: 0; max-width: 34rem; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.agent-starters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem;
  margin-top: .9rem; max-width: 40rem;
}
.agent-starters .agent-starter {
  background: transparent !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--text) !important;
  border-radius: 999px;
  padding: .5rem .95rem;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.agent-starters .agent-starter:hover {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}
.agent-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .65rem; }
.agent-tools button {
  background: transparent !important; border: 1px solid var(--line) !important;
  color: var(--muted) !important; font-size: .78rem; font-weight: 700; border-radius: 8px; padding: .4rem .6rem;
}
.agent-input-row {
  display: flex; gap: .55rem; align-items: flex-end; margin-top: auto; padding-top: .75rem;
}
.agent-input-row textarea { min-height: 56px; }
.agent-send {
  width: 44px; height: 44px; border-radius: 50% !important; background: #fff !important; color: #111 !important;
  display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; padding: 0 !important;
}

.discord-fab {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 30;
  background: #fff !important;
  color: #000 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 999px !important;
  padding: .55rem .9rem .55rem .75rem !important;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: -0.01em;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.discord-fab[hidden] { display: none !important; }
.discord-fab::before {
  content: "";
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-color: #000;
  -webkit-mask: url("/landing/icons/icon-discord.svg") center / contain no-repeat;
  mask: url("/landing/icons/icon-discord.svg") center / contain no-repeat;
}
.discord-fab:hover {
  text-decoration: none !important;
  background: #f5f5f5 !important;
  color: #000 !important;
  filter: none;
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72);
  display: grid; place-items: center; padding: 1rem; z-index: 50; animation: fade .2s ease;
}
.modal {
  width: min(920px, 100%); max-height: 90vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  padding: 1.25rem; box-shadow: var(--shadow); animation: rise .25s ease;
}

.demo-banner {
  /* sticky high-contrast styles live with settings polish below */
  margin: 0 0 1rem;
  padding: .7rem 1rem;
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 600;
}
.lp-hero-ctas, .lp-cta-actions {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: center;
}
.lp-cta-action.lp-cta-actions { justify-content: flex-end; }
.chip {
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  padding: .4rem .75rem; font-size: .8rem; font-weight: 600;
  background: transparent; color: var(--text);
}
.chip.on {
  background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: #FDE68A;
}
[data-theme="light"] .chip.on { color: var(--accent); }

.channels-layout {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
  max-width: none;
}
.ch-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
}
.ch-panel-head, .ch-browse-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 0.85rem 1.25rem;
  align-items: end;
  margin-bottom: 1rem;
}
.ch-panel-head h3, .ch-browse-head h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.ch-panel-lead {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 36rem;
}
.ch-browse-head .ch-panel-lead { margin-top: 0.45rem; }
.ch-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  background: var(--bg);
  width: 100%;
  max-width: none;
  margin-left: auto;
}
.ch-search span { color: var(--muted2); }
.ch-search input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  min-width: 0;
}
.ch-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
}
.ch-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  background: var(--elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: none !important;
  filter: none !important;
}
.ch-pill em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 1.4rem;
  height: 1.4rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(148,163,184,0.16);
  color: var(--muted);
}
.ch-pill.on {
  background: #111;
  color: #fff;
  border-color: #111;
}
.ch-pill.on em {
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.ch-connected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.ch-connected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.ch-connected-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.ch-connected-main strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.ch-connected-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.ch-status { color: var(--success); font-weight: 700; text-transform: lowercase; }
.ch-disconnect { flex-shrink: 0; }
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}
.ch-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.05rem 1.1rem 1.15rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 176px;
  font-family: inherit;
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.ch-card:hover:not(:disabled) {
  border-color: rgba(124, 58, 237, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}
.ch-card.is-disabled,
.ch-card:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}
.ch-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.ch-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.ch-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}
.ch-chev {
  color: var(--muted2);
  font-size: 1.35rem;
  line-height: 1;
}
.ch-cat {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted2);
}
.ch-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ch-desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  flex: 1;
}
.ch-badge {
  align-self: flex-start;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
}
.ch-badge.oauth { color: #1d4ed8; background: rgba(59,130,246,.14); }
.ch-badge.form { color: #15803d; background: rgba(34,197,94,.14); }
.ch-badge.soon { color: #a16207; background: rgba(245,158,11,.16); }
.ch-badge.experimental { color: #c2410c; background: rgba(234,88,12,.14); }
.ch-count {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.ch-soon {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.ch-soon summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}
.ch-grid-soon { margin-top: 0.85rem; opacity: 0.92; }
.ch-empty {
  padding: 1rem 0.25rem;
  font-size: 0.92rem;
}
.channel-row-name { display: flex; align-items: center; gap: .55rem; }
.channel-row-icon { border-radius: 6px; object-fit: contain; }
.cred-form {
  padding: 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--elevated);
}
.cred-form h4 { font-size: 1.05rem; }
[data-theme="light"] .ch-card,
[data-theme="light"] .ch-connected-card {
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
[data-theme="light"] .ch-search { background: #fff; }
[data-theme="light"] .ch-pill { background: #fff; }
[data-theme="light"] .ch-pill.on { background: #111; color: #fff; border-color: #111; }
[data-theme="dark"] .ch-badge.oauth { color: #93c5fd; }
[data-theme="dark"] .ch-badge.form { color: #86efac; }
[data-theme="dark"] .ch-badge.soon { color: #fcd34d; }
[data-theme="dark"] .ch-badge.experimental { color: #fdba74; }
@media (max-width: 960px) {
  .ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-panel-head, .ch-browse-head { grid-template-columns: 1fr; }
  .ch-search { margin-left: 0; max-width: none; }
}
@media (max-width: 620px) {
  .ch-grid { grid-template-columns: 1fr; }
  .ch-connected-card { flex-direction: column; align-items: stretch; }
}

/* legacy provider chips (kept for any leftover markup) */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .65rem;
}
.provider-chip {
  display: flex; align-items: center; gap: .55rem;
  padding: .7rem .75rem; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--elevated);
  color: var(--text); text-align: left; cursor: pointer;
  transition: border-color .15s ease, transform .12s ease;
  font: inherit; font-weight: 650; font-size: .88rem;
}
.provider-chip:hover:not(:disabled) {
  border-color: rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}
.provider-chip:disabled {
  opacity: .55; cursor: not-allowed; transform: none;
}
.provider-chip img {
  width: 22px; height: 22px; object-fit: contain; flex: 0 0 22px; border-radius: 6px;
}
.provider-chip-label { flex: 1; min-width: 0; line-height: 1.2; }
.provider-chip-badge {
  font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: .15rem .35rem; border-radius: 6px; background: rgba(255,255,255,.06);
  color: var(--muted);
}
.provider-chip-badge.form { color: #86efac; background: rgba(34,197,94,.12); }
.provider-chip-badge.oauth { color: #93c5fd; background: rgba(59,130,246,.12); }
.provider-chip-badge.soon { color: #fcd34d; background: rgba(245,158,11,.12); }
.provider-chip-badge.experimental { color: #fdba74; background: rgba(234,88,12,.14); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: .75rem .5rem;
  border-bottom: 1px solid var(--line); font-size: .92rem;
}
.table th { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: 0; }

.muted { color: var(--muted); }
.error { color: var(--danger); font-size: .9rem; margin: .4rem 0; font-weight: 600; }
.ok { color: var(--success); font-weight: 600; }
.warn { color: var(--warn); }

.chat { display: flex; flex-direction: column; gap: .7rem; flex: 1; overflow: auto; }
.bubble {
  padding: .85rem 1rem; border-radius: 14px; max-width: 80%;
  border: 1px solid var(--line); font-weight: 500;
}
.bubble.user { align-self: flex-end; background: var(--accent-soft); }
.bubble.assistant { align-self: flex-start; background: var(--elevated); }

/* Detail panes that wait on a selection: centred prompt beats a stray line of
   grey text pinned to the top-left of a large empty box. */
.pane-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 100%;
  min-height: 220px;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
}
.pane-placeholder svg { color: var(--muted2); margin-bottom: .2rem; }
.pane-placeholder strong { color: var(--text); font-size: .95rem; }
.pane-placeholder span { font-size: .85rem; max-width: 24rem; line-height: 1.5; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .85rem; }
.media-tile { margin: 0; }
.media-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--elevated);
  display: block;
}
.media-tile-file .media-file-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--elevated);
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--muted);
}
.media-tile-file.is-video .media-file-thumb {
  color: var(--accent);
  font-size: 1.35rem;
  letter-spacing: 0;
}
.media-tile figcaption {
  margin-top: .4rem;
  font-size: .78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Assets whose bytes will not decode (placeholders, expired remote URLs) get a
   labelled tile instead of an empty bordered box. */
.media-tile.is-broken { position: relative; }
.media-tile.is-broken img { visibility: hidden; }
.media-tile.is-broken::before {
  content: "Preview unavailable";
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: .5rem;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  background: var(--elevated);
  color: var(--muted2);
  font-size: .75rem;
}

/* The native file control cannot be styled, so it is hidden behind a label that
   doubles as the drop target. */
.visually-hidden-file {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.media-dropzone {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .95rem 1.1rem;
  margin-bottom: .75rem;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--elevated);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.media-dropzone:hover,
.media-dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--fg);
}
.visually-hidden-file:focus-visible + .media-dropzone {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.media-dropzone svg { flex-shrink: 0; color: var(--accent); }
.media-dropzone-text { font-size: .9rem; color: var(--fg); }
.media-dropzone-text strong { font-weight: 700; }
.media-dropzone-hint { margin-left: auto; font-size: .78rem; color: var(--muted2); }
.media-toolbar-row { flex-wrap: wrap; gap: .55rem; align-items: center; }
.media-toolbar-sep { color: var(--muted2); font-size: .82rem; }
.media-url-input { max-width: 320px; }
@media (max-width: 640px) {
  .media-dropzone { flex-wrap: wrap; }
  .media-dropzone-hint { margin-left: 0; width: 100%; }
  .media-url-input { max-width: none; }
}
.preview {
  border: 1px solid var(--line); border-radius: 12px; padding: .9rem;
  background: #0d0d0d; white-space: pre-wrap; min-height: 80px; font-weight: 500;
}
[data-theme="light"] .preview { background: #f4f4f5; }

.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tabs button {
  flex: 1; background: transparent; color: var(--muted);
  border: 1px solid var(--line); font-weight: 700;
  box-shadow: none !important; filter: none !important;
}
.tabs button.active {
  background: var(--accent-soft); color: var(--text);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: none !important;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ——— Gen-Z polish: alignment + motion ——— */
.auth-card,
.pricing-body > *,
.main > *,
.compose-layout,
.settings-layout {
  animation: rise .4s ease both;
}
.stat:nth-child(1) { animation-delay: .04s; }
.stat:nth-child(2) { animation-delay: .08s; }
.stat:nth-child(3) { animation-delay: .12s; }

.auth-card {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.auth-card .brand-mark {
  color: #FFFFFF;
  margin-bottom: .35rem;
}
.auth-card .auth-back {
  display: inline-block;
  margin: .15rem 0 .35rem;
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
}
.auth-card .auth-back:hover {
  color: #C4B5FD;
  text-decoration: underline;
}
.auth-card .field label,
.auth-card label {
  color: rgba(255,255,255,0.82) !important;
  font-weight: 700;
}
.auth-card .field span,
.auth-card label.field > span {
  color: rgba(255,255,255,0.82) !important;
  font-weight: 700;
}
.auth-card input,
.auth-card select {
  background: #0A0A0A !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  color: #FFFFFF !important;
}
.auth-card input::placeholder {
  color: rgba(255,255,255,0.42);
}
.auth-card button.primary-wide,
.auth-card button[type="submit"] {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  font-family: var(--font);
  font-weight: var(--weight-ui);
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
}

/* Light theme Sign In / Sign Up card */
[data-theme="light"] .auth-screen {
  background: #F7F7F8;
}
[data-theme="light"] .auth-card {
  background: #FFFFFF;
  border: 1px solid rgba(17,17,17,0.12);
  box-shadow: none;
  color: #111111;
}
[data-theme="light"] .auth-card .brand-mark {
  color: #0B0B14;
}
[data-theme="light"] .auth-card .auth-back {
  color: #5B5B78;
}
[data-theme="light"] .auth-card .auth-back:hover {
  color: #6D28D9;
}
[data-theme="light"] .auth-card h1 {
  color: #0B0B14;
}
[data-theme="light"] .auth-social-label {
  color: #4B4B63;
}
[data-theme="light"] .auth-social a.social-btn,
[data-theme="light"] .auth-social button.social-btn,
[data-theme="light"] .auth-card .auth-social button {
  background: #FFFFFF !important;
  color: #0B0B14 !important;
  border: 1px solid rgba(109, 40, 217, 0.28) !important;
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.1);
}
[data-theme="light"] .auth-social a.social-btn:hover,
[data-theme="light"] .auth-social button.social-btn:hover {
  background: #F3EEFF !important;
  border-color: rgba(109, 40, 217, 0.45) !important;
}
[data-theme="light"] .or-row {
  color: #6B6B84;
}
[data-theme="light"] .or-row::before,
[data-theme="light"] .or-row::after {
  background: rgba(15, 15, 35, 0.12);
}
[data-theme="light"] .auth-card .field label,
[data-theme="light"] .auth-card label,
[data-theme="light"] .auth-card .field span,
[data-theme="light"] .auth-card label.field > span {
  color: #2F2F46 !important;
}
[data-theme="light"] .auth-card input,
[data-theme="light"] .auth-card select {
  background: #F7F5FF !important;
  border: 1px solid rgba(15, 15, 35, 0.14) !important;
  color: #0B0B14 !important;
}
[data-theme="light"] .auth-card input:focus,
[data-theme="light"] .auth-card select:focus {
  border-color: rgba(109, 40, 217, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}
[data-theme="light"] .auth-card input::placeholder {
  color: #8B8BA3;
}
[data-theme="light"] .auth-card button.primary-wide,
[data-theme="light"] .auth-card button[type="submit"] {
  background: linear-gradient(105deg, #7C3AED, #DB2777) !important;
  color: #FFFFFF !important;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.28);
}
[data-theme="light"] .auth-footer {
  color: #4B4B63;
}
[data-theme="light"] .auth-footer a {
  color: #6D28D9;
}
[data-theme="light"] .auth-footer .forgot {
  color: #5B5B78;
}
[data-theme="light"] .auth-card .error {
  color: #BE123C;
}

.preview-body .txt { color: var(--muted); }
[data-theme="dark"] .preview-body .txt { color: #D4D4D4; }

.btn-create-post,
.pricing-footer .cta,
.btn-add-part {
  background-size: 180% 180% !important;
  animation: shimmer 4s ease infinite alternate;
}

.settings-layout {
  align-items: start;
  max-width: var(--max);
}
.settings-nav {
  position: sticky; top: 1rem;
  background: var(--panel2);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: .55rem;
}
.settings-nav a {
  color: var(--muted);
}
.settings-nav a:hover {
  color: var(--text);
  background: var(--elevated);
}
.settings-nav a.active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
/* Settings form surface: raised card — never blend into page black */
.settings-layout .panel,
#settingsPanel {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}
.settings-layout .panel h2,
.settings-layout .panel h3,
.settings-layout .panel label,
.settings-layout .panel strong,
#settingsPanel h2,
#settingsPanel h3,
#settingsPanel label,
#settingsPanel strong {
  color: var(--fg);
}
.settings-layout .panel .muted,
#settingsPanel .muted {
  color: var(--muted);
}
.settings-layout .panel input,
.settings-layout .panel select,
.settings-layout .panel textarea,
#settingsPanel input,
#settingsPanel select,
#settingsPanel textarea {
  background-color: var(--elevated);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  caret-color: var(--fg);
}
.settings-layout .panel input::placeholder,
.settings-layout .panel textarea::placeholder,
#settingsPanel input::placeholder,
#settingsPanel textarea::placeholder {
  color: var(--muted2);
}
.settings-layout .panel .toggle,
#settingsPanel .toggle {
  background: #3A3A52;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.settings-layout .panel .toggle.on,
#settingsPanel .toggle.on {
  background: var(--accent);
  border-color: transparent;
}
[data-theme="light"] .settings-layout .panel .toggle.on,
[data-theme="light"] #settingsPanel .toggle.on,
[data-theme="light"] .toggle.on {
  background: var(--accent);
  border-color: transparent;
}
[data-theme="dark"] .settings-nav {
  background: var(--panel2);
  border-color: var(--line-strong);
}
[data-theme="dark"] .settings-nav a { color: var(--muted); }
[data-theme="dark"] .settings-nav a.active,
[data-theme="dark"] .settings-nav a:hover { color: var(--fg); }
[data-theme="light"] .settings-nav {
  background: var(--card);
  border-color: var(--line-strong);
}
[data-theme="light"] .settings-layout .panel,
[data-theme="light"] #settingsPanel {
  background: var(--card);
  color: var(--fg);
  border-color: var(--line-strong);
  box-shadow: 0 10px 28px rgba(15, 15, 35, 0.08);
}
[data-theme="light"] .settings-layout .panel input,
[data-theme="light"] .settings-layout .panel select,
[data-theme="light"] .settings-layout .panel textarea,
[data-theme="light"] #settingsPanel input,
[data-theme="light"] #settingsPanel select,
[data-theme="light"] #settingsPanel textarea {
  background-color: #fff;
  color: var(--fg);
  border-color: var(--line-strong);
}
[data-theme="light"] .settings-layout .panel .toggle,
[data-theme="light"] #settingsPanel .toggle {
  background: #C4C0D8;
  border-color: var(--line-strong);
}
/* Not sticky: as an inline pill with no full-width backdrop, sticking it to the
   top left it floating over cards that scrolled underneath. */
.demo-banner {
  position: relative;
  margin: 0 0 var(--space-2);
  padding: .35rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--weight-ui);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .65rem;
  box-shadow: none;
  max-width: max-content;
}
.demo-banner a {
  color: var(--accent);
  margin-left: 0;
  font-weight: var(--weight-ui);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.demo-banner a:hover { color: var(--accent-hover); }
[data-theme="light"] .demo-banner,
[data-theme="dark"] .demo-banner {
  border-color: var(--line);
  background: var(--panel2);
  color: var(--muted);
  box-shadow: none;
}
[data-theme="light"] .demo-banner a,
[data-theme="dark"] .demo-banner a {
  color: var(--accent);
}

.compose-layout { align-items: start; }

.plug-card:hover,
.metric-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--cyan) 40%, var(--line));
  transition: transform .15s ease, border-color .15s ease;
}

.chip.on {
  background: linear-gradient(90deg, rgba(124, 58, 237, .2), rgba(79,70,229,.12));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--cyan));
  color: var(--text);
}

.discord-fab {
  background: #fff !important;
  color: #000 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.agent-send {
  background: var(--gradient-btn) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.32) !important;
}

.media-grid img:hover {
  transform: none;
  filter: brightness(1.05);
  transition: filter 180ms ease-out, border-color 180ms ease-out;
  border-color: var(--accent);
}

.table th { color: var(--muted); letter-spacing: 0; }

/* The shell already prints the route name in the topbar; pages carry only the
   one-line explanation rather than repeating their own title. */
.page-lede {
  margin: 0 0 1.15rem;
  max-width: 46rem;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.5;
}
.page-lede-row {
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.page-lede-row .page-lede { margin-bottom: 1.15rem; }

.team-invite {
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}
.team-invite h3 { margin: 0 0 .2rem; font-size: 1rem; }
.team-invite p { margin: 0 0 .85rem; font-size: .87rem; }
.team-invite-row {
  display: flex; flex-wrap: wrap; gap: .55rem; align-items: center;
}
.team-invite-row input { flex: 1 1 18rem; max-width: 24rem; }
.team-invite-row select { flex: 0 0 auto; width: auto; min-width: 9rem; }

.history-page { max-width: 960px; }
.history-toolbar {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end;
  margin-bottom: 1.15rem;
}
.history-toolbar > :first-child { flex: 1 1 18rem; }
/* Inputs default to width:100%, which made the filter group claim the whole row
   and push the heading underneath it. */
.history-filters { gap: .5rem; flex-wrap: wrap; flex: 0 1 auto; }
.history-filters select,
.history-filters input {
  width: auto;
  min-width: 170px;
}
.history-list { display: flex; flex-direction: column; gap: .55rem; }
.history-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel);
}
.hist-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: .45rem; flex-shrink: 0;
  background: var(--accent);
}
.hist-dot.cat-auth { background: #38bdf8; }
.hist-dot.cat-posts { background: #A78BFA; }
.hist-dot.cat-integrations { background: #34d399; }
.hist-dot.cat-ai { background: #f472b6; }
.hist-dot.cat-billing { background: #fbbf24; }
.hist-dot.cat-media { background: #60a5fa; }
.hist-dot.cat-team { background: #fb7185; }
.hist-top { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.hist-cat {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .12rem .4rem; border-radius: 6px; background: rgba(0,0,0,.06); opacity: .85;
}
.hist-status {
  font-size: .7rem; font-weight: 800; padding: .1rem .35rem; border-radius: 6px;
}
.hist-status.ok { background: rgba(34,197,94,.15); color: #16a34a; }
.hist-status.bad { background: rgba(239,68,68,.15); color: #dc2626; }
.hist-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; font-size: .8rem; }
.hist-meta code { font-size: .75rem; }

.billing-page {
  width: 100%;
  max-width: none !important;
  box-sizing: border-box;
  padding-bottom: 2.5rem;
}
.main:has(.billing-page) {
  max-width: none;
  width: 100%;
}
.billing-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.billing-hero .lead {
  margin: 0; color: var(--muted); font-size: .95rem; max-width: 48rem; line-height: 1.45;
}
.bill-status-chip {
  font-size: .78rem; font-weight: 800; padding: .4rem .85rem; border-radius: 999px;
  background: rgba(0,0,0,.06); border: 1px solid var(--line); white-space: nowrap; align-self: center;
}
.bill-status-chip.ok { background: rgba(34,197,94,.15); color: #16a34a; border-color: rgba(34,197,94,.25); }
.bill-status-chip.warn { background: rgba(251,191,36,.18); color: #b45309; border-color: rgba(251,191,36,.35); }
.bill-card, .bill-plan-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 1.15rem 1.25rem;
}
.bill-current { margin-bottom: 1rem; }
.bill-plan-name { font-size: clamp(1.45rem, 2.2vw, 1.8rem); font-weight: 800; letter-spacing: -0.03em; margin: .15rem 0 .3rem; }
.bill-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem 1rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.bill-meter {
  font-size: .88rem;
  padding: .7rem .85rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--elevated) 70%, transparent);
  border: 1px solid var(--line);
}
.bill-meter .bill-meter-label { font-weight: 700; }
.bill-meter .bill-meter-val { font-size: .8rem; font-weight: 600; }
.bill-meter-bar {
  height: 8px; border-radius: 999px; background: rgba(0,0,0,.08); margin-top: .5rem; overflow: hidden;
}
[data-theme="dark"] .bill-meter-bar { background: rgba(255,255,255,.08); }
.bill-meter-bar span {
  display: block; height: 100%; border-radius: 999px; background: var(--gradient-btn, var(--accent));
  min-width: 0;
}
.bill-meter.unlimited .bill-meter-bar {
  height: 0; margin-top: 0; background: transparent;
}
.bill-banner {
  padding: .85rem 1.05rem; border-radius: 14px; margin-bottom: 1rem;
  background: rgba(124, 58, 237, .1); border: 1px solid rgba(124, 58, 237, .22);
  font-size: .9rem; line-height: 1.45; color: var(--text);
}
.bill-banner strong { display: block; margin-bottom: .25rem; }
.bill-banner.warn { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.28); }
.bill-banner .muted { margin: 0; font-size: .85rem; }
.bill-section { margin-top: .25rem; width: 100%; }
.bill-section-head {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .85rem;
  margin-bottom: .25rem;
}
.bill-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
}
.bill-price-stack { margin-top: .45rem; }
.bill-price-was {
  font-size: .92rem; font-weight: 700; color: var(--muted);
  text-decoration: line-through; opacity: .85;
}
.bill-price-sale { margin-top: .1rem; color: var(--text); }
.bill-save-pill {
  display: inline-flex; margin-top: .4rem; padding: .22rem .55rem; border-radius: 999px;
  font-size: .68rem; font-weight: 800; letter-spacing: .02em;
  background: rgba(34,197,94,.16); color: #16a34a; border: 1px solid rgba(34,197,94,.28);
}
.bill-save-hint {
  margin-top: .35rem; font-size: .75rem; font-weight: 700; color: var(--accent);
}
.bill-comet-banner {
  margin: .85rem 0 0;
  padding: .9rem 1.05rem; border-radius: 14px;
  background: color-mix(in srgb, var(--elevated) 70%, transparent);
  border: 1px solid var(--line);
  font-size: .9rem; line-height: 1.45;
}
.bill-comet-banner strong { display: block; margin-bottom: .2rem; }
.bill-comet-banner p { margin: 0; color: var(--muted); font-size: .86rem; }
/* Promotional emphasis uses the brand accent; green is reserved for status. */
.bill-comet-banner.on {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}
.bill-plan-card.deal {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 12%, transparent);
}
.bill-pill.deal {
  background: var(--accent-soft); color: var(--accent);
}
.bill-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin-top: .9rem;
  width: 100%;
}
.bill-comet-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.bill-plan-card {
  display: flex; flex-direction: column; min-height: 100%;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.bill-plan-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.bill-plan-card.current {
  border-color: transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--gradient) border-box;
  border: 2px solid transparent;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.12);
}
.bill-price { font-size: clamp(1.35rem, 1.8vw, 1.55rem); font-weight: 800; letter-spacing: -0.02em; margin-top: .45rem; }
.bill-price span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.bill-feat { list-style: none; padding: 0; margin: 0 0 1.15rem; flex: 1; }
.bill-feat li {
  font-size: .88rem; color: var(--muted); padding: .32rem 0 .32rem 1.15rem; position: relative;
}
.bill-feat li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.bill-plan-card button,
.bill-plan-card .bill-cta {
  width: 100%; margin-top: auto;
}
.bill-plan-card button.bill-cta-primary,
.bill-plan-card .bill-cta-primary {
  background: var(--gradient-btn) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
}
.bill-plan-card button.bill-cta-primary:hover {
  filter: brightness(1.06);
}
.bill-pill {
  font-size: .68rem; font-weight: 800; padding: .18rem .5rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.bill-ok {
  padding: .85rem 1.05rem; border-radius: 12px; margin-bottom: 1rem;
  background: rgba(34,197,94,.12); color: #16a34a; font-weight: 600;
}
.bill-foot-note {
  margin-top: 1.15rem; padding: .85rem 1rem; border-radius: 12px;
  background: color-mix(in srgb, var(--elevated) 65%, transparent);
  border: 1px solid var(--line); font-size: .88rem; color: var(--muted); line-height: 1.45;
}
.shell.no-channels .main:has(.billing-page) {
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  padding-right: clamp(1.25rem, 3vw, 2.5rem);
}

/* ——— Product features ——— */
.feat-page { max-width: 1100px; }
.feat-page h2 { letter-spacing: -.02em; }
.pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .12rem .45rem; border-radius: 999px; font-size: .72rem;
  background: var(--elevated); border: 1px solid var(--line); color: var(--muted);
}
.pill.ok { background: rgba(34,197,94,.15); color: #16a34a; border-color: rgba(34,197,94,.25); }
.pill.warn { background: rgba(251,191,36,.18); color: #b45309; border-color: rgba(251,191,36,.35); }
.pill.bad { background: rgba(239,68,68,.15); color: #dc2626; border-color: rgba(239,68,68,.3); }

/* List/detail fills the shell the way a mail client should, rather than sitting
   as a short pair of boxes with dead space underneath. */
.main:has(.inbox-layout) { display: flex; flex-direction: column; height: 100%; }
.main:has(.inbox-layout) .main-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.inbox-layout {
  display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 1rem;
  flex: 1; min-height: 520px;
}
@media (max-width: 800px) {
  .inbox-layout { grid-template-columns: 1fr; min-height: 0; }
  .inbox-layout:not(.show-pane) .inbox-pane { display: none; }
  .inbox-layout.show-pane .inbox-threads { display: none; }
  .inbox-pane { min-height: min(60vh, 480px); }
}
.inbox-threads {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: .85rem; overflow: auto; min-height: 0;
}
.inbox-thread {
  display: block; width: 100%; text-align: left;
  background: var(--elevated) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px; padding: .55rem .6rem; margin-bottom: .35rem;
  color: var(--text) !important;
  cursor: pointer;
  box-shadow: none !important;
  filter: none !important;
}
.inbox-thread:hover { background: color-mix(in srgb, var(--elevated) 70%, var(--accent) 12%) !important; }
.inbox-thread.on {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel)) !important;
  border-color: var(--line-strong) !important;
  color: var(--text) !important;
}
.inbox-pane {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem;
  display: flex; flex-direction: column; min-height: 420px;
}
.inbox-pane > .pane-placeholder { flex: 1; }
.inbox-msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: .55rem; margin-bottom: .85rem; }
.inbox-msg {
  max-width: 85%; padding: .55rem .75rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--elevated); font-size: .9rem; line-height: 1.4;
}
.inbox-msg.outbound { align-self: flex-end; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.inbox-msg.inbound { align-self: flex-start; }
.inbox-reply { display: flex; flex-direction: column; gap: .5rem; }
.inbox-reply textarea { width: 100%; resize: vertical; }

.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem; }
.campaign-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem;
}
.camp-progress {
  height: 8px; border-radius: 999px; background: var(--elevated); overflow: hidden; margin-top: .55rem;
}
.camp-progress > div {
  height: 100%; border-radius: 999px;
  background: var(--accent);
}

.onboard-banner {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding: .9rem 1.1rem; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), var(--panel));
}
.onboard-steps { list-style: none; padding: 0; margin: .55rem 0 0; display: flex; flex-wrap: wrap; gap: .65rem 1.1rem; }
.onboard-steps li { display: flex; align-items: center; gap: .35rem; font-size: .88rem; }
.onboard-steps li.done { opacity: .65; }
.onboard-steps li.done a { text-decoration: line-through; }
.onboard-steps .chk { width: 1.1rem; color: #A78BFA; }

.cal-list { overflow: auto; }
.cal-list table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cal-list th, .cal-list td {
  text-align: left; padding: .55rem .45rem; border-bottom: 1px solid var(--line); vertical-align: top;
}
.cal-list th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.cal-list tr:hover td { background: color-mix(in srgb, var(--elevated) 70%, transparent); }

.approve-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .85rem 1rem; margin-bottom: .55rem; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
}
.approve-actions { display: flex; gap: .45rem; flex-wrap: wrap; }

.utm-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.utm-table th, .utm-table td {
  text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line);
}
.utm-table th { color: var(--muted); font-size: .75rem; }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .85rem; margin-top: 1rem; }
.recipe-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem;
}
.recipe-card h3 { margin: .55rem 0 .35rem; font-size: 1.05rem; }

.compose-extras {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin: 0;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.compose-extras-check { margin: 0 !important; }
.compose-extras-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem .85rem;
  align-items: end;
}
@media (min-width: 900px) {
  .compose-extras-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.compose-extras-grid .field {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.compose-extras-grid .field > span,
.compose-extras-utm .field > span {
  font-size: .78rem;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.2;
}
.compose-extras-grid .field input,
.compose-extras-grid .field select,
.compose-extras-utm .field input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
}
.compose-extras-evergreen-row {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.compose-extras-evergreen-row input {
  flex: 1 1 auto;
  min-width: 0;
}
.compose-extras-evergreen-row #bestTimeBtn {
  flex: 0 0 auto;
  min-height: 40px;
  height: 40px;
  white-space: nowrap;
}
.compose-extras-checks {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  align-items: center;
}
.compose-extras-checks .shortlink-opt { margin: 0 !important; }
.compose-extras-utm {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem .85rem;
}
@media (max-width: 700px) {
  .compose-extras-utm { grid-template-columns: 1fr; }
  .compose-extras-grid { grid-template-columns: 1fr; }
}
.compose-extras-utm .field {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.compose-extras-hint {
  margin: 0;
  font-size: .78rem;
  line-height: 1.45;
}
[data-theme="light"] .compose-extras {
  background: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.12);
}
[data-theme="light"] .thread-block {
  background: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.12);
}
[data-theme="light"] .compose-preview {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.12);
}
[data-theme="light"] .preview-body .txt { color: #475569; }
[data-theme="light"] .compose-schedule-row > select,
[data-theme="light"] .compose-schedule-row > input[type="datetime-local"],
[data-theme="light"] .compose-extras-grid input,
[data-theme="light"] .compose-extras-grid select,
[data-theme="light"] .compose-extras-utm input,
[data-theme="light"] .channel-extra-field input,
[data-theme="light"] .channel-extra-field select {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: none;
}
[data-theme="light"] .compose-extras-utm input:focus,
[data-theme="light"] .compose-extras-grid input:focus,
[data-theme="light"] .compose-extras-grid select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Composer topbar: theme + language share one baseline */
.topbar {
  align-items: center;
}
.topbar-utils {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.topbar #langBtn,
.topbar button.secondary#langBtn {
  height: var(--touch);
  min-height: var(--touch);
  box-sizing: border-box;
  padding: 0 .9rem !important;
  display: inline-flex !important;
  align-items: center;
  gap: .4rem;
  line-height: 1;
}

/* Shares the bottom-right corner with .tour-offer, stacked above it so the two
   prompts never land on top of each other. */
.pwa-hint {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  z-index: 80; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .8rem 1rem; border-radius: 14px; max-width: min(420px, calc(100vw - 2.5rem));
  background: var(--card); border: 1px solid var(--line-strong); box-shadow: 0 18px 44px rgba(15, 15, 35, .22);
  font-size: .85rem; color: var(--text);
}
body:has(.tour-offer) .pwa-hint { bottom: 6.25rem; }
@media (max-width: 640px) {
  .pwa-hint { left: 1rem; right: 1rem; max-width: none; }
}
.status-page { max-width: 720px; margin: 2rem auto; padding: 0 1rem 3rem; }

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

/* Post-login polish: empty states, focus, pill consistency */
.empty-panel,
.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  gap: .65rem;
  padding: clamp(2rem, 5vw, 3.5rem) 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(124, 58, 237, .05), transparent 55%),
    var(--panel);
  color: var(--muted);
}
.empty-panel h3,
.empty-state h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.empty-panel p,
.empty-state p {
  margin: 0;
  max-width: 28rem;
  line-height: 1.45;
  font-size: .92rem;
}
.empty-panel .empty-actions,
.empty-state .empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-top: .35rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.main .btn-create-post,
.topbar .btn-create-post,
button.primary-wide,
a.bill-cta-primary,
.pricing-footer .cta {
  border-radius: var(--radius-sm) !important;
  background: var(--accent) !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
  button, a, .chip, .bubble {
    transition: none !important;
  }
}

/* Finishing pass: a11y + mobile */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: .65rem 1rem;
  background: var(--accent, #0d9488);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}
.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;
}
.main-body { min-height: 40vh; }

@media (max-width: 980px) {
  .btn-create-row { position: sticky; bottom: 0; z-index: 5; padding: .5rem 0; background: linear-gradient(transparent, var(--bg, #0b0b0f) 30%); }
  .btn-create-post, .btn-add-channel, .mobile-nav-toggle {
    min-height: 44px;
    min-width: 44px;
  }
  .rail-item { min-height: 44px; }
  .compose-actions, .composer-footer {
    position: sticky;
    bottom: 0;
    z-index: 6;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--panel);
    border-top: 1px solid var(--line);
  }
  .compose-schedule-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .compose-schedule-row > * { width: 100%; min-width: 0; }
  .acct-chip { max-width: 100%; }
  .acct-chip-name { max-width: 12rem; }
  .notif-page { padding-left: .25rem; padding-right: .25rem; }
  .notif-item, .notif-row {
    min-height: 44px;
    padding: .75rem .65rem;
  }
}
[data-theme="light"] .compose-actions,
[data-theme="light"] .composer-footer {
  background: #ffffff;
}

/* —— UX polish pass: toasts, calendar tools, skeletons —— */
.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: .7rem .95rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--fg);
  font-size: .88rem;
  font-weight: 650;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-ok { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); }
.toast-error { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); color: var(--danger); }
.toast-info { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .65rem;
}
.cal-toolbar-nav,
.cal-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}
.cal-toolbar-filters { margin-left: auto; }
.cal-tools-menu {
  position: relative;
}
.cal-tools-menu summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .4rem .85rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  background: var(--elevated);
}
.cal-tools-menu summary::-webkit-details-marker { display: none; }
.cal-tools-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 20;
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .45rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--card);
}
.cal-tools-panel a,
.cal-tools-panel button {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  background: transparent !important;
  color: var(--text) !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  padding: .45rem .55rem !important;
  font-size: .84rem;
  font-weight: 650;
}
.cal-tools-panel a:hover,
.cal-tools-panel button:hover {
  background: var(--elevated) !important;
}

.onboard-next {
  display: inline-flex;
  margin-top: .55rem;
  font-size: .86rem;
  font-weight: 800;
  color: var(--accent2);
  text-decoration: none;
}
.onboard-next:hover { text-decoration: underline; }

.media-hero { margin-bottom: .85rem; }
.media-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--elevated);
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--elevated), var(--panel2), var(--elevated));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  min-height: 1rem;
}

[data-theme="light"] .cal-toolbar select,
[data-theme="light"] .week-board-tools select,
[data-theme="light"] .cal-tools-menu summary {
  background: #fff;
  color: var(--fg);
  border-color: var(--line-strong);
}
[data-theme="light"] .week-board-frame,
[data-theme="light"] .cal-day {
  border-color: var(--line-strong);
}
[data-theme="light"] .cal-day .d {
  color: var(--fg);
  font-weight: 750;
}

/* Product switcher — Social | Comet (same visual weight as rail items) */
.product-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0.35rem 0.35rem 0.75rem;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--rail-line);
  background: transparent;
}
.product-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none !important;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: .45rem .35rem;
  min-height: 36px;
  border-radius: 10px;
  color: var(--rail-item) !important;
  background: transparent;
  transition: background .15s ease, color .15s ease;
}
.product-switch-quiet {
  background: transparent;
  border-color: var(--rail-line);
  padding: 4px;
  gap: 4px;
}
.product-switch-quiet .product-switch-btn {
  font-weight: 600;
  font-size: 0.8125rem;
  opacity: 1;
}
.product-switch-quiet .product-switch-btn.on {
  opacity: 1;
  background: var(--rail-item-hover-bg);
  color: var(--rail-item-hover) !important;
}
.product-switch-btn:hover {
  background: var(--rail-item-hover-bg);
  color: var(--rail-item-hover) !important;
  text-decoration: none !important;
}
.product-switch-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.product-switch-btn:active {
  transform: translateY(1px);
}
.product-switch-btn.on {
  background: var(--rail-active-bg);
  color: #fff !important;
  box-shadow: var(--rail-active-shadow);
}
.product-switch-btn.on:hover {
  color: #fff !important;
  filter: brightness(1.06);
}
.shell.rail-collapsed .product-switch {
  margin: var(--space) calc(var(--space) * 0.5) calc(var(--space) * 0.75);
  grid-template-columns: 1fr;
}
.shell.rail-collapsed .product-switch-btn {
  font-size: .62rem;
  padding: .35rem .2rem;
  min-height: var(--touch);
}
.rail-item[data-comet-page] {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

/* Notifications */
.notif-page { max-width: 720px; }
.notif-section { margin-bottom: 1.25rem; }
.notif-section-title {
  margin: 0 0 .55rem;
  font-size: .95rem;
  display: flex;
  align-items: baseline;
  gap: .4rem;
}
.notif-day-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted2);
  margin: .65rem 0 .35rem;
}
.notif-row {
  display: flex;
  gap: .75rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  padding: .75rem .85rem;
  margin-bottom: .4rem;
  cursor: pointer;
  box-shadow: none;
}
.notif-row:hover { background: var(--elevated); filter: none; }
.notif-row.unread {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel));
}
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: .45rem;
  background: transparent;
  flex-shrink: 0;
}
.notif-row.unread .notif-dot { background: var(--accent); }
.notif-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.notif-type {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted2);
}
.notif-time { font-size: .75rem; margin-top: .25rem; }

/* Billing payment history */
.bill-pay-list { display: flex; flex-direction: column; gap: .55rem; }
.bill-pay-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
}
.bill-pay-row:last-child { border-bottom: 0; }
.bill-pay-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
  font-size: .82rem;
}
.bill-pay-status {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .15rem .4rem;
  border-radius: 6px;
  background: var(--elevated);
}
.bill-pay-status.paid, .bill-pay-status.authenticated, .bill-pay-status.active {
  background: rgba(34,197,94,.15); color: #16a34a;
}
.bill-pay-status.canceled, .bill-pay-status.failed {
  background: rgba(239,68,68,.12); color: #dc2626;
}
.bill-pay-amt { font-weight: 700; }

/* Product tour */
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: end center;
  padding: 1.25rem;
}
.tour-card {
  width: min(420px, 100%);
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}
.tour-progress {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: .35rem;
}
.tour-card h2 { margin: 0 0 .45rem; font-size: 1.15rem; }
.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
/* Anchored bottom-right rather than bottom-centre: centred, it landed on top of
   the Create Post form fields and read as part of the page. */
.tour-offer {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  max-width: min(420px, calc(100vw - 2.5rem));
  padding: .8rem 1rem;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 44px rgba(15, 15, 35, .22);
  color: var(--fg);
  font-size: .88rem;
  animation: tour-offer-in .22s ease-out both;
}
@keyframes tour-offer-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-offer { animation: none; }
}
@media (max-width: 640px) {
  .tour-offer { left: 1rem; right: 1rem; max-width: none; }
}

.comet-space-inline {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  border: 0;
  padding: 0;
}
.comet-space-inline label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--c-muted, var(--muted));
}
.comet-space-inline select {
  max-width: 140px;
  font-size: .82rem;
  padding: .35rem .5rem;
  border-radius: 8px;
  border: 1px solid var(--c-line, var(--line));
  background: var(--c-card, var(--panel));
  color: inherit;
}


/* Design-system utility helpers */
.u-mt-1 { margin-top: var(--space); }
.u-mt-2 { margin-top: calc(var(--space) * 2); }
.u-mb-1 { margin-bottom: var(--space); }
.u-p-2 { padding: calc(var(--space) * 2); }
.u-flex-1 { flex: 1; min-width: 0; }
.u-row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space); flex-wrap: wrap; }
.u-w-max-320 { max-width: 320px; width: 100%; }
.u-w-max-120 { max-width: 120px; }
.u-w-max-140 { max-width: 140px; }
.u-w-max-150 { max-width: 150px; }
.u-hidden { display: none !important; }


/* ——— Audit polish pass ——— */
.auth-proof-quiet {
  justify-content: center;
  background: var(--bg) !important;
}
.auth-quote {
  margin: 0;
  max-width: 28rem;
  padding: 0;
  border: 0;
}
.auth-quote p {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: var(--text-h2);
  font-weight: var(--weight-title);
  line-height: 1.35;
  color: var(--text);
}
.auth-quote footer {
  color: var(--muted);
  font-size: var(--text-sm);
}
.auth-metric {
  margin: 1.5rem 0 0;
  color: var(--muted2);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
  max-width: 28rem;
  text-align: center;
}
.grad-text { background: none !important; -webkit-background-clip: unset !important; background-clip: unset !important; color: var(--text) !important; }
.product-switch-quiet {
  background: transparent;
  border-color: transparent;
  padding: 0;
  gap: 0;
}
.product-switch-quiet .product-switch-btn {
  font-weight: var(--weight-ui);
  font-size: var(--text-caption);
  opacity: .72;
}
.product-switch-quiet .product-switch-btn.on {
  opacity: 1;
  background: var(--rail-item-hover-bg);
}
.cal-tools-panel-wide {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-width: 220px;
  padding: .75rem;
}
.cal-tool-label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: var(--text-caption);
  color: var(--muted);
  font-weight: var(--weight-ui);
}
.week-board-hero { display: none !important; }
.empty-state-hero {
  padding: var(--space-4) var(--space-3);
  text-align: center;
}
.empty-state-hero h3 {
  font-size: var(--text-h1);
  font-weight: var(--weight-title);
  margin: 0 0 .5rem;
}
.billing-soft-banner {
  margin: 0 0 var(--space-2);
  padding: .55rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  font-size: var(--text-sm);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .85rem;
  align-items: center;
}
.billing-soft-banner a { font-weight: var(--weight-ui); }


/* ——— Visual polish v2 ——— */
.auth-helpers { font-size: var(--text-sm); color: var(--muted); }
.auth-helpers a { font-weight: var(--weight-ui); }
.auth-sep { margin: 0 .35rem; opacity: .5; }
.auth-demo-link a { color: var(--muted2); font-weight: 500; font-size: var(--text-caption); }
.auth-card .auth-social button,
.auth-card .auth-social a.social-btn {
  background: var(--panel2) !important;
  border: 1px solid var(--line) !important;
}
/* soft-pill platform colors restored below */
[data-theme="light"] .auth-card button.primary-wide,
[data-theme="light"] .auth-card button[type="submit"] {
  background: #6D28D9 !important;
  color: #fff !important;
  border-radius: 12px !important;
}
.rail-item.active,
a.rail-item.active,
button.rail-item.active {
  box-shadow: none !important;
}


/* ——— Comet/Social rail parity (force) ——— */
:root { --rail-item-size: 0.9375rem; }
.shell .rail .rail-item,
.shell .rail a.rail-item,
.shell .rail button.rail-item,
.shell.shell-comet .rail .rail-item,
.shell.shell-comet .rail button.rail-item {
  font-size: var(--rail-item-size) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  padding: 0.6rem 0.85rem !important;
  min-height: 44px !important;
  gap: 0.65rem !important;
  border-radius: 12px !important;
}
.shell .rail .rail-item span,
.shell.shell-comet .rail .rail-item span {
  font-size: inherit !important;
  font-weight: inherit !important;
}
.shell .rail .rail-item svg,
.shell.shell-comet .rail .rail-item svg {
  width: 20px !important;
  height: 20px !important;
}


/* === UI UX PRO MAX === */
:root {
  --space-5: 48px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 180ms;
  --focus-ring: 2px solid var(--accent);
  --rail-item-size: 0.9375rem;
}

/* Clickable affordance — interactive targets only */
a[href], button, [role="button"], [role="tab"], summary,
.rail-item, .channel-item, .chip, .ci-card,
.product-switch-btn, .cal-event {
  cursor: pointer;
}

/* Micro-interactions without nuking existing transform hover */
.rail-item, .channel-item, .chip, .product-switch-btn,
.comet-btn, .ci-card {
  transition:
    background-color var(--duration) var(--ease-out),
    color var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out),
    opacity var(--duration) var(--ease-out);
}

/* Focus-visible for keyboard */
:where(a, button, input, select, textarea, summary, .rail-item, .chip):focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* Light mode readable muted (scoped — no body/shell color blast) */
[data-theme="light"] .muted,
[data-theme="light"] .hint,
[data-theme="light"] .sub,
[data-theme="light"] .comet-muted {
  color: #475569;
}

/* Do NOT force flex/gap on .main-body — calendar/comet own their layout */

/* Empty state type only — keep dashed panel from base styles */
.empty-state h3, .empty-state-hero h3, .comet-empty-hero h2 {
  font-family: var(--display);
  font-weight: var(--weight-title);
  color: var(--text);
}
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
  justify-content: center;
  margin-top: var(--space-2);
}

/* Unified theme / menu icon buttons — beat ghost transparent-border + comet-btn pill */
button.theme-toggle,
.theme-toggle,
button.ghost.theme-toggle,
.topbar button.ghost.theme-toggle,
.main button.ghost.theme-toggle,
.auth-proof button.ghost.theme-toggle,
.week-board-utils button.ghost.theme-toggle,
.pricing-top button.ghost.theme-toggle,
.lp-theme-btn,
.comet-theme-btn,
button.comet-theme-btn {
  width: var(--touch) !important;
  height: var(--touch) !important;
  min-width: var(--touch) !important;
  min-height: var(--touch) !important;
  padding: 0 !important;
  margin: 0;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--line-strong) !important;
  background: transparent !important;
  color: var(--text) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  filter: none !important;
  line-height: 1 !important;
  font-size: 0 !important;
  flex-shrink: 0;
  vertical-align: middle;
}
button.theme-toggle:hover,
.theme-toggle:hover,
button.ghost.theme-toggle:hover,
.topbar button.ghost.theme-toggle:hover,
.main button.ghost.theme-toggle:hover,
.auth-proof button.ghost.theme-toggle:hover,
.week-board-utils button.ghost.theme-toggle:hover,
.pricing-top button.ghost.theme-toggle:hover,
.lp-theme-btn:hover,
.comet-theme-btn:hover {
  background: var(--elevated) !important;
  color: var(--text) !important;
  filter: none !important;
}
button.theme-toggle:focus-visible,
.theme-toggle:focus-visible,
.lp-theme-btn:focus-visible,
.comet-theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.theme-toggle .ui-ico,
.lp-theme-btn .ui-ico,
.comet-theme-btn .ui-ico,
.lp-menu-btn .ui-ico {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
}
.lp-menu-btn {
  width: var(--touch) !important;
  height: var(--touch) !important;
  min-width: var(--touch) !important;
  min-height: var(--touch) !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--radius-sm) !important;
  line-height: 1;
}
#langBtn,
#authLangBtn,
#pricingLangBtn {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}
.auth-proof-quiet > .row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
[data-theme="light"] button.theme-toggle,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .lp-theme-btn,
[data-theme="light"] .comet-theme-btn {
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
  background: #FFFFFF !important;
}
[data-theme="light"] button.theme-toggle:hover,
[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .lp-theme-btn:hover,
[data-theme="light"] .comet-theme-btn:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}
/* Landing mobile drawer: text theme control, not icon square */
#lpThemeBtnMobile.lp-theme-btn {
  width: auto !important;
  height: auto !important;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0.5rem 1rem !important;
  font-size: 0.84rem !important;
  border-radius: 999px !important;
}
/* Reinstate desktop hide if anything else re-enabled the toggle */
.mobile-nav-toggle,
.mobile-nav-backdrop { display: none !important; }
@media (max-width: 980px) {
  .mobile-nav-toggle {
    display: grid !important;
    place-items: center;
    min-width: 42px;
    min-height: 42px;
  }
  .mobile-nav-backdrop.show { display: block !important; }
}

/* Onboarding quieter in light */
[data-theme="light"] .onboard-banner,
[data-theme="light"] .onboarding-banner,
[data-theme="light"] .feat-onboard {
  background: #F5F3FF;
  border: 1px solid rgba(109, 40, 217, 0.2);
  color: #0F172A;
  box-shadow: none;
}

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

/* === UI UX PRO MAX ICONS === */
.ui-ico { display: block; flex-shrink: 0; pointer-events: none; }
[data-theme="light"] .testimonial,
[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.12);
}
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background-color: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.16);
  color: #0F172A;
}
.rail .rail-item, .channels-pane .channel-item, .btn-add-channel, .btn-create-post {
  min-height: var(--touch);
}



/* === SHELL GRID SAFETY === */
/* Mobile toggle must NOT be a grid child on desktop — it steals column 1 from .rail/.main */
.shell > .mobile-nav-toggle { display: none !important; }
.shell > .mobile-nav-backdrop { display: none !important; }
@media (max-width: 980px) {
  .shell > .mobile-nav-toggle {
    display: grid !important;
    place-items: center;
    position: fixed !important;
    top: .75rem; left: .75rem; z-index: 60;
    width: 42px !important; height: 42px !important;
    min-width: 42px !important; min-height: 42px !important;
    max-height: 42px !important;
  }
  .shell > .mobile-nav-backdrop.show { display: block !important; }
}
.shell.shell-calendar .main-body,
.shell.shell-comet .main-body,
.shell .main-body {
  /* restore natural flow — do not force flex column gap that fights week-board */
  display: block;
  padding: 0;
}
.shell.shell-calendar .main.main-calendar .main-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 0;
}


/* === AUTH MASTER TIGHTEN === */
.auth-screen {
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  align-items: stretch;
}
.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow: hidden;
  min-height: 0;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  margin: auto;
  padding: 1.35rem 1.35rem 1.2rem;
  scrollbar-width: thin;
}
.auth-card .brand-mark {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .5rem;
}
.auth-card .auth-back {
  display: block;
  margin: 0 0 .85rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
}
.auth-card h1 {
  margin: 0.35rem 0 0.85rem;
}
.auth-proof-quiet {
  justify-content: center;
  align-items: center;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem);
  gap: 1.25rem;
  min-height: 0;
  overflow: hidden;
  min-width: 0;
}
.auth-proof-quiet > .row {
  align-self: flex-end;
  width: 100%;
  max-width: 28rem;
  margin-bottom: 0 !important;
}
.auth-quote {
  text-align: left;
  max-width: 28rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.auth-quote p {
  font-size: 1.25rem;
  line-height: 1.45;
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.auth-metric {
  width: 100%;
  max-width: 28rem;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
[data-theme="light"] .auth-card h1,
[data-theme="light"] .auth-card .brand-mark {
  color: #0F172A;
}
[data-theme="light"] .auth-card .auth-back {
  color: #475569;
}
.auth-card button.primary-wide {
  background: var(--accent) !important;
  border: none !important;
  border-radius: 12px !important;
  min-height: var(--touch);
  box-shadow: none !important;
}
@media (min-width: 721px) {
  .auth-screen {
    grid-template-columns: minmax(380px, 480px) minmax(0, 1fr);
  }
}


/* === SURFACE TIGHTEN === */
.empty-actions .primary,
.empty-state-hero .primary {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px;
  min-height: var(--touch);
  padding: 0.65rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
}
.empty-actions a.secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  font-weight: 600;
  color: var(--text);
  min-height: var(--touch);
}
.shell.shell-calendar .week-board {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
}
.shell.shell-calendar .week-board-frame {
  flex: 1;
  min-height: 0;
}
.shell.shell-calendar .cal-tools-menu:not([open]) .cal-tools-panel {
  display: none;
}


/* === AUTH LIGHT FIX === */
[data-theme="light"] .auth-card h1 { color: #0F172A !important; }
[data-theme="light"] .auth-social-label,
[data-theme="light"] .or-row,
[data-theme="light"] .auth-footer,
[data-theme="light"] .auth-card .muted { color: #475569 !important; }
[data-theme="light"] .auth-footer a { color: #6D28D9 !important; }
[data-theme="light"] .auth-footer .forgot { color: #64748B !important; }
[data-theme="light"] .auth-social a.social-btn,
[data-theme="light"] .auth-social button.social-btn {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  box-shadow: none !important;
}
[data-theme="light"] .auth-social a.social-btn:hover,
[data-theme="light"] .auth-social button.social-btn:hover {
  background: #F8FAFC !important;
  border-color: rgba(15, 23, 42, 0.28) !important;
}
[data-theme="light"] .auth-card input {
  background: #FFFFFF !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #0F172A !important;
}
[data-theme="light"] .auth-proof-quiet {
  background: #F1F5F9;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .auth-quote p { color: #0F172A; }
[data-theme="light"] .auth-metric { color: #475569; }
.auth-screen {
  align-items: stretch;
}
.auth-pane {
  padding: 2rem 1.5rem;
}
.auth-card {
  margin: auto;
}
@media (min-width: 721px) {
  .auth-screen {
    grid-template-columns: minmax(380px, 480px) minmax(0, 1fr);
  }
}

/* (replaced by RAIL SCROLL FIX) */

/* Calendar filters stay collapsed until opened */
.cal-tools-menu:not([open]) > .cal-tools-panel {
  display: none !important;
}
.cal-tools-menu > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font-weight: 600;
  font-size: 0.875rem;
}
.cal-tools-menu > summary::-webkit-details-marker { display: none; }
.cal-tools-menu[open] > .cal-tools-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
}

/* Demo chip quiet */
.demo-banner, .demo-chip, .billing-soft-banner {
  font-size: 0.8rem;
}

/* === COLORFUL CALENDAR POSTS === */
.cal-event.soft-pill[data-platform="linkedin"],
.cal-event.soft-pill[data-platform="linkedin_page"] {
  border-left-color: #2563EB !important;
  background: color-mix(in srgb, #2563EB 18%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="facebook"],
.cal-event.soft-pill[data-platform="threads"] {
  border-left-color: #1D4ED8 !important;
  background: color-mix(in srgb, #1D4ED8 16%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="instagram"],
.cal-event.soft-pill[data-platform="instagram_standalone"] {
  border-left-color: #DB2777 !important;
  background: color-mix(in srgb, #DB2777 18%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="pinterest"] {
  border-left-color: #BE185D !important;
  background: color-mix(in srgb, #BE185D 18%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="youtube"] {
  border-left-color: #DC2626 !important;
  background: color-mix(in srgb, #DC2626 16%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="reddit"] {
  border-left-color: #EA580C !important;
  background: color-mix(in srgb, #EA580C 16%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="x"],
.cal-event.soft-pill[data-platform="twitter"] {
  border-left-color: #6366F1 !important;
  background: color-mix(in srgb, #6366F1 18%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="tiktok"] {
  border-left-color: #14B8A6 !important;
  background: color-mix(in srgb, #14B8A6 16%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="bluesky"] {
  border-left-color: #0284C7 !important;
  background: color-mix(in srgb, #0284C7 16%, var(--panel)) !important;
}
.cal-event.soft-pill[data-platform="telegram"],
.cal-event.soft-pill[data-platform="discord"],
.cal-event.soft-pill[data-platform="slack"] {
  border-left-color: #7C3AED !important;
  background: color-mix(in srgb, #7C3AED 16%, var(--panel)) !important;
}
.cal-event.soft-pill.published {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent);
}
.cal-event.soft-pill.failed {
  border-left-color: var(--danger) !important;
  background: color-mix(in srgb, var(--danger) 14%, var(--panel)) !important;
}
.cal-event.soft-pill.draft {
  opacity: 0.95;
}

/* === RAIL SCROLL FIX === */
.shell .rail {
  overflow: hidden !important;
}
.shell .rail .rail-nav-scroll,
.shell.shell-unified.shell-comet .rail .rail-nav-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 0.15rem 0.15rem 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.shell .rail .rail-nav-scroll:hover,
.shell .rail .rail-nav-scroll:focus-within {
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}
.shell .rail .rail-nav-scroll::-webkit-scrollbar { width: 5px; }
.shell .rail .rail-nav-scroll::-webkit-scrollbar-track { background: transparent; }
.shell .rail .rail-nav-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 99px;
}
.shell .rail .rail-nav-scroll:hover::-webkit-scrollbar-thumb,
.shell .rail .rail-nav-scroll:focus-within::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
}
.shell .rail .rail-group-label {
  padding-top: 0.35rem;
  overflow: visible;
}
.shell .rail .rail-more:not([open]) {
  /* collapsed More keeps nav short — no phantom scroll */
}
