/*
 * SocialBurst — v2 design system (sage/green palette).
 * Extracted from app/static/v2.html prototype on 2026-05-23.
 *
 * Loaded by app/templates/v2/_base_v2.html. The legacy admin.css
 * (dark indigo) stays loaded only on legacy /admin/* pages — new
 * /app/* + /platform/admin/* pages use ONLY this file.
 */

:root {
  --sidebar-bg: #1E2A26;
  --sidebar-fg: #A8BCB3;
  --sidebar-fg-strong: #FFFFFF;
  --sidebar-muted: #5C7068;
  --ease-smooth: cubic-bezier(0.32, 0.72, 0.32, 1);
}

html, body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #F7F9F5;
  color: #1F1D2C;
  font-size: 14px;
  margin: 0;
  padding: 0;
}

h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 15px; font-weight: 600; }

/* nav */
.nav-item {
  color: var(--sidebar-fg);
  position: relative;
  transition: all 0.18s var(--ease-smooth);
  /* Explicit size + weight — don't rely on inherited text-sm because
     the dark sidebar makes 400-weight text feel thin/small. */
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: #fff;
  transform: translateX(2px);
}
.nav-item.active {
  background: rgba(79, 124, 108, 0.16);
  color: #9EBEA5;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: #9EBEA5;
  border-radius: 0 4px 4px 0;
}
.nav-item .ti {
  font-size: 17px;
}
.nav-section {
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 14px 6px;
}

/* Sidebar header / footer text sizes — make sure they don't shrink */
.app-sidebar .text-xs   { font-size: 12px; }
.app-sidebar .text-\[10px\] { font-size: 10px; }
.app-sidebar .text-\[9px\]  { font-size: 9px;  }

