/* ==========================================================================
   Relay console — Quiet light
   Apple-inspired clarity: warm white, soft graphite, one blue accent.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #f5f5f7;
  --core: #ffffff;
  --core-raised: #ffffff;
  --core-glass: rgba(255, 255, 255, 0.86);
  --hairline: #e5e5ea;
  --hairline-strong: #d2d2d7;
  --shell: #f2f2f4;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --text-mute: #86868b;
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --accent-line: rgba(0, 113, 227, 0.22);
  --live: #34c759;
  --live-soft: rgba(52, 199, 89, 0.1);
  --live-line: rgba(52, 199, 89, 0.24);
  --mock: #ff9f0a;
  --mock-soft: rgba(255, 159, 10, 0.1);
  --mock-line: rgba(255, 159, 10, 0.24);
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, 0.08);
  --danger-line: rgba(255, 59, 48, 0.22);
  --x: #1d1d1f;
  --x-soft: rgba(29, 29, 31, 0.05);
  --x-line: rgba(29, 29, 31, 0.14);
  --threads: #6e6e73;
  --threads-soft: rgba(110, 110, 115, 0.06);
  --threads-line: rgba(110, 110, 115, 0.16);
  --tiktok-cyan: #00a6a0;
  --tiktok-red: #fe2c55;
  --tiktok-soft: rgba(0, 166, 160, 0.07);
  --tiktok-line: rgba(0, 166, 160, 0.18);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.25, 0.1, 0.25, 1);
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "Cascadia Code", monospace;
  --sidebar-w: 224px;
  --main-gap: 0px;
  --page-pad: 56px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, p, pre, ol, ul {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(139, 124, 255, 0.34);
  color: #fff;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: -0.02em;
  color: #d9d4ff;
  background: rgba(139, 124, 255, 0.1);
  border: 1px solid rgba(139, 124, 255, 0.16);
  border-radius: 6px;
  padding: 1px 5px;
}

/* ---------- Focus ---------- */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

:where(input, textarea, select):focus-visible {
  outline: none;
}

/* ---------- Ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1000px 640px at 10% -10%, rgba(124, 108, 255, 0.14), transparent 62%),
    radial-gradient(820px 540px at 96% 4%, rgba(61, 220, 151, 0.07), transparent 60%),
    radial-gradient(760px 700px at 58% 112%, rgba(254, 44, 85, 0.05), transparent 65%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.orb-violet {
  width: 640px;
  height: 640px;
  left: -200px;
  top: -240px;
  background: radial-gradient(circle at 50% 50%, rgba(124, 108, 255, 0.34), transparent 66%);
  animation: drift-a 26s var(--ease) infinite alternate;
}

.orb-emerald {
  width: 520px;
  height: 520px;
  right: -160px;
  top: 4%;
  background: radial-gradient(circle, rgba(61, 220, 151, 0.16), transparent 66%);
  animation: drift-b 34s var(--ease) infinite alternate;
}

.orb-rose {
  width: 680px;
  height: 680px;
  left: 34%;
  bottom: -380px;
  background: radial-gradient(circle, rgba(254, 44, 85, 0.1), transparent 66%);
  animation: drift-a 40s var(--ease) infinite alternate-reverse;
}

@keyframes drift-a {
  to { transform: translate3d(64px, 48px, 0) scale(1.08); }
}

@keyframes drift-b {
  to { transform: translate3d(-48px, 64px, 0) scale(1.05); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.032;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ---------- App shell ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 90;
  padding: 10px 18px;
  border-radius: 999px;
  background: #f4f1ea;
  color: #0a0a0c;
  font-size: 13px;
  font-weight: 600;
  transition: top 0.5s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  z-index: 40;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: var(--sidebar-w);
  border-radius: var(--radius-xl);
  border: 1px solid var(--hairline);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    rgba(8, 8, 11, 0.78);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    0 40px 90px -50px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-core {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 14px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 20px;
  border-radius: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 14px;
  color: #ded9ff;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(139, 124, 255, 0.32), rgba(139, 124, 255, 0.05) 60%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 124, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 30px -18px rgba(139, 124, 255, 0.8);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-sub {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--text-mute);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 480;
  letter-spacing: -0.005em;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.45s var(--ease),
    background 0.45s var(--ease),
    transform 0.45s var(--ease);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  color: currentColor;
  opacity: 0.85;
  transition: transform 0.5s var(--ease), opacity 0.45s var(--ease);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item:hover .nav-icon {
  transform: translateY(-1px) scale(1.04);
  opacity: 1;
}

.nav-item.is-active {
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(139, 124, 255, 0.15), rgba(255, 255, 255, 0.045) 70%);
  box-shadow: inset 0 0 0 1px rgba(139, 124, 255, 0.2);
}

.nav-item.is-active .nav-icon {
  color: #c9c2ff;
  opacity: 1;
}

.nav-label {
  flex: 1;
  min-width: 0;
}

.nav-badge {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(139, 124, 255, 0.18);
  border: 1px solid rgba(139, 124, 255, 0.24);
  color: #d3cdff;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 14px 6px 2px;
}

.mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--hairline);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
  transition: border-color 0.5s var(--ease), background 0.5s var(--ease);
}

.mini-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--mock);
  box-shadow: 0 0 14px rgba(234, 180, 100, 0.7);
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.mini-dot[data-mode="live"] {
  background: var(--live);
  box-shadow: 0 0 14px rgba(75, 223, 160, 0.7);
}

.mini-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mini-label {
  font-size: 12px;
  font-weight: 560;
  color: var(--text);
}

.mini-sub {
  font-size: 10.5px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-mute);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.4s var(--ease), background 0.4s var(--ease);
}

.text-btn svg {
  width: 16px;
  height: 16px;
}

.text-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-meta {
  padding: 2px 12px 0;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.24);
  font-family: var(--font-mono);
}

/* ---------- Main column ---------- */
.main {
  position: relative;
  margin-left: calc(var(--sidebar-w) + var(--main-gap) + 18px);
  padding: 0 var(--page-pad) 28px 6px;
  max-width: 1520px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 18px;
  background: linear-gradient(180deg, rgba(5, 5, 6, 0.94) 0%, rgba(5, 5, 6, 0.76) 62%, rgba(5, 5, 6, 0) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-heading {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.topbar-eyebrow {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--text-mute);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn.menu-btn {
  display: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 11.5px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.status-dot[data-state="on"] {
  background: var(--live);
  box-shadow: 0 0 10px rgba(75, 223, 160, 0.65);
}

.status-dot[data-state="off"] {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 106, 127, 0.5);
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color 0.5s var(--ease), background 0.5s var(--ease), border-color 0.5s var(--ease);
}

.mode-badge .mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.mode-badge[data-mode="mock"] {
  color: #f0c98a;
  background: var(--mock-soft);
  border-color: var(--mock-line);
}

.mode-badge[data-mode="live"] {
  color: #7ff0bc;
  background: var(--live-soft);
  border-color: var(--live-line);
}

.mode-badge.small {
  height: 28px;
  padding: 0 11px;
  font-size: 10.5px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 13px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-dim);
  cursor: pointer;
  transition:
    color 0.4s var(--ease),
    background 0.4s var(--ease),
    border-color 0.4s var(--ease),
    transform 0.5s var(--ease);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--hairline-strong);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn.small {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.icon-btn.small svg {
  width: 14px;
  height: 14px;
}

.hamburger {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
}

.hamburger span {
  display: block;
  height: 1.5px;
  width: 100%;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.55s var(--ease), opacity 0.35s var(--ease);
}

.menu-btn[aria-expanded="true"] .hamburger span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] .hamburger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.2);
}

.menu-btn[aria-expanded="true"] .hamburger span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* ---------- Owner (host) banner ---------- */
.owner-banner {
  margin: 4px 0 16px;
}

.owner-banner-core {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: calc(var(--radius-xl) - 6px);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(30, 107, 79, 0.14), transparent 55%),
    #0b0b0e;
  border: 1px solid rgba(30, 107, 79, 0.35);
}

.owner-banner-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft, #a8b0a9);
}

/* ---------- Simulated banner ---------- */
.sim-banner {
  margin: 4px 0 24px;
}

.sim-banner-core {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 16px;
  border-radius: calc(var(--radius-xl) - 6px);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(234, 180, 100, 0.12), transparent 55%),
    radial-gradient(100% 140% at 100% 0%, rgba(139, 124, 255, 0.1), transparent 60%),
    #0b0b0e;
}

.sim-banner-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 13px;
  color: #f0c98a;
  background: var(--mock-soft);
  border: 1px solid var(--mock-line);
}

.sim-banner-icon svg {
  width: 19px;
  height: 19px;
}

.sim-banner-copy {
  flex: 1;
  min-width: 0;
}

.sim-banner-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sim-banner-text {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-mute);
  max-width: 88ch;
}

.sim-banner-text code {
  font-size: 10.5px;
}

/* ---------- Screens ---------- */
.screens {
  position: relative;
}

.screen {
  padding-bottom: 44px;
}

.screen.is-active {
  animation: screen-in 0.75s var(--ease) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.screen-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 2px 30px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 520;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--text-mute);
}

.display {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.4vw, 58px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.048em;
  color: #f7f7f8;
}

.display-dot {
  background: linear-gradient(135deg, #c9c2ff, #8b7cff 55%, #4bdfa0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 64ch;
  font-size: 14.5px;
  color: var(--text-dim);
}

/* ---------- Double-bezel cards ---------- */
.bezel {
  position: relative;
  padding: 6px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012));
  box-shadow:
    0 34px 70px -46px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bezel > .panel {
  border-radius: calc(var(--radius-xl) - 6px);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.028), transparent 42%),
    linear-gradient(180deg, #0d0d11 0%, #0a0a0d 60%, #09090c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
}

.panel {
  padding: 24px 25px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-eyebrow {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-mute);
  margin-bottom: 5px;
}

.panel-head h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
}

.panel-hint {
  flex: none;
  font-size: 11px;
  color: var(--text-mute);
  padding-top: 4px;
}

.panel-text {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
  max-width: 60ch;
}

.count-badge {
  min-width: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: linear-gradient(90deg, transparent, var(--hairline-strong) 18%, var(--hairline-strong) 82%, transparent);
}

.hint {
  font-size: 11.5px;
  color: var(--text-mute);
}

.fine-print {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-mute);
  text-align: center;
  padding: 14px 6px 4px;
}

/* ---------- Buttons ---------- */
.primary-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 54px;
  padding: 8px 9px 8px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7f5f0 0%, #e9e5db 100%);
  color: #08080a;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.012em;
  cursor: pointer;
  box-shadow:
    0 20px 44px -22px rgba(240, 236, 226, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition:
    transform 0.55s var(--ease),
    box-shadow 0.55s var(--ease),
    filter 0.55s var(--ease);
}

.primary-btn:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.035);
  box-shadow:
    0 28px 54px -22px rgba(240, 236, 226, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary-btn:active {
  transform: scale(0.985);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: progress;
  transform: none;
}

.btn-orb {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: #0a0a0c;
  color: #f6f4ee;
  transition: transform 0.55s var(--ease), background 0.4s var(--ease);
}

.btn-orb svg {
  width: 17px;
  height: 17px;
}

.primary-btn:hover .btn-orb {
  transform: translate(2px, -2px) scale(1.05);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.4s var(--ease),
    background 0.4s var(--ease),
    border-color 0.4s var(--ease),
    transform 0.5s var(--ease);
}

.ghost-btn svg {
  width: 15px;
  height: 15px;
}

.ghost-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--hairline-strong);
  transform: translateY(-1px);
}

.ghost-btn:active {
  transform: scale(0.985);
}

.ghost-btn.small {
  width: auto;
  min-height: 32px;
  padding: 6px 13px;
  font-size: 11.5px;
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: #ffb6c0;
  font-size: 12.5px;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), transform 0.5s var(--ease);
}

.danger-btn:hover {
  background: rgba(255, 106, 127, 0.2);
  color: #ffd6dc;
  transform: translateY(-1px);
}

.danger-btn:active {
  transform: scale(0.985);
}

/* ---------- Compose layout ---------- */
.compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.78fr);
  gap: 22px;
  align-items: start;
}

.compose-main,
.compose-rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* Targets */
.targets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.target {
  --brand: var(--x);
  --brand-soft: var(--x-soft);
  --brand-line: var(--x-line);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-height: 138px;
  text-align: left;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition:
    border-color 0.5s var(--ease),
    background 0.5s var(--ease),
    transform 0.55s var(--ease),
    box-shadow 0.55s var(--ease);
}

.target[data-platform="threads"] {
  --brand: var(--threads);
  --brand-soft: var(--threads-soft);
  --brand-line: var(--threads-line);
}

.target[data-platform="tiktok"] {
  --brand: var(--tiktok-cyan);
  --brand-soft: var(--tiktok-soft);
  --brand-line: var(--tiktok-line);
}

.target:hover {
  transform: translateY(-2px);
  border-color: var(--hairline-strong);
}

