/* ===== AutoShareAI admin theme ===== */
:root {
  --bg: #f3f6fb; --surface: #ffffff; --surface-2: #f7f9fd; --border: #e2e8f3; --text: #0f1a33; --muted: #62708f;
  --accent: #2f64b8; --accent-hover: #244f96; --accent-soft: #e8effa; --on-accent: #ffffff;
  --accent-grad: linear-gradient(135deg, #2c5fb0, #3a76c8);
  --sidebar: #0f2342; --sidebar-text: #b4c2dc; --sidebar-active: linear-gradient(135deg, #2c5fb0, #3a76c8); --sidebar-active-text: #ffffff; --sidebar-border: rgba(255,255,255,.08);
  --ok: #059669; --ok-soft: #d9f7e8; --warn: #b45309; --warn-soft: #fff0d6; --bad: #dc2626; --bad-soft: #ffe3e3; --info: #0e7c9b; --info-soft: #dcf2f8;
  --shadow: 0 2px 4px rgba(20,50,110,.04), 0 10px 30px rgba(20,50,110,.07);
  --radius: 18px;
  --bs-body-bg: var(--bg); --bs-body-color: var(--text); --bs-border-color: var(--border);
}
[data-bs-theme="dark"] {
  --bg: #0a1222; --surface: #111c32; --surface-2: #0d1729; --border: #1f2e4b; --text: #e6edfa; --muted: #8a9bbd;
  --accent: #5b94e6; --accent-hover: #7aaaee; --accent-soft: rgba(91,148,230,.16); --on-accent: #ffffff;
  --accent-grad: linear-gradient(135deg, #2c5fb0, #3a76c8); --sidebar-active: linear-gradient(135deg, #2c5fb0, #3a76c8);
  --sidebar: #08111f; --sidebar-border: rgba(255,255,255,.06);
  --ok: #34d399; --ok-soft: rgba(52,211,153,.14); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14); --bad: #f87171; --bad-soft: rgba(248,113,113,.14); --info: #60a5fa; --info-soft: rgba(96,165,250,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --bs-body-bg: var(--bg); --bs-body-color: var(--text); --bs-border-color: var(--border);
}
html { font-size: 15px; }
body { background: var(--bg); color: var(--text); font-family: Inter, -apple-system, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { color: var(--accent-hover); }
.icon { flex-shrink: 0; vertical-align: -0.2em; }
.text-muted, .muted { color: var(--muted) !important; }
h1, h2, h3, h4, h5 { letter-spacing: -.01em; }

/* ---- shell ---- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--sidebar) 0%, color-mix(in srgb, var(--sidebar) 78%, #050d1c) 100%); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.sidebar .brand { display: flex; align-items: center; gap: .75rem; padding: 1.3rem 1.25rem 1.1rem; color: #fff; font-weight: 750; font-size: 1.15rem; line-height: 1.15; }
.sidebar .brand small { display: block; font-weight: 500; font-size: .68rem; color: var(--sidebar-text); letter-spacing: .02em; margin-top: .15rem; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; background: var(--accent-grad); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 18px rgba(20,60,130,.45); flex-shrink: 0; }
.sidebar nav { padding: .4rem .85rem .9rem; flex: 1; overflow-y: auto; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #8a90c4; padding: 1.1rem .75rem .45rem; }
.nav-item-x { display: flex; align-items: center; gap: .75rem; padding: .62rem .85rem; border-radius: 12px; color: var(--sidebar-text); font-weight: 550; transition: background .15s, color .15s; }
.nav-item-x:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item-x.active { background: var(--sidebar-active); color: var(--sidebar-active-text); box-shadow: 0 6px 16px rgba(10,30,70,.35); }
.sidebar .foot { padding: .9rem 1.25rem; border-top: 1px solid var(--sidebar-border); font-size: .75rem; color: #8a90c4; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.75rem .85rem; background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.topbar h1 { font-size: 1.55rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.topbar .sub { color: var(--muted); font-size: .88rem; }
.topbar .top-title { flex: 1 1 0; min-width: 0; }
.topbar .actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: 0 1 auto; }
.topbar .actions .btn { white-space: nowrap; }
.topbar .theme-btn { flex: none; }
.content { padding: 1.75rem; max-width: 1400px; width: 100%; }
.icon-btn { background: var(--surface); border: 1px solid var(--border); color: var(--muted); border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; box-shadow: var(--shadow); position: relative; }
.icon-btn .dot { position: absolute; top: 9px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; border: 2px solid var(--surface); }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.min-w-0 { min-width: 0; }   /* a flex child that may shrink below its text (Bootstrap has no such class) */
#navToggle { display: none; }
.scrim { display: none; }

/* ---- cards & layout ---- */
.card-x { background: var(--surface); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-x > .head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-x > .head h2 { font-size: 1rem; font-weight: 650; margin: 0; }
.card-x > .head .hint { color: var(--muted); font-size: .82rem; }
.card-x > .body, .card-x > form > .body { padding: 1.25rem; }   /* a card whose body sits inside a form (calendar day cards) is padded too */
.card-x.flat { box-shadow: none; }
.section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; margin-bottom: .6rem; }

/* ---- stats ---- */
.stat { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
.stat .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat .ico.ok { background: var(--ok-soft); color: var(--ok); } .stat .ico.bad { background: var(--bad-soft); color: var(--bad); } .stat .ico.info { background: var(--info-soft); color: var(--info); }
.stat .num { font-size: 1.7rem; font-weight: 750; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .82rem; margin-top: .25rem; }

/* ---- buttons & forms ---- */
.btn { border-radius: 12px; font-weight: 650; }
.btn-accent { background: var(--accent-grad); border-color: transparent; color: var(--on-accent); box-shadow: 0 6px 16px rgba(30,80,160,.25); }
.btn-accent:hover, .btn-accent:focus { background: linear-gradient(135deg, #244f96, #2f66b8); border-color: transparent; color: var(--on-accent); box-shadow: 0 8px 20px rgba(30,80,160,.32); }
.btn-accent:disabled, .btn-accent.disabled { background: var(--accent-grad); opacity: .5; box-shadow: none; }
.btn-soft { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-soft:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.btn-danger-soft { background: var(--bad-soft); color: var(--bad); border: 1px solid transparent; }
.btn-danger-soft:hover { background: var(--bad); color: #fff; }
.form-control, .form-select { border-radius: 10px; background-color: var(--surface); border-color: var(--border); color: var(--text); padding: .6rem .8rem; }
.form-select { padding-right: 2.25rem; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 22%, transparent); background-color: var(--surface); color: var(--text); }
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: .35rem; }
.form-text, .hint { color: var(--muted); font-size: .8rem; }
textarea.form-control { resize: vertical; min-height: 100px; }
.counter { font-size: .78rem; color: var(--muted); text-align: right; }
.field-error, .text-danger { color: var(--bad) !important; font-size: .82rem; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

/* choice cards (radio) */
.choice-grid { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice .box { display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .15s, background .15s; height: 100%; }
.choice .box strong { display: block; font-size: .9rem; } .choice .box span.s { color: var(--muted); font-size: .78rem; }
.choice input:checked + .box { border-color: var(--accent); background: var(--accent-soft); }
.choice input:focus-visible + .box { box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 30%, transparent); }
.ratio-shape { width: 26px; border: 2px solid var(--muted); border-radius: 4px; flex-shrink: 0; } .choice input:checked + .box .ratio-shape { border-color: var(--accent); }
.ratio-shape.v { height: 40px; width: 23px; } .ratio-shape.h { height: 23px; width: 40px; }

/* ---- badges, tables ---- */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill.completed, .pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.failed, .pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.queued { background: var(--surface-2); color: var(--muted); }
.pill.running, .pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; } .pill.running .dot { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.table-x { width: 100%; border-collapse: collapse; }
.table-x th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; padding: .7rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table-x td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-x tr:last-child td { border-bottom: none; }
.table-x tbody tr:hover { background: var(--surface-2); }
.row-title { font-weight: 600; color: var(--text); } .row-title:hover { color: var(--accent); }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-progress { height: 6px; border-radius: 6px; background: var(--border); overflow: hidden; min-width: 90px; } .mini-progress > div { height: 100%; background: var(--accent); border-radius: 6px; }
.progress-x { height: 12px; border-radius: 8px; background: var(--border); overflow: hidden; } .progress-x > div { height: 100%; background: linear-gradient(90deg, var(--accent), #38bdf8); transition: width .5s; border-radius: 8px; }

/* ---- empty / alerts ---- */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); } .empty .big { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 1rem; } .empty h3 { color: var(--text); font-size: 1.05rem; }
.note { display: flex; gap: .75rem; padding: .85rem 1rem; border-radius: 12px; background: var(--info-soft); color: var(--info); font-size: .88rem; } .note.warn { background: var(--warn-soft); color: var(--warn); } .note.bad { background: var(--bad-soft); color: var(--bad); } .note.ok { background: var(--ok-soft); color: var(--ok); }
.note a { color: inherit; text-decoration: underline; }

/* ---- setup checklist ---- */
.check-row { display: flex; align-items: center; gap: .85rem; padding: .8rem 1.25rem; border-bottom: 1px solid var(--border); } .check-row:last-child { border-bottom: none; }
.check-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--border); color: transparent; flex-shrink: 0; }
.check-row.done .check-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.check-row .t { font-weight: 600; } .check-row .d { color: var(--muted); font-size: .82rem; }

/* ---- brands ---- */
.logo-tile { width: 64px; height: 64px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; color: var(--accent); font-weight: 750; font-size: 1.5rem; flex-shrink: 0; }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; padding: 6px; box-sizing: border-box; }
.logo-tile.lg { width: 96px; height: 96px; }
.brand-card { display: flex; flex-direction: column; height: 100%; }
.brand-card .top { display: flex; gap: 1rem; align-items: center; padding: 1.25rem; }
.brand-card .meta { padding: 0 1.25rem 1rem; font-size: .85rem; color: var(--muted); display: grid; gap: .35rem; }
.brand-card .foot { margin-top: auto; padding: .9rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---- template previews ---- */
.pv { position: relative; border-radius: 10px; overflow: hidden; background: #05070c; border: 1px solid var(--border); width: 100%; }
.pv iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: top left; pointer-events: none; }
.tpl-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.tpl-card .pv { border-radius: 0; border: 0; border-bottom: 1px solid var(--border); }
.tpl-card .info { padding: .9rem 1rem; flex: 1; } .tpl-card .info h3 { font-size: .95rem; font-weight: 650; margin: 0 0 .25rem; }
.tpl-card .foot { padding: .6rem 1rem; border-top: 1px solid var(--border); display: flex; gap: .4rem; align-items: center; }
.group-link { display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; border-radius: 12px; color: var(--text); border: 1.5px solid transparent; }
.group-link:hover { background: var(--surface-2); color: var(--text); } .group-link.active { background: var(--accent-soft); border-color: var(--accent); }
.group-link .cnt { margin-left: auto; font-size: .78rem; color: var(--muted); }
.code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; white-space: pre-wrap; overflow: auto; max-height: 340px; }

/* ---- log ---- */
.log-box { background: #070a10; color: #cbd5e1; border-radius: 12px; height: 280px; overflow-y: auto; font: 12px/1.5 ui-monospace, Consolas, monospace; padding: .75rem 1rem; white-space: pre-wrap; }
.log-Warn { color: #fbbf24; } .log-Error { color: #f87171; } .log-Info { color: #94a3b8; }
.video-box video { max-width: 100%; max-height: 72vh; border-radius: 12px; background: #000; }

/* ---- toast ---- */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; display: grid; gap: .6rem; z-index: 100; }
.toast-x { min-width: 260px; max-width: 380px; padding: .8rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; gap: .7rem; align-items: center; animation: slidein .25s; }
.toast-x.ok { border-left: 4px solid var(--ok); } .toast-x.bad { border-left: 4px solid var(--bad); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }

/* ---- responsive ---- */
@media (max-width: 991.98px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  #navToggle { display: grid; }
  .content { padding: 1.1rem; } .topbar { padding: .75rem 1rem; }
}

/* ---- phones: the title gets the whole line, the page's buttons sit under it ---- */
@media (max-width: 767.98px) {
  html { font-size: 15px; }
  .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "nav title theme" "actions actions actions"; align-items: center; gap: .45rem .7rem;
            padding: .55rem .8rem .6rem; transition: transform .22s ease; }
  .topbar:not(:has(.actions)) { grid-template-areas: "nav title theme"; row-gap: 0; }
  #navToggle { grid-area: nav; } .topbar .top-title { grid-area: title; } .topbar .theme-btn { grid-area: theme; }
  .topbar .actions { grid-area: actions; margin: 0; display: flex; flex-wrap: wrap; justify-content: stretch; gap: .5rem; }
  .topbar .actions > * { flex: 1 1 auto; text-align: center; justify-content: center; }
  .topbar .actions .btn { padding-top: .5rem; padding-bottom: .5rem; }
  .topbar h1 { font-size: 1.15rem; line-height: 1.25; margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .topbar h1 .greet { display: block; margin: .1rem 0 0; font-size: .85rem; }
  .topbar .sub { font-size: .76rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .icon-btn { width: 38px; height: 38px; }
  /* the bar slides away while reading down the page and comes back when scrolling up (site.js) */
  body.topbar-hidden .topbar { transform: translateY(-100%); }
  body.nav-open .topbar { transform: none; }
  .content { padding: .9rem .8rem 1.5rem; }
  .toasts { left: .8rem; right: .8rem; bottom: .8rem; } .toast-x { min-width: 0; max-width: none; }

  /* a card's title keeps most of the line; its hint or buttons wrap underneath instead of squeezing it */
  .card-x > .head { flex-wrap: wrap; row-gap: .3rem; padding: .85rem 1rem; }
  .card-x > .head h2 { flex: 1 1 60%; min-width: 0; overflow-wrap: anywhere; }
  .card-x > .head .hint { flex: 1 1 100%; order: 5; }
  .card-x > .body, .card-x > form > .body { padding: 1rem; }

  /* a list table becomes a list of small cards: the column names (set by site.js) label each value; (more specific than the table rules of the other style sheets) */
  .table-responsive, .table-wrap { overflow: visible !important; }
  table.table-x, table.table-x > tbody, table.table-x > tbody > tr, table.table-x > tbody > tr > td { display: block; width: 100%; }
  table.table-x > thead { display: none; }
  table.table-x > tbody > tr { padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
  table.table-x > tbody > tr:last-child { border-bottom: 0; }
  table.table-x > tbody > tr > td { padding: .18rem 0; border: 0; white-space: normal; text-align: left; vertical-align: top; }
  table.table-x > tbody > tr > td:first-child { font-size: 1rem; padding: 0 0 .3rem; }
  /* a field: its name on the left, the value beside it (fields with an input or a form keep the name above) */
  table.table-x > tbody > tr > td[data-label]:not(:first-child):not([data-label=""]) { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
  table.table-x > tbody > tr > td[data-label]:not(:first-child):not([data-label=""])::before { content: attr(data-label); flex: 0 0 30%; max-width: 30%; font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
  table.table-x > tbody > tr > td:has(input, select, textarea)[data-label]:not(:first-child)::before { flex: 0 0 100%; max-width: 100%; }
  table.table-x > tbody > tr > td:last-child:not(:first-child):not([data-label]) , table.table-x > tbody > tr > td[data-label=""]:last-child { padding-top: .4rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
  table.table-x td input:not([type=checkbox]):not([type=radio]), table.table-x td select { flex: 1 1 0; min-width: 0; width: 100%; }

  .person-row-flex, .logo-row-flex { flex-direction: column; align-items: stretch !important; }
  .person-row-flex > .person-photo { align-self: flex-start; }
  .logo-row-flex > .logo-tile { align-self: flex-start; }

  /* fields and filter rows use the whole width */
  .content input[style*="max-width"], .content select[style*="max-width"], .content textarea[style*="max-width"], .content .position-relative[style*="max-width"], .content .form-select.w-auto, .content .form-control.w-auto { max-width: 100% !important; }
  .content .form-select.w-auto { flex: 1 1 150px; width: auto; }
  .content form.d-flex.flex-wrap > .btn { flex: 0 0 auto; }

  /* touch: big enough to tap, and 16px text in fields so a phone does not zoom in when one is touched */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]), select, textarea, .form-control, .form-select { font-size: 16px !important; }
  .btn:not(.btn-sm) { min-height: 42px; }
  .row-title { display: inline-block; padding: .25rem 0; }
  .btn-sm, .btn-group-sm > .btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
  .form-control-sm, .form-select-sm { min-height: 38px; }
  .page-link { min-width: 38px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; }
  .hint a, a.small, .small > a, .note a { display: inline-block; padding: .3rem .1rem; }
  .pill.accent[type=button], button.pill { min-height: 32px; }
}

/* wording for a mouse or a finger (a phone has no pointer to hover with) */
.touch-only { display: none; }
@media (hover: none) { .hover-only { display: none; } .touch-only { display: inline; } }

/* ---- plans and billing ---- */
.pricing-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 1180px; align-items: stretch; }
.price-card { position: relative; display: flex; flex-direction: column; padding: 1.6rem 1.5rem 1.5rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.price-card.current { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.price-card h2 { font-size: 1.1rem; font-weight: 750; margin: 0 0 .25rem; }
.price-badge { position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--on-accent); font-size: .72rem; font-weight: 700; padding: .25rem .8rem; border-radius: 999px; white-space: nowrap; }
.price-desc { color: var(--muted); font-size: .88rem; margin: 0 0 1rem; min-height: 2.6em; }
.price-amount { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.price-amount.contact { font-size: 1.8rem; }
.price-unit { color: var(--muted); font-size: .82rem; font-weight: 600; }
.price-sub { color: var(--muted); font-size: .8rem; margin-top: .15rem; min-height: 1.2em; }
.price-by { margin-bottom: .25rem; min-height: 4rem; }
.price-lines { list-style: none; padding: 0; margin: 1rem 0 1.25rem; display: grid; gap: .65rem; flex: 1; }
.price-lines li { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; color: var(--text); }
.price-lines li .icon { color: var(--accent); margin-top: .2rem; }
.price-action .btn { padding: .65rem 1rem; }
.interval-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .25rem; }
.interval-switch button { border: 0; background: transparent; color: var(--muted); font-weight: 650; padding: .45rem 1.1rem; border-radius: 999px; }
.interval-switch button.on { background: var(--accent); color: var(--on-accent); }
@media (max-width: 575px) { .price-card { padding: 1.3rem 1.1rem 1.2rem; } .price-by { min-height: 0; } .interval-switch button { padding: .45rem .8rem; font-size: .9rem; } }

/* the cancel confirmation sits on the page: a button that opens a short question */
.cancel-box > summary { list-style: none; cursor: pointer; display: inline-flex; }
.cancel-box > summary::-webkit-details-marker { display: none; }
.cancel-confirm { margin-top: .6rem; padding: .75rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); max-width: 34rem; }

/* ---- picture libraries (group pictures, backgrounds) ---- */
.bg-card { overflow: hidden; }
.bg-thumb { display: block; aspect-ratio: 16 / 10; background-size: cover; background-position: center; background-color: var(--surface-2); border-bottom: 1px solid var(--border); }

/* ---- brand people ---- */
.person-card { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; background: var(--surface); }
.person-card + .person-card { margin-top: .75rem; }
.person-photo { width: 72px; height: 72px; border-radius: 50%; background: var(--surface-2) center / cover no-repeat; border: 1px solid var(--border); flex: none; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.person-photo.empty::after { content: attr(data-initials); }

/* ---- video options: theme + background picker ---- */
.choice-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.choice { flex: 1 1 140px; border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; cursor: pointer; display: flex; gap: .6rem; align-items: center; background: var(--surface); }
.choice > .box { flex: 1 1 auto; min-width: 0; }
/* a day-of-week chip: the box is the chip (the outer choice frame would double its border) */
.choice.day-chip { flex: 0 0 auto; padding: 0; border: 0; background: transparent; }
.choice.day-chip:has(input:checked) { box-shadow: none; }
.choice.day-chip > .box { justify-content: center; min-width: 4rem; }
.day-chips .btn { white-space: nowrap; }   /* the card fills its cell instead of shrinking to its text */
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.choice input { accent-color: var(--accent); }
.bg-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .6rem; }
.bg-pick { position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.bg-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.bg-pick .thumb { aspect-ratio: 4 / 3; background-size: cover; background-position: center; }
.bg-pick .cap { font-size: .72rem; padding: .25rem .4rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-pick:has(input:checked) { border-color: var(--accent); }

/* ---- closing scene picker (New video) ---- */
.closing-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.closing-grid.portrait { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.closing-opt { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: .55rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.closing-opt input { position: absolute; top: .9rem; right: .9rem; z-index: 2; accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
.closing-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.closing-opt .cap { font-size: .85rem; line-height: 1.3; padding: 0 .15rem .15rem; }
.closing-opt .cap .hint { font-size: .75rem; margin-top: .15rem; }
.closing-opt .pv-none { aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--muted); font-size: .8rem; background: var(--surface-2); border-radius: 10px; }

/* style picker: a gallery of sample videos */
.style-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(190px, 45%), 1fr)); }
.style-grid.landscape { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
@media (max-width: 575px) { .style-grid { gap: .6rem; } .style-card .cap .hint { display: none; } }
.style-card { position: relative; display: flex; flex-direction: column; gap: .55rem; padding: .55rem; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; outline: none; }
.style-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-1px); }
.style-card:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.style-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.style-card .pv { border-radius: 10px; }
.style-card .pv-none { aspect-ratio: 9 / 16; display: grid; place-items: center; color: var(--muted); font-size: .8rem; background: var(--surface-2); border-radius: 10px; }
.style-card .tick { position: absolute; top: .9rem; right: .9rem; width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px rgba(0,0,0,.3); z-index: 2; }
.style-card.selected .tick { display: grid; }
.style-card .cap { padding: 0 .2rem; font-size: .9rem; line-height: 1.3; }
.style-card .cap .hint { font-size: .76rem; margin-top: .15rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.style-card .watch { align-self: flex-start; margin: 0 .2rem .15rem; display: inline-flex; align-items: center; gap: .35rem; }
.sample-modal { position: fixed; inset: 0; z-index: 1080; background: rgba(5, 8, 15, .72); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.sample-box { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1rem; width: min(100%, 420px); display: flex; flex-direction: column; gap: .75rem; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.sample-box.landscape { width: min(100%, 860px); }
.sample-box .pv { border-radius: 12px; }
.sample-box.portrait { width: min(100%, 380px, calc((100vh - 230px) * .5625 + 2rem)); min-width: 240px; }
.sample-close { position: absolute; top: -.6rem; right: -.6rem; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.3rem; line-height: 1; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.sample-dots { display: flex; gap: .35rem; justify-content: center; }
.sample-dots span { width: 22px; height: 4px; border-radius: 3px; background: var(--border); transition: background .2s; }
.sample-dots span.on { background: var(--accent); }
.sample-title strong { font-size: 1.02rem; }
body.modal-open-x { overflow: hidden; }
.btn-check:checked + .btn-soft { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.style-more { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; margin-top: .75rem; }
.style-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.style-bar .form-control { max-width: 360px; }
.style-status { min-height: 1.2rem; color: var(--muted); font-size: .85rem; margin-bottom: .5rem; }
.style-status.bad { color: var(--bs-danger, #dc2626); }
.style-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem; margin-top: 1rem; }
.style-pager .on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.style-pager .gap { color: var(--muted); padding: 0 .15rem; }
.sample-box.browse-box { width: min(100%, 1120px); height: min(92vh, 940px); padding: 0; gap: 0; overflow: hidden; }
.sample-box.browse-box .sample-close { top: .7rem; right: .7rem; }
.browse-head { padding: 1.1rem 3.2rem .8rem 1.25rem; border-bottom: 1px solid var(--border); }
.browse-head h2 { font-size: 1.1rem; margin: 0 0 .15rem; }
.browse-body { flex: 1 1 auto; overflow-y: auto; padding: 1rem 1.25rem; }
.browse-foot { display: flex; align-items: center; gap: 1rem; justify-content: space-between; padding: .8rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); }
.browse-chosen { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.styles-actionbar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; justify-content: space-between; flex-wrap: wrap; margin-top: 1rem; padding: .8rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 -6px 24px rgba(0,0,0,.12); }

/* ---- HTML editor ---- */
.code-edit { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: .8rem; line-height: 1.5; white-space: pre; overflow: auto; tab-size: 2; }

/* ---- group tiles ---- */
a.group-tile { text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
a.group-tile:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.group-tile .pv-none { aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--muted); font-size: .85rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.group-tile.new-tile { border-style: dashed; min-height: 220px; justify-content: center; align-items: center; color: var(--muted); }
.group-tile h3 { display: flex; align-items: center; flex-wrap: wrap; }

/* ---- image categories ---- */
.cat-mosaic { display: grid; gap: 2px; aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.cat-mosaic span { background-size: cover; background-position: center; }
.cat-mosaic.n1 { grid-template-columns: 1fr; }
.cat-mosaic.n2 { grid-template-columns: 1fr 1fr; }
.cat-mosaic.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; } .cat-mosaic.n3 span:first-child { grid-row: span 2; }
.cat-mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

/* ---- content calendar ---- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; text-align: center; padding-bottom: 2px; }
.cal-cell { min-height: 92px; padding: .4rem .45rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); overflow: hidden; }
.cal-cell.blank { border: 0; background: transparent; }
.cal-cell.off { background: var(--surface-2); opacity: .55; }
.cal-cell.empty-slot { border-style: dashed; }
.cal-cell.has:hover { border-color: var(--accent); }
.cal-cell .n { font-size: .75rem; font-weight: 700; color: var(--muted); }
.cal-cell .t { font-size: .72rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cal-cell .pill.tiny { font-size: .62rem; padding: .08rem .4rem; align-self: flex-start; margin-top: auto; }
.card-x[id^="entry-"] { scroll-margin-top: 6rem; }   /* clear of the sticky top bar */
.card-x.flash { animation: calFlash 1.6s ease-out; }
@keyframes calFlash { 0%, 35% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: var(--shadow); } }
.cal-menu { position: fixed; z-index: 1080; min-width: 190px; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.cal-menu .cal-menu-head { padding: .35rem .6rem .25rem; font-size: .72rem; color: var(--muted); font-weight: 650; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-menu button { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .5rem .6rem; border: 0; background: transparent; color: var(--text); border-radius: 8px; font-size: .88rem; text-align: left; cursor: pointer; }
.cal-menu button:hover, .cal-menu button:focus-visible { background: var(--surface-2); outline: none; }
.cal-menu button.danger { color: var(--bad, #dc2626); }
.cal-cell.has { cursor: pointer; }
@media (max-width: 767px) { .cal-cell { min-height: 64px; } .cal-cell .t, .cal-cell .pill.tiny { display: none; } }
.cal-card { display: flex; flex-direction: column; }
.cal-card .foot { margin-top: auto; padding: .8rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cal-card .foot form { margin-left: auto; }

/* property photos (New video, photo templates) */
.photo-drop { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; padding: .85rem 1rem; border: 2px dashed var(--border); border-radius: 12px; background: var(--surface-2); }
.photo-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.photo-grid { display: grid; gap: .8rem .6rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: .85rem; }
.photo-card { display: flex; flex-direction: column; gap: .35rem; border-radius: 10px; }
.photo-card.over .photo-item { outline: 2px solid var(--accent); }
.photo-name { font-size: .8rem; }
.photo-item { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #05070c; cursor: grab; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo-item video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo-item .clip-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: .2rem .6rem; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; pointer-events: none; }
.photo-item .n { position: absolute; top: .3rem; left: .3rem; min-width: 1.4rem; height: 1.4rem; display: grid; place-items: center; border-radius: 999px; background: rgba(0,0,0,.65); color: #fff; font-size: .75rem; font-weight: 700; }
.photo-item .tag { position: absolute; left: 0; right: 0; bottom: 0; padding: .15rem .35rem; font-size: .68rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.photo-item .tag:empty { display: none; }
.photo-item .ctl { position: absolute; top: .3rem; right: .3rem; display: flex; gap: .2rem; opacity: 0; transition: opacity .15s; }
.photo-item:hover .ctl, .photo-item:focus-within .ctl { opacity: 1; }
.photo-item .ctl button { border: 0; width: 1.5rem; height: 1.5rem; border-radius: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: .7rem; line-height: 1; cursor: pointer; }
.photo-item .ctl button:hover { background: var(--accent); }
.photo-item.dragging { opacity: .4; }
@media (hover: none) { .photo-item .ctl { opacity: 1; } }

/* ---- image posts ---- */
.post-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.post-card:hover { border-color: var(--accent); box-shadow: 0 4px 18px rgba(0,0,0,.08); color: inherit; }
.post-thumb { background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.post-thumb.tall { aspect-ratio: 9 / 16; max-height: 340px; } .post-thumb.wide { aspect-ratio: 16 / 9; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-empty { color: var(--muted); }
.post-info { padding: .7rem .8rem .8rem; }
.post-versions { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.post-versions.wide { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.post-version { overflow: hidden; }
.post-version > a { display: block; background: #05070c; }
.post-version > a img { width: 100%; display: block; }
.post-versions.tall .post-version > a img { max-height: 520px; object-fit: contain; }

/* ---- brands: colours and logos found on a website */
.swatch-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.swatch-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; font-size: .7rem; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); display: block; }
.logo-choices { display: flex; gap: .6rem; flex-wrap: wrap; }
.logo-choice { border: 1.5px solid var(--border); border-radius: 12px; padding: .4rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .25rem; width: 112px; font-size: .66rem; text-align: center; background: var(--surface-2); }
.logo-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.logo-choice img { width: 88px; height: 58px; object-fit: contain; border-radius: 6px; background: repeating-conic-gradient(#8881 0 25%, transparent 0 50%) 50% / 12px 12px; }
.brand-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.brand-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--border); display: inline-block; }

/* ---- accounts ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; background: var(--bg, transparent); }
.auth-card { width: 100%; max-width: 440px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: .6rem; font-weight: 750; font-size: 1.15rem; margin-bottom: 1.25rem; }
.auth-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.auth-alt { margin-top: 1rem; text-align: center; font-size: .9rem; color: var(--muted); }
.usage-row { margin-bottom: 1rem; font-size: .92rem; }
.usage-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: .3rem; }
.usage-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.usage-bar > span.full { background: #dc2626; }
.user-chip { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; margin: .5rem .85rem .9rem; border-radius: 16px; background: rgba(255,255,255,.08); color: #fff; font-size: .85rem; text-decoration: none; }
.user-chip .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-grad); display: grid; place-items: center; font-weight: 750; font-size: .85rem; flex-shrink: 0; }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.2; }
.user-chip .who strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { opacity: .65; font-size: .75rem; }
.user-chip form { margin: 0; }
.user-chip button { background: transparent; border: 0; color: inherit; opacity: .7; padding: .2rem; line-height: 0; cursor: pointer; }
.user-chip button:hover { opacity: 1; }
.powered { margin: -.3rem .85rem .9rem; text-align: center; font-size: .68rem; letter-spacing: .02em; color: var(--sidebar-text); opacity: .75; }
.auth-powered { margin-top: 1.1rem; text-align: center; font-size: .75rem; color: var(--muted); }
.table-x { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-x th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; padding: .55rem .75rem; border-bottom: 1px solid var(--border); }
.table-x td { padding: .7rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-x tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
