:root {
  --bg: #f4f6f8;
  --bg-elevated: #f8fafb;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --surface-strong: #eef2f3;
  --border: #dce2e8;
  --border-strong: #cbd3da;
  --text: #17202a;
  --text-soft: #33404b;
  --muted: #65717e;
  --muted-light: #87939e;
  --primary: #0d6b57;
  --primary-hover: #095544;
  --primary-soft: #e7f5f0;
  --brand-accent: #29a886;
  --sidebar: #111b20;
  --sidebar-hover: #1b2a30;
  --sidebar-active: #24363d;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --warning: #695116;
  --warning-bg: #fff8e6;
  --info: #234f91;
  --info-bg: #eef4ff;
  --shadow-xs: 0 1px 2px rgba(23, 32, 42, 0.04);
  --shadow-sm: 0 4px 14px rgba(23, 32, 42, 0.06);
  --shadow-md: 0 12px 36px rgba(23, 32, 42, 0.1);
  --shadow-overlay: 0 24px 80px rgba(10, 19, 24, 0.24);
  --sidebar-width: 248px;
  --sidebar-collapsed: 76px;
  --topbar-height: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { margin: 0; min-height: 100vh; }
body.command-open { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select { color: inherit; font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.62; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 8px;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.18;
}
h2 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.015em;
}
h3 { margin-bottom: 6px; font-size: 15px; }
p { color: var(--muted); line-height: 1.55; }
kbd {
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--muted);
  font: 600 10px/1 ui-sans-serif, system-ui, sans-serif;
  padding: 4px 6px;
  box-shadow: var(--shadow-xs);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted-copy { color: var(--muted-light); }

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}
.app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
.app-stage { min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  overflow: visible;
  padding: 18px 14px;
  background: var(--sidebar);
  color: #fff;
}
.sidebar-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 4px;
}
.brand, .auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.03em;
}
.brand-mark {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #34bd99, var(--brand-accent));
  color: #071b15;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 4px 16px rgba(41, 168, 134, 0.16);
}
.brand-name, .nav-label, .nav-section-label, .workspace-switcher-copy,
.workspace-switcher-chevron, .user-copy {
  transition: opacity 120ms ease, transform 120ms ease;
}
.sidebar-collapse {
  position: absolute;
  top: 5px;
  right: -28px;
  z-index: 2;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #2a383e;
  border-radius: 0 8px 8px 0;
  background: var(--sidebar);
  color: #aebbc1;
  font-size: 20px;
  box-shadow: 4px 2px 10px rgba(17, 27, 32, 0.08);
}
.sidebar-collapse:hover { border-color: #42545c; background: var(--sidebar-hover); color: #fff; }
.sidebar-collapse-arrow { transition: transform 180ms ease; }
.workspace-switcher {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  margin: 22px 0 12px;
  padding: 9px;
  border: 1px solid #2a383e;
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.025);
}
.workspace-switcher:hover { border-color: #42545c; background: var(--sidebar-hover); }
.workspace-switcher-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: #d9efe8;
  color: var(--primary);
  font-weight: 850;
}
.workspace-switcher-copy { min-width: 0; display: grid; gap: 2px; }
.workspace-switcher-copy small { color: #86969d; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.workspace-switcher-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-switcher-chevron { color: #75868d; }
.nav {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-section-label {
  margin: 18px 10px 5px;
  color: #6f8087;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav a, .nav-disabled {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #b8c3c8;
  font-size: 13px;
  font-weight: 560;
}
.nav a::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  content: "";
}
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; }
.nav a.active::before { background: var(--brand-accent); }
.nav-disabled { opacity: 0.4; }
.nav-icon { text-align: center; font-size: 17px; line-height: 1; }
.sidebar-user {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px;
  gap: 9px;
  align-items: center;
  margin-top: auto;
  padding: 16px 4px 2px;
  border-top: 1px solid #2a383e;
  color: inherit;
}
.avatar, .topbar-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d9efe8;
  color: var(--primary);
  font-weight: 800;
}
.avatar { width: 36px; height: 36px; }
.user-copy { min-width: 0; display: grid; gap: 2px; }
.user-copy strong, .user-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy span { color: #82939a; font-size: 10px; }
.app-shell.sidebar-collapsed .sidebar { padding-inline: 14px; }
.app-shell.sidebar-collapsed .brand-name,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-section-label,
.app-shell.sidebar-collapsed .workspace-switcher-copy,
.app-shell.sidebar-collapsed .workspace-switcher-chevron,
.app-shell.sidebar-collapsed .user-copy {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-5px);
}
.app-shell.sidebar-collapsed .sidebar-head { justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-collapse-arrow { transform: rotate(180deg); }
.app-shell.sidebar-collapsed .brand {
  width: 34px;
  overflow: hidden;
}
.app-shell.sidebar-collapsed .workspace-switcher { grid-template-columns: 32px; justify-content: center; padding-inline: 7px; }
.app-shell.sidebar-collapsed .nav a,
.app-shell.sidebar-collapsed .nav-disabled { grid-template-columns: 24px; justify-content: center; padding-inline: 10px; }
.app-shell.sidebar-collapsed .sidebar-user { grid-template-columns: 36px; justify-content: center; }
.sidebar-user .user-copy { color: inherit; }
.app-shell.sidebar-collapsed .sidebar-user form { display: none; }
.mobile-nav { display: none; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 clamp(24px, 4vw, 56px);
  border-bottom: 1px solid rgba(220, 226, 232, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}
.topbar-context { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar-context strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.context-dot, .system-health > span, .live-indicator > span, .preflight-badge > span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(41, 168, 134, 0.12);
}
.context-role {
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.command-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 30vw);
  height: 36px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted);
  text-align: left;
}
.command-trigger:hover { border-color: var(--border-strong); background: #fff; box-shadow: var(--shadow-xs); }
.command-trigger > span:nth-child(2) { flex: 1; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.command-icon { font-size: 17px; }
.system-health {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d2e8e1;
  border-radius: 999px;
  background: #f3faf7;
  color: #276957;
}
.system-health strong { font-size: 10px; white-space: nowrap; }
.topbar-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
}
.topbar-icon:hover { border-color: var(--border-strong); color: var(--text); }
.topbar-avatar { width: 34px; height: 34px; font-size: 12px; }
.main-content {
  min-width: 0;
  max-width: 1680px;
  min-height: calc(100vh - var(--topbar-height));
  margin: 0 auto;
  padding: 34px clamp(24px, 4vw, 56px) 72px;
}

/* Command palette */
.command-palette[hidden] { display: none; }
.command-palette { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 14vh 20px 20px; }
.command-backdrop { position: absolute; inset: 0; border: 0; background: rgba(17, 27, 32, 0.56); backdrop-filter: blur(4px); }
.command-dialog {
  position: relative;
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid rgba(220, 226, 232, 0.8);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-overlay);
}
.command-search { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.command-search > span { color: var(--muted); font-size: 20px; }
.command-search input { height: 42px; padding: 0; border: 0; box-shadow: none; font-size: 15px; }
.command-search input:focus { border: 0; box-shadow: none; }
.command-results { max-height: min(460px, 60vh); overflow-y: auto; padding: 8px; }
.command-group-label { margin: 8px 9px 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.command-results a { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 56px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.command-results a:hover, .command-results a.is-active { background: var(--surface-muted); }
.command-results a > span { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--primary); background: #fff; }
.command-results a div { display: grid; gap: 2px; }
.command-results a strong { font-size: 13px; }
.command-results a small { color: var(--muted); font-size: 11px; }
.command-empty { padding: 28px; text-align: center; }
.command-footer { display: flex; gap: 18px; align-items: center; min-height: 42px; padding: 0 14px; border-top: 1px solid var(--border); background: var(--surface-muted); color: var(--muted); font-size: 10px; }
.command-footer span { display: flex; align-items: center; gap: 5px; }

/* Auth */
.auth-shell { background: #eef2f3; }
.auth-content {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 50% -10%, rgba(41, 168, 134, 0.12), transparent 34%),
    #eef2f3;
}
.auth-panel {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(203, 211, 218, 0.9);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.auth-brand { margin-bottom: 34px; color: var(--text); }
.auth-panel header { margin-bottom: 24px; }
.auth-panel header p { margin-bottom: 0; }
.auth-switch { margin: 22px 0 0; font-size: 13px; text-align: center; }

/* Premium login */
.auth-content:has(.login-experience) {
  display: block;
  padding: 0;
  background: #0c171b;
}
.login-experience {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(460px, 0.92fr);
  min-height: 100vh;
  overflow: hidden;
  background: #0c171b;
}
.login-story {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% 18%, rgba(53, 203, 160, 0.2), transparent 28%),
    radial-gradient(circle at 18% 88%, rgba(20, 113, 91, 0.28), transparent 34%),
    linear-gradient(145deg, #0b1519 0%, #10262a 100%);
}
.login-story::before {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
  content: "";
}
.login-story::after {
  position: absolute;
  top: -160px;
  right: -180px;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(73, 220, 177, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(73, 220, 177, 0.025), 0 0 0 160px rgba(73, 220, 177, 0.018);
  content: "";
}
.login-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.login-brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  background: linear-gradient(145deg, #50dbb4, #1a9c79);
  color: #061612;
  box-shadow: 0 8px 28px rgba(32, 191, 145, .2);
}
.login-story-copy {
  position: relative;
  z-index: 1;
  max-width: 670px;
  margin-top: clamp(70px, 11vh, 140px);
}
.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #9db7b2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.login-eyebrow i, .login-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #48d5aa;
  box-shadow: 0 0 0 4px rgba(72, 213, 170, .12);
}
.login-story-copy h1 {
  margin: 20px 0 22px;
  color: #f6fbf9;
  font-size: clamp(42px, 5.2vw, 76px);
  font-weight: 720;
  letter-spacing: -.062em;
  line-height: .98;
}
.login-story-copy h1 em {
  color: #59d9b4;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}
.login-story-copy p {
  max-width: 560px;
  margin: 0;
  color: #9eb1ae;
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.7;
}
.login-product-card {
  position: relative;
  z-index: 1;
  width: min(660px, 100%);
  margin-top: clamp(42px, 7vh, 80px);
  padding: 20px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  box-shadow: 0 28px 80px rgba(0,0,0,.24);
  backdrop-filter: blur(18px);
}
.login-product-head, .login-job, .login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.login-product-head > div { display: grid; gap: 3px; }
.login-product-head span, .login-metrics span { color: #78918d; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.login-product-head strong { font-size: 14px; }
.login-live { display: inline-flex; align-items: center; gap: 7px; color: #78dbbd !important; }
.login-live i { width: 5px; height: 5px; box-shadow: none; }
.login-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 18px 0; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.08); }
.login-metrics > div { display: grid; gap: 5px; padding: 15px; background: rgba(12,23,27,.78); }
.login-metrics strong { font-size: 23px; letter-spacing: -.04em; }
.login-metrics small { color: #54cda9; font-size: 9px; }
.login-pipeline { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 4px 0 18px; }
.login-pipeline span { height: 4px; border-radius: 3px; background: rgba(255,255,255,.1); }
.login-pipeline .is-done { background: #217d66; }
.login-pipeline .is-active { background: #58d9b4; box-shadow: 0 0 10px rgba(88,217,180,.5); }
.login-job { gap: 12px; }
.login-job-thumb { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 8px; background: #21453f; color: #6fddbd; font-size: 10px; font-weight: 800; }
.login-job > div { display: grid; flex: 1; gap: 3px; min-width: 0; }
.login-job strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.login-job small { color: #718984; font-size: 9px; }
.login-job-status { padding: 5px 7px; border-radius: 5px; background: rgba(72,213,170,.1); color: #69d9b9; font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.login-trust { position: relative; z-index: 1; margin: auto 0 0; padding-top: 38px; color: #607873; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.login-form-side {
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 78px);
  background:
    radial-gradient(circle at 90% 10%, rgba(41,168,134,.08), transparent 25%),
    #f7f9f8;
}
.auth-panel.login-panel {
  width: min(440px, 100%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.login-mobile-brand { display: none; }
.login-panel header { margin-bottom: 30px; }
.login-form-kicker { display: block; margin-bottom: 12px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.login-panel header h2 { margin-bottom: 10px; color: #111a1d; font-size: clamp(30px, 3vw, 40px); font-weight: 760; letter-spacing: -.045em; }
.login-panel header p { font-size: 14px; }
.login-form { gap: 18px; }
.login-form label { color: #243238; font-size: 11px; letter-spacing: .02em; }
.login-form input {
  height: 52px;
  padding: 0 15px;
  border-color: #d8e0de;
  border-radius: 9px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 1px 2px rgba(13,36,31,.03);
  font-size: 14px;
}
.login-form input:focus { border-color: #3a9f84; box-shadow: 0 0 0 4px rgba(13,107,87,.09); }
.login-options { gap: 12px; margin-top: -2px; }
.login-options span { color: #8a9794; font-size: 10px; }
.login-options a { font-size: 11px; font-weight: 700; }
.login-submit { display: flex; height: 52px; align-items: center; justify-content: space-between; padding-inline: 18px; border-radius: 9px; box-shadow: 0 10px 26px rgba(13,107,87,.18); }
.login-submit span:last-child { font-size: 18px; transition: transform 160ms ease; }
.login-submit:hover span:last-child { transform: translateX(3px); }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 0; color: #9aa5a2; font-size: 10px; text-transform: uppercase; }
.login-divider::before, .login-divider::after { flex: 1; height: 1px; background: #dfe5e3; content: ""; }
.login-panel .auth-switch { margin-top: 20px; color: #687572; }
.login-panel .auth-switch a { font-weight: 750; }
.login-legal { max-width: 340px; margin: 28px auto 0; color: #9aa5a2; font-size: 9px; line-height: 1.6; text-align: center; }

/* Header */
.page-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-header.compact { justify-content: flex-start; }
.page-heading { min-width: 0; }
.page-header h1 { margin-top: 4px; }
.page-description, .page-header p { max-width: 760px; margin-bottom: 0; }
.eyebrow, .panel-kicker {
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.eyebrow { margin-bottom: 7px; }
.back-link { display: inline-flex; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 650; }
.back-link:hover { color: var(--primary); }

/* Forms and buttons */
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: var(--text-soft); font-size: 12px; font-weight: 680; }
label small { color: var(--muted); font-weight: 400; line-height: 1.4; }
input, select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input::placeholder { color: #98a3ac; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 107, 87, 0.1); }
input:disabled { background: var(--surface-muted); color: var(--muted); }
.button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.2;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.button:hover { transform: translateY(-1px); }
.button.is-loading::before {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.button.primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(13, 107, 87, 0.2); }
.button.primary:hover { background: var(--primary-hover); box-shadow: 0 5px 16px rgba(13, 107, 87, 0.16); }
.button.secondary { border-color: var(--border); background: #fff; color: var(--text-soft); }
.button.secondary:hover { border-color: var(--border-strong); background: var(--surface-muted); }
.button.danger, .button.danger-button { background: var(--danger); color: #fff; }
.button.danger:hover, .button.danger-button:hover { background: #8f1c14; }
.button.small { min-height: 32px; padding: 5px 10px; border-radius: 5px; font-size: 11px; }
.button.full, .text-button.full { width: 100%; }
.text-button { border: 0; background: transparent; color: var(--primary); padding: 10px; font-weight: 650; }
.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 18px;
}
.icon-button:hover { background: rgba(255, 255, 255, 0.08); }
.icon-button.danger { color: var(--danger); }
.icon-button.danger:hover { background: var(--danger-bg); }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.form-row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.inline-form { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; gap: 12px; align-items: end; }
.composer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: end; }
.composer-title { grid-column: 1 / -1; }
.toggle-row { display: flex; gap: 18px; align-items: center; }
.toggle-row label { display: flex; gap: 7px; align-items: center; font-weight: 500; }
.toggle-row input { width: 16px; height: 16px; }

/* Feedback */
.form-errors, .notice, .dev-link, .flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.5;
}
.form-errors { display: grid; gap: 5px; border-color: #f0b6b1; background: var(--danger-bg); color: #8c1d14; }
.notice { border-color: #ead7a1; background: var(--warning-bg); color: var(--warning); }
.notice.success, .flash-success { border-color: #aedbcf; background: var(--primary-soft); color: #075846; }
.flash-error { border-color: #f0b6b1; background: var(--danger-bg); color: #8c1d14; }
.flash {
  position: fixed;
  z-index: 80;
  top: 78px;
  right: 24px;
  max-width: 440px;
  box-shadow: var(--shadow-md);
  animation: slide-in 180ms ease-out;
}
@keyframes slide-in { from { transform: translateY(-8px); opacity: 0; } }
.dev-link { display: grid; gap: 6px; overflow-wrap: anywhere; border-color: #b8c6e8; background: #f0f4ff; color: #253864; }

/* Panels */
.settings-panel, .queue-status-panel, .control-tower, .quick-publish {
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.settings-panel.narrow { max-width: 680px; }
.settings-panel.centered { margin: 10vh auto 0; text-align: center; }
.panel-heading, .section-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 35px;
  margin-bottom: 16px;
}
.panel-heading h2, .section-heading h2 { margin: 2px 0 0; }
.panel-heading p, .section-heading p { margin: 4px 0 0; font-size: 12px; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.danger-zone {
  margin-top: 34px;
  padding: 22px;
  border: 1px solid #efb7b2;
  border-radius: 10px;
  background: #fff8f7;
}
.danger-zone h2 { color: var(--danger); }
.delete-form { margin-top: 18px; }

/* Metrics */
.metrics, .metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.metrics {
  overflow: hidden;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.metrics > div {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 18px;
  border-right: 1px solid var(--border);
}
.metrics > div:last-child { border-right: 0; }
.metrics span, .metric-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.metrics strong, .metric-value { font-size: 23px; font-weight: 760; letter-spacing: -0.025em; }
.metric-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.metric-card-head { display: flex; align-items: center; justify-content: space-between; }
.metric-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--primary);
  font-weight: 800;
}
.metric-meta {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #075846;
  font-size: 9px;
  font-weight: 800;
}
.metric-detail { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.metric-danger .metric-icon { background: var(--danger-bg); color: var(--danger); }
.metric-warning .metric-icon { background: var(--warning-bg); color: var(--warning); }
.metric-info .metric-icon { background: var(--info-bg); color: var(--info); }

/* Workspace dashboard */
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.workspace-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 18px;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.workspace-card:hover { transform: translateY(-1px); border-color: #aebbc4; box-shadow: var(--shadow-sm); }
.workspace-card { position: relative; }
.workspace-card-main-link { position: absolute; z-index: 1; inset: 0; border-radius: inherit; }
.workspace-card > *:not(.workspace-card-main-link) { position: relative; z-index: 2; pointer-events: none; }
.workspace-card-actions { display: grid; gap: 8px; justify-items: end; }
.workspace-card-actions a { pointer-events: auto !important; }
.workspace-card-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); font-size: 10px; }
.plan-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.upgrade-hero { display: flex; gap: 28px; align-items: center; justify-content: space-between; margin: 0 0 34px; padding: 28px 30px; overflow: hidden; border: 1px solid #cad8ff; border-radius: 22px; background: linear-gradient(120deg, #f7f9ff 0%, #edf3ff 58%, #e2ebff 100%); box-shadow: var(--shadow-sm); }
.upgrade-hero-copy { max-width: 720px; }
.upgrade-hero h2 { margin: 7px 0 8px; font-size: clamp(22px, 3vw, 32px); letter-spacing: -.035em; }
.upgrade-hero p { margin: 0; color: var(--muted); }
.upgrade-benefits { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; color: #16468f; font-size: 11px; font-weight: 750; }
.upgrade-hero-action { flex: 0 0 auto; min-height: 48px; padding-inline: 22px; }
.workspace-logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 10px;
  background: #dcefe9;
  color: var(--primary);
  font-size: 20px;
  font-weight: 850;
}
.workspace-logo.large { width: 64px; height: 64px; margin: 0 auto 18px; font-size: 26px; }
.workspace-main h2 { margin: 0 0 3px; }
.workspace-main p { margin: 0; font-size: 11px; }
.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #edf1f4;
  color: #485661;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
}
.card-arrow { color: #87929b; font-size: 22px; }
.workspace-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.action-tile {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.action-tile:hover { border-color: #aebbc4; box-shadow: var(--shadow-sm); }
.action-tile span { color: var(--muted); font-size: 11px; }
.content-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr); gap: 24px; }
.content-columns > * { min-width: 0; }
.account-columns { margin-bottom: 26px; }

/* Tables and filters */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e7ebee; text-align: left; white-space: nowrap; }
th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
tbody tr { transition: background 100ms ease; }
tbody tr:hover { background: #fbfcfc; }
tr:last-child td { border-bottom: 0; }
.premium-table { border-radius: 8px; }
.actions-col { text-align: right; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions form { display: flex; gap: 6px; align-items: center; }
.row-actions select { width: 118px; height: 32px; font-size: 11px; }
.title-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.error-copy { display: block; max-width: 280px; overflow: hidden; color: var(--danger); text-overflow: ellipsis; }
.selection-col { width: 38px; text-align: center; }
.selection-col input { width: 15px; height: 15px; }
.media-cell, .user-cell { display: flex; gap: 10px; align-items: center; }
.media-cell > div { display: grid; gap: 2px; }
.media-cell small { color: var(--muted); font-size: 9px; }
.media-thumbnail {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(145deg, #26343a, #111b20);
  color: #fff;
  font-size: 9px;
}
.table-avatar {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.filter-search { position: relative; flex: 1; max-width: 380px; }
.filter-search > span { position: absolute; z-index: 1; top: 50%; left: 11px; color: var(--muted); font-size: 17px; transform: translateY(-50%); }
.filter-search input { padding-left: 35px; background: var(--surface-muted); }
.filter-select { width: 170px; }
.filter-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.bulk-action-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #aedbcf;
  border-radius: 8px;
  background: var(--primary-soft);
  color: #075846;
  font-size: 11px;
}
.bulk-action-bar > span { flex: 1; }

/* Status */
.status-pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf1f4;
  color: #53606b;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.025em;
}
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.status-ready, .status-active, .status-approved, .status-published, .status-paid, .status-success {
  background: var(--primary-soft);
  color: #075846;
}
.status-pending, .status-past-due, .status-overdue { background: var(--warning-bg); color: var(--warning); }
.status-processing, .status-submitted { background: var(--info-bg); color: var(--info); }
.status-failed, .status-expired { background: var(--danger-bg); color: var(--danger); }
.status-cancelled, .status-rejected, .status-muted, .status-deleted { background: #edf1f4; color: var(--muted); }

/* Empty, activity and loading */
.empty { padding: 22px; color: var(--muted); text-align: center; }
.empty-state { display: grid; justify-items: center; max-width: 460px; margin: 0 auto; padding: 30px 20px; text-align: center; }
.empty-state-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-muted);
  color: var(--primary);
  font-size: 20px;
}
.empty-state h3 { margin-bottom: 5px; }
.empty-state p { max-width: 340px; margin-bottom: 14px; font-size: 12px; }
.audit-timeline, .activity-list { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.audit-event, .activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 13px 15px;
  border-bottom: 1px solid #e7ebee;
}
.audit-event:last-child, .activity-item:last-child { border-bottom: 0; }
.audit-marker, .activity-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--brand-accent); box-shadow: 0 0 0 3px rgba(41, 168, 134, 0.09); }
.audit-copy { min-width: 0; }
.audit-copy strong { font-size: 11px; }
.audit-copy p, .activity-item p { margin: 2px 0 0; font-size: 11px; }
.audit-event time, .activity-item time { color: var(--muted); font-size: 9px; }
.skeleton { overflow: hidden; border-radius: 5px; background: #e9eef1; }
.skeleton::after {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  content: "";
  animation: skeleton 1.3s infinite;
  transform: translateX(-100%);
}
@keyframes skeleton { to { transform: translateX(100%); } }
.loading-skeleton { display: grid; gap: 10px; }
.loading-skeleton .skeleton { height: 44px; }

/* Quick publish */
.preflight-badge, .live-indicator {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3faf7;
  color: #276957;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.upload-dropzone {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px dashed #b9c7cd;
  border-radius: 9px;
  background: var(--surface-muted);
  transition: border-color 120ms ease, background 120ms ease;
}
.upload-dropzone.is-dragging { border-color: var(--primary); background: var(--primary-soft); }
.upload-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.dropzone-copy { display: grid; justify-items: center; padding: 16px; color: var(--text); text-align: center; cursor: pointer; }
.dropzone-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  color: var(--primary);
  font-size: 21px;
  box-shadow: var(--shadow-xs);
}
.dropzone-copy strong { font-size: 14px; }
.dropzone-copy small { margin-top: 4px; color: var(--muted); font-weight: 400; }
.file-requirements { margin-top: 12px; color: var(--muted-light); font-size: 9px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.upload-actions { display: flex; align-items: center; justify-content: space-between; }
.upload-status { color: var(--muted); font-size: 11px; }
.channel-selector {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}
.channel-selector-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: #111; color: #fff; }
.channel-selector > div:nth-child(2) { display: grid; gap: 2px; }
.channel-selector-label { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.channel-selector strong { font-size: 11px; }
.channel-state { color: var(--warning); font-size: 10px; font-weight: 750; }
.channel-selector.is-connected .channel-state { color: var(--primary); }

/* Queue and control tower */
.pipeline-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pipeline-segment { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted); }
.pipeline-segment > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.pipeline-segment span { color: var(--muted); font-size: 10px; }
.pipeline-segment strong { font-size: 17px; }
.progress-track { width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: #e5eaed; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.progress-w-0 { width: 0; }
.progress-w-10 { width: 10%; }
.progress-w-20 { width: 20%; }
.progress-w-30 { width: 30%; }
.progress-w-40 { width: 40%; }
.progress-w-50 { width: 50%; }
.progress-w-60 { width: 60%; }
.progress-w-70 { width: 70%; }
.progress-w-80 { width: 80%; }
.progress-w-90 { width: 90%; }
.progress-w-100 { width: 100%; }
.progress-track .progress-processing, .progress-track .progress-submitted { background: #5487cf; }
.progress-track .progress-failed { background: var(--danger); }
.control-tower { padding-bottom: 18px; }

/* Channels */
.channel-panel { display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.channel-summary { display: flex; gap: 16px; align-items: center; }
.channel-summary h2 { margin: 7px 0 3px; }
.channel-summary p { margin: 0; font-size: 11px; }
.channel-avatar { width: 62px; height: 62px; border-radius: 50%; background: var(--surface-strong); object-fit: cover; }
.channel-avatar.placeholder { display: grid; place-items: center; color: var(--primary); font-size: 24px; }
.connection-hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff, #f4faf7);
}
.connection-hero::after {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(41, 168, 134, 0.08);
  content: "";
}
.connection-hero > * { position: relative; z-index: 1; }

/* Billing */
.billing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.billing-usage-card { padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.billing-usage-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.billing-usage-head > div { display: grid; gap: 6px; }
.billing-usage-head strong { font-size: 20px; letter-spacing: -0.02em; }
.billing-usage-head > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.billing-usage-card p { margin: 10px 0 0; font-size: 10px; }
.plan-card-current { border-color: #aedbcf; background: linear-gradient(135deg, #fff, #f5fbf8); }
.pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pricing-card { position: relative; display: flex; min-height: 330px; padding: 22px; flex-direction: column; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-xs); }
.pricing-card.is-featured { border-color: #8eabff; background: linear-gradient(180deg, #f8faff, #fff); box-shadow: 0 16px 38px rgba(30,73,170,.13); }
.pricing-card.is-current { outline: 2px solid rgba(14,122,92,.18); }
.pricing-popular { position: absolute; top: -11px; right: 18px; padding: 5px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.pricing-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pricing-card h3 { margin: 5px 0 0; font-size: 20px; }
.pricing-price { display: flex; gap: 6px; align-items: baseline; margin: 24px 0 18px; }
.pricing-price strong { font-size: 26px; letter-spacing: -.04em; }
.pricing-price span { color: var(--muted); font-size: 10px; }
.pricing-features { display: grid; gap: 10px; padding: 0; margin: 0 0 22px; list-style: none; color: var(--muted); font-size: 11px; }
.pricing-features li::before { margin-right: 7px; color: var(--success); content: '✓'; font-weight: 900; }
.pricing-features strong { color: var(--text); }
.pricing-card-action { margin-top: auto; }
.pricing-card-action form, .pricing-card-action .button { width: 100%; }
.topbar-upgrade { text-decoration: none; }
.nav-billing { margin-top: 6px; border: 1px solid rgba(65,105,225,.18); background: rgba(65,105,225,.07); }
.bank-payment-panel { margin-bottom: 24px; }
.bank-payment-grid { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 28px; align-items: center; }
.bank-payment-qr { display: block; width: 100%; max-width: 320px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.bank-payment-details { display: grid; gap: 0; margin: 0; }
.bank-payment-details div { display: grid; grid-template-columns: minmax(120px, 0.7fr) 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.bank-payment-details dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.bank-payment-details dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.profile-hero {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
}
.profile-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 21px;
  font-weight: 850;
}
.profile-hero h2 { margin: 3px 0 2px; }
.profile-hero p { margin: 0; font-size: 11px; }
.definition-list { display: grid; gap: 0; margin: 0; }
.definition-list > div { display: flex; gap: 18px; align-items: center; justify-content: space-between; min-height: 46px; border-bottom: 1px solid #e7ebee; }
.definition-list > div:last-child { border-bottom: 0; }
.definition-list dt { color: var(--muted); font-size: 11px; }
.definition-list dd { margin: 0; font-size: 11px; font-weight: 650; }
.definition-list code { font-size: 10px; }
.admin-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-tabs { padding: 10px; }
.admin-tabs .button { flex: 0 0 auto; }
.admin-filter { grid-template-columns: repeat(3, minmax(140px, 1fr)) auto; }

/* Misc */
.pagination { margin-top: 14px; }
.error-page { display: grid; min-height: 65vh; place-content: center; justify-items: center; text-align: center; }
.error-code { color: var(--primary); font-size: 70px; font-weight: 900; letter-spacing: -0.05em; }

@media (max-width: 1180px) {
  .system-health strong { display: none; }
  .system-health { width: 32px; justify-content: center; padding: 0; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell, .app-shell.sidebar-collapsed { display: block; }
  .sidebar {
    position: fixed;
    right: auto;
    left: 0;
    width: 280px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow-overlay);
  }
  .app-shell.mobile-sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-collapse { display: none; }
  .topbar { padding: 0 18px; }
  .topbar-context::before {
    display: grid;
    width: 34px;
    height: 34px;
    margin-right: 2px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    content: "☰";
    cursor: pointer;
  }
  .command-trigger { width: 42px; justify-content: center; padding: 0; }
  .command-trigger > span:nth-child(2), .command-trigger kbd { display: none; }
  .main-content { padding: 26px 18px 86px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics > div { border-bottom: 1px solid var(--border); }
  .metrics > div:nth-child(2n) { border-right: 0; }
  .metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
  .content-columns { grid-template-columns: 1fr; }
  .workspace-actions { grid-template-columns: 1fr; }
  .channel-panel { align-items: flex-start; flex-direction: column; }
  .pipeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: flex;
    align-items: end;
    justify-content: space-around;
    min-height: 62px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border: 1px solid rgba(220, 226, 232, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 36px rgba(17, 27, 32, 0.16);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a { display: grid; min-width: 52px; justify-items: center; gap: 3px; color: var(--muted); }
  .mobile-nav a > span { font-size: 18px; }
  .mobile-nav small { font-size: 9px; font-weight: 700; }
  .mobile-nav a.active { color: var(--primary); }
  .mobile-nav .mobile-primary > span {
    display: grid;
    width: 36px;
    height: 36px;
    margin-top: -20px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 7px 18px rgba(13, 107, 87, 0.24);
  }
}

@media (max-width: 620px) {
  .auth-panel { padding: 26px 20px; border-radius: 10px; }
  .topbar-context strong, .context-role, .topbar-icon { display: none; }
  .topbar-avatar { display: none; }
  .page-header { display: grid; gap: 16px; }
  .page-header > .button { width: 100%; }
  .metrics-grid, .billing-grid { grid-template-columns: 1fr 1fr; }
  .admin-metrics { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 116px; padding: 15px; }
  .workspace-card { grid-template-columns: 42px minmax(0, 1fr) 18px; }
  .workspace-card .role-badge { display: none; }
  .inline-form, .upload-form, .composer-grid { grid-template-columns: 1fr; }
  .admin-filter { grid-template-columns: 1fr 1fr; }
  .composer-title { grid-column: auto; }
  .toggle-row { align-items: flex-start; flex-direction: column; }
  .button-row .button { flex: 1; }
  .row-actions { min-width: 190px; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-search { grid-column: 1 / -1; max-width: none; }
  .filter-select { width: auto; }
  .filter-count { align-self: center; margin-left: 0; text-align: right; }
  .pipeline-grid { grid-template-columns: 1fr 1fr; }
  .settings-panel, .queue-status-panel, .control-tower, .quick-publish { padding: 17px; border-radius: 9px; }
  .panel-heading { display: grid; }
  .upload-actions { display: grid; gap: 10px; }
  .upload-actions .button { width: 100%; }
  .channel-selector { grid-template-columns: 36px minmax(0, 1fr); }
  .channel-state { grid-column: 2; }
  .flash { right: 14px; left: 14px; max-width: none; }
  .command-palette { padding: 8vh 12px 12px; }
  .command-dialog { border-radius: 10px; }
  .command-footer { display: none; }
  .profile-hero { grid-template-columns: 50px minmax(0, 1fr); }
  .profile-avatar { width: 50px; height: 50px; }
  .profile-hero > .status-pill { grid-column: 2; justify-self: start; }
}

@media (max-width: 900px) {
  .login-experience { grid-template-columns: minmax(0, 1fr) minmax(410px, .9fr); }
  .login-story { padding: 34px; }
  .login-story-copy h1 { font-size: 46px; }
  .login-product-card { padding: 15px; }
}

@media (max-width: 760px) {
  .login-experience { display: block; min-height: 100vh; background: #f7f9f8; }
  .login-story { display: none; }
  .login-form-side { min-height: 100vh; padding: 34px 22px; }
  .login-mobile-brand { display: inline-flex; margin-bottom: 54px; }
  .login-panel header h2 { font-size: 34px; }
  .login-options span { display: none; }
}


/* VidHub Stitch premium — restore dark sidebar + teal (selected frames) */
:root {
  --bg: #f4f6f8;
  --bg-elevated: #f8fafb;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --surface-strong: #eef2f3;
  --border: #dce2e8;
  --border-strong: #cbd3da;
  --text: #17202a;
  --text-soft: #33404b;
  --muted: #65717e;
  --muted-light: #87939e;
  --primary: #0d6b57;
  --primary-hover: #095544;
  --primary-soft: #e7f5f0;
  --brand-accent: #29a886;
  --sidebar: #111b20;
  --sidebar-hover: #1b2a30;
  --sidebar-active: #24363d;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --warning: #695116;
  --warning-bg: #fff8e6;
  --info: #234f91;
  --info-bg: #eef4ff;
  --radius-control: 8px;
  --radius-card: 12px;
}

/* Queue strip (Control Tower) */
.queue-status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.queue-chip {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.queue-chip span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.queue-chip strong { font-size: 26px; font-weight: 760; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.queue-chip.is-pending strong { color: var(--warning); }
.queue-chip.is-processing strong, .queue-chip.is-submitted strong { color: var(--info); }
.queue-chip.is-failed strong { color: var(--danger); }
.queue-chip.is-published strong { color: #075846; }

.control-tower-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
.control-tower-main { min-width: 0; }
.activity-rail {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}
.activity-rail h2 { margin: 0 0 12px; font-size: 14px; }
.activity-rail .live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  color: #075846; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.activity-rail .live-dot i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(41,168,134,.14);
}
.activity-item-card {
  display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.activity-item-card:last-child { border-bottom: 0; }
.activity-item-card strong { color: var(--text); font-size: 12px; }
.activity-item-card span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.activity-item-card time { color: var(--muted-light); font-size: 10px; }
.activity-item-card.is-error strong { color: var(--danger); }

/* Floating bulk bar (Stitch) */
.bulk-action-bar[data-bulk-actions]:not([hidden]) {
  position: sticky;
  bottom: 18px;
  z-index: 25;
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 16px auto 0;
  padding: 12px 16px;
  max-width: 720px;
  border: 0;
  border-radius: 999px;
  background: #111b20;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.bulk-action-bar[data-bulk-actions]:not([hidden]) strong { color: #fff; font-size: 12px; }
.bulk-action-bar[data-bulk-actions]:not([hidden]) > span { color: #95a4aa; font-size: 11px; }
.bulk-action-bar[data-bulk-actions]:not([hidden]) .text-button { color: #d9efe8; }

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.schedule-header h1 { margin-bottom: 6px; }
.schedule-list-item {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

@media (max-width: 1100px) {
  .control-tower-layout { grid-template-columns: 1fr; }
  .queue-status-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .queue-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-action-bar[data-bulk-actions]:not([hidden]) {
    bottom: 72px;
    border-radius: 16px;
    flex-wrap: wrap;
  }
}


/* Schedule/calendar refinements (teal-safe) */


html { background: var(--bg); }
body.app-shell { background: var(--bg); color: var(--text); }
h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.025em; }
p { line-height: 1.6; }
a, button, input, select, .metric-card, .settings-panel, .workspace-card, .action-tile {
  transition: all 200ms cubic-bezier(.16, 1, .3, 1);
}

.app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  padding: 18px 14px;
  border-right: 0;
  background: var(--sidebar);
  color: #fff;
  box-shadow: none;
}
.sidebar-head { min-height: 40px; padding: 0 8px; }
.brand { gap: 11px; color: #fff; }
.brand-mark {
  flex-basis: 34px;
  border-radius: 8px;
  background: linear-gradient(145deg, #34bd99, var(--brand-accent));
  color: #071b15;
  box-shadow: inset 0 1px rgba(255,255,255,.3), 0 4px 16px rgba(41,168,134,.16);
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy small { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .02em; }
.sidebar-collapse {
  border-color: #2a383e;
  border-left-color: var(--sidebar);
  background: var(--sidebar);
  color: #aebbc1;
}
.sidebar-collapse:hover { border-color: #42545c; background: var(--sidebar-hover); color: #fff; }
.workspace-switcher {
  margin: 22px 0 12px;
  border-color: #2a383e;
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: #fff;
}
.workspace-switcher:hover { border-color: #42545c; background: var(--sidebar-hover); }
.workspace-switcher-mark { border-radius: 7px; background: #d9efe8; color: var(--primary); }
.workspace-switcher-copy small, .workspace-switcher-chevron { color: var(--muted); }
.sidebar-primary-action {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px rgba(255,255,255,.22), 0 7px 18px rgba(13,107,87,.14);
}
.sidebar-primary-action:hover { background: var(--primary-hover); transform: scale(.985); }
.nav { gap: 3px; }
.nav-section-label { margin: 18px 11px 6px; color: #6f8087; font-size: 9px; letter-spacing: .12em; }
.nav a, .nav-disabled {
  min-height: 40px;
  border-radius: 7px;
  color: #b8c3c8;
  font-size: 13px;
}
.nav a::before { display: none; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: none;
}
.nav-disabled { color: #6f8087; }
.nav-icon { color: #95a4aa; font-size: 16px; }
.nav a:hover .nav-icon { color: #fff; }
.nav a.active .nav-icon { color: #fff; }
.sidebar-user { border-top-color: #2a383e; }
.avatar, .topbar-avatar { background: #d9efe8; color: #075846; }
.sidebar .user-copy strong { color: #fff; }
.sidebar .user-copy span { color: #82939a; }
.sidebar-user .icon-button:hover { background: var(--surface-strong); color: var(--primary); }
.app-shell.sidebar-collapsed .brand-copy { opacity: 0; pointer-events: none; }
.app-shell.sidebar-collapsed .sidebar-primary-action { padding-inline: 0; }
.sidebar-reopen { display: none; }
.app-shell.sidebar-collapsed .sidebar-reopen {
  position: fixed;
  z-index: 45;
  top: 78px;
  left: 68px;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #c5ddd4;
  border-radius: 0 9px 9px 0;
  background: #fff;
  color: var(--primary);
  box-shadow: 6px 5px 18px rgba(15, 23, 42, .12);
  font-size: 10px;
}
.sidebar-reopen span { font-size: 17px; line-height: 1; }
.sidebar-reopen:hover { background: var(--primary-soft); }

.topbar {
  height: 64px;
  padding: 0 clamp(24px, 4vw, 48px);
  border-bottom-color: var(--border);
  background: rgba(255,255,255,.88);
  box-shadow: none;
  backdrop-filter: blur(20px);
}
.context-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}
.context-role { border-radius: 999px; background: var(--surface-strong); color: #075846; }
.command-trigger {
  width: min(320px, 32vw);
  height: 38px;
  border-color: var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}
.command-trigger:hover { border-color: #d9efe8; background: #fff; box-shadow: 0 0 0 4px rgba(13,107,87,.06); }
.system-health { border: 0; background: #effbf6; color: #087452; }
.system-health > span, .live-indicator > span, .preflight-badge > span {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.1);
}
.topbar-icon { border-color: var(--border); }
.topbar-icon:hover { border-color: #d9efe8; color: var(--primary); background: var(--surface-strong); }
.main-content {
  max-width: 1680px;
  padding: 44px clamp(24px, 4vw, 48px) 80px;
}

.page-header { margin-bottom: 38px; }
.page-header h1 { margin-top: 6px; }
.page-description { font-size: 14px; }
.eyebrow, .panel-kicker { color: var(--primary); font-size: 10px; letter-spacing: .12em; }
.back-link { margin-bottom: 16px; }

input, select {
  height: 44px;
  padding-inline: 13px;
  border-color: var(--border);
  border-radius: 11px;
}
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}
input:hover, select:hover { border-color: #cdd5e7; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,107,87,.1); outline: 0; }
.button {
  min-height: 40px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
}
.button:hover { transform: scale(.985); }
.button.primary { background: var(--primary); box-shadow: inset 0 1px rgba(255,255,255,.22), 0 6px 18px rgba(13,107,87,.12); }
.button.primary:hover { background: var(--primary-hover); box-shadow: 0 8px 22px rgba(9,85,68,.16); }
.button.secondary { border-color: var(--border); color: var(--text-soft); }
.button.secondary:hover { border-color: #d9efe8; background: var(--surface-strong); color: var(--primary); }
.button.small { min-height: 32px; border-radius: 8px; }

.settings-panel, .queue-status-panel, .control-tower, .quick-publish {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid rgba(240,240,240,.75);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.settings-panel:hover, .queue-status-panel:hover, .control-tower:hover, .quick-publish:hover {
  box-shadow: var(--shadow-md);
}
.panel-heading, .section-heading { margin-bottom: 20px; }
.danger-zone { border-radius: 20px; }

.metrics-grid {
  gap: 16px;
  margin-bottom: 36px;
}
.metric-card {
  min-height: 148px;
  padding: 22px;
  border-color: rgba(240,240,240,.7);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #d9efe8;
  color: var(--primary);
}
.metric-label { color: var(--muted); font-size: 11px; }
.metric-value { color: var(--text); font-size: 27px; font-weight: 700; letter-spacing: -.04em; }
.metric-detail { color: var(--muted); font-size: 10px; }
.metric-meta { background: #eaf8f2; color: #087452; }
.metric-danger .metric-icon { background: var(--danger-bg); }
.metric-warning .metric-icon { background: var(--warning-bg); }
.metric-info .metric-icon { background: #d9efe8; color: var(--primary); }

.getting-started-card {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid #d9efe8;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff 0%, #f2f6ff 100%);
  box-shadow: var(--shadow-sm);
}
.getting-started-intro h2 { margin: 10px 0 8px; font-size: 24px; }
.getting-started-intro p { max-width: 520px; margin: 0 0 18px; color: var(--text-soft); font-size: 13px; }
.getting-started-badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.simple-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.simple-steps li {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255,255,255,.82);
}
.simple-steps li > span {
  display: grid;
  flex: 0 0 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #edf0f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.simple-steps li > div { display: grid; gap: 2px; }
.simple-steps strong { font-size: 13px; }
.simple-steps small { color: var(--muted); font-size: 10px; }
.simple-steps .is-current { border-color: #aedbcf; background: #fff; box-shadow: 0 5px 18px rgba(13,107,87,.07); }
.simple-steps .is-current > span { background: var(--primary); color: #fff; }
.simple-steps .is-done > span { background: #eaf8f2; color: #087452; }
.compact-metrics .metric-card { min-height: 122px; }
.compact-workspace-header { align-items: end; }
.workspace-setup {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.workspace-setup > a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 94px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.workspace-setup > a:hover { border-color: #bad2ff; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.workspace-setup > a > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #edf0f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.workspace-setup > a > div { display: grid; gap: 4px; }
.workspace-setup strong { font-size: 13px; }
.workspace-setup small { color: var(--muted); font-size: 10px; }
.workspace-setup b { color: var(--muted); font-size: 20px; }
.workspace-setup > a.is-current { border-color: #aedbcf; background: #f8faff; }
.workspace-setup > a.is-current > span { background: var(--primary); color: #fff; }
.workspace-setup > a.is-complete > span { background: #eaf8f2; color: #087452; }
.workspace-management-links { padding-top: 24px; border-top: 1px solid var(--border); }
.workspace-management-links h2 { margin: 5px 0 18px; }
.workspace-management-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.workspace-management-grid a { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 13px; color: var(--text); background: #fff; }
.workspace-management-grid a:hover { border-color: #bad2ff; background: var(--surface-muted); }
.workspace-management-grid a > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
.workspace-management-grid a > div { display: grid; gap: 2px; }
.workspace-management-grid strong { font-size: 11px; }
.workspace-management-grid small { color: var(--muted); font-size: 9px; }
.settings-shortcuts { display: grid; gap: 9px; margin-bottom: 24px; }
.settings-shortcuts a { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); }
.settings-shortcuts a:hover { border-color: #bad2ff; background: var(--surface-muted); }
.settings-shortcuts a > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.settings-shortcuts a > div { display: grid; gap: 2px; }
.settings-shortcuts strong { font-size: 11px; }
.settings-shortcuts small { color: var(--muted); font-size: 9px; }
.settings-technical-heading { padding-top: 20px; border-top: 1px solid var(--border); }

.workspace-grid { gap: 16px; }
.workspace-card {
  min-height: 108px;
  padding: 20px;
  border-color: rgba(240,240,240,.8);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.workspace-card:hover { transform: translateY(-3px); border-color: #d9efe8; box-shadow: var(--shadow-md); }
.workspace-logo {
  border-radius: 14px;
  background: #d9efe8;
  color: var(--primary);
}
.role-badge { border-radius: 999px; background: var(--surface-strong); color: #075846; }
.action-tile {
  min-height: 122px;
  padding: 22px;
  border-color: rgba(240,240,240,.8);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.action-tile:hover { transform: translateY(-2px); border-color: #d9efe8; box-shadow: var(--shadow-md); }

.table-wrap {
  border-color: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
table { font-size: 12px; }
th, td { padding: 14px 16px; border-bottom-color: var(--border); }
th { background: var(--surface-muted); color: var(--muted); font-size: 10px; letter-spacing: .07em; }
tbody tr:hover { background: #fafbff; }
.media-thumbnail { border-radius: 10px; background: linear-gradient(145deg, #283044, #131b2e); }
.table-avatar { background: #d9efe8; color: var(--primary); }
.filter-search input { background: #fff; }


.status-ready, .status-active, .status-approved, .status-published, .status-paid, .status-success {
  background: #eaf8f2;
  color: #087452;
}
.status-processing, .status-submitted { background: #eef4ff; color: #0d6b57; }
.status-pending, .status-past-due, .status-overdue { background: #fff4df; color: #9a5b00; }
.status-failed, .status-expired { background: #ffeded; color: #ba1a1a; }
.status-cancelled, .status-rejected, .status-muted, .status-deleted { background: #f1f3f7; color: #64748b; }

.empty-state { padding: 42px 22px; }
.empty-state-icon { width: 56px; height: 56px; border-color: var(--border); border-radius: 18px; background: var(--surface-strong); }
.audit-timeline, .activity-list { border-color: var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); }
.audit-event, .activity-item { padding: 16px 18px; border-bottom-color: var(--border); }
.audit-marker, .activity-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(13,107,87,.09); }

.queue-status-panel { background: var(--surface); }
.pipeline-segment { border-color: var(--border); border-radius: 14px; }
.progress-track { background: #eaedff; }
.progress-pending { background: #f59e0b; }
.progress-processing, .progress-submitted { background: var(--primary); }
.progress-failed { background: #ef4444; }
.upload-dropzone {
  border-color: #c1c6d7;
  border-radius: 18px;
  background: var(--surface-muted);
}
.upload-dropzone:hover, .upload-dropzone.is-dragging { border-color: var(--primary); background: var(--surface-strong); }
.dropzone-icon { border-radius: 18px; background: #d9efe8; color: var(--primary); }
.connection-hero { border-radius: 24px; background: linear-gradient(145deg, #fff, #eef2f3); box-shadow: var(--shadow-sm); }
.channel-avatar { background: #131b2e; color: #fff; }
.billing-usage-card { border-radius: 20px; box-shadow: var(--shadow-sm); }
.progress-bar { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 999px; background: #eaedff; appearance: none; }
.progress-bar::-webkit-progress-bar { border-radius: 999px; background: #eaedff; }
.progress-bar::-webkit-progress-value { border-radius: 999px; background: var(--primary); }
.progress-bar::-moz-progress-bar { border-radius: 999px; background: var(--primary); }
.profile-avatar { background: #d9efe8; color: var(--primary); }
.admin-tabs { padding: 10px; border-radius: 16px; }
.command-dialog { border-color: rgba(255,255,255,.5); border-radius: 20px; backdrop-filter: blur(20px); }

.insights-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: 20px;
  margin-bottom: 36px;
}
.insight-primary, .insight-callout, .analytics-overview, .roi-calculator, .current-usage-card,
.operations-card {
  border: 1px solid rgba(240,240,240,.75);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.insight-primary { padding: 24px; }
.insight-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--border); }
.insight-stat-row > div { display: grid; gap: 6px; padding: 18px; background: #fff; }
.insight-stat-row span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.insight-stat-row strong { font-size: 24px; letter-spacing: -.04em; }
.insight-stat-row small { color: var(--muted); font-size: 10px; }
.insight-callout { display: flex; gap: 14px; align-items: flex-start; padding: 24px; background: linear-gradient(145deg, #fff, #eef2f3); }
.insight-callout.needs-attention { border-top: 2px solid #f59e0b; }
.insight-callout-icon { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 50%; background: #d9efe8; color: var(--primary); font-weight: 800; }
.insight-callout.needs-attention .insight-callout-icon { background: var(--warning-bg); color: var(--warning); }
.insight-callout h2 { margin: 5px 0 8px; }
.insight-callout p { margin-bottom: 12px; font-size: 12px; }
.insight-callout a { font-size: 12px; font-weight: 700; }

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.workflow-steps article { position: relative; display: flex; gap: 11px; align-items: center; min-height: 78px; padding: 16px 18px; border-right: 1px solid var(--border); }
.workflow-steps article:last-child { border-right: 0; }
.workflow-steps article > span { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; background: #edf0f7; color: var(--muted); font-size: 10px; font-weight: 800; }
.workflow-steps article.is-complete > span { background: var(--primary); color: #fff; }
.workflow-steps article > div { display: grid; gap: 3px; }
.workflow-steps strong { font-size: 12px; }
.workflow-steps small { color: var(--muted); font-size: 9px; }

.control-tower-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .55fr); gap: 24px; align-items: start; margin-bottom: 28px; }
.control-tower-grid .queue-status-panel { margin: 0; }
.operations-rail { display: grid; gap: 18px; }
.operations-card { padding: 20px; }
.exceptions-card { border-top: 2px solid #ef4444; }
.exceptions-card .panel-heading > strong { display: grid; min-width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #ffeded; color: #ba1a1a; }
.exception-item { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.exception-item + .exception-item { margin-top: 9px; }
.exception-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.exception-item small { display: -webkit-box; overflow: hidden; color: var(--danger); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.exception-item form, .exception-item .button { width: 100%; }
.completed-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.completed-item:last-child { border-bottom: 0; }
.completed-item > span { display: grid; flex: 0 0 28px; height: 28px; place-items: center; border-radius: 8px; background: #eaf8f2; color: #10b981; font-weight: 800; }
.completed-item > div { display: grid; min-width: 0; gap: 2px; }
.completed-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.completed-item small { color: var(--muted); font-size: 9px; }
.operations-empty { display: grid; justify-items: center; gap: 8px; padding: 20px 8px; text-align: center; }
.operations-empty > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: #eaf8f2; color: #10b981; }
.operations-empty p { margin: 0; font-size: 11px; }

/* Central publishing calendar */
.schedule-page { min-width: 0; }
.schedule-header {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}
.schedule-header h1 { margin: 5px 0 6px; }
.schedule-header .page-description { margin: 0; }
.create-post-button { min-width: 154px; }
.schedule-alert {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #bad2ff;
  border-radius: 13px;
  background: #f2f6ff;
}
.schedule-alert.warning { border-color: #f0d9a8; background: #fff8eb; }
.schedule-alert > div { display: grid; gap: 3px; }
.schedule-alert strong { font-size: 12px; }
.schedule-alert span { color: var(--muted); font-size: 11px; }
.scheduler-workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.schedule-profile-rail {
  padding: 20px 16px;
  border-right: 1px solid var(--border);
  background: #fbfcff;
}
.schedule-rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.schedule-rail-heading a { color: var(--muted); font-size: 14px; }
.profile-filter {
  display: grid;
  grid-template-columns: 18px 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.profile-filter.is-selected { border-color: #c5d7ff; box-shadow: 0 4px 16px rgba(13,107,87,.05); }
.profile-filter input { width: 15px; height: 15px; }
.profile-filter-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.profile-filter > span:last-child { display: grid; min-width: 0; gap: 2px; }
.profile-filter strong, .profile-filter small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-filter strong { font-size: 11px; }
.profile-filter small { color: var(--muted); font-size: 9px; }
.rail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 24px; }
.rail-summary > span { grid-column: 1 / -1; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rail-summary > div { display: grid; gap: 2px; padding: 9px 5px; border-radius: 9px; background: #fff; text-align: center; }
.rail-summary strong { font-size: 17px; }
.rail-summary small { color: var(--muted); font-size: 8px; }
.rail-library-link {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  margin-top: 20px;
  padding: 11px;
  border-radius: 11px;
  color: var(--text);
}
.rail-library-link:hover { background: var(--surface-strong); }
.rail-library-link > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.rail-library-link > div { display: grid; gap: 2px; }
.rail-library-link strong { font-size: 11px; }
.rail-library-link small { color: var(--muted); font-size: 9px; }
.rail-library-link b { color: var(--muted); font-size: 18px; }
.calendar-panel { min-width: 0; padding: 18px; }
.calendar-toolbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.calendar-navigation { display: flex; gap: 7px; align-items: center; min-width: 0; }
.calendar-navigation h2 { margin-left: 7px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-nav-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font-size: 19px;
}
.calendar-nav-button:hover { border-color: #c5d7ff; color: var(--primary); }
.calendar-view-tabs { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); }
.calendar-view-tabs a { padding: 7px 11px; border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.calendar-view-tabs a.active { color: var(--primary); background: #fff; box-shadow: var(--shadow-xs); }
.calendar-filters {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(4, minmax(105px, .8fr)) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}
.calendar-filters label { display: grid; gap: 4px; min-width: 0; }
.calendar-filters label span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.calendar-filters input, .calendar-filters select { min-width: 0; padding: 8px 9px; font-size: 10px; }
.filter-clear { align-self: center; color: var(--muted); font-size: 9px; font-weight: 700; }
.content-calendar {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--border);
}
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(115px, 1fr)); gap: 1px; }
.calendar-weekdays span { padding: 10px; background: var(--surface-muted); color: var(--muted); font-size: 9px; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { min-width: 0; min-height: 440px; background: #fff; transition: background 120ms ease, box-shadow 120ms ease; }
.month-view .calendar-day { min-height: 148px; }
.calendar-day.is-outside { background: #fafbfc; opacity: .7; }
.calendar-day.is-today { box-shadow: inset 0 3px var(--primary); }
.calendar-day.is-drop-target { background: #eef4ff; box-shadow: inset 0 0 0 2px var(--primary); }
.calendar-day > header { display: flex; align-items: center; justify-content: space-between; min-height: 37px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.calendar-day > header span { color: var(--muted); font-size: 9px; font-weight: 700; }
.calendar-day.is-today > header span { color: var(--primary); }
.calendar-day > header button { display: grid; width: 24px; height: 24px; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.calendar-day > header button:hover { background: var(--primary-soft); color: var(--primary); }
.calendar-day-posts { display: grid; gap: 6px; padding: 7px; }
.calendar-post {
  min-width: 0;
  padding: 8px;
  border-left: 3px solid var(--primary);
  border-radius: 7px;
  background: #f4f7ff;
  cursor: default;
}
.calendar-post-preview {
  float: right;
  width: 42px;
  height: 42px;
  margin: 0 0 5px 7px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: #111827;
  color: #fff;
}
.calendar-post-preview img, .post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.calendar-post-preview span { display: grid; height: 100%; place-items: center; }
.calendar-post[draggable="true"] { cursor: grab; }
.calendar-post.is-dragging { opacity: .45; cursor: grabbing; }
.calendar-post.status-card-published { border-left-color: #10b981; background: #effbf6; }
.calendar-post.status-card-failed { border-left-color: #ef4444; background: #fff2f2; }
.calendar-post.status-card-processing, .calendar-post.status-card-submitted { border-left-color: #8b5cf6; background: #f5f3ff; }
.calendar-post-time { margin-bottom: 4px; color: var(--primary); font-size: 9px; font-weight: 800; }
.calendar-post strong, .calendar-post > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-post strong { font-size: 10px; }
.calendar-post > span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.calendar-post footer { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.calendar-post footer small { color: var(--muted); font-size: 8px; }
.calendar-post footer a, .calendar-post footer button { padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 8px; font-weight: 800; }
.calendar-post footer .status-pill { font-size: 7px; }
.schedule-job-actions, .calendar-card-actions, .mobile-day-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.schedule-job-actions form, .calendar-card-actions form, .mobile-day-actions form { margin: 0; }
.calendar-card-actions { justify-content: flex-end; }
.calendar-card-actions form:last-child button, .mobile-day-actions form:last-child button { color: var(--danger); }
.button.danger { border-color: #ffcaca; background: #fff2f2; color: #b42323; }
.button.danger:hover { border-color: #f5a8a8; background: #ffe8e8; }
.calendar-drag-hint { margin: 10px 0 0; color: var(--muted); font-size: 9px; text-align: right; }
.schedule-list { display: grid; gap: 8px; }
.schedule-list-item {
  display: grid;
  grid-template-columns: 90px 38px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
}
.schedule-list-date { display: grid; gap: 2px; }
.schedule-list-date strong { color: var(--primary); font-size: 13px; }
.schedule-list-date span, .schedule-list-copy span { color: var(--muted); font-size: 9px; }
.post-thumbnail { display: grid; width: 38px; height: 38px; padding: 0; overflow: hidden; place-items: center; border: 0; border-radius: 9px; background: #111827; color: #fff; font-size: 10px; }
.post-thumbnail:focus-visible, .calendar-post-preview:focus-visible { outline: 3px solid rgba(13,107,87,.28); outline-offset: 2px; }
.schedule-list-copy { display: grid; min-width: 0; gap: 3px; }
.schedule-list-copy strong, .schedule-list-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-job-actions { justify-content: flex-end; }
.failed-posts-panel { margin-top: 24px; padding: 20px; border: 1px solid #ffd1d1; border-radius: 16px; background: #fff; }
.failed-posts-panel article { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--border); }
.failed-posts-panel article > div { display: grid; gap: 3px; }
.failed-posts-panel article strong { font-size: 11px; }
.failed-posts-panel article span { color: var(--danger); font-size: 9px; }

body.modal-open { overflow: hidden; }
.post-modal[hidden] { display: none; }
.post-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; }
.post-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(15, 23, 42, .58); backdrop-filter: blur(3px); }
.post-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-overlay);
}
.post-modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
.post-modal-header h2 { margin-top: 3px; }
.post-modal-body { display: grid; grid-template-columns: 160px minmax(0, 1fr); }
.post-modal-steps { display: grid; align-content: start; gap: 8px; padding: 22px 16px; border-right: 1px solid var(--border); background: var(--surface-muted); }
.post-modal-steps span { display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 7px; align-items: center; min-height: 38px; padding: 7px; border-radius: 9px; color: var(--muted); font-size: 10px; }
.post-modal-steps span::first-letter { font-weight: 800; }
.post-modal-steps span.active { color: var(--primary); background: #fff; box-shadow: var(--shadow-xs); }
.post-modal-steps b { font-size: 10px; }
.post-composer { padding: 22px; }
.modal-video-picker { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.modal-section-heading { display: flex; gap: 15px; align-items: center; justify-content: space-between; }
.modal-section-heading h3 { margin-bottom: 3px; font-size: 14px; }
.modal-section-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.inline-modal-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 12px; padding: 12px; border: 1px dashed #aedbcf; border-radius: 11px; background: var(--primary-soft); }
.inline-modal-upload[hidden] { display: none; }
.inline-modal-upload input { min-width: 0; padding: 8px; background: #fff; }
.inline-modal-upload span { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.post-composer form { display: grid; gap: 15px; }
.post-composer label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; }
.post-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-help { justify-self: end; margin-top: -3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.post-options { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 13px; border: 1px solid var(--border); border-radius: 11px; }
.post-options legend { padding: 0 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.post-options label { display: flex; gap: 7px; align-items: center; font-size: 10px; font-weight: 600; }
.post-options input { width: 15px; height: 15px; }
.post-modal-footer { display: flex; gap: 9px; justify-content: flex-end; padding-top: 5px; }
.preview-dialog { width: min(720px, 100%); }
.preview-dialog video { display: block; width: 100%; max-height: 72vh; background: #05070b; }
.reschedule-dialog { width: min(420px, 100%); }
.reschedule-dialog form { display: grid; gap: 14px; padding: 20px; }
.reschedule-dialog label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; }
.mobile-day-schedule { display: none; }
.mobile-day-schedule > header { display: grid; grid-template-columns: 34px 1fr 34px; gap: 8px; align-items: center; margin-bottom: 10px; }
.mobile-day-schedule > header strong { text-align: center; text-transform: capitalize; }
.mobile-day-schedule > header button { height: 34px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.mobile-day-schedule > section { display: grid; gap: 8px; }
.mobile-day-schedule > section > p { margin: 0; padding: 30px 14px; color: var(--muted); text-align: center; }
.mobile-day-post { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; }
.mobile-day-post .post-thumbnail { width: 42px; height: 42px; grid-row: span 2; }
.mobile-day-post > div { display: grid; min-width: 0; gap: 3px; }
.mobile-day-post > div strong, .mobile-day-post > div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-day-post > div strong { font-size: 11px; }
.mobile-day-post > div span { color: var(--muted); font-size: 9px; }
.mobile-day-post .status-pill { grid-column: 2; justify-self: start; }
.mobile-day-actions { grid-column: 2; }
.mobile-day-actions button { padding: 0; border: 0; background: transparent; color: var(--primary); font-size: 9px; font-weight: 800; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; font-size: 10px; }
.pagination a { font-weight: 800; }
.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid #b9dccd; border-radius: 11px; background: #effbf6; color: #116149; box-shadow: var(--shadow-overlay); font-size: 11px; font-weight: 700; }
.toast-error { border-color: #ffcaca; background: #fff2f2; color: #a52222; }

.analytics-overview { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr); gap: 0; margin-bottom: 30px; overflow: hidden; }
.analytics-metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.analytics-metric-grid article { display: grid; min-height: 150px; align-content: center; gap: 8px; padding: 24px; background: #fff; }
.analytics-metric-grid span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.analytics-metric-grid strong { font-size: 32px; letter-spacing: -.04em; }
.analytics-metric-grid small { color: var(--muted); }
.analytics-insights { padding: 26px; background: linear-gradient(145deg, #fff, #eef2f3); }
.analytics-insights h2 { margin: 7px 0 20px; }
.analytics-insight { display: flex; gap: 12px; align-items: flex-start; padding: 15px; border: 1px solid rgba(240,240,240,.9); border-radius: 14px; background: rgba(255,255,255,.82); box-shadow: var(--shadow-xs); }
.analytics-insight + .analytics-insight { margin-top: 12px; }
.analytics-insight > span { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; background: #d9efe8; color: var(--primary); font-weight: 800; }
.analytics-insight p { margin: 0; color: var(--text-soft); font-size: 12px; }

.roi-bento { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr); gap: 24px; margin-bottom: 30px; }
.roi-calculator, .current-usage-card { padding: 26px; }
.roi-icon { display: grid; width: 38px; height: 38px; margin-bottom: 12px; place-items: center; border-radius: 50%; background: var(--surface-strong); color: var(--primary); }
.roi-score { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; padding-top: 6px; }
.roi-score > div:first-child { display: grid; align-content: center; gap: 8px; padding: 22px; border: 1px solid var(--border); border-radius: 15px; }
.roi-score span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.roi-score strong { font-size: 38px; letter-spacing: -.05em; }
.roi-score small { color: var(--muted); }
.roi-score-visual { display: grid; align-content: center; justify-items: center; min-height: 164px; border-radius: 15px; background: linear-gradient(145deg, #eef2f3, #e2e7ff); }
.roi-score-visual strong { color: var(--primary); }
.roi-assumptions { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 20px; color: var(--text-soft); font-size: 11px; }
.current-usage-card h2 { margin: 6px 0 26px; }
.usage-line + .usage-line { margin-top: 22px; }
.usage-line > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 11px; }
.usage-line strong { font-size: 11px; }

/* Keep the auth composition, align it with the blue premium identity. */
.login-story {
  background:
    radial-gradient(circle at 78% 18%, rgba(9,85,68,.22), transparent 28%),
    radial-gradient(circle at 18% 88%, rgba(70,72,212,.24), transparent 34%),
    linear-gradient(145deg, #11182a 0%, #182744 100%);
}
.login-brand-mark { background: linear-gradient(145deg, #aedbcf, #095544); color: #001a41; box-shadow: 0 8px 28px rgba(9,85,68,.22); }
.login-eyebrow i, .login-live i { background: #70a6ff; box-shadow: 0 0 0 4px rgba(112,166,255,.12); }
.login-story-copy h1 em { color: #aedbcf; }
.login-product-card { background: rgba(255,255,255,.06); }
.login-pipeline .is-done { background: #366ec0; }
.login-pipeline .is-active { background: #aedbcf; box-shadow: 0 0 10px rgba(173,198,255,.55); }
.login-form-side { background: radial-gradient(circle at 90% 10%, rgba(9,85,68,.08), transparent 25%), #f8fafc; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,107,87,.1); }
.login-submit { box-shadow: 0 10px 26px rgba(13,107,87,.18); }

@media (max-width: 1100px) {
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-columns { grid-template-columns: 1fr; }
  .control-tower-grid, .roi-bento, .analytics-overview, .insights-bento { grid-template-columns: 1fr; }
  .getting-started-card { grid-template-columns: 1fr; }
  .scheduler-workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .calendar-weekdays, .calendar-days { grid-template-columns: repeat(7, minmax(100px, 1fr)); }
  .content-calendar { overflow-x: auto; }
}

@media (max-width: 900px) {
  .sidebar { box-shadow: 16px 0 40px rgba(19,27,46,.12); }
  .sidebar-reopen, .app-shell.sidebar-collapsed .sidebar-reopen { display: none; }
  .main-content { padding-top: 32px; }
  .scheduler-workspace { grid-template-columns: 1fr; }
  .schedule-profile-rail { display: none; }
  .workspace-setup, .workspace-management-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .main-content { padding: 28px 20px 92px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric-card { min-height: 132px; padding: 17px; border-radius: 17px; }
  .workspace-grid, .workspace-actions { grid-template-columns: 1fr; }
  .upgrade-hero { align-items: stretch; flex-direction: column; padding: 22px; }
  .upgrade-hero-action { width: 100%; }
  .pricing-grid { grid-template-columns: 1fr; }
  .workflow-steps { grid-template-columns: 1fr; }
  .workflow-steps article { border-right: 0; border-bottom: 1px solid var(--border); }
  .workflow-steps article:last-child { border-bottom: 0; }
  .insight-stat-row, .roi-score { grid-template-columns: 1fr; }
  .bank-payment-grid { grid-template-columns: 1fr; }
  .bank-payment-qr { margin: 0 auto; }
  .analytics-metric-grid { grid-template-columns: 1fr 1fr; }
  .settings-panel, .queue-status-panel, .control-tower, .quick-publish { padding: 18px; border-radius: 18px; }
  .getting-started-card { gap: 22px; padding: 20px; border-radius: 18px; }
  .getting-started-intro h2 { font-size: 21px; }
  .schedule-header { align-items: stretch; flex-direction: column; }
  .schedule-header-actions, .create-post-button { width: 100%; }
  .schedule-alert { align-items: stretch; flex-direction: column; }
  .calendar-panel { padding: 12px; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .calendar-navigation { display: grid; grid-template-columns: 32px auto 32px; }
  .calendar-navigation h2 { grid-column: 1 / -1; grid-row: 1; margin: 0 0 4px; }
  .calendar-view-tabs { align-self: flex-start; }
  .calendar-filters { grid-template-columns: 1fr 1fr; }
  .calendar-filters label:first-of-type { grid-column: 1 / -1; }
  .content-calendar, .calendar-drag-hint { display: none; }
  .mobile-day-schedule { display: block; }
  .schedule-list-item { grid-template-columns: 64px 34px minmax(0, 1fr); }
  .schedule-list-item > .status-pill, .schedule-list-item > .schedule-job-actions { grid-column: 3; justify-self: start; }
  .post-modal { padding: 0; }
  .post-modal-dialog { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .post-modal-body { grid-template-columns: 1fr; }
  .post-modal-steps { display: flex; overflow-x: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .post-modal-steps span { flex: 0 0 auto; }
  .post-composer { padding: 18px; }
  .post-form-row, .inline-modal-upload { grid-template-columns: 1fr; }
  .inline-modal-upload span { grid-column: auto; }
  .mobile-nav { border-color: var(--border); background: rgba(255,255,255,.94); }
  .mobile-nav .mobile-primary > span { background: var(--primary); box-shadow: 0 7px 18px rgba(13,107,87,.24); }
  .topbar-upgrade { display: none; }
}

@media (max-width: 430px) {
  .analytics-metric-grid { grid-template-columns: 1fr; }
  .analytics-metric-grid article { min-height: 122px; }
}

@media (max-width: 420px) {
  .metrics-grid, .billing-grid { grid-template-columns: 1fr; }
  .admin-metrics, .admin-filter { grid-template-columns: 1fr; }
  .metric-card { min-height: auto; }
  .pipeline-grid { grid-template-columns: 1fr; }
}

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

/* Control tower table polish */
.check-col { width: 36px; text-align: center; }
.table-video-cell { display: flex; gap: 10px; align-items: center; min-width: 140px; }
.table-thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-muted); flex: 0 0 40px;
}
.table-thumb.placeholder {
  display: grid; place-items: center; color: var(--muted); font-size: 12px;
}
.premium-table th, .premium-table td { vertical-align: middle; }
.schedule-list-mobile-only { display: none; }

@media (max-width: 720px) {
  .control-tower .premium-table { display: none; }
  .schedule-list-mobile-only { display: grid !important; gap: 10px; }
  .schedule-list-mobile-only[hidden] { display: grid !important; }
  .activity-rail { order: 3; }
}

/* Multi TikTok accounts */
.channel-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.channel-account-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card, 12px);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.channel-account-head { display: flex; gap: 12px; align-items: flex-start; }
.channel-avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface-muted); flex: 0 0 48px;
}
.channel-avatar.placeholder {
  display: grid; place-items: center; font-weight: 800; color: var(--primary);
}
.channel-account-copy { min-width: 0; display: grid; gap: 2px; }
.channel-account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-account-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.account-picker {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px;
}
.account-picker label {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-muted); font-size: 12px; font-weight: 600; cursor: pointer;
}
.account-picker label:has(input:checked) {
  border-color: #aedbcf; background: var(--primary-soft); color: #075846;
}
.account-picker input { accent-color: var(--primary); }

/* Google OAuth */
.google-oauth-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  text-decoration: none;
  font-weight: 650;
}
.google-oauth-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  color: #4285f4;
  font-size: 13px;
  font-weight: 800;
}

/* Commercial legal and Zalo private-beta surfaces */
.checkbox-row {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500 !important;
}
.checkbox-row input { width: auto; margin-top: 4px; accent-color: var(--primary); }
.checkbox-row span { line-height: 1.55; }
.legal-page {
  width: min(920px, calc(100% - 32px));
  margin: 40px auto;
  display: grid;
  gap: 20px;
}
.legal-header, .legal-content {
  padding: clamp(22px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.legal-header { display: grid; gap: 14px; }
.legal-header h1 { margin: 4px 0 0; font-size: clamp(32px, 5vw, 52px); }
.legal-header p { margin: 0; max-width: 760px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.legal-content h2 { margin: 28px 0 8px; font-size: 20px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { margin: 0 0 12px; color: var(--text-secondary, #455468); line-height: 1.72; }
.legal-footer { display: flex; justify-content: center; gap: 20px; padding: 12px; }
.channel-account-card.status-error { border-color: #efb0a9; }
.channel-account-card.status-disconnected { opacity: .78; }

@media (max-width: 640px) {
  .legal-page { width: min(100% - 20px, 920px); margin: 16px auto 84px; }
  .legal-header, .legal-content { padding: 20px; border-radius: 14px; }
}
