/* Guild Feed app styles — cacheable static asset */

:root {
  --bg: #0c0c12;
  --sidebar: #101018;
  --panel: #16161f;
  --border: rgba(255,255,255,0.09);
  --text: #ececf1;
  --muted: #9b9ba8;
  --accent: #38bdf8;
  --accent2: #c084fc;
  --primary: #6366f1;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}
h1, h2, h3, .panel-title, .cal-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand { display: flex; gap: 0.85rem; align-items: flex-start; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: #0b1220 url('/static/icons/playtok-main.webp') center/cover no-repeat;
  display: block;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
  border: 1px solid rgba(255,255,255,0.2);
}
h1 { font-size: 1.15rem; margin: 0; }
h1 .grad {
  background: linear-gradient(120deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--muted); margin: 0.35rem 0 0; font-size: 0.8125rem; line-height: 1.45; }
.titlebar {
  margin: 0.45rem 0 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.titlebar .tagline {
  margin: 0;
  font-size: 0.79rem;
}
.playtok-app-btn {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(56,189,248,0.45);
  color: #b7f0ff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(56,189,248,0.12);
}
.playtok-app-btn:hover { background: rgba(56,189,248,0.2); }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: background 0.15s, color 0.15s;
}
.nav-badge {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.18rem 0.38rem;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.38);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item--active {
  background: rgba(99,102,241,0.18);
  color: var(--text);
  border: 1px solid rgba(99,102,241,0.35);
}
.nav-item--external .nav-external {
  font-size: 0.75rem;
  opacity: 0.55;
}
.sidebar-foot { margin: 0; font-size: 0.8rem; }
.sidebar-toggle-btn {
  display: none;
  margin: 0 auto 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover { background: rgba(99,102,241,0.22); }
.app-shell--studio-collapsed {
  grid-template-columns: 56px 1fr;
}
.app-shell--studio-collapsed .sidebar {
  padding: 0.75rem 0.35rem;
  align-items: center;
  gap: 0.65rem;
}
.app-shell--studio-collapsed .sidebar-brand {
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
}
.app-shell--studio-collapsed .sidebar-brand-text,
.app-shell--studio-collapsed .sidebar-nav,
.app-shell--studio-collapsed .sidebar-foot {
  display: none !important;
}
.app-shell--studio-collapsed .sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-shell--studio-collapsed.app-shell--studio-expanded {
  grid-template-columns: 260px 1fr;
}
.app-shell--studio-collapsed.app-shell--studio-expanded .sidebar {
  padding: 1.5rem 1rem;
  align-items: stretch;
}
.app-shell--studio-collapsed.app-shell--studio-expanded .sidebar-brand {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem;
}
.app-shell--studio-collapsed.app-shell--studio-expanded .sidebar-brand-text,
.app-shell--studio-collapsed.app-shell--studio-expanded .sidebar-nav,
.app-shell--studio-collapsed.app-shell--studio-expanded .sidebar-foot {
  display: block !important;
}
.app-shell--studio-collapsed.app-shell--studio-expanded .sidebar-nav {
  display: flex !important;
}
.main-area {
  padding: 1.75rem 2rem 3rem;
  overflow-x: auto;
  background: radial-gradient(ellipse 70% 40% at 80% 0%, rgba(56,189,248,0.06), transparent);
}
.main-topbar { display: flex; justify-content: flex-end; margin-bottom: 0.75rem; position: relative; z-index: 5; }
.topbar-user { position: relative; }
.topbar-user-btn {
  margin: 0;
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
}
.topbar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
}
.topbar-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 220px;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111827;
}
.flash-wrap:empty { display: none; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  max-width: 1100px;
}
.panel-title { font-size: 1.35rem; margin: 0 0 1.25rem; }
.studio-panel--full {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  max-width: none;
}
.studio-frame {
  display: block;
  width: 100%;
  flex: 1;
  min-height: calc(100vh - 4.5rem);
  border: none;
  border-radius: 0;
  background: #0a0a10;
}
.main-area--studio {
  padding: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}
