/* Imagen Social Scheduler: Imagen Web Pro brand (Geologica + Commissioner, #6352CC, #D3CAFF, #14141E).
   Phone first: bottom tab bar under 1024 px, top navigation from 1024 px. */
@font-face { font-family: "Geologica"; src: url("fonts/geologica-greek.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+0370-03FF, U+1F00-1FFF; }
@font-face { font-family: "Geologica"; src: url("fonts/geologica-latin.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Commissioner"; src: url("fonts/commissioner-greek.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+0370-03FF, U+1F00-1FFF; }
@font-face { font-family: "Commissioner"; src: url("fonts/commissioner-latin.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* brand */
  --c-dark: #14141E;
  --c-dark-mid: #1D1D27;
  --c-dark-surf: #25252E;
  --c-light: #F1F0F4;
  --c-white: #FBFBFC;
  --c-accent: #6352CC;
  --c-accent-ink: #4B3BB0;
  --c-accent-tint: #EEEBFF;
  --c-lavender: #D3CAFF;
  /* ui */
  --c-text: #2B2A38;
  --c-muted: #5B5A6B;
  --c-border: #E4E2EA;
  --c-border-strong: #CFCCD9;
  --c-surface-2: #F6F5F9;
  --c-success: #22c55e;
  --c-warn: #8a4b06;
  --c-danger: #9a1b1b;
  --f-head: Geologica, "Geologica Fallback", system-ui, sans-serif;
  --f-body: Commissioner, "Commissioner Fallback", system-ui, sans-serif;
  --radius-card: 12px;
  --radius: 5px;
  --radius-tile: 8px;
  --gutter: 16px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 10px 28px -16px rgba(20, 20, 30, .16);
  --shadow-lift: 0 1px 2px rgba(20, 20, 30, .05), 0 18px 40px -18px rgba(40, 28, 120, .28);
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0; color: var(--c-text); min-height: 100dvh;
  background: radial-gradient(900px 420px at 100% -80px, rgba(211, 202, 255, .55), rgba(211, 202, 255, 0) 70%) no-repeat,
    var(--c-light);
  font: 400 16px/1.55 var(--f-body); overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-head); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  margin: 0 0 12px; color: var(--c-dark); text-wrap: balance; }
h1 { font-size: clamp(28px, 4.2vw, 40px); letter-spacing: -0.04em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
a { color: var(--c-accent); text-underline-offset: 3px; }
strong { color: var(--c-dark); font-weight: 600; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
img, video { max-width: 100%; }
.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; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--c-muted); }
.small { font-size: 14px; }
.path { display: flex; gap: 8px; align-items: flex-start; font-family: ui-monospace, Consolas, monospace;
  font-size: 13px; margin-bottom: 14px; }
.path .i { width: 16px; height: 16px; margin-top: 1px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.empty { margin: 0; color: var(--c-muted); }

/* ------------------------------------------------------------------ header and navigation */
.top { position: sticky; top: 0; z-index: 30; background: rgba(251, 251, 252, .94);
  border-bottom: 1px solid var(--c-border); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--c-dark);
  text-decoration: none; min-width: 0; margin-right: auto; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-family: var(--f-head); font-size: 17px; letter-spacing: -0.03em; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name strong { font-weight: 800; }
.brand-name span { font-weight: 500; color: var(--c-muted); }
.top-tools { display: flex; align-items: center; gap: 4px; }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 10px; color: var(--c-text); background: transparent; border: 0; cursor: pointer; font: inherit;
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.tool-btn .i { width: 20px; height: 20px; }
.tool-btn:hover { background: var(--c-accent-tint); color: var(--c-accent-ink); }
.tool-btn[aria-current="page"] { background: var(--c-accent-tint); color: var(--c-accent); }
.logout-form { margin: 0; }

/* phone and tablet: the nav is a bottom tab bar */
.nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 4px var(--safe-b); background: rgba(251, 251, 252, .97); border-top: 1px solid var(--c-border);
  box-shadow: 0 -8px 24px -18px rgba(20, 20, 30, .25); }
@supports (backdrop-filter: blur(8px)) {
  .nav { background: rgba(251, 251, 252, .88); backdrop-filter: saturate(1.4) blur(14px); }
}
.nav a { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; min-width: 0; min-height: 44px; padding: 6px 2px; color: var(--c-muted); text-decoration: none;
  font-size: 11px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; text-align: center;
  transition: color .15s var(--ease); }
.nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a .i { width: 22px; height: 22px; }
.nav a::before { content: ""; position: absolute; top: -1px; left: 50%; width: 28px; height: 3px;
  margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--c-accent); transform: scaleX(0);
  transition: transform .2s var(--ease); }
.nav a:hover { color: var(--c-dark); }
.nav a[aria-current="page"] { color: var(--c-accent); font-weight: 600; }
.nav a[aria-current="page"]::before { transform: scaleX(1); }
.nav a:focus-visible { outline-offset: -3px; border-radius: 10px; }
.main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 32px); }

@media (max-width: 359px) {
  .nav a { font-size: 10px; }
  .brand-name span { display: none; }
}

@media (min-width: 1024px) {
  .top-in { min-height: 68px; gap: 24px; }
  .top { background: rgba(251, 251, 252, .82); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px); }
  .nav { position: static; flex: none; height: auto; padding: 0; gap: 2px; background: none; border: 0;
    box-shadow: none; backdrop-filter: none; }
  .nav a { flex: none; flex-direction: row; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px;
    color: var(--c-text); transition: background-color .15s var(--ease), color .15s var(--ease); }
  .nav a .i { width: 18px; height: 18px; }
  .nav a::before { display: none; }
  .nav a:hover { background: rgba(99, 82, 204, .07); color: var(--c-accent-ink); }
  .nav a[aria-current="page"] { background: var(--c-accent-tint); color: var(--c-accent-ink); }
  .nav a:focus-visible { outline-offset: 2px; }
  .main { padding-bottom: 64px; }
  .settings-link { display: none !important; }
}
@media (min-width: 1024px) and (max-width: 1179px) {
  .brand-name span { display: none; }
}

/* ------------------------------------------------------------------ page scaffolding */
.page-title { margin: 20px 0 20px; }
@media (min-width: 768px) { .page-title { margin: 32px 0 28px; } }
.card { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius-card);
  padding: 20px; margin-bottom: var(--gutter); min-width: 0; box-shadow: var(--shadow); }