.target[aria-pressed="true"] {
  border-color: var(--brand-line);
  background:
    radial-gradient(130% 130% at 12% 0%, var(--brand-soft), transparent 58%),
    rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 20px 42px -30px rgba(0, 0, 0, 0.9);
}

.target-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.glyph[data-platform="x"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.glyph[data-platform="threads"] {
  color: #cdd2da;
  background: var(--threads-soft);
  border-color: var(--threads-line);
}

.glyph[data-platform="tiktok"] {
  color: #eafeff;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(37, 244, 238, 0.22), transparent 60%),
    radial-gradient(120% 120% at 90% 100%, rgba(254, 44, 85, 0.22), transparent 60%),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(37, 244, 238, 0.22);
}

.glyph svg {
  width: 18px;
  height: 18px;
}

.target-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  color: transparent;
  transition:
    background 0.45s var(--ease),
    border-color 0.45s var(--ease),
    color 0.45s var(--ease),
    transform 0.55s var(--ease-spring);
}

.target-check svg {
  width: 11px;
  height: 11px;
}

.target[aria-pressed="true"] .target-check {
  color: #08080a;
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.05);
}

.target-name {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.target-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-foot {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-mute);
}

.target-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-mute);
}

.target-dot[data-state="connected"] {
  background: var(--live);
  box-shadow: 0 0 8px rgba(75, 223, 160, 0.6);
}

/* Parts */
.parts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.part {
  position: relative;
  padding: 15px 15px 13px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background:
    radial-gradient(140% 140% at 0% 0%, rgba(255, 255, 255, 0.024), transparent 46%),
    rgba(255, 255, 255, 0.014);
  transition: border-color 0.5s var(--ease), background 0.5s var(--ease);
}

.part:focus-within {
  border-color: rgba(139, 124, 255, 0.34);
  background:
    radial-gradient(140% 140% at 0% 0%, rgba(139, 124, 255, 0.06), transparent 48%),
    rgba(255, 255, 255, 0.02);
}

.part-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.part-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-mute);
}

.part-index {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0;
  color: var(--text-dim);
}

.part-remove {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  transition: color 0.4s var(--ease), background 0.4s var(--ease), transform 0.5s var(--ease);
}

.part-remove svg {
  width: 13px;
  height: 13px;
}

.part-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
  transform: rotate(8deg);
}

.part-text {
  display: block;
  width: 100%;
  min-height: 104px;
  max-height: 420px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  letter-spacing: -0.012em;
  resize: none;
  overflow-y: auto;
  transition: height 0.15s var(--ease);
}

.part-text::placeholder {
  color: rgba(255, 255, 255, 0.26);
}

.part-text:focus {
  outline: none;
}

.part-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--hairline);
}

.counters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0;
  color: var(--text-mute);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}

.counter b {
  font-weight: 500;
  color: var(--text-dim);
}

.counter[data-platform="x"] { --counter-brand: var(--x); }
.counter[data-platform="threads"] { --counter-brand: var(--threads); }
.counter[data-platform="tiktok"] { --counter-brand: var(--tiktok-cyan); }

.counter.is-active {
  border-color: color-mix(in srgb, var(--counter-brand) 40%, transparent);
  color: var(--text-dim);
}

.counter.is-warn {
  color: #f0c98a;
  border-color: var(--mock-line);
  background: var(--mock-soft);
}

.counter.is-over {
  color: #ffb0ba;
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.counter.is-over b {
  color: #ffd0d6;
}

.media-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.media-chip {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  flex: none;
  animation: chip-in 0.55s var(--ease-spring) both;
}

@keyframes chip-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}

.media-chip img,
.media-chip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-video {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--text-dim);
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(139, 124, 255, 0.18), transparent 60%),
    rgba(255, 255, 255, 0.02);
}

.media-video svg {
  width: 20px;
  height: 20px;
}

.media-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(5, 5, 6, 0.82);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.35s var(--ease), transform 0.4s var(--ease-spring), background 0.3s var(--ease);
}

.media-chip:hover .media-remove,
.media-remove:focus-visible {
  opacity: 1;
  transform: none;
}

.media-remove:hover {
  background: var(--danger);
}

.media-remove svg {
  width: 9px;
  height: 9px;
}

.media-add {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: none;
  border: 1px dashed var(--hairline-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-mute);
  cursor: pointer;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease), transform 0.5s var(--ease);
}

.media-add svg {
  width: 18px;
  height: 18px;
}

.media-add:hover {
  color: var(--text);
  border-color: rgba(139, 124, 255, 0.42);
  background: rgba(139, 124, 255, 0.06);
  transform: translateY(-1px);
}

.media-add.is-busy {
  opacity: 0.6;
  cursor: progress;
}

.media-hint {
  font-size: 10.5px;
  color: var(--text-mute);
  margin-left: 2px;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.editor-actions .ghost-btn {
  width: auto;
}

.editor-actions .ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Options */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 11px;
  font-weight: 520;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.field-label-dim {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-mute);
}

.key-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text-mute);
  background: var(--shell);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}

.key-status.is-on {
  color: var(--live);
  border-color: var(--live-line);
  background: var(--live-soft);
}

.field-hint {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-mute);
}

.input,
.select {
  width: 100%;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: -0.006em;
  transition:
    border-color 0.4s var(--ease),
    background 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.24);
}

.input:hover,
.select:hover {
  border-color: var(--hairline-strong);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: rgba(139, 124, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 4px rgba(139, 124, 255, 0.11);
}

.mono-input {
  font-family: var(--font-mono);
  font-size: 12px;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  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 d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23767680' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.select option {
  background: #0d0d11;
  color: var(--text);
}

input[type="datetime-local"] {
  color-scheme: dark;
  font-family: var(--font-mono);
  font-size: 12px;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  cursor: pointer;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #b9b9c2;
  transition: transform 0.5s var(--ease-spring), background 0.4s var(--ease);
}

.switch-input:checked + .switch-track {
  background: rgba(139, 124, 255, 0.4);
  border-color: var(--accent-line);
}

.switch-input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
  background: #f4f1ff;
}

.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.switch-copy {
  font-size: 12px;
  color: var(--text-dim);
}

/* Publish panel */
.publish-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
}

.summary-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-key {
  color: var(--text-mute);
}

.summary-value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: right;
}

.summary-value.is-strong {
  color: var(--text);
}

.publish-panel .primary-btn {
  margin-bottom: 10px;
}

.publish-panel .ghost-btn {
  width: 100%;
}

/* Preflight */
.spinner {
  width: 15px;
  height: 15px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.preflight {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 42px;
}

.preflight-idle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--hairline);
  border-radius: 14px;
  font-size: 11.5px;
  color: var(--text-mute);
}

.preflight-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.018);
  animation: row-in 0.55s var(--ease) both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.preflight-row[data-state="ok"] {
  border-color: rgba(75, 223, 160, 0.18);
  background: rgba(75, 223, 160, 0.045);
}

.preflight-row[data-state="error"] {
  border-color: rgba(255, 106, 127, 0.2);
  background: rgba(255, 106, 127, 0.045);
}

.preflight-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-mute);
}

.preflight-row[data-state="ok"] .preflight-mark {
  color: var(--live);
  background: var(--live-soft);
}

.preflight-row[data-state="error"] .preflight-mark {
  color: var(--danger);
  background: var(--danger-soft);
}

.preflight-mark svg {
  width: 11px;
  height: 11px;
}

.preflight-copy {
  min-width: 0;
  flex: 1;
}

.preflight-name {
  font-size: 11.5px;
  font-weight: 560;
  color: var(--text);
}

.preflight-note {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-mute);
}

.preflight-overall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 11.5px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
}

.preflight-overall[data-state="ok"] {
  color: #a8f2cf;
  border-color: rgba(75, 223, 160, 0.24);
  background: rgba(75, 223, 160, 0.06);
}

.preflight-overall[data-state="error"] {
  color: #ffbcc6;
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.preflight-overall strong {
  font-weight: 600;
}

.preflight-overall span {
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Results */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
}

.result-row[data-state="ok"] {
  border-color: rgba(75, 223, 160, 0.18);
}

.result-row[data-state="error"] {
  border-color: rgba(255, 106, 127, 0.2);
}

.result-copy {
  flex: 1;
  min-width: 0;
}

.result-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 560;
}

.result-note {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-mute);
  overflow-wrap: anywhere;
}

.result-link {
  font-size: 10.5px;
  color: #c9c2ff;
  text-decoration: underline;
  text-decoration-color: rgba(201, 194, 255, 0.35);
  text-underline-offset: 3px;
}

.result-link:hover {
  text-decoration-color: currentColor;
}

/* ---------- Status badges & platform chips ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-mute);
  white-space: nowrap;
}

.status-badge[data-tone="live"] {
  color: #8af3c8;
  border-color: var(--live-line);
  background: var(--live-soft);
}

.status-badge[data-tone="mock"] {
  color: #f0c98a;
  border-color: var(--mock-line);
  background: var(--mock-soft);
}

.status-badge[data-tone="error"] {
  color: #ffb3bd;
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.status-badge[data-tone="pending"] {
  color: #cfc8ff;
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.status-badge[data-tone="neutral"] {
  color: var(--text-dim);
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.platform-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--chip-color, var(--text-mute));
}

.platform-chip[data-platform="x"] { --chip-color: #ffffff; }
.platform-chip[data-platform="threads"] { --chip-color: #a9adb6; }
.platform-chip[data-platform="tiktok"] { --chip-color: #25f4ee; }

/* ---------- Queue / History lists ---------- */
.list {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 2px;
  border-top: 1px solid var(--hairline);
  animation: row-in 0.55s var(--ease) both;
}

.list-row:first-child {
  border-top: 0;
  padding-top: 4px;
}

.list-marker {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.list-marker[data-tone="pending"] {
  color: #cfc8ff;
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.list-marker[data-tone="done"] {
  color: var(--live);
  border-color: var(--live-line);
  background: var(--live-soft);
}

.list-marker[data-tone="failed"],
.list-marker[data-tone="canceled"] {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.list-main {
  min-width: 0;
}

.list-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 540;
  color: var(--text);
  letter-spacing: -0.01em;
}

.list-excerpt {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.meta-text {
  font-size: 10.5px;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.row-actions .ghost-btn {
  width: auto;
  min-height: 30px;
  padding: 5px 12px;
  font-size: 11px;
}

.result-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

/* ---------- Empty states ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px 34px;
}

.empty-art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 16px;
  border-radius: 21px;
  border: 1px dashed var(--hairline-strong);
  background:
    radial-gradient(120% 120% at 30% 0%, rgba(139, 124, 255, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.018);
  color: var(--text-mute);
}

.empty-art svg {
  width: 24px;
  height: 24px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 580;
  letter-spacing: -0.015em;
}

.empty-text {
  max-width: 40ch;
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-mute);
}

.empty .ghost-btn {
  width: auto;
  margin-top: 16px;
}

/* ---------- Accounts ---------- */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.account-card {
  position: relative;
  overflow: hidden;
}

.account-card::before {
  content: "";
  position: absolute;
  inset: -40% 20% auto;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(255, 255, 255, 0.12)), transparent 65%);
  filter: blur(30px);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
}

.account-card[data-platform="x"] { --glow: rgba(255, 255, 255, 0.14); }
.account-card[data-platform="threads"] { --glow: rgba(170, 175, 184, 0.14); }
.account-card[data-platform="tiktok"] { --glow: rgba(37, 244, 238, 0.16); }

.account-card:hover::before {
  opacity: 0.9;
  transform: translateY(6px) scale(1.04);
}

.account-card > .panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px 22px 20px;
}

.account-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.account-top .glyph {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 16px;
}

.account-identity {
  min-width: 0;
  flex: 1;
}

.account-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.account-desc {
  min-height: 44px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-mute);
}

.account-empty {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0;
  padding: 12px 13px;
  border: 1px dashed var(--hairline);
  border-radius: 14px;
  font-size: 11px;
  color: var(--text-mute);
}

.account-connected {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(139, 124, 255, 0.32), transparent 62%),
    rgba(255, 255, 255, 0.03);
  color: #efeaff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.account-handle {
  min-width: 0;
  flex: 1;
}

.account-handle strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-handle span {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-mute);
}

.account-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.scope-tag {
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--text-mute);
}

.account-spacer {
  flex: 1;
}

.account-connect {
  margin-top: 4px;
}

.account-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.account-actions .ghost-btn {
  flex: 1;
  width: auto;
}

.account-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: var(--text-mute);
}

.account-foot .status-badge {
  font-size: 9px;
}

.note-panel {
  padding: 22px 24px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.note-item {
  padding: 14px 15px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.017);
}