/* buttons */
.btn-primary {
  background: #4F7C6C;
  color: #fff;
  transition: all 0.18s var(--ease-smooth);
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover {
  background: #3D6053;
  box-shadow: 0 6px 16px -6px rgba(79,124,108,0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: #2D2B3F;
  border: 1px solid #E7E4DD;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
}
.btn-ghost:hover { background: #F3F1EC; }
/* Secondary = neutral solid button (was undefined → rendered as bare text). */
.btn-secondary {
  background: #F3F1EC;
  color: #2D2B3F;
  border: 1px solid #E7E4DD;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s var(--ease-smooth);
}
.btn-secondary:hover { background: #E7E4DD; }
.btn-secondary.is-danger { background: #FEF2F2; color: #B91C1C; border-color: #FCA5A5; }
.btn-secondary.is-danger:hover { background: #FEE2E2; }
/* Small size modifier for compact table/inline actions. */
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
button { transition: transform 0.12s ease; }
button:active { transform: scale(0.97); }
a, button { -webkit-tap-highlight-color: transparent; }

/* table */
table.app { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.app th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6A6882;
  padding: 10px 16px;
  background: #FBFAF7;
  border-bottom: 1px solid #E7E4DD;
}
table.app td { padding: 12px 16px; border-bottom: 1px solid #F3F1EC; vertical-align: middle; }
table.app tbody tr { transition: all 0.15s ease; }
table.app tr:hover td { background: #FBFAF7; }

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.badge-fb       { background: #E6F1FB; color: #0C447C; }
.badge-ig       { background: #FBEAF0; color: #72243E; }
.badge-yt       { background: #FCEBEB; color: #791F1F; }
.badge-active   { background: #D1FAE5; color: #065F46; }
.badge-paused   { background: #FEF3C7; color: #78350F; }
.badge-failed   { background: #FEE2E2; color: #991B1B; }
.badge-brand    { background: #ECF3EE; color: #2B463D; }
.badge-info     { background: #DBEAFE; color: #1E40AF; }
.badge-neutral  { background: #F3F1EC; color: #5B5970; }
.badge-success  { background: #D1FAE5; color: #065F46; }
.badge-warning  { background: #FEF3C7; color: #78350F; }
.badge-error    { background: #FEE2E2; color: #991B1B; }

/* card */
.card {
  background: #fff;
  border: 1px solid #E7E4DD;
  border-radius: 12px;
  transition: all 0.22s var(--ease-smooth);
}
.card-hover:hover {
  border-color: #9EBEA5;
  box-shadow: 0 8px 24px -10px rgba(79,124,108,0.18);
  transform: translateY(-2px);
}

/* input */
.input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #E7E4DD;
  border-radius: 8px;
  background: #fff;
  transition: all 0.15s ease;
}
.input:hover { border-color: #C7C4B8; }
.input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79,124,108,0.18);
  border-color: #4F7C6C;
}

/* usage bar */
.usage-bar {
  height: 6px;
  background: #F3F1EC;
  border-radius: 999px;
  overflow: hidden;
}
.usage-bar > div {
  height: 100%;
  width: calc(var(--pct, 0) * 1%);
  background: #4F7C6C;
  border-radius: 999px;
  transition: width 0.6s var(--ease-smooth);
}
.usage-bar.warning > div { background: #F59E0B; }
.usage-bar.danger > div  { background: #EF4444; }
.usage-bar.is-unlimited > div { width: 8%; }

/* Text utility shortcuts mapping to our token names */
.text-good-500 { color: #10B981; }
.text-good-600 { color: #059669; }
.text-good-700 { color: #047857; }
.text-ink-400  { color: #6A6882; }
.text-ink-500  { color: #5B5970; }
.text-ink-700  { color: #2D2B3F; }
.text-ink-900  { color: #1F1D2C; }
.text-brand-500 { color: #4F7C6C; }
.text-brand-600 { color: #3D6053; }
.text-red-500  { color: #EF4444; }
.text-red-600  { color: #DC2626; }

/* "unlimited" badge text used in usage meters */
.unlimited-tag { color: #10B981; font-weight: 600; }

/* Check / cross icons in feature checklists */
.icon-yes { color: #10B981; }
.icon-no  { color: #C7C4B8; }

/* Generic width utilities the templates use */
.w-12 { width: 50px; }
.w-40 { max-width: 160px; }
.opacity-60 { opacity: 0.6; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }

/* topbar */
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #E7E4DD;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* shell */
.app-shell {
  display: flex;
  min-height: 100vh;
  /* Don't clip — sticky needs to escape its scroll-container */
  align-items: flex-start;
}
.app-sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  /* Pin to viewport so long pages don't push the logout button off-screen.
     align-self is essential: a flex item only stretches by default, which
     overrides the explicit height. */
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  flex-shrink: 0;
}
.app-sidebar > nav {
  /* The middle <nav> is the scroll surface — header + footer (sign-out)
     stay anchored top/bottom of the sidebar viewport. */
  overflow-y: auto;
}
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #FBFAF7;
  min-width: 0;
}
/* Base content gutters — MUST sit before the @media blocks below so the mobile
   overrides (later in source) actually win (they didn't before → dead code). */
.app-content {
  flex: 1;
  padding: 32px;
  overflow-x: hidden;
}

/* Skip-to-content link — visually hidden until keyboard focus, then slides in.
   Lets keyboard/screen-reader users jump past the ~25 sidebar tab stops. */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--sidebar-bg, #1E2A26); color: #fff;
  padding: 8px 14px; border-radius: 8px; text-decoration: none;
  font-size: 13px; transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }
.app-main:focus { outline: none; }

/* Mobile nav controls — hidden on desktop. */
.nav-hamburger, .nav-backdrop { display: none; }

/* ── Mobile (<=820px): the fixed 240px sidebar made the app unusable on a phone.
   Turn it into an off-canvas DRAWER toggled by the hamburger (pure CSS via the
   #nav-toggle checkbox); the sidebar keeps its normal vertical layout and slides
   in over a backdrop, while the main content goes full-width. ──────────────── */
@media (max-width: 820px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: -284px;               /* off-canvas until toggled */
    width: 264px;
    height: 100vh;
    z-index: 65;
    transition: left 0.25s ease;
    box-shadow: 2px 0 18px rgba(0, 0, 0, 0.28);
  }
  .nav-toggle-cb:checked ~ .app-shell .app-sidebar { left: 0; }

  .nav-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 70;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--sidebar-bg, #1E2A26);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  }
  .nav-toggle-cb:checked ~ .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.42);
  }
  /* Keep the page header/topbar clear of the floating hamburger, and stop the
     fixed-width search input (w-80 = 320px) from overflowing the viewport. */
  .topbar { padding-left: 56px; padding-right: 14px; }
  .topbar .topbar-search { flex: 1 1 auto; min-width: 0; }
  .topbar-search-input { width: 100% !important; }
  /* Roomier content + collapse NON-responsive Tailwind grids (grid-cols-3/4 with
     no sm:/md: prefix) so KPI + card rows don't stay 3-4 wide and cramped on a
     phone. (md:grid-cols-* responsive grids are untouched — different class.) */
  .app-content { padding: 16px; }
  .grid-cols-4, .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* Wide tables scroll horizontally inside their card instead of being clipped
     by .app-content overflow-x:hidden — right columns (Status/Actions) were
     unreachable. Direct-child selector skips tables already in an
     .overflow-x-auto wrapper (e.g. schedules), avoiding double scrollbars. */
  .card > table.app { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Tab strips scroll instead of clipping when wider than the screen. */
  .tabs-row { overflow-x: auto; gap: 16px; -webkit-overflow-scrolling: touch; }
  .tabs-row::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; white-space: nowrap; }
  /* Column spans overflow a collapsed 1-2 col grid on mobile — neutralise. */
  .col-span-2, .col-span-3 { grid-column: auto !important; }
  /* Search dropdown full-width so it doesn't run past the right edge. */
  .topbar-search-dropdown { width: 100% !important; min-width: 0; }
}

@media (max-width: 480px) {
  .app-content { padding: 12px; }
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr !important; }
  .topbar-search { display: none; }   /* reclaim room on the smallest phones */
}

/* Red-themed KPI card variant (used for the "Errors today" card) */
.card.is-error {
  border-color: #FECACA;
  background: rgba(254, 242, 242, 0.5);
}
.card.is-error .kpi-label { color: #B91C1C; }
.card.is-error .kpi-value { color: #7F1D1D; }
.card.is-error .kpi-link  { color: #B91C1C; }
.card.is-error .kpi-link:hover { text-decoration: underline; }

/* Pulse dot — animated dot indicating live/active */
.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.45);
  animation: pulseRing 1.6s ease-out infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.0); opacity: 0; }
}

/* KPI card sub-parts (replaces ad-hoc Tailwind utilities so the
   card has a stable internal structure). */
.kpi-label { font-size: 11px; color: #5B5970; }
.kpi-value { font-size: 30px; font-weight: 600; line-height: 1.1; margin-top: 8px; color: #1F1D2C; }
.kpi-meta  { font-size: 11px; color: #6A6882; margin-top: 4px; }
.kpi-trend-up   { color: #059669; font-weight: 500; }
.kpi-trend-down { color: #DC2626; font-weight: 500; }
.kpi-link a     { color: #4F7C6C; font-weight: 500; }
.kpi-link a:hover { text-decoration: underline; }

/* Schedule list row (used on dashboard + page-detail Overview tab) */
.sched-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}
.sched-row:hover { background: #FBFAF7; }
.sched-row .sched-time { font-weight: 500; font-size: 13px; min-width: 56px; }
.sched-row .sched-name { font-size: 13px; flex: 1; }
.sched-row .sched-persona { font-size: 11px; color: #5B5970; min-width: 96px; text-align: right; }

/* shimmer skeleton */
.skeleton {
  background: linear-gradient(90deg, #F3F1EC 0%, #E7E4DD 50%, #F3F1EC 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* status dots — for inline use in table rows, badges, etc. */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C7C4B8;
}
.status-dot.is-active   { background: #10B981; }
.status-dot.is-paused   { background: #F59E0B; }
.status-dot.is-failed   { background: #EF4444; }
.status-dot.is-inactive { background: #C7C4B8; }

/* Tab nav (used on page detail) */
.tabs-row {
  border-bottom: 1px solid #E7E4DD;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.tab {
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 500;
  color: #6A6882;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}
.tab:hover { color: #1F1D2C; }
.tab.is-active { color: #1F1D2C; border-bottom-color: #4F7C6C; }
/* Keyboard focus ring for click-target controls that aren't native inputs
   (tabs are onclick <div>s that get tabindex from JS; ditto clickable rows).
   :focus-visible only — invisible to mouse/touch users. */
.tab:focus-visible,
.toggle-btn:focus-visible,
tr[tabindex]:focus-visible,
.card-hover[tabindex]:focus-visible {
  outline: 2px solid #4F7C6C;
  outline-offset: 2px;
}

/* Clickable table row */
.row-clickable { cursor: pointer; }

/* Card link — for the persona card / page row use case where the
   whole card is a link but should not look like one */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Danger-flavored ghost button (for "Revoke", "Delete") */
.btn-ghost.is-danger { color: #EF4444; border-color: #FCA5A5; }
.btn-ghost.is-danger:hover { background: #FEF2F2; }

/* Channel brand colors (for icons next to channel name in Connections) */
.text-fb { color: #0866FF; }
.text-ig { color: #E1306C; }
.text-yt { color: #FF0000; }

/* Small monospace inline label (used for time codes, slugs, keys) */
.mono-sm {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #5B5970;
}

/* Sidebar small badge — for "PLATFORM ADMIN" sub-tag */
.sidebar-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Filter chip — pill button used in quick filter bars (pages, schedules) */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #E7E4DD;
  background: #fff;
  color: #2D2B3F;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s var(--ease-smooth);
  white-space: nowrap;
}
.filter-chip:hover { border-color: #9EBEA5; background: #FBFAF7; }
.filter-chip.is-on { background: #ECF3EE; border-color: #9EBEA5; color: #2B463D; }
.filter-chip .count {
  font-size: 11px;
  color: #6A6882;
  background: #F3F1EC;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
}
.filter-chip.is-on .count { background: #9EBEA5; color: #2B463D; }

/* Segmented view-mode toggle (Table / Grid / Kanban) */
.view-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #E7E4DD;
  border-radius: 8px;
  padding: 4px;
  background: #fff;
}
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #6A6882;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.view-toggle:hover { color: #2D2B3F; }
.view-toggle.is-active { background: #F3F1EC; color: #1F1D2C; }

/* Inline keyboard hint inside a search input (⌘K) */
.kbd-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  background: #FBFAF7;
  border: 1px solid #E7E4DD;
  padding: 1px 6px;
  border-radius: 4px;
  color: #6A6882;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Post-thumbnail tile inside the page-detail Recent posts panel */
.thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #F3F1EC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C7C4B8;
  font-size: 20px;
  flex-shrink: 0;
}

/* 2-line text clamp (used for caption snippets) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Interactive dual-handle range slider — two overlaid native range
   inputs, sharing a visual track. The native inputs' built-in thumbs
   are kept (pointer-events:auto), but their tracks are hidden so only
   one shared track is rendered. */
.dual-slider {
  position: relative;
  height: 28px;
  margin: 6px 0 4px;
}
.dual-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  background: #F3F1EC;
  border-radius: 999px;
  transform: translateY(-50%);
  pointer-events: none;
}
.dual-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  right: 0%;
  background: #9EBEA5;
  border-radius: 999px;
}
.dual-input {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}
.dual-input::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #4F7C6C;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  cursor: pointer;
  pointer-events: auto;
}
.dual-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #4F7C6C;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  cursor: pointer;
  pointer-events: auto;
}
.dual-input::-webkit-slider-runnable-track,
.dual-input::-moz-range-track { background: transparent; border: 0; }

/* Tag chip (real, in the advanced panel) — wraps a hidden checkbox.
   When the checkbox is checked the surrounding .filter-chip gets .is-on. */
.tag-chip-wrap { cursor: pointer; }
.tag-chip { user-select: none; }
.tag-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Settings tab — section + label + toggle helpers ──────────────── */
.settings-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.settings-section-head h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1F1D2C;
  margin: 0;
}
.settings-section-head .ti {
  font-size: 16px;
  color: #4F7C6C;
}
.settings-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5B5970;
  margin-bottom: 6px;
}
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid #E7E4DD;
  border-radius: 8px;
  background: #FBFAF7;
  font-size: 13px;
  color: #2D2B3F;
  width: 100%;
}
.toggle-row:hover { border-color: #9EBEA5; }
.toggle-row input[type="checkbox"] { width: 16px; height: 16px; }

/* Current-folder summary card inside Folder Mapping section */
.folder-current {
  border: 1px solid #C7DCCC;
  background: #ECF3EE;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.folder-current-head {
  font-size: 11px;
  font-weight: 600;
  color: #2B463D;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.folder-current dl {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 4px 12px;
  font-size: 12px;
  margin: 0;
}
.folder-current dt { color: #5B5970; }
.folder-current dd { margin: 0; color: #1F1D2C; }

/* Reusable confirm modal — kicks in via <form data-confirm="…">.
   Replaces the native browser confirm() so destructive actions match
   the v2 design system. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 29, 44, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFade 0.16s ease-out;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: #fff;
  border: 1px solid #E7E4DD;
  border-radius: 14px;
  box-shadow: 0 20px 50px -16px rgba(31, 29, 44, 0.30);
  width: 100%;
  max-width: 440px;
  padding: 24px 24px 20px;
  text-align: left;
  animation: modalRise 0.18s ease-out;
}
.modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FEF3C7;
  color: #B45309;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.modal-icon > .ti { font-size: 20px; }
.modal-card.is-danger .modal-icon { background: #FEE2E2; color: #B91C1C; }
.modal-title { font-size: 16px; font-weight: 600; color: #1F1D2C; margin: 0 0 6px; }
.modal-body  { font-size: 13px; color: #5B5970; margin: 0 0 18px; line-height: 1.45; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-card.is-danger .modal-confirm-btn {
  background: #DC2626;
}
.modal-card.is-danger .modal-confirm-btn:hover {
  background: #B91C1C;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalRise { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Schedules tab — inner sub-tabs (Page schedules / Text background) */
.sched-subtabs {
  display: inline-flex;
  background: #F3F1EC;
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}
.sched-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #5B5970;
  border-radius: 7px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.sched-subtab:hover { color: #2D2B3F; }
.sched-subtab.is-active { background: #fff; color: #1F1D2C; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.sched-subtab .count {
  font-size: 11px;
  color: #6A6882;
  background: #fff;
  border: 1px solid #E7E4DD;
  padding: 0 6px;
  border-radius: 999px;
  font-weight: 500;
  line-height: 1.5;
}
.sched-subtab.is-active .count { background: #ECF3EE; border-color: #C7D8C9; color: #2B463D; }

/* Big "10:00" time pill rendered next to each page-schedule row */
.sched-time-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  background: #ECF3EE;
  color: #2B463D;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  min-width: 110px;
}
.sched-time-pill > .ti { font-size: 16px; }

/* Searchable multi-select dropdown — used for FB apps / folders / any
   list that grows beyond ~10 items (chip rows become unusable past that).
   No library; the JS lives in v2-app.js. */
.multi-search { position: relative; width: 100%; }
.multi-search-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #E7E4DD;
  border-radius: 8px;
  font-size: 13px;
  color: #2D2B3F;
  cursor: pointer;
  text-align: left;
  min-height: 38px;
}
.multi-search-trigger:hover { border-color: #C7C4B8; }
.multi-search.is-open .multi-search-trigger {
  border-color: #4F7C6C;
  box-shadow: 0 0 0 3px rgba(79, 124, 108, 0.18);
}
.multi-search-chips {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.multi-search-placeholder { color: #6A6882; font-weight: 400; }
.multi-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  background: #ECF3EE;
  color: #2B463D;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  max-width: 180px;
}
.multi-search-pill > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-search-pill .ti-x {
  font-size: 11px;
  cursor: pointer;
  opacity: 0.7;
}
.multi-search-pill .ti-x:hover { opacity: 1; }
.multi-search-trigger > .ti-chevron-down {
  font-size: 14px;
  color: #6A6882;
  transition: transform 0.18s ease;
}
.multi-search.is-open .multi-search-trigger > .ti-chevron-down { transform: rotate(180deg); }

.multi-search-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #E7E4DD;
  border-radius: 10px;
  box-shadow: 0 12px 28px -10px rgba(31, 29, 44, 0.18);
  z-index: 50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 320px;
}
.multi-search-search-wrap {
  position: relative;
  padding: 10px;
  border-bottom: 1px solid #F3F1EC;
}
.multi-search-search-wrap > .ti-search {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #6A6882;
  font-size: 14px;
}
.multi-search-input {
  width: 100%;
  padding: 6px 8px 6px 30px;
  border: 1px solid #E7E4DD;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.multi-search-input:focus {
  border-color: #4F7C6C;
  box-shadow: 0 0 0 2px rgba(79, 124, 108, 0.18);
}
.multi-search-options {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}
.multi-search-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: #2D2B3F;
}
.multi-search-option:hover { background: #FBFAF7; }
.multi-search-option > input[type="checkbox"] { accent-color: #4F7C6C; }
.multi-search-option > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-search-option .count {
  font-size: 11px;
  color: #6A6882;
  background: #F3F1EC;
  padding: 1px 7px;
  border-radius: 999px;
}
.multi-search-option.is-hidden { display: none; }
.multi-search-empty {
  padding: 16px 10px;
  text-align: center;
  font-size: 12px;
  color: #6A6882;
}
.multi-search-footer {
  border-top: 1px solid #F3F1EC;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #FBFAF7;
}
.multi-search-footer button { font-size: 12px; padding: 4px 8px; }

/* ── Connections page — top channel cards ────────────────────────── */
.conn-card {
  border-left: 3px solid #E7E4DD;   /* default: silent */
  transition: border-color 0.18s var(--ease-smooth);
}
.conn-card-ok    { border-left-color: #10B981; }
.conn-card-warn  { border-left-color: #F59E0B; background: #FEFCE8; }
.conn-card-bad   { border-left-color: #DC2626; background: #FEF2F2; }
.conn-card-empty { border-left-color: #C7C4B8; }

/* Square channel-icon badge (top card) */
.conn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.conn-icon-facebook   { background: #E6F1FB; }
.conn-icon-instagram  { background: #FBEAF0; }
.conn-icon-youtube    { background: #FCEBEB; }
.conn-icon-google     { background: #ECF3EE; }
.conn-icon-permission { background: #D1FAE5; }

/* Smaller version used inside the All-connections table rows */
.conn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.conn-icon-sm.conn-icon-facebook   { background: #E6F1FB; }
.conn-icon-sm.conn-icon-instagram  { background: #FBEAF0; }
.conn-icon-sm.conn-icon-youtube    { background: #FCEBEB; }

/* ── Page detail — Uploads tab ───────────────────────────────────── */
/* Tab pill with a count badge (Uploads tab uses this to surface "12") */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ECF3EE;
  color: #2B463D;
  margin-left: 4px;
}
.tab.is-active .tab-count { background: #4F7C6C; color: #fff; }

/* Per-row upload progress bar (similar to .usage-bar but driven by
   data-pct on the wrapper so we don't need inline width). */
.upload-bar {
  height: 6px;
  background: #F3F1EC;
  border-radius: 999px;
  overflow: hidden;
}
.upload-bar > div {
  height: 100%;
  width: 0%;
  background: #4F7C6C;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.32, 0.72, 0.32, 1);
}
.upload-bar[data-status="completed"] > div { background: #10B981; }
.upload-bar[data-status="uploading"] > div { background: #3B82F6; }
.upload-bar[data-status="failed"]    > div { background: #EF4444; }
.upload-bar[data-status="pending"]   > div { background: #C7C4B8; }

/* ── Pages list — Kanban view ─────────────────────────────────────── */
.kanban-col {
  background: #FBFAF7;
  border: 1px solid #E7E4DD;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: calc(100vh - 320px);
}
.kanban-col-head {
  padding: 10px 12px;
  border-bottom: 1px solid #E7E4DD;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 12px 12px 0 0;
}
.kanban-count {
  margin-left: auto;
  font-size: 11px;
  color: #6A6882;
  background: #F3F1EC;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kanban-card {
  display: block;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #E7E4DD;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s var(--ease-smooth);
}
.kanban-card:hover {
  border-color: #9EBEA5;
  box-shadow: 0 4px 12px -6px rgba(79, 124, 108, 0.18);
  transform: translateY(-1px);
}
.kanban-empty {
  text-align: center;
  font-size: 11px;
  color: #6A6882;
  padding: 16px 8px;
  font-style: italic;
}

/* Inline tag pill — shown next to a page name in the table */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  color: #2D2B3F;
  background: #FBFAF7;
  border: 1px solid #E7E4DD;
}

/* ═══════════════════════════════════════════════════════════════════════
   BILLING UI — Foundation utilities (APPEND ONLY).
   Tokens reused from above: brand #4F7C6C, amber #F59E0B, red #EF4444,
   ink #1F1D2C/#5B5970/#6A6882, surface #FBFAF7/#F3F1EC, border #E7E4DD,
   --ease-smooth. Note: .card-hover and .skeleton already exist above and
   are reused as-is (not redefined here).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Billing sub-nav (pill/tab bar) ─────────────────────────────────── */
.bill-subnav {
  /* horizontal scroll on mobile, hidden scrollbar */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bill-subnav::-webkit-scrollbar { display: none; }
.bill-subnav-list {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: #F3F1EC;
  border-radius: 12px;
  min-width: max-content;
}
.bill-subnav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #5B5970;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.16s var(--ease-smooth);
}
.bill-subnav-pill .ti { font-size: 16px; }
.bill-subnav-pill:hover { color: #1F1D2C; background: rgba(255,255,255,0.55); }
.bill-subnav-pill.is-active {
  background: #fff;
  color: #1F1D2C;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.bill-subnav-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79,124,108,0.30);
}

/* ── Usage meter (usage_meter macro) ─────────────────────────────────── */
.meter { margin-bottom: 18px; }
.meter:last-child { margin-bottom: 0; }
.meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.meter-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #2D2B3F;
}
.meter-label .ti { font-size: 16px; color: #6A6882; }
.meter-value { font-size: 13px; font-weight: 500; color: #1F1D2C; white-space: nowrap; }
.meter-value .meter-sep,
.meter-value .meter-limit { color: #6A6882; font-weight: 400; }
.meter-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #6A6882;
  margin: 6px 0 0;
}
.meter-note .ti { font-size: 13px; }
.meter-note.is-warn { color: #B45309; }
.meter-note.is-over { color: #B91C1C; }

/* progress-bar fill variants — reuse the existing .usage-bar wrapper */
.usage-bar.meter-ok   > div { background: #4F7C6C; }
.usage-bar.meter-warn > div { background: #F59E0B; }
.usage-bar.meter-over > div { background: #EF4444; }
/* Unlimited metrics render NO bar (the ∞ tag carries the meaning) — a filled
   bar reads as "maxed out", the opposite of unlimited. Any residual
   .is-unlimited bar collapses to nothing rather than a full green fill. */
.usage-bar.is-unlimited { display: none; }

/* Danger primary — destructive actions (Delete workspace, disable 2FA). Was
   referenced (`btn-primary is-danger`) but never defined → rendered as a normal
   green/unstyled button, hiding that the action is destructive. */
.btn-primary.is-danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.btn-primary.is-danger:hover { background: #B91C1C; border-color: #B91C1C; }

/* ── Empty state (empty_state macro) ─────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}
.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ECF3EE;
  color: #4F7C6C;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.empty-state-icon .ti { font-size: 26px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: #1F1D2C; margin: 0; }
.empty-state-body {
  font-size: 13px;
  color: #6A6882;
  margin: 6px 0 0;
  max-width: 340px;
  line-height: 1.5;
}
.empty-state-cta { margin-top: 18px; }

/* ── Timeline (timeline macro) ───────────────────────────────────────── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 22px;
}
.timeline-item:last-child { padding-bottom: 0; }
/* connector line — runs through the dots, stops at last node */
.timeline-item::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: -4px;
  width: 2px;
  background: #E7E4DD;
}
.timeline-item:last-child::before { display: none; }
.timeline-node {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F3F1EC;
  color: #5B5970;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #E7E4DD;
}
.timeline-node .ti { font-size: 15px; }
.timeline-node.tl-success { background: #D1FAE5; color: #065F46; box-shadow: 0 0 0 1px #A7F3D0; }
.timeline-node.tl-warning { background: #FEF3C7; color: #78350F; box-shadow: 0 0 0 1px #FDE68A; }
.timeline-node.tl-error   { background: #FEE2E2; color: #991B1B; box-shadow: 0 0 0 1px #FECACA; }
.timeline-node.tl-info    { background: #DBEAFE; color: #1E40AF; box-shadow: 0 0 0 1px #BFDBFE; }
.timeline-node.tl-neutral { background: #F3F1EC; color: #5B5970; box-shadow: 0 0 0 1px #E7E4DD; }
.timeline-body { padding-top: 3px; }
.timeline-title { font-size: 13px; font-weight: 500; color: #1F1D2C; margin: 0; }
.timeline-when { font-size: 11px; color: #6A6882; margin: 2px 0 0; }

/* ── Activity feed item (activity_item macro) ────────────────────────── */
.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F3F1EC;
}
.activity-row:last-child { border-bottom: none; }
.activity-chip {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F3F1EC;
  color: #5B5970;
}
.activity-chip .ti { font-size: 16px; }
.activity-chip.chip-success { background: #D1FAE5; color: #065F46; }
.activity-chip.chip-warning { background: #FEF3C7; color: #78350F; }
.activity-chip.chip-error   { background: #FEE2E2; color: #991B1B; }
.activity-chip.chip-info    { background: #DBEAFE; color: #1E40AF; }
.activity-chip.chip-neutral { background: #F3F1EC; color: #5B5970; }
.activity-main { min-width: 0; flex: 1; }
.activity-title { font-size: 13px; font-weight: 500; color: #1F1D2C; margin: 0; }
.activity-when { font-size: 11px; color: #6A6882; margin: 2px 0 0; }

/* ── Locked feature (locked_feature macro) ───────────────────────────── */
.locked-feature {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #FBFAF7;
}
.locked-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #F3F1EC;
  color: #6A6882;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.locked-icon .ti { font-size: 20px; }
.locked-body { flex: 1; min-width: 0; }
.locked-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1F1D2C;
  margin: 0;
}
.locked-plan { flex-shrink: 0; }
.locked-sub { font-size: 12px; color: #6A6882; margin: 4px 0 0; }
.locked-cta { flex-shrink: 0; }

/* ── Confetti (upgrade-success delight) ──────────────────────────────── */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2000;
}
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall 2.6s var(--ease-smooth) forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-12px) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(102vh) rotate(720deg); opacity: 0; }
}

/* Respect reduced-motion for the celebratory + shimmer animations */
@media (prefers-reduced-motion: reduce) {
  .confetti-piece { animation: none; display: none; }
  .card-hover:hover { transform: none; }
  /* Static green dot stays; only the expanding halo ring is dropped. */
  .pulse-dot::after { animation: none; display: none; }
  /* Skeleton keeps its flat placeholder look without the shimmer sweep. */
  .skeleton { animation: none; }
}

/* Mobile: stack meter head + widen touch targets */
@media (max-width: 640px) {
  .locked-feature { flex-direction: column; align-items: flex-start; }
  .locked-cta { width: 100%; justify-content: center; }
  .bill-subnav-pill { padding: 9px 16px; }
}

/* ── Billing dashboard / overview (bill-*) ─────────────────────────── */
.bill-hero { padding: 24px 26px; }
.bill-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.bill-hero-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6A6882; font-weight: 600; margin-bottom: 6px; }
.bill-hero-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bill-hero-plan { font-size: 22px; font-weight: 600; color: #1F1D2C; margin: 0; }
.bill-hero-price { text-align: right; white-space: nowrap; }
.bill-hero-amount { font-size: 26px; font-weight: 700; color: #1F1D2C; }
.bill-hero-period { font-size: 13px; color: #6A6882; }
.bill-hero-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 22px 0 0; padding-top: 20px; border-top: 1px solid #ECEBF0; }
.bill-hero-meta-item dt { font-size: 12px; color: #6A6882; display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.bill-hero-meta-item dd { margin: 0; font-size: 15px; font-weight: 600; color: #1F1D2C; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bill-hero-meta-when { font-size: 12px; color: #6A6882; font-weight: 400; }
.bill-hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.bill-hero-free { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.bill-hero-free-main { display: flex; gap: 16px; align-items: flex-start; }
.bill-hero-free-icon { width: 46px; height: 46px; border-radius: 13px; background: #ECF3EE; color: #4F7C6C; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.bill-hero-free-sub { font-size: 14px; color: #6A6882; margin-top: 4px; max-width: 54ch; line-height: 1.55; }
.bill-cancel-note { font-size: 13px; color: #5B5970; display: flex; align-items: flex-start; gap: 8px; line-height: 1.55; flex-basis: 100%; max-width: 640px; }
.bill-cancel-note i { margin-top: 2px; flex-shrink: 0; color: #B45309; font-size: 15px; }
.bill-cancel-note strong { color: #1F1D2C; font-weight: 600; }
.bill-cancel-btn { color: #B91C1C !important; }

.bill-alert { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; margin-bottom: 20px; background: #FFFBEB; border: 1px solid #FDE68A; }
.bill-alert-icon { width: 38px; height: 38px; border-radius: 10px; background: #FEF3C7; color: #B45309; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.bill-alert-body { flex: 1; min-width: 180px; }
.bill-alert-title { font-weight: 600; color: #1F1D2C; }
.bill-alert-sub { font-size: 13px; color: #6A6882; margin-top: 2px; }
.bill-alert-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bill-alert-danger { background: #FEF2F2; border-color: #FECACA; }
.bill-alert-danger .bill-alert-icon { background: #FEE2E2; color: #B91C1C; }

.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 860px) { .bill-grid { grid-template-columns: 1fr; } }
.bill-panel { padding: 0; overflow: hidden; margin-top: 20px; }
.bill-grid > .bill-panel { margin-top: 0; }
.bill-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #ECEBF0; }
.bill-panel-title { font-size: 14px; font-weight: 600; color: #1F1D2C; display: flex; align-items: center; gap: 8px; margin: 0; }
.bill-panel-title .ti { color: #6A6882; }
.bill-panel-link { font-size: 13px; color: #4F7C6C; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; text-decoration: none; white-space: nowrap; }
.bill-panel-link:hover { text-decoration: underline; }
.bill-panel-body { padding: 20px; }
.bill-panel-body-flush { padding: 0; }
.bill-usage-grid { display: grid; gap: 4px; }

.bill-invoice-list { list-style: none; margin: 0; padding: 0; }
.bill-invoice-row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid #F2F1F6; }
.bill-invoice-row:last-child { border-bottom: 0; }
.bill-invoice-icon { width: 34px; height: 34px; border-radius: 9px; background: #F5F4F8; color: #6A6882; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bill-invoice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bill-invoice-number { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: #1F1D2C; font-weight: 500; }
.bill-invoice-date { font-size: 12px; color: #6A6882; }
.bill-invoice-amount { font-weight: 600; color: #1F1D2C; white-space: nowrap; }
.bill-invoice-dl { font-size: 13px; white-space: nowrap; gap: 5px; }

.bill-js-status { margin-top: 16px; font-size: 13px; color: #4F7C6C; }
.bill-js-status.is-error { color: #B91C1C; }
.bill-js-status.is-info { color: #4F7C6C; }

@media (max-width: 640px) {
  .bill-hero-price { text-align: left; }
  .bill-invoice-row { flex-wrap: wrap; }
  .bill-invoice-amount { margin-left: 48px; }
}

/* Managed-billing (manual mode) panel — shown to tenants whose billing is
   handled by staff, in place of self-serve checkout/upgrade/cancel controls. */
.managed-billing { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; background: #F6F8F7; border: 1px solid #DDE7E2; }
.managed-billing-icon { width: 40px; height: 40px; border-radius: 10px; background: #ECF3EE; color: #4F7C6C; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 20px; }
.managed-billing-body { flex: 1; min-width: 0; }
.managed-billing-title { font-size: 14px; font-weight: 600; color: #1F1D2C; margin: 0 0 3px; }
.managed-billing-sub { font-size: 13px; color: #5B5970; line-height: 1.55; margin: 0; max-width: 60ch; }
.managed-billing-cta { flex-shrink: 0; white-space: nowrap; gap: 6px; }
@media (max-width: 640px) {
  .managed-billing { flex-wrap: wrap; }
  .managed-billing-cta { margin-left: 54px; }
}

/* Alert banners — .alert / .alert-warning were referenced (viral report parse
   warnings) but never defined, so they rendered as unstyled text. */
.alert { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px;
  border-radius: 8px; border: 1px solid #E7E4DD; background: #FBFAF7; }
.alert-warning { border-color: #FDE68A; background: #FFFBEB; color: #92400E; }
.alert > i { flex-shrink: 0; margin-top: 1px; }