.card-head, .section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h2, .section-head h2 { margin: 0; }
.section-head { margin: 28px 0 14px; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px;
  padding: 0 8px; border-radius: var(--radius); background: var(--c-accent-tint); color: var(--c-accent-ink);
  font: 700 13px/1 var(--f-head); }
.card-accent { border-color: var(--c-lavender); background: linear-gradient(180deg, #F7F5FF, var(--c-white)); }
.note { background: var(--c-accent-tint); color: var(--c-dark); padding: 10px 14px; border-radius: var(--radius-tile);
  font-size: 15px; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  font: 600 15px/1.2 var(--f-body); text-decoration: none; text-align: center; white-space: normal;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease),
    box-shadow .15s var(--ease), transform .1s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-accent); color: var(--c-white);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 16px -8px rgba(99, 82, 204, .7); }
.btn-primary:hover { background: var(--c-accent-ink); }
.btn-secondary { background: var(--c-white); color: var(--c-accent-ink); border-color: #C9C0F7; }
.btn-secondary:hover { background: var(--c-accent-tint); border-color: var(--c-accent); }
.btn-ghost { background: transparent; color: var(--c-dark); border-color: var(--c-border-strong); }
.btn-ghost:hover { background: var(--c-surface-2); border-color: #B9B5C8; }
.btn-danger { background: var(--c-white); color: var(--c-danger); border-color: #EDBDBD; }
.btn-danger:hover { background: #FDF2F2; border-color: var(--c-danger); }
.btn .i:last-child:not(:first-child) { width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

/* ------------------------------------------------------------------ status pills */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: var(--radius);
  background: #ECEBF0; color: #4F4E60; font-size: 13px; font-weight: 600; line-height: 1.35;
  white-space: normal; max-width: 100%; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.state-pending { background: #EEEBFF; color: #4733B8; }
.chip.state-scheduled_platform { background: #E4DEFF; color: #3A2A9E; }
.chip.state-waiting_local, .chip.chip-warn { background: #FDF0D5; color: #7A4205; }
.chip.state-publishing { background: #E3ECFD; color: #1D3F8F; }
.chip.state-publishing::before { animation: pulse 1.4s ease-in-out infinite; }
.chip.state-published, .chip.state-manual_done { background: #DCF3E3; color: #135231; }
.chip.state-published::before, .chip.state-manual_done::before { background: #1F9D55; }
.chip.state-failed { background: #FBE1E1; color: #9A1B1B; }
.chip.state-missed { background: #FDE6D6; color: #8F360E; }
.chip.state-cancelled { background: #ECEBF0; color: #4F4E60; }
.chip.state-cancelled::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.chip.state-manual_pending { background: var(--c-accent); color: var(--c-white); }
.chip.state-manual_pending::before { background: var(--c-lavender); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* platform marks */
.pm { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border-radius: var(--radius-tile); background: #EDEBF4; color: var(--c-dark); }
.pm .i { width: 17px; height: 17px; vertical-align: 0; }
.job-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; color: var(--c-dark); }

/* cover thumbnails */
.thumb { position: relative; display: block; flex: none; width: 64px; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: var(--radius-tile); background: var(--c-dark);
  box-shadow: 0 0 0 1px rgba(20, 20, 30, .06), 0 8px 18px -10px rgba(20, 20, 30, .45); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--c-accent);
  background: linear-gradient(160deg, var(--c-accent-tint), var(--c-lavender)); }
.thumb-empty .i { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.label { font-weight: 600; font-size: 14px; color: var(--c-dark); }
input[type="text"], input[type="url"], input[type="password"], input[type="datetime-local"], input[type="date"],
textarea, select {
  width: 100%; max-width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-tile); background: #FFFFFF; color: var(--c-dark);
  font: 400 16px/1.45 var(--f-body); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
textarea { resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: #B9B5C8; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(99, 82, 204, .28); }
input[readonly], textarea[readonly] { background: var(--c-surface-2); }
input[type="datetime-local"] { max-width: 300px; }
select:disabled { background: var(--c-surface-2); color: var(--c-muted); }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0 0 4px; cursor: pointer; }
.toggle input[type="radio"] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--c-accent); }
.toggle input:disabled + span { color: var(--c-muted); }
.toggle input:disabled { cursor: not-allowed; }
/* checkboxes inside .toggle are switches */
.toggle input[type="checkbox"] { -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 42px; height: 26px; margin: 0; border-radius: 13px; background: #C9C6D4; cursor: pointer;
  transition: background-color .18s var(--ease); }
.toggle input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(20, 20, 30, .3);
  transition: transform .18s var(--ease); }
.toggle input[type="checkbox"]:checked { background: var(--c-accent); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(16px); }
.toggle input[type="checkbox"]:disabled { opacity: .5; }
.toggle input[type="checkbox"]:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { margin: 0; padding: 10px 14px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-tile);
  background: var(--c-white); transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.choice:hover { border-color: #B9B5C8; }
.choice:has(input:checked) { border-color: var(--c-accent); background: #F7F5FF; }
.tiktok-brands { margin: 0 0 6px 20px; padding-left: 16px; border-left: 2px solid var(--c-border); }
.consent { font-size: 14px; margin: 6px 0 10px; }

/* ------------------------------------------------------------------ flash messages */
.flash-slot { padding-top: 16px; }
.flash-slot:empty { padding-top: 0; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-tile);
  border: 1px solid; margin: 0 0 10px; font-weight: 500; }
.flash .i { margin-top: 3px; }
.flash-error { background: #FEF3F3; border-color: #F3C9C9; color: var(--c-danger); }
.flash-ok { background: #EFFAF3; border-color: #BDE5CB; color: #135231; }
.flash-info { background: #F5F3FF; border-color: var(--c-lavender); color: var(--c-dark); }

/* ------------------------------------------------------------------ lists */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--c-border); }
.row:first-child { border-top: 0; padding-top: 4px; }
.row:last-child { padding-bottom: 0; }
.row-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 150px; }
.row-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
  border-radius: var(--radius-tile); background: var(--c-accent-tint); color: var(--c-accent); }
.row-name { font-weight: 600; color: var(--c-dark); }
.row-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.row-link .copybox { flex: 1 1 320px; }

/* ------------------------------------------------------------------ inbox */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tile { position: relative; display: flex; gap: 16px; align-items: stretch; padding: 12px; background: var(--c-white);
  border: 1px solid var(--c-border); border-radius: var(--radius-card); box-shadow: var(--shadow);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.tile:hover { border-color: #CFC7F7; box-shadow: var(--shadow-lift); }
.tile .thumb { width: 72px; }
.tile-body { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 12px;
  min-width: 0; flex: 1; padding: 2px 0; }
.tile-title { font-family: var(--f-head); font-weight: 700; font-size: 17px; line-height: 1.25; letter-spacing: -0.02em;
  color: var(--c-dark); text-wrap: pretty; }
.tile:focus-within { box-shadow: 0 0 0 3px rgba(99, 82, 204, .3), var(--shadow); }
.tile .stretch:focus-visible { outline: none; }
@media (min-width: 768px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .inbox { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: start; }
  .inbox-drafts { order: -1; }
  .inbox-drafts .section-head { margin-top: 0; }
  .inbox-new { position: sticky; top: 92px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1180px) {
  .inbox .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ the Short screen */
.short-title { font-size: clamp(24px, 3.4vw, 34px); max-width: 30em; }
.short-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); margin-bottom: var(--gutter);
  align-items: start; }
.short-top .card { margin-bottom: 0; }
.media { background: var(--c-dark); border-color: var(--c-dark); color: var(--c-white); padding: 16px;
  background-image: radial-gradient(420px 300px at 0% 100%, rgba(99, 82, 204, .45), rgba(99, 82, 204, 0) 70%); }
.media h2 { color: var(--c-lavender); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.media video { display: block; width: 100%; max-width: min(220px, 30vh * 9 / 16 * 2); max-height: 70vh; aspect-ratio: 9 / 16;
  background: #000; border-radius: 10px; margin: 0 auto; }
.plan h2 { font-size: 17px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-tile);
  font-size: 15px; margin: 0; }
.check .i { margin-top: 3px; }
.check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.check-top strong { color: inherit; }
.check-plat { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .7); }
.check-block { background: #FEF3F3; color: var(--c-danger); }
.check-warn { background: #FFF8E8; color: #6F3B04; }
.check-ok { background: #EFFAF3; color: #135231; }
.platforms { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); margin-bottom: var(--gutter);
  align-items: start; }
.platforms .card { margin-bottom: 0; }
.platform-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 14px; }
.platform-name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.platform-name h2 { margin: 0; font-size: 18px; }
.platform.is-disabled { opacity: .6; }
.toggle-enable { justify-content: space-between; flex-direction: row-reverse; margin: 0 0 14px; padding: 8px 12px 8px 14px;
  border-radius: var(--radius-tile); background: var(--c-surface-2); border: 1px solid var(--c-border); }
.toggle-enable span { font-weight: 600; color: var(--c-dark); margin-right: auto; }
/* a platform switched off: its fields step back */
.platform:has(.toggle-enable input:not(:checked)) > :not(.platform-head):not(.toggle-enable) { opacity: .5; }
.readonly-text { white-space: pre-wrap; color: var(--c-muted); }
.account-label { font-family: var(--f-head); font-weight: 700; font-size: 17px; letter-spacing: -0.02em;
  color: var(--c-dark); margin-bottom: 6px; }

/* the sticky action bar (Short page, Settings) */
.action-bar { position: sticky; z-index: 20; bottom: calc(var(--tabbar-h) + var(--safe-b));
  margin: 0 calc(var(--gutter) * -1) var(--gutter); padding: 12px var(--gutter);
  background: rgba(251, 251, 252, .96); border-top: 1px solid var(--c-border);
  box-shadow: 0 -10px 24px -18px rgba(20, 20, 30, .35); }
@supports (backdrop-filter: blur(8px)) {
  .action-bar { background: rgba(251, 251, 252, .86); backdrop-filter: saturate(1.4) blur(12px); }
}
.action-bar .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.action-bar .btn { width: 100%; padding-left: 10px; padding-right: 10px; }
@media (max-width: 399px) { .action-bar .btn .i { display: none; } }
@media (min-width: 1024px) {
  .action-bar { bottom: 20px; width: fit-content; margin: 0 0 var(--gutter) auto; padding: 10px; border: 1px solid var(--c-border);
    border-radius: var(--radius-card); box-shadow: var(--shadow-lift); }
  .action-bar .actions { display: flex; justify-content: flex-end; }
  .action-bar .btn { width: auto; padding-left: 22px; padding-right: 22px; }
}

@media (min-width: 768px) {
  .short-top { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
  .media video { max-width: 268px; }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ schedule: a timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.slot { position: relative; margin: 0 0 22px; }
.slot-when { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.slot-time { font-family: var(--f-head); font-weight: 800; font-size: 30px; letter-spacing: -0.04em; line-height: 1;
  color: var(--c-accent); font-variant-numeric: tabular-nums; }
.slot-day { font-weight: 600; color: var(--c-muted); font-size: 15px; }
.group { margin-bottom: 0; padding: 0; overflow: hidden; }
.group-head { display: flex; gap: 14px; align-items: center; padding: 16px 16px 14px; }
.group-head .thumb { width: 48px; }
.group-title { min-width: 0; }
.group-title h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.group-title h2 a { color: var(--c-dark); text-decoration: none; }
.group-title h2 a:hover { color: var(--c-accent-ink); text-decoration: underline; }
.jobs { list-style: none; margin: 0; padding: 0; }
.job { border-top: 1px solid var(--c-border); padding: 12px 16px; }
.job-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.job-line .job-who { min-width: 132px; }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.job-error { color: var(--c-danger); margin: 8px 0 0; font-size: 15px; }
.assisted { margin-top: 12px; padding: 16px; background: #F7F5FF; border: 1px solid #E2DBFF;
  border-radius: var(--radius-card); }
.assisted h3 { display: flex; align-items: center; gap: 8px; }
.assisted h3 .i { color: var(--c-accent); }
.copybox { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.copybox input, .copybox textarea { flex: 1 1 auto; min-width: 0; font-size: 15px; }
.copybox .btn { flex: none; }
.group-actions { display: flex; flex-wrap: wrap; gap: 10px 12px; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--c-surface-2); border-top: 1px solid var(--c-border); }
.group-actions .muted { margin: 0; }
.manual-done { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.manual-done .field { flex: 1 1 260px; margin: 0; }
@media (min-width: 768px) {
  .timeline { position: relative; }
  .timeline::before { content: ""; position: absolute; top: 12px; bottom: 12px; left: 124px; width: 2px;
    background: linear-gradient(var(--c-lavender), rgba(211, 202, 255, .2)); border-radius: 2px; }
  .slot { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 28px; margin-bottom: 24px; }
  .slot-when { flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 16px; text-align: right; }
  .slot-when::after { content: ""; position: absolute; left: 119px; top: 28px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--c-white); box-shadow: inset 0 0 0 3px var(--c-accent); }
  .slot-time { font-size: 34px; }
  .slot-day { font-size: 14px; }
  .group-head { padding: 18px 20px 16px; }
  .group-head .thumb { width: 56px; }
  .group-title h2 { font-size: 20px; }
  .job { padding: 12px 20px; }
  .group-actions { padding: 14px 20px; }
  .reschedule { flex-wrap: nowrap; }
  .reschedule input[type="datetime-local"] { width: auto; }
}

/* ------------------------------------------------------------------ published */
.card-list { padding-top: 16px; padding-bottom: 16px; }
.published .row-main { align-items: flex-start; flex-basis: 100%; }
.published .thumb { width: 44px; }
.pub-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.pub-title { font-family: var(--f-head); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; line-height: 1.3; }
.pub-title a { color: var(--c-dark); text-decoration: none; }
.pub-title a:hover { color: var(--c-accent-ink); text-decoration: underline; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; }
.pub-meta .pm { width: 24px; height: 24px; border-radius: 6px; }
.pub-meta .pm .i { width: 14px; height: 14px; }
.pub-meta .job-who { gap: 7px; }
.pub-when { display: inline-flex; align-items: center; gap: 6px; }
.pub-when .i { width: 15px; height: 15px; }
.published .row-link { padding-left: 56px; }
.published .note { margin: 0 0 0 56px; }
@media (max-width: 479px) {
  .published .row-link { padding-left: 0; }
  .published .note { margin-left: 0; }
}

/* ------------------------------------------------------------------ accounts and settings */
.platforms.accounts { align-items: stretch; }
.accounts .card { display: flex; flex-direction: column; }
.accounts .actions { margin-top: auto; padding-top: 12px; }
.settings-link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 14px 18px; color: var(--c-dark);
  font-weight: 600; text-decoration: none; }
.settings-link .i:first-child { color: var(--c-accent); }
.settings-link .i:last-child { margin-left: auto; color: var(--c-muted); }
.settings-link:hover { border-color: #CFC7F7; }
.settings { gap: 0; }
.settings .card { margin-bottom: var(--gutter); }
.keys { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 768px) {
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choices { flex-direction: row; }
  .choices .choice { flex: 1 1 0; }
}
.action-bar-plain .actions { display: flex; justify-content: flex-end; }
.action-bar-plain .btn { width: auto; min-width: 160px; }
@media (max-width: 1023px) {
  .action-bar-plain .btn { width: 100%; }
}

.token-form .field { max-width: 560px; }

/* small screens */
@media (max-width: 479px) {
  .row-link .copybox { display: contents; }
  .row-link input { flex: 1 1 100%; }
  .row-link .btn { flex: 1 1 0; }
  .stats-actions > form { flex: 1 1 auto; }
  .stats-actions > form .btn { width: 100%; }
  .card { padding: 16px; }
  .copybox { flex-direction: column; align-items: stretch; }
  .actions .btn, .actions form.inline, .actions form.inline .btn { flex: 1 1 auto; }
  .group-actions > form, .group-actions .btn { width: 100%; }
  .reschedule input[type="datetime-local"] { max-width: none; }
  .job-actions { margin-left: 0; width: 100%; }
  .job-actions > *, .job-actions .btn { flex: 1 1 auto; }
  .manual-done .btn { width: 100%; }
}

/* ------------------------------------------------------------------ statistics */
.stats-boxes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 86%); gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  margin: 0 calc(var(--gutter) * -1) var(--gutter); padding: 4px var(--gutter) 14px; scrollbar-width: thin; }
.stats-boxes .stats-box { margin-bottom: 0; scroll-snap-align: start; }
.stats-box .platform-head { margin-bottom: 12px; }
.stats-windows { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.stats-window dt { font-size: 13px; font-weight: 600; color: var(--c-muted); margin-bottom: 6px; }
.stats-window dd { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats-metric { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--radius-tile);
  background: var(--c-surface-2); min-width: 0; font-size: 13px; }
.stats-metric strong { font-family: var(--f-head); font-weight: 800; font-size: 22px; letter-spacing: -0.03em;
  line-height: 1.1; color: var(--c-dark); font-variant-numeric: tabular-nums; }
.stats-window:first-child .stats-metric:first-child { background: var(--c-accent-tint); }
.stats-window:first-child .stats-metric:first-child strong { color: var(--c-accent-ink); }
.stats-followers { display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--c-border); }
.stats-followers dt { margin: 0; }
.stats-followers dd { display: block; }
.stats-followers strong { font-family: var(--f-head); font-weight: 800; font-size: 20px; letter-spacing: -0.03em; }
.stats-status { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: 14px; color: var(--c-muted); }
.stats-status .i { margin-top: 2px; }
.stats-status-error { color: var(--c-danger); }
.stats-lag { margin: 8px 0 0; font-size: 13px; }
.stats-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.stats-filters .field { margin: 0; flex: 1 1 130px; }
.stats-filters .stats-plats { flex: 1 1 100%; }
.stats-filters input[type="date"] { min-width: 0; }
.stats-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-checks .toggle { margin: 0; padding: 4px 12px 4px 8px; border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-tile); gap: 8px; }
.stats-checks .toggle:has(input:checked) { border-color: var(--c-accent); background: #F7F5FF; }
.plat-check .pm { width: 26px; height: 26px; border-radius: 6px; background: transparent; }
.toggle.plat-check input[type="checkbox"] { width: 20px; height: 20px; border-radius: 5px; background: #FFFFFF;
  box-shadow: inset 0 0 0 1.5px var(--c-border-strong); }
.toggle.plat-check input[type="checkbox"]::after { top: 4px; left: 7px; width: 6px; height: 10px; border-radius: 0;
  background: none; border: solid var(--c-white); border-width: 0 2px 2px 0; box-shadow: none;
  transform: rotate(45deg) scale(0); transition: transform .15s var(--ease); }
.toggle.plat-check input[type="checkbox"]:checked { background: var(--c-accent); box-shadow: none; }
.toggle.plat-check input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
.stats-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--c-border); }
.stats-data { padding: 0; overflow: hidden; }
.stats-data .empty { padding: 20px; }
.stats-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.stats-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 10px 12px; border-top: 1px solid var(--c-border); text-align: right;
  white-space: nowrap; background: var(--c-white); }
.stats-table thead th { border-top: 0; font-weight: 600; font-size: 13px; color: var(--c-muted); vertical-align: bottom;
  background: var(--c-surface-2); }
.stats-table thead tr:first-child th { padding-top: 14px; }
.stats-table .stats-title { position: sticky; left: 0; z-index: 1; text-align: left; font-weight: 600; color: var(--c-dark);
  white-space: normal; min-width: 160px; max-width: 260px; box-shadow: 1px 0 0 var(--c-border); }
.stats-table .stats-when { text-align: left; color: var(--c-muted); }
.stats-table .stats-plat { text-align: center; color: var(--c-dark); }
.stats-table .stats-plat .job-who { gap: 8px; }
.stats-table .stats-plat .pm { width: 24px; height: 24px; border-radius: 6px; background: var(--c-white); }
.stats-table .stats-plat .pm .i { width: 14px; height: 14px; }
.stats-table .stats-sep { border-left: 1px solid var(--c-border); }
.stats-table a { color: var(--c-accent-ink); font-weight: 600; text-decoration: none; }
.stats-table a:hover { text-decoration: underline; }
.stats-table tbody tr:hover td, .stats-table tbody tr:hover th { background: #F8F7FC; }
.stats-table .stats-subhead th { text-align: left; background: var(--c-surface-2); color: var(--c-dark); }
@media (min-width: 768px) {
  .stats-boxes { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible;
    margin: 0 0 var(--gutter); padding: 0; }
  .stats-filters .stats-plats { flex: 0 1 auto; }
  .stats-filters .field:not(.stats-plats) { flex: 0 1 180px; }
}

/* ------------------------------------------------------------------ login and the OAuth bounce page (dark) */
.login-body { min-height: 100dvh; display: flex; align-items: center; justify-content: center; color: #E9E8EF;
  background-color: var(--c-dark);
  background-image: radial-gradient(640px 480px at 0% 100%, rgba(99, 82, 204, .42), rgba(99, 82, 204, 0) 70%),
    radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: auto, 40px 40px; background-position: 0 0, 20px 20px; }
.login-wrap { width: 100%; max-width: 420px; padding: 24px var(--gutter) calc(24px + var(--safe-b)); }
.login-shell { padding: 5px; border-radius: 18px; background: rgba(211, 202, 255, .06);
  border: 1px solid rgba(211, 202, 255, .14); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7); }
.login-card { background: var(--c-dark-mid); border: 1px solid rgba(255, 255, 255, .07); border-radius: 13px;
  padding: 30px 26px 28px; color: #E9E8EF; }
.login-brand { display: flex; align-items: center; gap: 10px; color: var(--c-lavender); font-family: var(--f-head);
  font-weight: 700; font-size: 15px; letter-spacing: -0.02em; margin: 0 0 28px; }
.login-mark { width: 30px; height: 30px; flex: none; }
.login-title { color: #F4F3F8; margin: 0 0 22px; font-size: 32px; letter-spacing: -0.04em; }
.login-label { display: block; color: var(--c-lavender); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.login-card .login-input { width: 100%; min-height: 48px; padding: 12px 14px; font: 400 16px/1.4 var(--f-body); color: #F4F3F8;
  background: var(--c-dark); border: 1px solid rgba(211, 202, 255, .3); border-radius: var(--radius-tile);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.login-card .login-input:hover { border-color: rgba(211, 202, 255, .5); }
.login-card .login-input:focus-visible { outline: none; border-color: var(--c-lavender); box-shadow: 0 0 0 3px rgba(211, 202, 255, .3); }
.login-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 18px;
  padding: 12px 16px; font: 600 16px/1.2 var(--f-body); color: var(--c-white); background: var(--c-accent); border: 0;
  border-radius: var(--radius); cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 10px 24px -10px rgba(99, 82, 204, .9);
  transition: background-color .15s var(--ease), transform .1s var(--ease); }
.login-btn:hover { background: #7262D8; }
.login-btn:active { transform: translateY(1px); }
.login-btn:focus-visible { outline: 3px solid var(--c-lavender); outline-offset: 3px; }
.login-error { color: #FFC9C9; background: rgba(220, 38, 38, .16); border: 1px solid rgba(248, 113, 113, .3);
  border-radius: var(--radius-tile); padding: 10px 12px; margin: 0 0 16px; font-size: 14px; }
.login-ok { color: #F4F3F8; margin: 0 0 12px; }
.login-home { margin: 8px 0 0; }

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: no-preference) {
  .login-shell { animation: rise .6s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