.note-item .note-num {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.note-item h4 {
  margin: 6px 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.note-item p {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-mute);
}

/* ---------- Settings ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 22px;
  align-items: start;
}

.settings-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.kv-list {
  display: flex;
  flex-direction: column;
}

.kv-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  font-size: 11.5px;
}

.kv-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.kv-key {
  color: var(--text-mute);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.kv-value {
  color: var(--text-dim);
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.kv-value.mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.kv-value strong {
  color: var(--text);
  font-weight: 560;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.cred-forms {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cred-form {
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background:
    radial-gradient(130% 130% at 0% 0%, rgba(255, 255, 255, 0.02), transparent 46%),
    rgba(255, 255, 255, 0.012);
  transition: border-color 0.5s var(--ease);
}

.cred-form:focus-within {
  border-color: rgba(139, 124, 255, 0.3);
}

.cred-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cred-head .glyph {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 12px;
}

.cred-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 560;
}

.cred-source {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-mute);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.025);
}

.cred-source[data-source="settings"] {
  color: #cfc8ff;
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.cred-source[data-source="env"] {
  color: #a8f2cf;
  border-color: var(--live-line);
  background: var(--live-soft);
}

.cred-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cred-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.cred-actions .ghost-btn {
  width: auto;
  min-height: 34px;
  padding: 6px 15px;
  font-size: 11px;
}

.cred-note {
  font-size: 10px;
  color: var(--text-mute);
  line-height: 1.5;
  flex: 1;
}

.cred-setup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px dashed var(--hairline);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.cred-portal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: #cfc8ff;
  text-decoration: none;
  white-space: nowrap;
}

.cred-portal svg {
  width: 12px;
  height: 12px;
}

.cred-portal:hover {
  text-decoration: underline;
}

.cred-redirect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 250px;
}

.cred-redirect .field-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.redirect-uri {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #d6d2ea;
  padding: 3px 7px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  word-break: break-all;
}

.cred-redirect .ghost-btn {
  width: auto;
  min-height: 28px;
  padding: 2px 10px;
  font-size: 10px;
}

.steps {
  display: flex;
  flex-direction: column;
  counter-reset: step;
}

.step {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}

.step:first-child {
  border-top: 0;
  padding-top: 2px;
}

.step-index {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
}

.step-copy h4 {
  font-size: 12px;
  font-weight: 580;
  letter-spacing: -0.01em;
}

.step-copy p {
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-mute);
}

.code-block {
  padding: 15px 16px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.34);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.68;
  color: #c6c1ea;
  overflow-x: auto;
  white-space: pre;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.app-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 4px 8px;
  border-top: 1px solid var(--hairline);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.28);
}

.footer-dot {
  opacity: 0.6;
}

/* ---------- Scrim, toasts, modal ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(3, 3, 5, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.scrim.is-visible {
  opacity: 1;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 13px 13px 14px;
  border-radius: 17px;
  border: 1px solid var(--hairline);
  background: rgba(12, 12, 16, 0.9);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: auto;
  animation: toast-in 0.62s var(--ease-spring) both;
}

.toast.is-leaving {
  animation: toast-out 0.36s var(--ease) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  margin-top: 1px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.toast-icon svg {
  width: 13px;
  height: 13px;
}

.toast[data-tone="success"] .toast-icon { color: var(--live); background: var(--live-soft); }
.toast[data-tone="error"] .toast-icon { color: var(--danger); background: var(--danger-soft); }
.toast[data-tone="info"] .toast-icon { color: #cfc8ff; background: var(--accent-soft); }

.toast-copy {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 12px;
  font-weight: 580;
  letter-spacing: -0.01em;
}

.toast-text {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-mute);
  overflow-wrap: anywhere;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

.toast-close svg {
  width: 11px;
  height: 11px;
}

.toast-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-root[hidden] {
  display: none;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 5, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.modal-root.is-open .modal-scrim {
  opacity: 1;
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  opacity: 0;
  transform: translateY(16px) scale(0.975);
  transition: opacity 0.55s var(--ease), transform 0.6s var(--ease);
}

.modal-root.is-open .modal-card {
  opacity: 1;
  transform: none;
}

.modal-core {
  padding: 26px 26px 22px;
  border-radius: calc(var(--radius-xl) - 6px);
  background:
    radial-gradient(130% 130% at 0% 0%, rgba(255, 106, 127, 0.07), transparent 48%),
    linear-gradient(180deg, #0e0e12, #09090c);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 6px 0 8px;
}

.modal-body {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions .ghost-btn {
  width: auto;
}

/* ---------- Login page ---------- */
.auth-page {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  animation: screen-in 0.8s var(--ease) both;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
}

.auth-brand .brand-mark svg {
  width: 28px;
  height: 28px;
}

.auth-brand .brand-word {
  font-size: 20px;
}

.auth-card .panel {
  padding: 30px 28px 26px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 6px 0 8px;
}

.auth-lede {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-mute);
  margin-bottom: 22px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-label {
  font-size: 11px;
  font-weight: 520;
  color: var(--text-dim);
  display: block;
  margin-bottom: 7px;
}

.auth-form .primary-btn {
  margin-top: 4px;
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: #ffbcc6;
  font-size: 11px;
  line-height: 1.5;
  animation: shake 0.5s var(--ease);
}

@keyframes shake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(1px); }
}

.auth-foot {
  margin-top: 18px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-mute);
  text-align: center;
}

.auth-foot code {
  font-size: 9.5px;
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.995);
  transition:
    opacity 0.85s var(--ease),
    transform 0.85s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Scrollbars ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
  background-clip: content-box;
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  :root {
    --sidebar-w: 244px;
    --main-gap: 44px;
    --page-pad: 30px;
  }

  .targets {
    gap: 8px;
  }

  .target {
    padding: 14px;
    min-height: 132px;
  }

  .accounts-grid {
    gap: 14px;
  }
}