.main-area--studio .main-topbar {
  padding: 0 1rem;
  margin-bottom: 0;
  flex-shrink: 0;
}
.panel-root--studio {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.panel-root--studio .flash-wrap:empty { display: none; }
.panel--calendar { max-width: none; }
.sub-title { font-size: 1rem; margin: 1.5rem 0 0.75rem; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { border: 1px solid var(--border); padding: 0.65rem 0.85rem; text-align: left; vertical-align: top; }
th { background: rgba(255,255,255,0.03); color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.platform-cell { display: inline-flex; align-items: center; gap: 0.45rem; }
.platform-cell img { width: 20px; height: 20px; border-radius: 5px; }
.connected { color: #4ade80; font-weight: 600; }
.not.connected { color: #fbbf24; font-weight: 600; }
.published { color: #4ade80; font-weight: 600; }
.draft { color: #fbbf24; }
.queued { color: var(--accent); }
.failed { color: #f87171; font-weight: 600; }
.ok {
  background: rgba(74,222,128,0.1);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(74,222,128,0.25);
  margin-bottom: 1rem;
}
.err { color: #f87171; }
td.ok { color: #4ade80; font-weight: 600; }
td.err { color: #f87171; font-weight: 600; }
td.hint { color: var(--muted); font-size: 0.88rem; }
.api-excerpt {
  font-size: 0.75rem; max-height: 6rem; overflow: auto;
  background: rgba(0,0,0,0.25); padding: 0.5rem; border-radius: 6px;
  margin: 0; white-space: pre-wrap; word-break: break-all;
}
.btn-secondary {
  display: inline-block; padding: 0.55rem 0.9rem; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.9rem;
}
.btn-secondary:hover { border-color: rgba(56,189,248,0.35); }
.platform-grid { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 1rem 0; }
.platform-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.9rem; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.9rem;
}
.platform-btn:hover { border-color: rgba(56,189,248,0.45); background: rgba(56,189,248,0.08); }
.platform-btn img { width: 22px; height: 22px; }
.channel-pick-grid {
  display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.35rem 0 0.5rem;
}
.channel-pick {
  position: relative; cursor: pointer; margin: 0;
}
.channel-pick input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.channel-pick-face {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 12px;
  border: 2px solid var(--border);
  background: rgba(255,255,255,0.04);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.channel-pick-face img { width: 28px; height: 28px; border-radius: 6px; }
.channel-pick input:checked + .channel-pick-face {
  border-color: rgba(56,189,248,0.85);
  background: rgba(56,189,248,0.12);
  box-shadow: 0 0 0 2px rgba(56,189,248,0.25);
}
.channel-pick input:focus-visible + .channel-pick-face {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.channel-pick:hover .channel-pick-face {
  border-color: rgba(56,189,248,0.45);
}
.post-form, form {
  background: rgba(0,0,0,0.15);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 560px;
}
label { display: block; margin: 0.85rem 0 0.35rem; font-weight: 500; font-size: 0.9rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; max-width: none; }
input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.9375rem;
}
button, .btn-primary {
  margin-top: 1rem;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
}
.btn-small { margin-top: 0.35rem; padding: 0.35rem 0.75rem; font-size: 0.8rem; }
button:hover { filter: brightness(1.06); }
.hint { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.hint code { font-size: 0.8rem; color: var(--accent); word-break: break-all; }
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}
.stat-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.stat-label { display: block; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { display: block; font-size: 1.35rem; font-weight: 700; margin-top: 0.25rem; }
.stats-hud {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.65rem 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(56,189,248,0.35);
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(56,189,248,0.1));
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  max-width: 1100px;
}
.stats-hud-score { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.stats-hud-grid { grid-column: 2; grid-row: 1; }
.stats-hud-link { grid-column: 3; grid-row: 1; align-self: center; }
.stats-hud-updated { grid-column: 1 / -1; grid-row: 2; }
.stats-hud-kicker {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600;
}
.stats-hud-value {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 2rem; font-weight: 800; line-height: 1.1;
  background: linear-gradient(120deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stats-hud-day { font-size: 0.78rem; color: var(--muted); }
.stats-hud-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 0.65rem;
}
.stats-hud-metric {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  text-align: center;
}
.stats-hud-metric-label {
  display: block; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); font-weight: 600;
}
.stats-hud-metric-value {
  display: block; font-size: 1.15rem; font-weight: 700; margin-top: 0.2rem;
}
.stats-hud-updated {
  margin: 0; font-size: 0.78rem; color: var(--muted);
}
.stats-hud-link {
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  white-space: nowrap; align-self: start;
}
@media (max-width: 900px) {
  .stats-hud {
    grid-template-columns: 1fr;
  }
  .stats-hud-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.info-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  vertical-align: baseline;
}
.info-btn:hover { color: #7dd3fc; }
.score-formula-pop {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  max-width: 520px;
}
.score-formula-pop[hidden] { display: none; }
.mono { font-family: ui-monospace, monospace; }
.gf-modal[hidden] { display: none; }
.gf-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}
.gf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(2px);
}
.gf-modal__card {
  position: relative;
  width: min(640px, calc(100vw - 2rem));
  margin: 8vh auto;
  background: linear-gradient(180deg, rgba(30,41,59,0.92), rgba(15,23,42,0.95));
  border: 1px solid rgba(56,189,248,0.35);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  padding: 1.25rem 1.25rem 1.1rem;
}
.gf-modal__title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}
.gf-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: #e5e7eb;
  font-size: 1.2rem;
  cursor: pointer;
}
.gf-formula-pill {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(56,189,248,0.35);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  margin: 0.55rem 0 0.6rem;
  line-height: 1.6;
}
.uri-list { margin: 0.5rem 0 1rem; padding-left: 1.2rem; }
a { color: var(--accent); }

/* Calendar */
.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 1rem;
}
.cal-title { margin: 0; font-size: 1.2rem; }
.cal-nav {
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.9rem;
  padding: 0.4rem 0.75rem; border-radius: 8px; border: 1px solid var(--border);
}
.cal-nav:hover { background: rgba(255,255,255,0.05); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; margin-bottom: 6px;
  font-size: 0.75rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  text-align: center;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day {
  min-height: 88px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem;
  text-align: left;
  cursor: default;
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cal-day--empty { background: transparent; border-color: transparent; }
.cal-day--today { border-color: rgba(56,189,248,0.5); box-shadow: inset 0 0 0 1px rgba(56,189,248,0.25); }
.cal-day--active { cursor: pointer; }
.cal-day--active:hover { border-color: var(--accent); background: rgba(56,189,248,0.08); }
.cal-day:disabled { opacity: 0.55; }
.cal-day-num { font-weight: 700; font-size: 0.95rem; }
.cal-day-num--sm { font-size: 0.8rem; }
.cal-badges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: auto; }
.cal-empty { font-size: 0.7rem; color: var(--muted); }
.cal-legend { margin-top: 1rem; }
.cal-view-tabs {
  display: flex; gap: 0.35rem; margin-bottom: 1rem;
  background: rgba(0,0,0,0.25); padding: 0.25rem; border-radius: 10px; width: fit-content;
}
.cal-tab {
  padding: 0.45rem 1rem; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-weight: 600; font-size: 0.875rem;
}
.cal-tab--active { background: var(--primary); color: #fff; }
.cal-grid--week .cal-day { min-height: 100px; }
.cal-day--dayview { min-height: 120px; width: 100%; max-width: 320px; }
.cal-day-view { margin: 1rem 0; }
.day-timeline { margin: 1rem 0 0; padding-left: 1.25rem; }
.day-timeline li { margin: 0.35rem 0; }
.status-tag { font-size: 0.75rem; color: var(--muted); margin-left: 0.35rem; }

/* WhatsApp-style icon + count badges */
.wa-badge-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.wa-badge {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
}
.wa-badge img { width: 22px; height: 22px; border-radius: 50%; display: block; }
.wa-count {
  position: absolute; top: -5px; right: -7px;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: #facc15; color: #111;
  font-size: 0.72rem; font-weight: 800; line-height: 22px;
  text-align: center; border-radius: 999px;
  border: 2px solid var(--panel);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* Connect channel cards */
.platform-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem; margin-top: 0.5rem;
}
.platform-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.platform-card:hover { border-color: rgba(56,189,248,0.45); background: rgba(56,189,248,0.06); }
.platform-card--connected {
  border-color: rgba(74,222,128,0.35);
  background: rgba(74,222,128,0.06);
  cursor: pointer;
}
.platform-card--connected:hover { border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.08); }
.platform-card-icon { position: relative; flex-shrink: 0; }
.platform-card-icon .tick {
  position: absolute; bottom: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #22c55e; color: #fff; font-size: 0.65rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--panel);
}
.platform-card-body { display: flex; flex-direction: column; gap: 0.22rem; flex: 1; min-width: 0; width: 100%; }
.platform-card-body strong { font-size: 1rem; }
.connected-label { color: #4ade80; font-size: 0.8rem; font-weight: 600; }
.connect-label { color: var(--accent); font-size: 0.8rem; font-weight: 600; }
.platform-card-meta { font-size: 0.85rem; color: var(--muted); }
.platform-card-date { font-size: 0.8rem; color: var(--muted); }
.platform-card-hint { font-size: 0.75rem; color: var(--muted); opacity: 0.85; margin-top: 0.25rem; }
.platform-card-action {
  margin-top: 0.3rem; padding: 0.35rem 0.65rem; font-size: 0.75rem;
  background: transparent; border: 1px solid rgba(248,113,113,0.4);
  color: #fca5a5; align-self: flex-start; flex-shrink: 0;
}
.platform-card-action:hover { background: rgba(248,113,113,0.15); filter: none; }
.platform-card-action--refresh {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(56,189,248,0.45);
  color: #7dd3fc;
}
.platform-card-action--refresh:hover {
  background: rgba(56,189,248,0.15);
  filter: none;
}
.tabs-row {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.tab-btn {
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.8rem;
  font-size: 0.83rem;
}
.tab-btn--active {
  background: rgba(99,102,241,0.25);
  color: #fff;
}

/* Modal — wide, horizontal columns */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); }
.modal-panel {
  position: relative; z-index: 1;
  width: min(960px, 96vw);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 1.15rem; }
.modal-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0.25rem 0.5rem; margin: 0;
}
.modal-body { padding: 1rem 1.25rem 1.25rem; overflow: hidden; }
.modal-columns {
  display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}
.modal-col {
  flex: 0 0 220px; min-width: 200px; max-height: 60vh;
  overflow-y: auto; scroll-snap-align: start;
  background: rgba(0,0,0,0.2); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.75rem;
}
.modal-col-head {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0 0.65rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 700;
}
.modal-col-head img { width: 24px; height: 24px; border-radius: 6px; }
.modal-post {
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 0.4rem;
  font-size: 0.85rem; line-height: 1.45;
}
.modal-post time {
  display: block; color: var(--accent); font-weight: 600;
  font-size: 0.8rem; margin-bottom: 0.2rem;
}
.modal-post .status {
  display: inline-block; font-size: 0.7rem; color: var(--muted);
  margin-top: 0.25rem; text-transform: capitalize;
}

/* Posting rules — edit modal */
.rules-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin: 0.75rem 0 1rem;
}
.rules-table .rule-row-actions {
  display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
  white-space: nowrap;
}
.rules-help {
  margin: 1rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.rules-help summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.rule-edit-modal .rule-edit-panel {
  width: min(720px, 96vw);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
}
.rule-edit-modal .rule-edit-body {
  overflow-y: auto;
  max-height: calc(92vh - 4.5rem);
  padding-bottom: 1.5rem;
}
.rule-form-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--panel);
  padding-bottom: 0.25rem;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
}

.panel-loading { opacity: 0.55; pointer-events: none; transition: opacity 0.15s; }

/* Public marketing landing (TikTok / OAuth website URL) */
.landing-body { background: var(--bg); }
.landing-header {
  border-bottom: 1px solid var(--border);
  background: rgba(16, 16, 24, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.landing-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.landing-brand .logo-mark { width: 36px; height: 36px; }
.landing-legal {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}
.landing-legal a {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 500;
}
.landing-legal a:hover { text-decoration: underline; }
.landing-legal--header a {
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(147, 197, 253, 0.25);
  background: rgba(99, 102, 241, 0.08);
}
.landing-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.landing-hero { text-align: center; padding: 2rem 1.5rem; }
.landing-hero h1 { font-size: 1.75rem; }
.landing-lead {
  font-size: 1.05rem;
  color: var(--text);
  margin: 0.75rem auto 0;
  max-width: 36rem;
}
.landing-intro {
  max-width: 40rem;
  margin: 1rem auto 0;
  text-align: left;
}
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.landing-card { margin: 0; }
.landing-offering { margin: 0; }
.landing-offerings {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}
.landing-foot {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  text-align: center;
}
.landing-foot .landing-legal { justify-content: center; margin-bottom: 0.5rem; }