@media (max-width: 1120px) {
  :root {
    --sidebar-w: 84px;
    --main-gap: 32px;
    --page-pad: 26px;
  }

  .sidebar-core {
    padding: 18px 10px 14px;
    align-items: center;
  }

  .brand {
    padding: 4px 0 18px;
    justify-content: center;
  }

  .brand-text {
    display: none;
  }

  .nav {
    width: 100%;
    gap: 6px;
  }

  .nav-item {
    justify-content: center;
    padding: 12px 0;
  }

  .nav-label,
  .nav-badge {
    display: none;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
  }

  .nav-icon svg {
    width: 21px;
    height: 21px;
  }

  .sidebar-foot {
    align-items: center;
    width: 100%;
    padding: 12px 0 0;
  }

  .mini-card {
    justify-content: center;
    padding: 10px;
    width: 44px;
  }

  .mini-copy,
  .sidebar-meta,
  .sidebar-foot .text-btn span {
    display: none;
  }

  .sidebar-foot .text-btn {
    justify-content: center;
    padding: 8px;
  }

  .compose-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .compose-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .compose-rail > .bezel:last-child {
    grid-column: 1 / -1;
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .accounts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounts-grid > .bezel:last-child {
    grid-column: 1 / -1;
  }

  .note-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  :root {
    --page-pad: 22px;
  }

  .main {
    margin-left: 0;
    padding: 0 var(--page-pad) 24px;
  }

  .icon-btn.menu-btn {
    display: grid;
  }

  .sidebar {
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: min(292px, calc(100vw - 40px));
    transform: translateX(calc(-100% - 28px));
    transition: transform 0.7s var(--ease);
    will-change: transform;
  }

  .sidebar.is-open {
    transform: none;
  }

  .sidebar-core {
    align-items: stretch;
    padding: 20px 14px 16px;
  }

  .brand {
    justify-content: flex-start;
    padding: 4px 8px 20px;
  }

  .brand-text {
    display: flex;
  }

  .nav-item {
    justify-content: flex-start;
    padding: 11px 13px;
  }

  .nav-label {
    display: block;
  }

  .nav-badge {
    display: inline-block;
  }

  .sidebar-foot {
    align-items: stretch;
  }

  .mini-card {
    width: auto;
  }

  .mini-copy,
  .sidebar-meta {
    display: block;
  }

  .sidebar-foot .text-btn {
    justify-content: flex-start;
    padding: 9px 12px;
  }

  .sidebar-foot .text-btn span {
    display: inline;
  }

  .topbar {
    padding: 16px 0 14px;
  }

  .status-pill span:last-child {
    display: none;
  }

  .status-pill {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .accounts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .accounts-grid > .bezel:last-child {
    grid-column: auto;
  }

  .note-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .screen-intro {
    padding: 8px 2px 24px;
  }

  .display {
    font-size: clamp(34px, 8vw, 46px);
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
  }
}

@media (max-width: 760px) {
  .compose-rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .compose-rail > .bezel:last-child {
    grid-column: auto;
  }

  .targets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .options-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cred-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .note-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .list-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .list-excerpt {
    -webkit-line-clamp: 3;
  }

  .kv-row {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .panel {
    padding: 20px 18px;
  }

  .sim-banner-core {
    flex-wrap: wrap;
    gap: 12px;
  }

  .sim-banner-copy {
    flex-basis: calc(100% - 50px);
  }

  .sim-banner-core .ghost-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  :root {
    --page-pad: 15px;
  }

  body {
    font-size: 14px;
  }

  .topbar-right {
    gap: 6px;
  }

  .mode-badge,
  .status-pill {
    height: 30px;
    font-size: 10.5px;
  }

  .mode-badge {
    padding: 0 10px;
  }

  .targets {
    grid-template-columns: minmax(0, 1fr);
  }

  .target {
    min-height: 0;
    padding: 13px 14px;
  }

  .target-top {
    align-items: flex-start;
  }

  .target-foot {
    margin-top: 2px;
  }

  .panel {
    padding: 18px 15px;
  }

  .panel-head {
    flex-wrap: wrap;
  }

  .screen-intro {
    padding-bottom: 20px;
  }

  .display {
    font-size: clamp(30px, 9vw, 38px);
  }

  .lede {
    font-size: 13px;
  }

  .part {
    padding: 12px 12px 11px;
  }

  .part-text {
    font-size: 15px;
    min-height: 96px;
  }

  .account-top {
    gap: 10px;
  }

  .modal-core {
    padding: 22px 20px 18px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .ghost-btn,
  .modal-actions .danger-btn {
    width: 100%;
  }

  .app-footer {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 9.5px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .orb {
    animation: none;
  }
}

/* ---------- Console component additions ---------- */
.part .media-strip {
  margin-top: 11px;
}

.media-spinner {
  width: 16px;
  height: 16px;
  border-width: 1.5px;
}

.target-name,
.target-sub {
  display: block;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: #c9c2ff;
  font-size: 10px;
  font-family: var(--font-sans);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(201, 194, 255, 0.35);
  text-underline-offset: 3px;
  transition: color 0.3s var(--ease), text-decoration-color 0.3s var(--ease);
}

.link-btn:hover {
  color: #e6e1ff;
  text-decoration-color: currentColor;
}

.connect-btn {
  width: 100%;
  min-height: 44px;
  justify-content: space-between;
  padding: 9px 15px 9px 18px;
  font-size: 12.5px;
}

.connect-btn svg {
  width: 15px;
  height: 15px;
  transition: transform 0.5s var(--ease);
}

.connect-btn:hover svg {
  transform: translate(2px, -2px);
}

.account-card[data-platform="x"] .connect-btn {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
}

.account-card[data-platform="threads"] .connect-btn {
  border-color: var(--threads-line);
  background: var(--threads-soft);
  color: #e2e6ec;
}

.account-card[data-platform="tiktok"] .connect-btn {
  border-color: var(--tiktok-line);
  background: var(--tiktok-soft);
  color: #e6feff;
}

.list-marker {
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.list-marker span {
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}

.list-marker strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: inherit;
}

.modal-primary {
  width: 100%;
  min-height: 44px;
}

.cred-actions .ghost-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Layout refinements ---------- */
.account-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-desc {
  min-height: 0;
}

.account-empty svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  opacity: 0.75;
}

@media (max-width: 760px) {
  .sim-banner-core {
    position: relative;
    padding-right: 44px;
  }

  .sim-banner-core > .icon-btn.small {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .sim-banner-core .ghost-btn {
    width: 100%;
  }
}

/* ---------- Previews, calendar, recurring posts ---------- */
.previews {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 2px;
}

.previews-idle {
  color: var(--text-mute);
  font-size: 13px;
  padding: 14px 4px;
}

.preview-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  padding: 12px;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.preview-platform {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.preview-part {
  border-left: 2px solid var(--hairline-strong);
  padding: 2px 0 2px 10px;
  margin: 8px 0;
}

.preview-part p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.preview-part-index {
  display: inline-block;
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 3px;
  font-family: var(--font-mono);
}

.preview-count {
  display: block;
  text-align: right;
  font-size: 10px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.preview-issue {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--mock);
  line-height: 1.45;
}

.preview-foot {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-apply {
  float: right;
  margin-top: -4px;
  padding: 3px 8px;
  font-size: 9px;
  text-transform: none;
  letter-spacing: 0;
}

.queue-viewbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 16px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--shell);
}

.segmented-btn {
  border: 0;
  border-radius: 999px;
  padding: 7px 16px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.segmented-btn.is-active {
  background: var(--text);
  color: var(--bg);
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-month {
  min-width: 150px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekday {
  padding: 6px 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.calendar-day {
  min-height: 104px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.012);
  overflow: hidden;
}

.calendar-day.is-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.is-today {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.calendar-day-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 5px;
}

.calendar-day.is-today .calendar-day-number {
  color: var(--accent);
}

.calendar-events {
  display: grid;
  gap: 3px;
}

.calendar-event {
  border-radius: 5px;
  padding: 3px 5px;
  background: var(--shell);
  border-left: 2px solid var(--hairline-strong);
  overflow: hidden;
}

.calendar-event[data-tone="pending"] {
  border-left-color: var(--accent);
}

.calendar-event[data-tone="done"] {
  border-left-color: var(--live);
  opacity: .62;
}

.calendar-event[data-tone="done"] .calendar-event-title {
  text-decoration: line-through;
  text-decoration-thickness: .5px;
}

.calendar-event[data-tone="failed"] {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.calendar-event[data-tone="canceled"] {
  border-left-color: var(--text-mute);
  opacity: .55;
}

.calendar-event-status {
  display: inline-block;
  margin-right: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.calendar-event[data-tone="done"] .calendar-event-status { color: var(--live); }
.calendar-event[data-tone="failed"] .calendar-event-status { color: var(--danger); }
.calendar-event[data-tone="pending"] .calendar-event-status { color: var(--accent); }

.calendar-event-time {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-mute);
}

.calendar-event-title {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.calendar-more {
  font-size: 9px;
  color: var(--text-mute);
  padding-left: 3px;
}

.calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-mute);
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.legend-dot[data-tone="recurring"] { background: var(--mock); }
.legend-dot[data-tone="done"] { background: var(--live); }
.legend-dot[data-tone="failed"] { background: var(--danger); }
.legend-dot[data-tone="canceled"] { background: var(--text-mute); }

@media (max-width: 760px) {
  .calendar-day { min-height: 76px; }
  .calendar-event-title { display: none; }
}


/* ==========================================================================
   Quiet light redesign
   ========================================================================== */

html { color-scheme: light; }

body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.012em;
}

::selection { background: rgba(0, 113, 227, 0.16); color: var(--text); }

code {
  color: var(--text-dim);
  background: var(--shell);
  border: 1px solid var(--hairline);
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ambient, .grain, .brand-sub, .topbar-eyebrow, .sidebar-meta,
.app-footer, .mini-card, .status-pill, .mode-badge,
.eyebrow, .panel-eyebrow, .lede, .panel-hint, .field-hint,
.fine-print, .panel-text, .note-panel, .cred-note,
#goLiveSteps, .cred-setup, .sidebarScheduler {
  display: none !important;
}

/* Shell */
.app-shell { min-height: 100dvh; }

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  height: 100dvh;
  border: 0;
  border-right: 1px solid var(--hairline);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: none;
}

.sidebar-core {
  height: 100%;
  padding: 30px 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand {
  gap: 10px;
  padding: 0 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  padding: 5px;
  border: 0;
  border-radius: 9px;
  background: var(--text);
  color: #fff;
}

.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; }
.brand-word {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
}

.nav { display: grid; gap: 2px; }

.nav-item {
  min-height: 40px;
  padding: 0 11px;
  gap: 11px;
  border: 0;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
}

.nav-item:hover { color: var(--text); background: #f0f0f2; }
.nav-item.is-active,
.nav-item.is-active:hover {
  color: var(--text);
  background: #e9e9ec;
}
.nav-icon { width: 19px; height: 19px; color: currentColor; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-label { letter-spacing: -0.01em; }

.nav-badge {
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border: 0;
  border-radius: 99px;
  background: var(--text);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 0 2px;
  display: grid;
  gap: 4px;
}

.sidebar-foot .text-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  color: var(--text-dim);
  background: transparent;
  font-size: 13px;
}

.sidebar-foot .text-btn:hover { color: var(--text); background: #f0f0f2; }

.credit-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.credit-card .mini-label {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.credit-card strong {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.03em;
}

.credit-card #creditFree { color: var(--text-mute); font-size: 10px; }

/* The base design reset hides .mini-card; the balance card must remain visible. */
.sidebar-foot .credit-card:not([hidden]) { display: flex !important; }

.main {
  margin-left: var(--sidebar-w);
  padding: 0 52px 80px;
  max-width: 1340px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 24px 0 14px;
  background: rgba(245, 245, 247, 0.84);
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.topbar-title {
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--text-mute);
}

.topbar-heading { gap: 0; }
.topbar-right { gap: 6px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-dim);
}
.icon-btn:hover { color: var(--text); background: #fff; border-color: var(--hairline-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.menu-btn { display: none; }

.screens { padding-top: 20px; }

.screen-intro {
  gap: 0;
  padding: 34px 0 34px;
}

.display {
  font-size: clamp(38px, 4vw, 50px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--text);
}

.display-dot { display: none; }

/* Cards */
.bezel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.bezel > .panel {
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--core);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
}

.panel { padding: 28px; }

.panel-head {
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.panel-head h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

.count-badge {
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--hairline);
  border-radius: 99px;
  background: var(--shell);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 22px;
}

/* Compose */
.compose-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.72fr);
  gap: 24px;
}

.compose-main, .compose-rail { gap: 24px; }

.targets { gap: 10px; }

.target {
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #fbfbfc;
  color: var(--text);
  box-shadow: none;
}

.target:hover {
  border-color: var(--hairline-strong);
  background: #f5f5f7;
}

.target[aria-pressed="true"] {
  border-color: var(--text);
  background: #fff;
  box-shadow: 0 0 0 1px var(--text);
}

.target-top { margin-bottom: 16px; }
.target-name { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.target-sub { display: none; }
.target-foot { color: var(--text-mute); font-size: 11px; }
.target-check { border-color: var(--hairline-strong); background: #fff; }
.target[aria-pressed="true"] .target-check { background: var(--text); border-color: var(--text); color: #fff; }

.glyph,
.glyph[data-platform="x"],
.glyph[data-platform="threads"],
.glyph[data-platform="tiktok"] {
  color: var(--text);
  background: var(--shell);
  border-color: var(--hairline);
  box-shadow: none;
}

.parts { gap: 10px; }

.part {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #fbfbfc;
  padding: 14px 15px;
  box-shadow: none;
}
.part:focus-within { border-color: var(--text); background: #fff; }

.part-head { margin-bottom: 8px; }
.part-label { font-size: 11px; color: var(--text-mute); font-weight: 500; }
.part-index { color: var(--text-mute); font-family: var(--font-mono); }
.part-remove { color: var(--text-mute); }
.part-remove:hover { color: var(--danger); background: var(--danger-soft); }

.part-text {
  min-height: 74px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  box-shadow: none;
}
.part-text::placeholder { color: #a1a1a6; }
.part-text:focus { outline: none; box-shadow: none; }

.part-foot { margin-top: 8px; color: var(--text-mute); font-size: 10px; }

.editor-actions { margin-top: 14px; }
.divider { background: var(--hairline); margin: 22px 0; }

.options-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.field { gap: 0; }
.field-label {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: -0.005em;
}

.input, .select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  box-shadow: none;
}
.input:hover, .select:hover { border-color: #b8b8bd; }
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}
.input::placeholder { color: #a1a1a6; }

.switch-row { gap: 9px; }
.switch-copy { color: var(--text-dim); font-size: 12px; }
.switch-track {
  width: 36px;
  height: 21px;
  border: 0;
  border-radius: 99px;
  background: #d2d2d7;
  box-shadow: none;
}
.switch-thumb { width: 17px; height: 17px; top: 2px; left: 2px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch-input:checked + .switch-track { background: var(--text); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(15px); }

/* Buttons */
.primary-btn {
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.01em;
  box-shadow: none;
}
.primary-btn:hover { background: #000; transform: none; }
.primary-btn:active { transform: scale(0.99); }
.primary-btn:disabled { opacity: 0.35; }
.primary-btn .btn-orb { display: none; }

.ghost-btn {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}
.ghost-btn:hover { background: var(--shell); border-color: #b8b8bd; }
.ghost-btn:active { transform: none; }
.ghost-btn svg { width: 16px; height: 16px; }
.ghost-btn.small { height: 34px; padding: 0 12px; font-size: 12px; }

.danger-btn {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-weight: 550;
  box-shadow: none;
}

.publish-summary {
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--shell);
}
.publish-panel .primary-btn { width: 100%; margin-top: 14px; }
.publish-panel .ghost-btn { width: 100%; margin-top: 8px; }

/* Previews and validation */
.previews { max-height: 470px; gap: 8px; }
.previews-idle { color: var(--text-mute); font-size: 13px; }

.preview-card {
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #fbfbfc;
}
.preview-platform { font-size: 12px; color: var(--text); font-weight: 600; text-transform: none; letter-spacing: -0.01em; }
.preview-part { border-left: 2px solid var(--hairline-strong); margin: 8px 0; padding: 1px 0 1px 10px; }
.preview-part p { font-size: 13px; color: var(--text-dim); }
.preview-part-index, .preview-count, .preview-foot { color: var(--text-mute); font-family: var(--font-sans); }
.preview-foot { border-top-color: var(--hairline); text-transform: none; letter-spacing: 0; }
.preview-apply { border: 1px solid var(--hairline-strong); border-radius: 99px; background: #fff; color: var(--text); }

.preflight { gap: 8px; }
.preflight-row, .result-row {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #fbfbfc;
  padding: 12px;
}
.preflight-row[data-state="ok"], .result-row[data-state="ok"] { border-color: rgba(52, 199, 89, 0.28); }
.preflight-row[data-state="error"], .result-row[data-state="error"] { border-color: rgba(255, 59, 48, 0.25); }
.preflight-mark { color: var(--text-mute); }
.preflight-name, .result-name { color: var(--text); font-weight: 550; }
.preflight-note, .result-note { color: var(--text-mute); }
.preflight-overall { border: 0; border-radius: 12px; background: var(--shell); color: var(--text); }

/* Lists, queue, calendar */
.segmented {
  gap: 2px;
  padding: 3px;
  border: 0;
  border-radius: 10px;
  background: #ececef;
  box-shadow: none;
}
.segmented-btn {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
.segmented-btn.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.list-row { padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.list-row:first-child { border-top: 1px solid var(--hairline); }
.list-marker { color: var(--text-mute); }
.list-title { font-size: 14px; font-weight: 550; color: var(--text); }
.list-excerpt, .list-meta { color: var(--text-mute); font-size: 11px; }
.list-row .ghost-btn { height: 32px; font-size: 11px; }

.calendar-nav .ghost-btn { width: 32px; height: 32px; padding: 0; }
.calendar-month { color: var(--text-dim); font-size: 12px; }
.calendar-grid { gap: 4px; }
.calendar-weekday { color: var(--text-mute); font-size: 10px; font-weight: 500; }
.calendar-day { min-height: 96px; border: 1px solid var(--hairline); border-radius: 10px; background: #fff; padding: 8px; }
.calendar-day.is-empty { background: transparent; border-color: transparent; }
.calendar-day.is-today { border-color: var(--accent); background: var(--accent-soft); }
.calendar-day-number { color: var(--text-mute); font-family: var(--font-sans); font-size: 11px; }
.calendar-day.is-today .calendar-day-number { color: var(--accent); font-weight: 600; }
.calendar-event { border-left: 2px solid var(--accent); border-radius: 5px; background: var(--shell); }
.calendar-event[data-tone="done"] { border-left-color: var(--live); }
.calendar-event[data-tone="failed"] { border-left-color: var(--danger); }
.calendar-event-time, .calendar-more { color: var(--text-mute); font-family: var(--font-sans); }
.calendar-event-title { color: var(--text-dim); font-size: 10px; }
.calendar-legend { color: var(--text-mute); font-size: 11px; }

/* Accounts */
.accounts-grid { gap: 16px; }
.account-card::before { display: none; }
.account-card > .panel { padding: 24px; border-radius: 18px; }
.account-name { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.account-desc { min-height: 0; color: var(--text-mute); font-size: 12px; line-height: 1.5; }
.account-empty { border: 1px dashed var(--hairline-strong); border-radius: 12px; color: var(--text-mute); background: #fbfbfc; }
.avatar { border: 0; border-radius: 12px; background: var(--shell); color: var(--text); }
.account-handle strong { font-size: 13px; color: var(--text); }
.account-handle span { color: var(--text-mute); font-family: var(--font-sans); }
.scope-tag { border: 0; border-radius: 5px; background: var(--shell); color: var(--text-mute); font-family: var(--font-sans); }
.account-foot { border-top-color: var(--hairline); color: var(--text-mute); }
.connect-btn {
  height: 38px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
}
.account-card[data-platform="x"] .connect-btn,
.account-card[data-platform="threads"] .connect-btn,
.account-card[data-platform="tiktok"] .connect-btn {
  border-color: var(--hairline-strong);
  background: #fff;
  color: var(--text);
}
.status-badge { border: 0; background: var(--shell); color: var(--text-mute); font-size: 10px; }

/* Settings */
.settings-layout { gap: 24px; }
.kv-row { padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.kv-key { color: var(--text-mute); font-size: 11px; }
.kv-value { color: var(--text); font-size: 12px; }
.kv-value.mono { font-family: var(--font-mono); }
.cred-form { border: 1px solid var(--hairline); border-radius: 14px; background: #fbfbfc; padding: 16px; box-shadow: none; }
.cred-head { margin-bottom: 12px; }
.cred-title { font-size: 14px; font-weight: 600; color: var(--text); }
.cred-source { border: 0; background: var(--shell); color: var(--text-mute); font-size: 9px; }
.cred-fields { gap: 10px; }
.cred-actions .ghost-btn { height: 34px; font-size: 12px; }
.cred-portal { color: var(--accent); }
.cred-redirect { border: 0; background: var(--shell); border-radius: 10px; padding: 10px; }
.code-block {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--shell);
  color: var(--text-dim);
  font-size: 11px;
  padding: 14px;
}
.steps { gap: 10px; }
.session-row { border-top-color: var(--hairline); }

/* Auth */
.auth-page { background: var(--bg); }
.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 32px;
}
.auth-brand { justify-content: center; margin: 0 0 24px; }
.auth-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--text); color: #fff; padding: 6px; }
.auth-brand .brand-word { font-size: 19px; }
.auth-card { width: min(400px, 100%); }
.auth-card > .panel { padding: 34px; border-radius: 20px; }
.auth-title { font-size: 32px; font-weight: 650; letter-spacing: -0.04em; color: var(--text); margin-bottom: 8px; }
.auth-lede { color: var(--text-mute); font-size: 13px; margin-bottom: 24px; }
.auth-form { gap: 14px; }
.auth-label { color: var(--text-dim); font-size: 12px; font-weight: 500; margin-bottom: 6px; }
.auth-error { color: var(--danger); font-size: 12px; }
.auth-form .primary-btn { width: 100%; margin-top: 2px; }

/* Modal, toast */
.modal-card { border-radius: 20px; }
.modal-card > .panel, .modal-core { padding: 28px; }
.modal-title { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; color: var(--text); }
.modal-body { color: var(--text-dim); font-size: 13px; }
.modal-scrim { background: rgba(0, 0, 0, 0.24); backdrop-filter: blur(4px); }
.toast {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
}
.toast-title { color: var(--text); }
.toast-text { color: var(--text-dim); }
.toast-icon { background: var(--shell); color: var(--text-dim); }

/* Simulated banner, if it appears */
.sim-banner { border: 1px solid var(--hairline); border-radius: 14px; background: #fff; margin: 0 0 22px; }
.sim-banner-core { padding: 14px 16px; background: transparent; }
.sim-banner-title { color: var(--text); font-size: 13px; font-weight: 550; }
.sim-banner-text { display: none; }

/* Responsive */
@media (max-width: 1120px) {
  .main { padding: 0 32px 64px; }
  .compose-layout { grid-template-columns: minmax(0, 1fr); }
  .compose-rail { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (max-width: 940px) {
  :root { --page-pad: 22px; }
  .main { margin-left: 0; padding: 0 22px 56px; }
  .menu-btn { display: grid; }
  .sidebar {
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, calc(100vw - 36px));
    border-radius: 0;
    transform: translateX(calc(-100% - 12px));
    transition: transform 0.35s var(--ease);
    background: rgba(255, 255, 255, 0.94);
  }
  .sidebar.is-open { transform: none; }
  .sidebar-core { padding: 22px 14px 18px; }
  .brand { padding: 0 10px; }
  .brand-text { display: flex; }
  .nav-label { display: block; }
  .nav-badge { display: inline-block; }
  .topbar { padding: 16px 0 12px; }
  .compose-rail { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .main { padding: 0 16px 48px; }
  .topbar { padding: 12px 0 10px; }
  .screen-intro { padding: 22px 0 24px; }
  .display { font-size: 36px; }
  .panel { padding: 20px; }
  .bezel > .panel { border-radius: 16px; }
  .options-grid { grid-template-columns: 1fr; }
  .targets { grid-template-columns: 1fr; }
  .target { padding: 14px; }
  .accounts-grid { grid-template-columns: 1fr; }
  .compose-layout { gap: 16px; }
  .compose-main, .compose-rail { gap: 16px; }
  .publish-summary { padding: 12px; }
  .auth-card > .panel { padding: 26px; }
}

.settings-col .bezel:has(#goLiveSteps) { display: none; }


/* Source label ("Claude", "Grokbot") in front of queued and published posts. Never published. */
.source-label {
  display: inline-block;
  margin-right: 4px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  letter-spacing: 0.01em;
  color: #9a4b2f;
  background: #fdf0ea;
  border: 1px solid #f0d4c6;
  vertical-align: 1px;
}
.source-label[data-source="grokbot"],
.source-label[data-source="grok"] {
  color: #345a9f;
  background: #edf2ff;
  border-color: #d5e0f7;
}

/* ==========================================================================
   Wide, colourful, touch-friendly
   ========================================================================== */

:root {
  --sidebar-w: 248px;
  --page-pad: clamp(22px, 2.4vw, 46px);
}

body {
  font-size: 16px;
  background:
    radial-gradient(900px 560px at 92% -8%, rgba(255, 179, 120, 0.14), transparent 62%),
    radial-gradient(760px 560px at 4% 104%, rgba(96, 160, 255, 0.1), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}

.main {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  max-width: 1920px;
  padding: 0 var(--page-pad) 80px;
}

.topbar { padding: 22px 0 10px; }
.screen-intro { padding: 30px 0 30px; }
.screens { padding-top: 14px; }

.display {
  font-size: clamp(48px, 4.6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.052em;
}

.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 249, 252, 0.86));
}

.nav-item {
  min-height: 44px;
  font-size: 15px;
  gap: 12px;
}

.nav-icon, .nav-icon svg { width: 22px; height: 22px; }

.nav-item.is-active,
.nav-item.is-active:hover {
  color: #0b57d0;
  background: #e9f1ff;
}
.nav-item.is-active .nav-icon { color: #0b57d0; }
.nav-badge { background: #0071e3; }

.panel { padding: 32px; }
.bezel > .panel { border-radius: 22px; }
.panel-head { margin-bottom: 24px; }
.panel-head h3 { font-size: 21px; letter-spacing: -0.03em; }

.compose-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, 0.62fr);
  gap: 28px;
}
.compose-main, .compose-rail { gap: 28px; }

.targets {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.target {
  position: relative;
  padding: 22px 18px 18px;
  border-radius: 16px;
  --accent-color: var(--text);
  --accent-bg: var(--text);
}
.target::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 3px;
  border-radius: 0 0 99px 99px;
  background: var(--accent-bg);
}
.target[data-target="x"] { --accent-color: #1d1d1f; --accent-bg: #1d1d1f; }
.target[data-target="threads"] { --accent-color: #3c3c43; --accent-bg: #3c3c43; }
.target[data-target="tiktok"] { --accent-color: #00b8b2; --accent-bg: linear-gradient(90deg, #25f4ee, #fe2c55); }
.target[data-target="youtube"] { --accent-color: #ff0033; --accent-bg: #ff0033; }
.target[data-target="instagram"] { --accent-color: #d62976; --accent-bg: linear-gradient(90deg, #feda75, #d62976, #4f5bd5); }

.target:hover { border-color: var(--hairline-strong); }
.target[aria-pressed="true"] {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color);
}

.target[data-target="x"] .glyph,
.target[data-target="threads"] .glyph {
  color: #fff;
  background: #1d1d1f;
  border-color: #1d1d1f;
}
.target[data-target="tiktok"] .glyph {
  color: #fff;
  background: linear-gradient(135deg, #25f4ee, #fe2c55);
  border-color: transparent;
}
.target[data-target="youtube"] .glyph {
  color: #fff;
  background: #ff0033;
  border-color: #ff0033;
}
.target[data-target="instagram"] .glyph {
  color: #fff;
  background: linear-gradient(135deg, #feda75, #d62976, #4f5bd5);
  border-color: transparent;
}

.glyph { width: 46px; height: 46px; border-radius: 14px; font-size: 17px; }
.glyph svg { width: 24px; height: 24px; }
.target-name { font-size: 15px; }
.target-foot { font-size: 12px; margin-top: 4px; }
.target-check { width: 24px; height: 24px; }
.target-check svg { width: 13px; height: 13px; }

.part-text { min-height: 88px; font-size: 17px; }
.options-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
.field-wide { grid-column: span 2; }
.field-label { font-size: 13px; }
.input, .select { height: 48px; font-size: 15px; }
.switch-copy { font-size: 13px; }

.primary-btn { height: 50px; font-size: 15px; }
.ghost-btn { height: 44px; font-size: 14px; padding: 0 18px; }
.publish-summary { padding: 16px; }
.preview-card { padding: 14px; }
.previews { max-height: 520px; }

.list-row { padding: 18px 0; }
.list-title { font-size: 15px; }
.calendar-day { min-height: 118px; }

.accounts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.account-card > .panel { padding: 28px; }
.account-name { font-size: 18px; }
.account-desc { font-size: 13px; }
.account-top .glyph { width: 48px; height: 48px; border-radius: 14px; }

.kv-row { padding: 13px 0; }
.kv-value { font-size: 13px; }
.cred-form { padding: 20px; }

@media (max-width: 1500px) {
  .targets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1240px) {
  .compose-layout { grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.7fr); }
  .options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: span 2; }
}

@media (max-width: 1000px) {
  .main { margin-left: 0; width: 100%; max-width: none; padding: 0 24px 64px; }
  .compose-layout { grid-template-columns: minmax(0, 1fr); }
  .compose-rail { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .sidebar {
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, calc(100vw - 28px));
    border-radius: 0;
    transform: translateX(calc(-100% - 12px));
    transition: transform 0.3s var(--ease);
  }
  .sidebar.is-open { transform: none; }
  .menu-btn { display: grid; }
}

@media (max-width: 760px) {
  .main { padding: 0 18px 104px; }
  .topbar { padding: 12px 0 8px; }
  .topbar-title { font-size: 15px; }
  .menu-btn { display: none; }
  .sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 74px;
    border-top: 1px solid var(--hairline);
    border-right: 0;
    border-radius: 0;
    transform: none !important;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
  }
  .sidebar-core {
    height: 74px;
    padding: 5px 6px;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }
  .brand, .sidebar-foot, .scrim { display: none !important; }
  .nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    gap: 0;
  }
  .nav-item {
    position: relative;
    min-height: 62px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 5px 2px;
    border-radius: 12px;
    font-size: 10.5px;
    letter-spacing: -0.01em;
  }
  .nav-icon, .nav-icon svg { width: 22px; height: 22px; }
  .nav-label { font-size: 10.5px; }
  .nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    margin: 0;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 9px;
  }
  .screen-intro { padding: 20px 0 22px; }
  .display { font-size: clamp(38px, 10vw, 46px); }
  .panel { padding: 20px; }
  .bezel > .panel { border-radius: 18px; }
  .panel-head { margin-bottom: 18px; }
  .panel-head h3 { font-size: 19px; }
  .compose-layout { grid-template-columns: 1fr; gap: 16px; }
  .compose-main, .compose-rail { gap: 16px; }
  .compose-rail { display: flex; flex-direction: column; }
  .targets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .target { padding: 18px 14px 15px; }
  .target::before { left: 14px; right: 14px; }
  .glyph { width: 42px; height: 42px; border-radius: 12px; }
  .glyph svg { width: 22px; height: 22px; }
  .options-grid { grid-template-columns: 1fr; gap: 15px; }
  .field-wide { grid-column: auto; }
  .input, .select { height: 50px; font-size: 16px; }
  .primary-btn { height: 52px; font-size: 15px; }
  .ghost-btn { height: 46px; }
  .accounts-grid { grid-template-columns: 1fr; }
  .publish-summary { padding: 14px; }
  .previews { max-height: none; }
  .calendar-day { min-height: 82px; }
  .auth-shell { padding: 20px; }
  .icon-btn.menu-btn { display: none !important; }
}

/* Larger reading scale */
body { font-size: 17px; }
.display { font-size: clamp(54px, 5vw, 80px); }
.panel-head h3 { font-size: 23px; }
.nav-item { font-size: 16px; }
.topbar-title { font-size: 14px; }
.target-name { font-size: 16px; }
.target-foot { font-size: 12.5px; }
.glyph { width: 50px; height: 50px; border-radius: 15px; font-size: 18px; }
.glyph svg { width: 26px; height: 26px; }
.target-check { width: 26px; height: 26px; }
.target-check svg { width: 14px; height: 14px; }
.field-label { font-size: 14px; }
.input, .select { height: 50px; font-size: 16px; }
.switch-copy { font-size: 14px; }
.part-text { font-size: 18px; min-height: 96px; }
.primary-btn { height: 52px; font-size: 16px; }
.ghost-btn { height: 46px; font-size: 15px; }
.publish-summary { font-size: 14px; }
.preview-part p { font-size: 14px; }
.preview-platform { font-size: 13px; }
.list-title { font-size: 16px; }
.list-excerpt, .list-meta { font-size: 12px; }
.account-name { font-size: 19px; }
.account-desc { font-size: 14px; }
.account-handle strong { font-size: 14px; }
.kv-key { font-size: 12px; }
.kv-value { font-size: 14px; }
.cred-title { font-size: 16px; }
.auth-title { font-size: 38px; }
.auth-lede { font-size: 15px; }
.modal-title { font-size: 25px; }
.modal-body { font-size: 15px; }
.toast-title { font-size: 15px; }
.toast-text { font-size: 13px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .display { font-size: clamp(42px, 11vw, 50px); }
  .panel-head h3 { font-size: 21px; }
  .nav-item { font-size: 11px; }
  .nav-label { font-size: 11px; }
  .target-name { font-size: 16px; }
  .field-label { font-size: 14px; }
  .input, .select { font-size: 17px; }
  .primary-btn { font-size: 16px; }
}

/* Auto-reply settings */
.autoreply-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: #fbfbfc;
}
.autoreply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.autoreply-head .kv-value { font-size: 17px; font-weight: 600; color: var(--text); }
.autoreply-head .switch-track { width: 46px; height: 27px; background: #d2d2d7; }
.autoreply-head .switch-thumb { width: 23px; height: 23px; }
.autoreply-head .switch-input:checked + .switch-track { background: #34c759; }
.autoreply-head .switch-input:checked + .switch-track .switch-thumb { transform: translateX(19px); }
.autoreply-remark {
  margin: 8px 0 0;
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1.45;
}
.autoreply-remark.is-on { color: #1f7a3a; }
.autoreply-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.access-chip {
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--shell);
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 500;
}
.access-chip.is-live { background: #e8f8ed; color: #1f7a3a; }
.access-chip.is-ready { background: #eaf1ff; color: #2257a6; }
.deepseek-key { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.deepseek-row { display: flex; gap: 8px; margin-top: 7px; align-items: center; }
.deepseek-row .input { flex: 1 1 auto; width: auto; min-width: 0; }
.deepseek-row .ghost-btn { flex: 0 0 auto; width: auto; min-width: 92px; }





/* ------------------------------------------------------------------ */
/* Home dashboard                                                      */
/* ------------------------------------------------------------------ */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 18px; margin-bottom: 18px; }
.dash-card { min-width: 0; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dash-head h2, .dash-recommend h2, .dash-integrations-panel h2 { margin: 2px 0 0; font-family: "Sora", sans-serif; font-size: 22px; letter-spacing: -.03em; }
.dash-big { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.dash-big strong { font-family: "Sora", sans-serif; font-size: 30px; letter-spacing: -.04em; }
.dash-big span { color: var(--text-mute); font-size: 11px; margin-top: 4px; }
.heatmap-wrap { margin: 22px 0 18px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 4px; overflow: hidden; }
.heat-cell { width: 11px; height: 11px; border-radius: 3px; background: #eef0f2; }
.heat-cell[data-level="1"] { background: #d8eedf; }
.heat-cell[data-level="2"] { background: #a9ddb9; }
.heat-cell[data-level="3"] { background: #63c283; }
.heat-cell[data-level="4"] { background: #239a50; }
.heatmap-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 9px; color: var(--text-mute); font-size: 10px; }
.heatmap-legend i { width: 9px; height: 9px; border-radius: 2px; background: #eef0f2; }
.heatmap-legend i:nth-of-type(2) { background: #a9ddb9; }
.heatmap-legend i:nth-of-type(3) { background: #63c283; }
.heatmap-legend i:nth-of-type(4) { background: #239a50; }
.dash-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.dash-stats div { display: flex; flex-direction: column; gap: 5px; }
.dash-stats span { color: var(--text-mute); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.dash-stats strong { font-family: "Sora", sans-serif; font-size: 16px; letter-spacing: -.02em; }
.dash-breakdown { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.breakdown-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.breakdown-eyebrow { margin: 0 0 4px; color: var(--text-mute); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.breakdown-total { margin: 0; color: var(--text-mute); font-size: 11px; }
.breakdown-total strong { color: var(--text); font-family: "Sora", sans-serif; font-size: 21px; font-weight: 600; letter-spacing: -.04em; margin-right: 3px; }
.breakdown-note { padding: 3px 8px; border: 1px solid var(--hairline); border-radius: 999px; color: var(--text-mute); font-size: 10px; }
.breakdown-bar { display: flex; gap: 2px; height: 9px; margin: 14px 0 16px; overflow: hidden; border-radius: 999px; background: #eef0f2; }
.breakdown-segment { height: 100%; flex: none; border-radius: 999px; transition: width .7s cubic-bezier(.32,.72,0,1); }
.breakdown-segment[data-tone="done"] { background: var(--live); }
.breakdown-segment[data-tone="pending"] { background: var(--accent); }
.breakdown-segment[data-tone="failed"] { background: var(--danger); }
.breakdown-segment[data-tone="canceled"] { background: #a8b0aa; }
.breakdown-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.breakdown-stat { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 10px 11px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--shell); }
.breakdown-stat > div { min-width: 0; }
.breakdown-stat strong { display: block; font-family: "Sora", sans-serif; font-size: 14px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.breakdown-stat div span { display: block; overflow: hidden; color: var(--text-mute); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-stat em { margin-left: auto; color: var(--text-mute); font-size: 9px; font-style: normal; line-height: 1.4; }
.breakdown-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; flex: none; background: var(--text-mute); }
.breakdown-dot[data-tone="done"] { background: var(--live); }
.breakdown-dot[data-tone="pending"] { background: var(--accent); }
.breakdown-dot[data-tone="failed"] { background: var(--danger); }
.breakdown-dot[data-tone="canceled"] { background: #a8b0aa; }
.dash-copy { color: var(--text-soft); line-height: 1.6; margin: 12px 0 18px; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-note { color: var(--text-mute); font-size: 11px; line-height: 1.55; margin: 16px 0 0; }
.dash-integrations-panel { margin-bottom: 22px; }
.dash-integrations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.integration-card { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--shell); }
.integration-card.is-recommended { border-color: rgba(57, 172, 97, .35); background: rgba(232, 248, 237, .55); }
.integration-mark { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: #fff; font-family: "Sora", sans-serif; font-weight: 600; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.integration-copy { min-width: 0; flex: 1 1 auto; }
.integration-title { display: flex; align-items: center; gap: 7px; }
.integration-title strong { font-size: 13px; }
.integration-copy p { margin: 3px 0 0; color: var(--text-mute); font-size: 11px; }
.integration-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.integration-actions .small { width: auto; min-width: 0; padding: 7px 10px; font-size: 11px; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } .dash-integrations { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .dash-head { flex-direction: column; } .dash-stats { grid-template-columns: 1fr 1fr; } .breakdown-legend { grid-template-columns: 1fr 1fr; } .integration-card { align-items: flex-start; flex-wrap: wrap; } .integration-actions { width: 100%; justify-content: flex-start; } }
/* Integration setup wizard */
.integration-wizard { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 22px; }
.integration-wizard[hidden] { display: none; }
.integration-wizard-scrim { position: absolute; inset: 0; background: rgba(18, 24, 20, .42); backdrop-filter: blur(5px); }
.integration-wizard-card { position: relative; width: min(680px, 100%); max-height: 90vh; overflow: auto; padding: 28px; border: 1px solid var(--hairline); border-radius: 24px; background: var(--paper); box-shadow: 0 28px 80px rgba(16, 25, 18, .22); transform: translateY(8px); opacity: 0; transition: .28s var(--ease); }
.integration-wizard.is-open .integration-wizard-card { transform: none; opacity: 1; }
.integration-wizard-close { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border: 1px solid var(--hairline); border-radius: 50%; background: #fff; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.integration-wizard-card h2 { margin: 6px 0 8px; font-family: var(--font-display); font-size: 26px; letter-spacing: -.04em; }
.integration-wizard-desc { margin: 0 0 16px; color: var(--text-soft); font-size: 13px; line-height: 1.6; }
.integration-wizard-steps { margin: 0 0 16px; padding-left: 19px; color: var(--text-soft); font-size: 12.5px; line-height: 1.7; }
.integration-wizard-code { margin: 0 0 16px; padding: 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--shell); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.integration-wizard-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.integration-wizard-actions .primary-btn, .integration-wizard-actions .ghost-btn { width: auto; }
@media (max-width: 620px) { .integration-wizard { padding: 10px; } .integration-wizard-card { padding: 22px 17px; border-radius: 18px; } }

.topup-custom { display: inline-flex; align-items: center; gap: 6px; }
.topup-custom .input { height: 38px; }


/* ---------- Relay Connector entry ---------- */
.connect-relay-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; padding: 18px; border: 1px solid var(--hairline); border-radius: 16px; background: linear-gradient(135deg, rgba(232,248,237,.75), rgba(255,255,255,.35)); }
.connect-relay-hero h3 { margin: 0 0 6px; font-family: "Sora", sans-serif; font-size: 18px; }
.connect-relay-hero .dash-copy { margin: 0; max-width: 62ch; }
.connect-relay-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.connect-relay-status { grid-column: 1 / -1; margin: 0; color: var(--text-mute); font-size: 12px; min-height: 16px; }
.connect-relay-manual { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; border: 1px dashed var(--hairline); border-radius: 10px; background: var(--shell); }
.connect-relay-manual code { font-size: 11px; word-break: break-all; }
.connect-client-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.integration-auto-note { color: var(--text-mute); font-size: 11px; }
@media (max-width: 720px) { .connect-relay-hero { grid-template-columns: 1fr; } .connect-relay-actions { justify-content: flex-start; } .connect-client-list { grid-template-columns: 1fr; } }
.connect-relay-wrap { grid-column: 1 / -1; }

/* ==========================================================================
   Mobile and touch pass
   ========================================================================== */
.skip-link:focus { min-height: 44px; }

@media (max-width: 760px) {
  /* Seven screens fit in one row of the bottom bar. */
  .nav { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .sidebar-core { padding: 5px 2px; }
  .nav-item { padding: 5px 0; min-height: 62px; }
  .nav-label { font-size: 11px; letter-spacing: -0.02em; }
  .nav-badge { right: calc(50% - 18px); font-size: 10px; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .sidebar { padding-bottom: env(safe-area-inset-bottom); height: calc(74px + env(safe-area-inset-bottom)); }

}

@media (max-width: 940px), (pointer: coarse) {
  /* Tap targets of at least 44px. */
  .icon-btn, .icon-btn.small { width: 44px; height: 44px; }
  .ghost-btn, .ghost-btn.small, .danger-btn { min-height: 44px; padding-left: 16px; padding-right: 16px; font-size: 14px; }
  .link-btn { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
  .segmented-btn { min-height: 44px; padding: 8px 18px; font-size: 14px; }
  .text-btn { min-height: 44px; }

  /* Inputs at 16px so iOS Safari does not zoom. */
  input, select, textarea, .input, .select, .part-text { font-size: 16px !important; }
  input[type="datetime-local"] { min-height: 50px; }

  /* Secondary text no smaller than 12px. */
  .breakdown-eyebrow, .breakdown-total, .breakdown-note, .breakdown-legend em, .dash-note, .status-badge, .part-index,
  .part-label, .counter, .media-hint, .field-label-dim, .summary-value, .count-badge, .empty-text, .note-num,
  .kv-value.mono, .access-chip, .key-status, .cred-source, .list-excerpt, .list-meta, .code-block,
  .cred-setup span, .cred-setup p, .integration-card p, .integration-card span, .toast-text {
    font-size: 12px !important;
  }
  .part-index, .cred-source, .note-num, .breakdown-eyebrow, .counter { letter-spacing: 0.04em; }
  .code-block { overflow-x: auto; max-width: 100%; }
  pre, code { overflow-wrap: anywhere; }
  .panel, .kv-value, .list-title, .account-name { overflow-wrap: anywhere; }
  table { display: block; max-width: 100%; overflow-x: auto; }
}

@media (max-width: 380px) {
  .nav-label { font-size: 10.5px; letter-spacing: -0.03em; }
  .main { padding-left: 14px; padding-right: 14px; }
}
.skip-link { min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 940px), (pointer: coarse) {
  .switch-row { min-height: 48px; }
}
@media (max-width: 940px), (pointer: coarse) {
  .preflight-idle span, .account-empty span, .account-foot span { font-size: 13px !important; }
  .dash-big span, .heatmap-legend span, .dash-stats span, .breakdown-stat span { font-size: 12px !important; }
  .brand { min-height: 44px; }
  .note-item p { font-size: 14px !important; line-height: 1.55; }
}

/* Official brand lockup */
.brand .brand-lockup,.brand-lockup{display:block;width:auto;height:30px;max-width:100%;border-radius:0;object-fit:contain}
.auth-brand img{display:block;width:auto;height:48px;max-width:100%;object-fit:contain}

/* Mobile console polish: keep the accounts screen inside the viewport. */
@media (max-width: 640px) {
  .screen-intro { padding: 12px 0 18px; }
  .screen-intro .display { font-size: clamp(27px, 8vw, 34px) !important; line-height: 1.06; letter-spacing: -0.035em; }
  .screen-intro .lede { font-size: 13px; line-height: 1.45; }
  .accounts-grid { gap: 12px; }
  .account-card > .panel { padding: 16px; border-radius: 16px; }
  .account-top { gap: 10px; }
  .account-top .glyph { width: 38px; height: 38px; border-radius: 11px; }
  .account-name { font-size: 15px; }
  .account-desc { font-size: 12px; line-height: 1.45; }
  .account-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
  .account-actions .ghost-btn { width: 100%; min-width: 0; height: 38px; padding: 0 4px; font-size: 11px; letter-spacing: 0; white-space: nowrap; }
  .account-foot { gap: 8px; font-size: 11px; }
  .account-foot .status-badge { font-size: 8.5px; padding: 3px 7px; }
  .scope-tag { font-size: 9.5px; padding: 3px 5px; }
}

/* Profile & API key */
.profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.profile-key-box{margin-top:14px;padding:14px;border:1px solid var(--hairline);border-radius:14px;background:#fbfbfc}
.profile-key-box code{display:block;margin:8px 0 10px;padding:10px;border-radius:9px;background:#fff;border:1px solid var(--hairline);font:12px/1.6 var(--font-mono);word-break:break-all;color:var(--text)}
.profile-key-box .ghost-btn{width:auto}
@media(max-width:640px){.profile-grid{grid-template-columns:1fr}}

/* Profile & API keys */
.profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.profile-actions{display:flex;justify-content:flex-end;margin-top:12px}
.profile-key-section{margin-top:18px;padding-top:18px;border-top:1px solid var(--hairline)}
.profile-key-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.profile-key-head .kv-value{overflow-wrap:anywhere}
.profile-key-head .ghost-btn{flex:none}
.profile-key-section .field-hint{display:block !important;margin:7px 0 0}
.profile-key-box{margin-top:14px;padding:14px;border:1px solid var(--hairline);border-radius:14px;background:#fbfbfc}
.profile-key-box code{display:block;margin:8px 0 10px;padding:10px;border-radius:9px;background:#fff;border:1px solid var(--hairline);font:12px/1.6 var(--font-mono);word-break:break-all;color:var(--text)}
.profile-key-box .ghost-btn{width:auto}
@media(max-width:640px){.profile-grid{grid-template-columns:1fr}.profile-key-head{flex-direction:column;align-items:stretch}.profile-key-head .ghost-btn{width:100%}}

/* History cost and credit */
.history-billing{display:flex;flex-wrap:wrap;gap:18px 32px;padding:14px 0 16px;margin-bottom:2px;border-bottom:1px solid var(--hairline)}
.history-billing>div{display:flex;flex-direction:column;gap:2px}
.history-billing-label{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--text-mute);font-weight:600}
.history-billing strong{font-size:20px;font-weight:600;letter-spacing:-.02em;color:var(--text)}
.history-billing-note{font-size:11px;color:var(--text-mute)}
.row-actions .cost-badge{display:inline-flex;align-items:baseline;gap:5px;padding:7px 10px;border:1px solid var(--hairline);border-radius:999px;background:var(--surface-2);color:var(--text);font-size:12px;font-weight:600;white-space:nowrap}
.row-actions .cost-badge small{font-size:10px;font-weight:400;color:var(--text-mute)}

.history-billing + .history-billing-note{margin:-6px 0 14px}

.auth-links{display:flex;flex-wrap:wrap;gap:14px;justify-content:center;margin-top:18px;font-size:13px}
.auth-links a{color:var(--text-dim);text-decoration:none}
.auth-links a:hover{color:var(--text)}

/* Customer console: only the profile card remains under Settings. */
body[data-role="customer"] #screen-settings .settings-col:first-child .bezel:not(:first-child),
body[data-role="customer"] #screen-settings .settings-col:last-child { display: none !important; }

/* Simple web flow */
.topbar-new{width:auto;height:36px;padding:0 15px;border-radius:999px;background:var(--ink);color:var(--bg);border-color:transparent;font-weight:650}
.topbar-new:hover{background:#fff;color:#071009}
.topbar-logout{display:inline-flex;align-items:center;gap:6px;width:auto;height:36px;padding:0 13px;border-radius:999px;color:var(--text-dim);font-size:12px;font-weight:600;white-space:nowrap}
.topbar-logout:hover{color:var(--text);border-color:var(--hairline-strong);background:#fff}
.topbar-logout svg{width:15px;height:15px;flex:none}
.hero-actions{margin:22px 0 0;align-items:center}
.hero-actions .primary-btn,.hero-actions .ghost-btn{width:auto}
.compose-modebar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 18px}
.compose-mode-state{display:flex;align-items:center;flex-wrap:wrap;gap:4px 9px;min-width:0;flex:1}
.compose-mode-features{display:flex;flex-wrap:wrap;gap:4px;flex-basis:100%}
.compose-mode-features span{display:inline-flex;align-items:center;min-height:20px;padding:2px 7px;border:1px solid var(--hairline);border-radius:999px;background:#fff;color:var(--text-mute);font-size:9px;font-weight:600;letter-spacing:.02em}
body[data-compose-mode="advanced"] .compose-mode-features span{background:rgba(255,159,10,.07);border-color:rgba(255,159,10,.24);color:#8a5200}
.compose-mode-label{display:inline-flex;align-items:center;min-height:24px;padding:3px 9px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;flex:none}
body[data-compose-mode="advanced"] .compose-mode-label{background:rgba(255,159,10,.1);color:#a85f00}
.compose-mode-note{margin:0;color:var(--text-mute);font-size:12px;max-width:52ch;line-height:1.45}
.advanced-options-head{grid-column:1/-1;display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:0 0 2px}
.advanced-options-head span:first-child{font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--text)}
.advanced-options-head span:last-child{font-size:10px;color:var(--text-mute)}
.first-run{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 18px;border-color:rgba(24, 122, 78, .24);background:linear-gradient(120deg, rgba(24,122,78,.06), transparent 70%)}
.first-run h3{margin:4px 0 6px;font-size:18px;letter-spacing:-.02em}
.first-run .primary-btn{width:auto;flex:none}
.advanced-only[hidden],.platform-option[hidden]{display:none !important}
.basic-options{margin-top:18px}
.advanced-options{margin-top:14px;padding-top:14px;border-top:1px solid var(--hairline)}
body[data-role="customer"] .publish-panel{position:sticky;top:84px}
@media(max-width:940px){
  .topbar-new{display:none}
  .topbar-logout{width:36px;height:36px;padding:0;justify-content:center;border-radius:50%}
  .topbar-logout span{display:none}
  .first-run{display:block;padding:18px}
  .first-run .primary-btn{width:100%;margin-top:14px}
  .compose-modebar{align-items:flex-start;gap:8px}
  .compose-modebar .segmented{width:100%;display:flex}
  .compose-modebar .segmented-btn{flex:1}
  .compose-mode-state{flex:1 0 100%;width:100%;display:grid;grid-template-columns:auto 1fr;gap:5px 9px;align-items:start}
  .compose-mode-note{width:auto;max-width:none}
  .compose-mode-features{grid-column:1/-1;flex-basis:auto}
  .advanced-options-head{display:block}
  .advanced-options-head span:last-child{display:block;margin-top:3px}
  .publish-panel .primary-btn{position:sticky;bottom:12px;z-index:5}
}

/* Posts dashboard, week calendar and safe retry */
.posts-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 16px}
.posts-tabs{flex-wrap:wrap}
.posts-tabs .segmented-btn{display:inline-flex;align-items:center;gap:7px}
.tab-count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:rgba(15,23,20,.08);font-size:10px;line-height:1;font-weight:700}
.segmented-btn.is-active .tab-count{background:rgba(15,23,20,.12)}
.calendar-mode{display:inline-flex;margin-right:6px}
.calendar-nav{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.calendar-grid.is-week{grid-template-columns:repeat(7,minmax(0,1fr));grid-auto-rows:minmax(220px,auto)}
.calendar-grid.is-week .calendar-weekday{display:flex;flex-direction:column;gap:2px;font-weight:600;color:var(--text);text-transform:none;letter-spacing:0}
.calendar-grid.is-week .calendar-weekday span{font-size:10px;font-weight:500;color:var(--text-mute);letter-spacing:.04em;text-transform:uppercase}
.calendar-grid.is-week .calendar-day{min-height:220px;overflow:auto}
.calendar-grid.is-week .calendar-events{max-height:none}
.calendar-empty{display:block;padding:8px 0;font-size:11px;color:var(--text-mute)}
.calendar-event{width:100%;text-align:left;border:1px solid transparent;font:inherit;cursor:pointer}
.calendar-event:hover,.calendar-event:focus-visible{border-color:currentColor}
.calendar-more{border:0;background:transparent;padding:4px 0;font:inherit;font-size:10px;color:var(--text-mute);cursor:pointer;text-align:left}
.calendar-more:hover{color:var(--text)}
.error-details{margin:8px 0 0}
.error-details summary{cursor:pointer;font-size:11px;color:var(--text-mute);width:max-content}
.error-details pre{margin:6px 0 0;padding:10px;border-radius:8px;background:var(--surface-2);border:1px solid var(--hairline);font-size:11px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text-mute)}
.retry-btn{border-color:rgba(184,60,42,.3);color:#a33a2b}
.retry-btn:hover{border-color:rgba(184,60,42,.55);color:#7d281d}
@media(max-width:940px){
  .posts-toolbar{align-items:stretch}
  .posts-toolbar>.segmented{width:100%}
  .posts-tabs .segmented-btn{flex:1 1 auto}
  .calendar-grid.is-week{grid-template-columns:repeat(7,minmax(160px,1fr));overflow-x:auto}
}

/* Approximate native previews */
.preview-card-native{padding-bottom:10px}
.approximate-label{font-size:9px;letter-spacing:.08em;text-transform:uppercase;color:var(--text-mute);margin-left:auto;margin-right:8px}
.preview-mock{margin:12px 0 0;border:1px solid var(--hairline);border-radius:14px;background:#fff;color:#141915;overflow:hidden;font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
.preview-mock p{margin:0;white-space:normal}
.mock-avatar{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:50%;background:linear-gradient(145deg,#2f6b4b,#173a29);color:#effff5;font-size:12px;font-weight:700;overflow:hidden}
.mock-avatar img{width:100%;height:100%;object-fit:cover}
.mock-media{position:relative;background:#eef1ee;overflow:hidden}
.mock-media img,.mock-media video{display:block;width:100%;height:100%;object-fit:cover}
.mock-media-empty{display:grid;place-items:center;min-height:120px;color:#7a867e;font-size:11px;text-align:center;padding:16px}
.mock-play{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff}
.mock-video-label{position:absolute;right:8px;top:8px;padding:3px 7px;border-radius:999px;background:rgba(0,0,0,.6);color:#fff;font-size:9px}
.mock-x{padding:14px}
.mock-thread{display:grid;gap:0}
.mock-post-line{display:flex;gap:10px;align-items:flex-start}
.mock-avatar-col{display:flex;flex-direction:column;align-items:center;align-self:stretch}
.mock-thread-join{flex:1;width:2px;min-height:16px;background:#e3e8e4;margin:4px 0}
.mock-post-body{min-width:0;flex:1;padding-bottom:14px}
.mock-user{display:flex;gap:5px;align-items:baseline;flex-wrap:wrap;font-size:12px;color:#66736b}
.mock-user strong{font-size:13px;color:#141915}
.mock-user .mock-dot{color:#98a49c}
.mock-post-body>p{font-size:13px;line-height:1.5;margin-top:3px}
.mock-x-media,.mock-threads-media{margin-top:9px;border-radius:12px;min-height:130px;max-height:240px}
.mock-post-actions{display:flex;gap:22px;margin-top:10px;color:#748179;font-size:10px}
.mock-threads{padding:14px}
.mock-threads .mock-post-body>p{font-size:13.5px}
.mock-tiktok{background:#0b0d0c;padding:16px;display:grid;place-items:center}
.mock-phone{position:relative;width:min(240px,100%);aspect-ratio:9/16;border-radius:22px;overflow:hidden;background:linear-gradient(160deg,#22342a,#0a0d0b)}
.mock-tiktok-media{position:absolute;inset:0;width:100%;height:100%}
.mock-tiktok-media video,.mock-tiktok-media img{width:100%;height:100%;object-fit:cover}
.mock-tiktok-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.05),transparent 45%,rgba(0,0,0,.65))}
.mock-tiktok-caption{position:absolute;left:12px;right:42px;bottom:20px;display:grid;gap:5px;color:#fff;font-size:11px;line-height:1.4;text-shadow:0 1px 8px rgba(0,0,0,.5)}
.mock-tiktok-caption strong{font-size:12px}
.mock-tiktok-caption span{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.mock-tiktok-actions{position:absolute;right:8px;bottom:26px;display:grid;gap:10px;color:#fff;font-size:17px;text-align:center}
.mock-tiktok-rail{position:absolute;left:12px;bottom:5px;color:rgba(255,255,255,.75);font-size:9px;letter-spacing:.02em}
.mock-youtube{background:#fff}
.mock-video-16x9{aspect-ratio:16/9;display:grid;place-items:center;background:#dfe5e1}
.mock-yt-meta{display:flex;gap:10px;padding:12px}
.mock-yt-meta strong{display:block;font-size:13px;line-height:1.35}
.mock-yt-meta span{display:block;margin-top:3px;font-size:10.5px;color:#718077}
.mock-yt-meta p{margin-top:7px;font-size:11px;line-height:1.45;color:#55635a;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.mock-instagram{background:#fff}
.mock-ig-head{display:flex;align-items:center;gap:9px;padding:10px 12px}
.mock-ig-head .mock-avatar{width:28px;height:28px;font-size:9px}
.mock-ig-head strong{font-size:12px;flex:1}
.mock-ig-head>span:last-child{color:#637069;letter-spacing:2px}
.mock-square{aspect-ratio:1/1}
.mock-ig-actions{display:flex;gap:13px;padding:9px 12px 3px;font-size:16px}
.mock-save{margin-left:auto}
.mock-ig-caption{padding:2px 12px 12px;font-size:11.5px;line-height:1.5}
.mock-ig-caption strong{margin-right:4px}
.mock-carousel-dots{display:flex;justify-content:center;gap:4px;padding:0 0 10px}
.mock-carousel-dots i{width:5px;height:5px;border-radius:50%;background:#c8d0cb}
.mock-carousel-dots i[data-active="true"]{background:#4c7a61}
.mock-linkedin{padding:14px}
.mock-li-head{display:flex;gap:9px;align-items:center}
.mock-li-head .mock-avatar{width:40px;height:40px;font-size:11px;border-radius:6px}
.mock-li-head strong{display:block;font-size:13px}
.mock-li-head span{display:block;font-size:10px;color:#6a7870;margin-top:2px}
.mock-linkedin>p{margin:10px 0 0;font-size:12.5px;line-height:1.5}
.mock-li-media{margin-top:10px;border-radius:6px;min-height:130px;max-height:230px}
.mock-li-actions{display:flex;gap:24px;margin-top:12px;padding-top:9px;border-top:1px solid #e6ebe7;color:#647269;font-size:10px}
@media(max-width:640px){
  .preview-card-native .preview-head{flex-wrap:wrap}
  .approximate-label{order:4;width:100%;margin:4px 0 0}
  .mock-x,.mock-threads,.mock-linkedin{padding:11px}
}

.mock-facebook{padding:14px}
.mock-fb-head{display:flex;gap:9px;align-items:center}
.mock-fb-head .mock-avatar{border-radius:8px;background:#1877f2}
.mock-fb-head strong{display:block;font-size:13px}
.mock-fb-head span{display:block;font-size:10px;color:#6a7870;margin-top:2px}
.mock-facebook>p{margin:10px 0 0;font-size:12.5px;line-height:1.5}
.mock-fb-media{margin-top:10px;border-radius:6px;min-height:130px;max-height:230px}
.mock-fb-actions{display:flex;gap:24px;margin-top:12px;padding-top:9px;border-top:1px solid #e6ebe7;color:#647269;font-size:10px}

/* Lightweight composer — final overrides */
#screen-compose .composer-intro {
  margin-bottom: 4px;
}
#screen-compose .composer-intro .display {
  font-size: clamp(30px, 4vw, 40px);
  margin: 0;
}
#screen-compose .composer-intro .lede { display: none; }

#screen-compose .compose-modebar {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
}
#screen-compose .compose-modebar .compose-mode-state { display: none; }
#screen-compose .compose-modebar .segmented {
  background: rgba(0, 0, 0, 0.04);
  padding: 2px;
}
#screen-compose .compose-modebar .segmented-btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

#screen-compose .compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 12px;
}
#screen-compose .compose-main,
#screen-compose .compose-rail {
  display: grid;
  gap: 10px;
  min-width: 0;
}
#screen-compose .compose-rail { align-content: start; }

#screen-compose .targets-panel,
#screen-compose .editor-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  background: #fff;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
#screen-compose .targets-panel { padding: 12px 14px; }
#screen-compose .targets-panel .panel-head,
#screen-compose .editor-panel .panel-head {
  margin-bottom: 10px;
}
#screen-compose .targets-panel .panel-eyebrow,
#screen-compose .targets-panel h3 { display: none; }
#screen-compose .targets-panel .panel-head { justify-content: flex-end; min-height: 0; }
#screen-compose #targetsHint { font-size: 11px; color: var(--text-mute); }

#screen-compose .targets {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
#screen-compose .targets::-webkit-scrollbar { display: none; }
#screen-compose .target {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-width: 0;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #f7f7f8;
  box-shadow: none;
}
#screen-compose .target[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
  box-shadow: none;
}
#screen-compose .target-top { margin: 0; display: flex; align-items: center; }
#screen-compose .target .glyph {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
}
#screen-compose .target[aria-pressed="true"] .glyph { color: #fff; background: rgba(255,255,255,0.16); border-color: transparent; }
#screen-compose .target-name { font-size: 12px; font-weight: 600; white-space: nowrap; }
#screen-compose .target-sub, #screen-compose .target-foot, #screen-compose .target-check { display: none; }

#screen-compose .editor-panel .panel-eyebrow,
#screen-compose .editor-panel h3,
#screen-compose .editor-panel .panel-hint { display: none; }
#screen-compose .editor-panel .panel-head { display: none; }
#screen-compose .parts { gap: 8px; }
#screen-compose .part {
  border: 0;
  border-radius: 14px;
  background: #f7f7f8;
  padding: 12px 13px 8px;
}
#screen-compose .part:focus-within { background: #fff; box-shadow: inset 0 0 0 1px var(--text); }
#screen-compose .part-head { margin-bottom: 4px; }
#screen-compose .part-text {
  min-height: 96px;
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.45;
}
#screen-compose .part-foot { margin-top: 4px; }
#screen-compose .part .media-strip { margin-top: 8px; }
#screen-compose .divider { display: none; }
#screen-compose .editor-actions { margin-top: 8px; }
#screen-compose .options-grid { gap: 10px 12px; }
#screen-compose .basic-options { margin-top: 0; }
#screen-compose .basic-options:empty { display: none; }
#screen-compose .advanced-options { margin-top: 4px; }

#screen-compose .compose-rail > .bezel:first-child {
  position: sticky;
  bottom: 12px;
  z-index: 8;
}
#screen-compose .publish-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(16px);
}
#screen-compose .publish-panel .panel-head { display: none; }
#screen-compose .publish-summary {
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 8px;
}
#screen-compose .composer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
#screen-compose .composer-actions .primary-btn {
  width: 100%;
  margin: 0;
  min-height: 44px;
}
#screen-compose .composer-schedule-btn {
  width: auto;
  min-width: 104px;
  margin: 0;
  min-height: 44px;
  border: 1px solid var(--hairline-strong);
  background: #fff;
}
#screen-compose .composer-clear {
  width: auto;
  margin: 8px 0 0;
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  font-size: 11px;
}
#screen-compose .composer-schedule {
  margin-top: 8px;
  border-top: 1px solid var(--hairline);
  padding-top: 8px;
}
#screen-compose .composer-schedule summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  color: var(--text-mute);
}
#screen-compose .composer-schedule summary::-webkit-details-marker { display: none; }
#screen-compose .composer-schedule[open] summary { margin-bottom: 8px; color: var(--text); }
#screen-compose .composer-schedule .field { margin: 0; }
#screen-compose .composer-schedule .field-hint { font-size: 10px; }

#screen-compose .preview-panel,
#screen-compose .preflight-panel {
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: none;
}
#screen-compose .preview-panel .panel-head,
#screen-compose .preflight-panel .panel-head { margin-bottom: 8px; }
#screen-compose .preview-panel h3,
#screen-compose .preflight-panel h3 { font-size: 13px; }
#screen-compose .previews {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-height: none;
  padding-bottom: 2px;
}
#screen-compose .previews > * { flex: 0 0 min(240px, 76vw); }
#screen-compose .preflight { max-height: 160px; overflow: auto; }
#screen-compose #resultCard { display: none !important; }

@media (max-width: 760px) {
  #screen-compose .compose-layout { grid-template-columns: minmax(0, 1fr); }
  #screen-compose .targets-panel,
  #screen-compose .editor-panel { border-radius: 18px; padding: 13px 14px; }
  #screen-compose .compose-rail > .bezel:first-child { bottom: 68px; }
  #screen-compose .publish-panel { border-radius: 16px; padding: 10px 12px; }
  #screen-compose .composer-actions { grid-template-columns: minmax(0, 1fr) auto; }
  #screen-compose .composer-schedule-btn { min-width: 92px; }
  #screen-compose .preview-panel { display: none; }
}


/* Compact destination chips */
#screen-compose .target {
  flex-direction: row;
  min-height: 0;
  height: auto;
  align-items: center;
  padding: 6px 11px 6px 6px;
  gap: 7px;
  border-radius: 999px;
}
#screen-compose .target::before { display: none; }
#screen-compose .target > div:nth-child(2) {
  display: flex;
  align-items: center;
  min-width: 0;
}
#screen-compose .target-top { gap: 0; }
#screen-compose .target .glyph {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  font-size: 12px;
}
#screen-compose .target .glyph svg { width: 14px; height: 14px; }
#screen-compose .target-name { font-size: 12px; line-height: 1; }
#screen-compose .target[aria-pressed="true"] .target-name { color: #fff; }
#screen-compose .target[aria-pressed="true"] .glyph {
  color: #fff;
  background: rgba(255,255,255,0.15);
  border-color: transparent;
}

/* Keep only the preflight line in the lightweight composer */
#screen-compose .publish-summary {
  padding: 0;
  margin: 0 0 6px;
  background: transparent;
  gap: 0;
}
#screen-compose .publish-summary .summary-row { display: none; }
#screen-compose .publish-summary .summary-row:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
}
#screen-compose .publish-summary .summary-key { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
#screen-compose .publish-summary .summary-value { font-size: 11px; }
#screen-compose .targets-panel { margin-bottom: -2px; }
#screen-compose .editor-panel { padding-top: 14px; }

/* Mobile composer containment */
#screen-compose .compose-rail { grid-template-columns: minmax(0, 1fr); }
#screen-compose .compose-rail > .bezel,
#screen-compose .compose-main > .bezel { min-width: 0; }
#screen-compose .publish-panel { width: 100%; min-width: 0; }
#screen-compose .composer-actions { min-width: 0; }
#screen-compose .composer-actions .primary-btn { min-width: 0; }
#screen-compose .compose-modebar .segmented { width: auto; display: inline-flex; }
#screen-compose .compose-modebar { display: flex; }
@media (max-width: 760px) {
  #screen-compose .composer-actions .primary-btn { font-size: 14px; padding: 0 14px; }
  #screen-compose .composer-actions .composer-schedule-btn { min-width: 96px; }
  #screen-compose .basic-options { display: none; }
}
#screen-compose .basic-options { display: none !important; }
@media (max-width: 760px) {
  #screen-compose .preflight-panel { display: none; }
}


/* Counters are also destination toggles */
#screen-compose .counter {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  min-height: 26px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
#screen-compose .counter[aria-pressed="false"] { opacity: 0.62; }
#screen-compose .counter[aria-pressed="false"]:hover { opacity: 1; border-color: var(--text-dim); }
#screen-compose .counter[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
#screen-compose .counter[aria-pressed="true"] b { color: #fff; }
#screen-compose .counter.is-warn { opacity: 1; }
#screen-compose .counter.is-over { opacity: 1; }


/* Home no longer carries the composer hero; Compose owns it */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
#screen-home .dash-grid { margin-top: 4px; }
#screen-compose .composer-intro .display {
  max-width: 22ch;
  line-height: 1.02;
}
#screen-compose .composer-intro .lede {
  display: block;
  max-width: 54ch;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
}
#screen-compose .composer-intro-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
#screen-compose .composer-intro-actions .primary-btn {
  width: auto;
  min-width: 0;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
}
#screen-compose .composer-intro-actions .ghost-btn {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}
@media (max-width: 760px) {
  #screen-compose .composer-intro .display { max-width: 18ch; }
  #screen-compose .composer-intro .lede { display: none; }
}


/* Keep the moved Compose hero actions compact */
#screen-compose .composer-intro-actions {
  width: max-content;
  max-width: 100%;
  flex-wrap: wrap;
}
#screen-compose .composer-intro-actions .primary-btn,
#screen-compose .composer-intro-actions .ghost-btn {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
}
#screen-compose .composer-intro-actions .primary-btn {
  justify-content: center;
}
