/* Mikyla's palette and type, copied from mikyla-cc's brief (v3, sections 6-8) by way of
   insta-photo-maker/lib/ui/tokens.css. Rainforest is the signature, moss is for actions and focus,
   oxblood is the rare warm accent (destructive actions only). Dark only, no shadows, hairlines. */
:root {
  --ink: #0A0A0A;
  --rainforest: #1A4D2E;
  --rainforest-deep: #0F3320;
  --moss: #22C55E;
  --oxblood: #4A1520;
  --bone: #E8E6E1;
  --slate: #8A9490;
  --panel: #0E1512;
  --sink: #0B100D;
  --line: #1E2A23;
  --line-soft: #141C17;
  --grip: #2A3A31;
  --warn: #E0A295;

  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --gutter: 16px;
  --tabs-h: 62px;

  color-scheme: dark;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--bone);
  background: var(--ink);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ink);
  /* faint top sheen, as on mikyla.cc */
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(26, 77, 46, 0.22), transparent 60%);
  background-attachment: fixed;
  color: var(--bone);
}
main { max-width: 640px; margin: 0 auto; padding: 8px var(--gutter) 112px; }
h1, h2 { font-family: var(--display); font-variation-settings: "opsz" 144, "SOFT" 75; letter-spacing: -0.03em; }
h1 { font-size: 2rem; line-height: 1.1; font-weight: 640; margin: 28px 0 16px; }
h2 { font-size: 1.15rem; line-height: 1.25; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
p { margin: 0 0 8px; }
a { color: var(--moss); text-decoration: none; }
::selection { background: var(--rainforest); color: var(--bone); }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }

/* Labels and numbers: JetBrains Mono, tracked, slate (per the brief). */
.meta, .label {
  font-family: var(--mono); font-size: 0.72rem; line-height: 1.5;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--slate);
  font-variant-numeric: tabular-nums;
}

.top {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px var(--gutter); padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(10, 10, 10, 0.92); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--bone); font-weight: 600; }
.back::before { content: ""; width: 9px; height: 9px; border-left: 2px solid var(--moss); border-bottom: 2px solid var(--moss); transform: rotate(45deg); margin-right: 2px; }
.brand {
  font-family: var(--display); font-variation-settings: "opsz" 144, "SOFT" 75;
  font-weight: 640; font-size: 1.2rem; letter-spacing: -0.03em; color: var(--bone);
}

.button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--bone);
  font: inherit; font-weight: 600; text-decoration: none;
  padding: 10px 18px; min-height: 44px;
}
.button.primary { background: var(--moss); border-color: var(--moss); color: var(--ink); }
.button.danger { color: var(--warn); border-color: var(--oxblood); }
.button.small { padding: 6px 14px; min-height: 36px; font-size: 0.94rem; }
.button:disabled { opacity: 0.45; cursor: default; }

.error { color: var(--warn); font-weight: 600; }

/* Queue: each post leads with its time, like a mile marker. */
.queue { list-style: none; margin: 0; padding: 0; }
.entry {
  display: block; color: inherit; position: relative;
  padding: 20px 0 18px 16px; border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--grip);
}
.entry.status-approved { border-left-color: var(--rainforest); }
.entry.status-published { border-left-color: var(--moss); }
.entry.status-failed { border-left-color: var(--oxblood); }
.when {
  font-family: var(--mono); font-size: 1.9rem; font-weight: 500; line-height: 1.1;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--bone); margin-bottom: 6px;
}
.strip { display: flex; gap: 6px; margin-top: 12px; overflow: hidden; }
.strip img { width: 64px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; background: var(--panel); }

.empty { padding: 56px 0; }
.empty p { color: var(--slate); max-width: 34ch; }
.empty .button { margin-top: 16px; }

/* Forms */
.stack { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
input, select, textarea {
  font: inherit; color: var(--bone); background: var(--sink);
  border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; width: 100%;
}
input[type="file"] { padding: 12px; }
textarea { resize: vertical; }
.actions {
  position: sticky; bottom: 0; padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  background: var(--ink); border-top: 1px solid var(--line-soft);
}
.actions .button { width: 100%; }
.has-tabs .actions { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }

/* Draft preview: swipe like Instagram. */
.reel { position: relative; margin: 12px calc(var(--gutter) * -1) 20px; }
.carousel {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  background: var(--sink);
}
.carousel::-webkit-scrollbar { display: none; }
.position {
  position: absolute; right: 12px; bottom: 12px; margin: 0; padding: 2px 8px; border-radius: 99px;
  background: rgba(10, 10, 10, 0.72); color: var(--bone);
}
.carousel img { flex: 0 0 100%; width: 100%; aspect-ratio: var(--ratio); object-fit: cover; scroll-snap-align: center; }
.account { color: var(--slate); font-family: var(--mono); font-size: 0.8rem; font-weight: 400; letter-spacing: 0.04em; }
.caption { white-space: pre-wrap; }

@media (prefers-reduced-motion: no-preference) {
  .carousel { scroll-behavior: smooth; }
}

/* Pages reached from the tab bar */
.has-tabs main { padding-bottom: calc(var(--tabs-h) + 96px + env(safe-area-inset-bottom)); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10, 10, 10, 0.94); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tabs a {
  position: relative; height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--slate); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.01em;
}
.tabs a[aria-current="page"] { color: var(--bone); }
.tabs a[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--moss); border-radius: 0 0 2px 2px;
}
.icon { width: 24px; height: 24px; }
.badge {
  position: absolute; top: 7px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--moss); color: var(--ink);
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600; line-height: 18px; text-align: center;
}
@media (min-width: 720px) {
  .tabs { left: 50%; right: auto; width: 520px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; }
}

/* Page openers and quiet helper text */
.intro { color: var(--slate); max-width: 52ch; margin-bottom: 20px; }
.hint { color: var(--slate); font-size: 0.88rem; line-height: 1.5; margin: 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Queue groups */
.group { margin-top: 28px; }
.group h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.count { font-family: var(--mono); font-size: 0.78rem; font-weight: 500; color: var(--slate); letter-spacing: 0.04em; }
.strip .more { align-self: center; color: var(--slate); font-family: var(--mono); font-size: 0.8rem; padding-left: 4px; }

/* Draft page */
.pill {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  padding: 4px 10px; border-radius: 99px; border: 1px solid var(--grip); color: var(--slate);
}
.pill.status-approved { border-color: var(--rainforest); color: var(--moss); }
.pill.status-published { border-color: var(--moss); color: var(--moss); }
.pill.status-failed { border-color: var(--oxblood); color: var(--warn); }
.lede h1 { margin-bottom: 6px; }
.lede { margin-bottom: 4px; }

.platforms { display: grid; gap: 12px; }
.platform {
  margin: 0; min-width: 0; padding: 14px 14px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  display: grid; gap: 10px;
}
.platform-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.platform-head h2 { margin: 0; font-family: var(--sans); font-size: 1rem; letter-spacing: 0; }
.platform-body { display: grid; gap: 8px; }
.platform.off { background: transparent; }
.platform.off .platform-body { display: none; }
.platform.unavailable { opacity: 0.55; }
.platform textarea { background: var(--sink); }

/* On/off switch built from the native checkbox, so it stays a real form field. */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 32px; }
.switch input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; padding: 0;
  width: 42px; height: 24px; border-radius: 12px; border: 1px solid var(--grip); background: var(--sink);
  position: relative; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--slate); transition: transform 0.15s, background 0.15s;
}
.switch input:checked { background: var(--rainforest); border-color: var(--moss); }
.switch input:checked::after { transform: translateX(18px); background: var(--bone); }
.switch input:disabled { opacity: 0.4; cursor: default; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--slate); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px; min-height: 34px;
}
.chip[aria-pressed="true"] { color: var(--ink); background: var(--moss); border-color: var(--moss); }
.counter { text-align: right; margin: -4px 0 0; min-height: 1.1em; }
.counter.over { color: var(--warn); }

.fold { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.fold[open] { padding-bottom: 14px; }
.fold summary { cursor: pointer; color: var(--moss); font-weight: 600; min-height: 52px; display: flex; align-items: center; }
.fold .platform { margin-top: 10px; }

.steer { display: grid; gap: 10px; padding-top: 8px; }
.steer h2 { margin: 0; }
.steer .button { justify-self: start; }

/* One row on a phone: time on the left, the button on the right. */
.schedule { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.schedule .field { gap: 2px; }
.schedule .label { font-size: 0.64rem; }
.schedule input { padding: 9px 8px; min-height: 44px; min-width: 0; font-size: 0.94rem; }
.schedule .field { min-width: 0; }
.schedule .button { width: auto; padding: 10px 14px; line-height: 1.2; }
.steer { padding-bottom: 8px; }

.danger-zone { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

/* Accounts */
.accounts { list-style: none; margin: 0; padding: 0; }
.accounts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); min-height: 56px; }
.accounts .account { font-size: 0.9rem; color: var(--bone); }
.meta.ok { color: var(--moss); }

/* Places */
.places { list-style: none; margin: 0 0 32px; padding: 0; border-top: 1px solid var(--line); }
.places li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.places strong { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.places .meta { margin: 2px 0 0; }
.add-place h2 { margin: 0; }

.place { color: var(--bone); margin: 4px 0 0; }
.place strong { font-family: var(--display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }

/* Claude's summary and "check before posting" flags */
.note { white-space: pre-wrap; border-left: 3px solid var(--rainforest); padding: 8px 0 8px 12px; color: var(--bone); background: var(--panel); border-radius: 0 7px 7px 0; }
.caption { white-space: pre-wrap; margin: 0; }
.account { color: var(--slate); font-family: var(--mono); font-size: 0.8rem; font-weight: 400; letter-spacing: 0.04em; }

@media (prefers-reduced-motion: reduce) {
  .switch input, .switch input::after { transition: none; }
}

/* Photo editor: the picture fills what the ribbon leaves; everything sized for a 390px phone. */
.edit-link { margin: 10px 0 16px; }
.editing main { max-width: 720px; padding: 0 var(--gutter) env(safe-area-inset-bottom); }
.editor { display: flex; flex-direction: column; height: calc(100dvh - 57px - env(safe-area-inset-top)); }
.ed-photos { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 10px 0; scrollbar-width: none; flex: none; }
.ed-photos::-webkit-scrollbar { display: none; }
.ed-thumb { flex: none; padding: 0; border: 2px solid transparent; border-radius: 9px; background: none; cursor: pointer; line-height: 0; }
.ed-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 7px; }
.ed-thumb[aria-pressed="true"] { border-color: var(--moss); }
.ed-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.ed-view {
  position: relative; overflow: hidden; background: var(--sink); touch-action: none; user-select: none; -webkit-user-select: none;
  outline: 1px solid var(--line); cursor: grab;
}
.ed-view img { position: absolute; max-width: none; pointer-events: none; }
.ed-status { text-align: center; min-height: 1.6em; margin: 6px 0 0; }
.ed-ribbon { flex: none; display: grid; gap: 10px; padding: 8px 0 12px; border-top: 1px solid var(--line); }
.ed-control { display: grid; grid-template-columns: 6.5em 1fr 4.2em; align-items: center; gap: 10px; }
.ed-name { font-weight: 600; font-size: 0.92rem; }
.ed-value { text-align: right; }
.ed-slider { width: 100%; padding: 0; border: 0; background: none; accent-color: var(--moss); height: 32px; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-chips::-webkit-scrollbar { display: none; }
.ed-chips .chip, .ed-photos .chip { flex: none; position: relative; }
.chip.changed::after { content: ""; position: absolute; top: 4px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--moss); }
.chip[aria-pressed="true"].changed::after { background: var(--ink); }
.chip.quiet { color: var(--slate); }
.chip.danger { color: var(--warn); border-color: var(--oxblood); }
.chip:disabled { opacity: 0.35; cursor: default; }
.ed-bar { display: flex; justify-content: space-between; align-items: center; }
.ed-tabs { display: flex; gap: 4px; background: var(--sink); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.ed-tabs button {
  font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--slate); background: none; border: 0;
  border-radius: 99px; padding: 6px 18px; min-height: 36px; cursor: pointer;
}
.ed-tabs button[aria-selected="true"] { background: var(--rainforest); color: var(--bone); }
.ed-undo { font: inherit; font-weight: 600; color: var(--bone); background: none; border: 1px solid var(--line); border-radius: 99px; padding: 6px 16px; min-height: 36px; cursor: pointer; }
.ed-undo:disabled { opacity: 0.35; cursor: default; }
.switch.story { padding-top: 6px; border-top: 1px solid var(--line-soft); }
.switch.story .meta { margin-left: 6px; }
.location-tag { display: grid; gap: 10px; }
.location-tag h2 { margin: 0; }
.add-tag { gap: 12px; }

/* Stats */
.stat-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px; margin-bottom: 14px; }
.stat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stat-head h2 { margin: 0; font-family: var(--sans); font-size: 1rem; letter-spacing: 0; }
.stat-big { font-family: var(--mono); font-size: 1.9rem; font-weight: 500; line-height: 1.1; margin: 12px 0 2px; }
.stat-big .meta { font-size: 0.68rem; }
.stat-change { font-family: var(--mono); font-size: 0.8rem; margin: 0 0 6px; }
.stat-change.up { color: var(--moss); }
.stat-change.down { color: var(--warn); }
.best { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.best li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.best li:last-child { border-bottom: 0; }
.best a { color: var(--bone); }
.best .meta { margin: 2px 0 0; }
.schedule .suggestion { grid-column: 1 / -1; font-size: 0.8rem; margin: 0; color: var(--moss); }
.brand-row { margin: 0; }
.brand-row select { width: auto; flex: 1; min-width: 0; }
.clip { display: block; width: 100%; max-height: 70vh; background: var(--sink); }
.video-editor .clip { margin-top: 12px; border-radius: 8px; }
.clip-length { padding: 6px var(--gutter) 0; margin: 0; }
input[type=range] { accent-color: var(--moss); padding: 0; border: 0; background: none; }

/* ===== Layout: phone first; a sidebar and wider pages from 900px ===== */
.sidebar { display: none; }
.page { min-width: 0; }
.nav-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--slate); margin: 18px 12px 6px; }
.menu { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.menu li a { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 4px; color: var(--bone); border-bottom: 1px solid var(--line); }
.menu .icon { color: var(--moss); }
.menu .cal-item { width: 44px; height: 44px; flex: none; }
.more-link { display: inline-block; margin-top: 12px; font-weight: 600; }
.up { color: var(--moss); }
.down { color: var(--warn); }

@media (min-width: 900px) {
  :root { --gutter: 32px; }
  body { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .tabs { display: none; }
  .has-tabs main { padding-bottom: 64px; }
  .has-tabs .actions { bottom: 0; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(10, 10, 10, 0.6);
  }
  .sidebar .brand { padding: 0 10px 14px; font-size: 1.35rem; }
  .sidebar .new { margin: 0 4px 14px; gap: 8px; }
  .sidebar .new .icon { width: 18px; height: 18px; }
  .sidebar nav { display: grid; gap: 2px; }
  .sidebar nav a {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px;
    border-radius: 9px; color: var(--slate); font-weight: 500;
  }
  .sidebar nav a:hover { color: var(--bone); background: var(--panel); }
  .sidebar nav a[aria-current="page"] { color: var(--bone); background: var(--rainforest-deep); }
  .sidebar nav a[aria-current="page"] .icon { color: var(--moss); }
  .sidebar .badge { position: static; margin-left: auto; }
  .top .brand { visibility: hidden; }  /* the sidebar carries the name */
  .top { position: static; background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }  /* see-through, so it scrolls away instead of floating over the page */
  body:not(.split) .top > .button.primary { display: none; }  /* New draft lives in the sidebar */
  main { max-width: 760px; padding: 0 var(--gutter) 64px; margin: 0; }
  .wide main { max-width: 1240px; }
}

/* ===== Home ===== */
.home { display: grid; gap: 28px; padding-top: 8px; }
.home h2 { display: flex; gap: 10px; align-items: baseline; }
.cards { display: grid; gap: 10px; }
.post-card {
  display: flex; gap: 12px; align-items: center; padding: 10px; color: var(--bone);
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.post-card:hover { border-color: var(--grip); }
.post-card .thumbs { display: flex; flex: none; }
.post-card .thumbs img { width: 52px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid var(--panel); }
.post-card .thumbs img + img { margin-left: -26px; }
.card-text { display: grid; gap: 2px; min-width: 0; }
.card-text .when { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; }
.post-card.status-approved { border-left: 3px solid var(--rainforest); }
.post-card.status-failed { border-left: 3px solid var(--oxblood); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; display: grid; gap: 10px; border-left: 2px dotted var(--grip); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.kpi-value { font-family: var(--mono); font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
@media (min-width: 900px) {
  .home { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; column-gap: 32px; }
  .home-week { grid-column: 1 / -1; }
  .home-week .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}



/* ===== Calendar ===== */
.cal-head, .an-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-head h1 { margin-bottom: 8px; }
.cal-hint { margin-bottom: 12px; }
.cal { display: grid; gap: 4px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-names span { font-family: var(--mono); font-size: 0.66rem; color: var(--slate); text-align: center; letter-spacing: 0.1em; text-transform: uppercase; }
.cal-day {
  min-height: 64px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--sink);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.cal-day.other { opacity: 0.4; }
.cal-day.today { border-color: var(--moss); }
.cal-day.picked { background: var(--rainforest-deep); }
.cal-day.drop { outline: 2px dashed var(--moss); }
.cal-date { font-family: var(--mono); font-size: 0.78rem; color: var(--slate); }
.today .cal-date { color: var(--moss); font-weight: 600; }
.cal-items { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-item { display: block; width: 100%; aspect-ratio: 4 / 5; max-width: 34px; border-radius: 5px; overflow: hidden; background: var(--grip); }
.cal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-item.status-approved { outline: 2px solid var(--moss); outline-offset: -2px; }
.cal-item.status-history { opacity: 0.55; }
.cal-item[draggable="true"] { cursor: grab; }
.cal-more { font-family: var(--mono); font-size: 0.7rem; color: var(--slate); align-self: center; }
.cal-list { margin-top: 20px; }
@media (min-width: 900px) {
  .cal-day { min-height: 118px; padding: 8px; }
  .cal-item { max-width: 52px; }
}

/* ===== Analytics ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.filters select, .filters input { width: auto; flex: 1 1 140px; min-height: 40px; padding: 6px 10px; font-size: 0.92rem; }
.an-kpis { margin-bottom: 18px; }
.an-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px; min-width: 0; }
.panel h2 { font-family: var(--sans); font-size: 1rem; letter-spacing: 0; margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; }
.mini { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.mini th { text-align: left; font-weight: 500; padding: 5px 8px 5px 0; white-space: nowrap; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.mini th a { color: var(--bone); }
.mini td { padding: 5px 0 5px 8px; }
.mini .num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--sink); min-width: 40px; }
.bar span { display: block; height: 100%; border-radius: 3px; background: var(--moss); }
.spark { width: 100%; height: 80px; color: var(--moss); }
.heat { display: grid; grid-template-columns: 16px repeat(24, minmax(0, 1fr)); gap: 2px; }
.heat-h, .heat-d { font-family: var(--mono); font-size: 0.58rem; color: var(--slate); text-align: center; }
.heat-c { aspect-ratio: 1; border-radius: 2px; background: color-mix(in srgb, var(--moss) calc(var(--v) * 100%), var(--sink)); }
.sorts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.86rem; }
.sorts a { color: var(--slate); }
.sorts a[aria-current="true"] { color: var(--moss); font-weight: 600; }
.posts { list-style: none; margin: 8px 0 0; padding: 0; }
.post-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--bone); }
.post-row img, .post-row .noimg { width: 52px; height: 64px; object-fit: cover; border-radius: 7px; background: var(--sink); display: block; }
.post-text { display: grid; gap: 2px; min-width: 0; }
.post-caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-nums { display: grid; justify-items: end; text-align: right; }
.post-nums .meta { display: none; }
.num-big { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; }
@media (min-width: 900px) {
  .an-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .an-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .an-heat { grid-column: span 2; }
  .post-nums .meta { display: block; max-width: 22em; }
}

/* ===== Draft page on a computer: media left, captions right (the media scrolls with the page: pinning it hid the
   buttons and notes under it) ===== */
@media (min-width: 1100px) {
  .split main { max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 32px; align-items: start; }
  .split main > .lede, .split main > .reel, .split main > .edit-link, .split main > .note { grid-column: 1; }
  .split main > .reel { margin: 0; }
  .split main > form, .split main > .platforms, .split main > .danger-zone, .split main > .error { grid-column: 2; grid-row: 1 / span 6; }
  .split main > .danger-zone { grid-row: auto; }
}
.an-grid { align-items: start; }

/* ==========================================================================
   v3: flat, dense, industrial (after the Sigma timeclock admin restyle), in Mikyla's colours.
   Small radii, no shadows, thin dividers; tiles in a 1px-gap box so a row is always one height.
   ========================================================================== */
:root { --r: 5px; --line-strong: #263429; }
.panel, .kpi, .post-card, .stat-card, .platform, .fold, .note, .filters select, .filters input { border-radius: var(--r); }

/* Page header */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 18px 0 16px; }
.pagehead h1 { margin: 0; font-size: 2rem; }
.trail { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); margin: 0 0 4px; }
.pagehead-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Fact tiles: equal heights by construction (grid rows stretch inside one bordered box) */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 0 0 20px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.fact { background: var(--panel); padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; }
.fact dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); }
.fact dd { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fact-n { font-family: var(--mono); font-size: 1.75rem; font-weight: 500; letter-spacing: -0.03em; line-height: 1; color: var(--bone); }
.fact small { color: var(--slate); font-size: 0.8rem; }
.fact .delta { font-family: var(--mono); font-size: 0.74rem; }
.fact.alert .fact-n { color: var(--warn); }
.fact.lead .fact-n { color: var(--moss); }
@media (min-width: 900px) { .fact-n { font-size: 2.1rem; } }

/* Cards: header row (title, count, controls) + body */
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); min-height: 48px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-family: var(--sans); font-size: 0.98rem; font-weight: 650; letter-spacing: 0; }
.card-head .count { margin-right: auto; }
.card-head > :last-child:not(h2):not(.count) { margin-left: auto; }
.card-body { padding: 14px 16px; }
.card-flush { padding: 0; }
.card-empty { padding: 22px 16px; color: var(--slate); text-align: center; font-size: 0.92rem; }
.card .more-link { margin: 0; padding: 10px 16px; display: block; border-top: 1px solid var(--line-soft); font-size: 0.9rem; }

/* Chips with counts, filter bar, pager, tags */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.chips-group { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1.5px solid var(--line-strong);
  color: var(--slate); font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.pill i { font-style: normal; font-family: var(--mono); font-size: 0.74rem; color: var(--slate); }
.pill[aria-current="true"] { color: var(--bone); border-color: var(--moss); background: var(--rainforest-deep); }
.pill[aria-current="true"] i { color: var(--moss); }
.filter-selects { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 260px; }
.filter-selects select, .filter-selects input { flex: 1 1 150px; width: auto; min-height: 36px; padding: 5px 10px; font-size: 0.9rem; border-radius: var(--r); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0; }
.pager [aria-disabled="true"] { opacity: 0.35; }
.tag { font-family: var(--mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 7px;
  border-radius: 4px; border: 1px solid var(--line-strong); color: var(--slate); white-space: nowrap; }
.tag-draft { color: var(--bone); }
.tag-approved { color: var(--moss); border-color: var(--rainforest); background: var(--rainforest-deep); }
.tag-published { color: var(--moss); }
.tag-failed { color: var(--warn); border-color: var(--oxblood); }

/* Data rows (tables on a computer, stacked on a phone) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line-soft); }
.row-link { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; color: var(--bone); }
.row-link:hover { background: var(--sink); }
.row-link img, .row-link .noimg { width: 48px; height: 60px; object-fit: cover; border-radius: 4px; background: var(--sink); display: block; }
.row-main { display: grid; gap: 3px; min-width: 0; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.row-time { font-family: var(--mono); font-size: 1rem; font-weight: 500; }
.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data th { font-family: var(--mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate);
  text-align: left; padding: 9px 12px; background: var(--sink); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data th a { color: var(--slate); }
.data th a[aria-current="true"] { color: var(--moss); }
.data td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data tr:hover td { background: var(--sink); }
.data .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data .cap { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data img { width: 40px; height: 50px; object-fit: cover; border-radius: 4px; display: block; }
.data td a { color: var(--bone); }
.table-scroll { overflow-x: auto; }
.only-desk { display: none; }
@media (min-width: 900px) { .only-desk { display: block; } .only-phone { display: none; } }

/* Dashboard grid */
.dash { display: grid; gap: 16px; }
@media (min-width: 1000px) {
  .dash { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
  .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
}
.weekstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); }
.weekstrip > div { background: var(--panel); padding: 8px 6px 10px; min-height: 96px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.weekstrip .wd { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); }
.weekstrip .today .wd { color: var(--moss); }
.weekstrip img { width: 100%; max-width: 44px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 3px; outline: 2px solid var(--moss); outline-offset: -2px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 6px 0 0; }
.bars span { flex: 1; background: var(--rainforest); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.bars span.has { background: var(--moss); }
.bars-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.62rem; color: var(--slate); margin-top: 6px; }
.times li, .health li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 16px; font-size: 0.92rem; }
.times, .health { list-style: none; margin: 0; padding: 0; }
.times li + li, .health li + li { border-top: 1px solid var(--line-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; background: var(--moss); }
.dot.off { background: var(--warn); }
.feature { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px 16px; color: var(--bone); }
.feature img { width: 96px; height: 120px; object-fit: cover; border-radius: 4px; }

/* Skipped grid */
.skip-grid { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 900px) { .skip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.skip-grid .entry { border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 12px 14px; }
.dash-side { display: grid; gap: 16px; }
.cal-day { border-radius: 4px; }
.cal { gap: 1px; background: var(--line-soft); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal-row { gap: 1px; }
.cal-names span { background: var(--sink); padding: 6px 0; }
.cal-day { border: 0; border-radius: 0; background: var(--panel); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--moss); }

/* Fact tiles: fixed columns so a row never ends with an orphan tile (2 on a phone, --cols on a computer) */
.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); } }
.row-link .strip { margin-top: 4px; display: none; gap: 4px; }
@media (min-width: 900px) { .row-link .strip { display: flex; } .row-link .strip img { width: 32px; height: 40px; } }
.queue .row-side { align-self: start; }
.brand img { height: 30px; width: auto; display: block; }
.sidebar .brand img { height: 44px; }
/* Settings */
.settings-nav { margin-bottom: 16px; }
.settings-intro { margin-bottom: 14px; max-width: 70ch; }
.settings-form .stack { gap: 16px; }
.card-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.logo-preview { max-height: 56px; width: auto; align-self: start; background: var(--sink); padding: 8px; border-radius: var(--r); }
.icon-preview { width: 64px; height: 64px; border-radius: 14px; }
.channel-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.settings-form textarea { font-size: 0.92rem; line-height: 1.5; }

/* Sign-in pages */
.signin { display: grid; place-items: center; min-height: 100dvh; padding: 24px var(--gutter); }
.signin-box { width: 100%; max-width: 400px; padding: 28px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.signin-box h1 { margin: 6px 0 10px; }
.signin-box .button { width: 100%; }
.signin-brand { margin: 0 0 8px; font-family: var(--display); font-size: 1.3rem; }
.signin-brand img { height: 52px; width: auto; display: block; }
.me-link { margin-top: auto; display: grid; gap: 2px; padding: 12px; border-top: 1px solid var(--line); color: var(--bone); font-weight: 600; }
.link-card { margin-bottom: 16px; }
.link-card input { flex: 1; font-family: var(--mono); font-size: 0.85rem; }
.guide ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; max-width: 80ch; }
.guide code { font-family: var(--mono); font-size: 0.82rem; background: var(--sink); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.wanted { padding: 8px 16px 12px; margin: 0; }
.channel-row .row-main { min-width: 0; } .channel-row .row-title { overflow: hidden; text-overflow: ellipsis; }

/* ===== One size system (fixes uneven pills and cells) =====
   Every control is 36px tall; status tags are 22px; cards in the same row are the same height. */
:root { --control: 36px; }
.pill, .chip, .button.small, .ed-tabs button, .ed-undo,
.filter-selects select, .filter-selects input, .filters select, .filters input, .brand-row select, .card-head .button {
  height: var(--control); min-height: var(--control); box-sizing: border-box;
}
.pill, .chip, .button.small { display: inline-flex; align-items: center; justify-content: center; padding-block: 0; line-height: 1; }
.pill { font-family: var(--sans); font-size: 0.86rem; letter-spacing: 0; text-transform: none; }
.chip { font-size: 0.86rem; }
.filter-selects select, .filter-selects input, .brand-row select { padding: 0 10px; line-height: normal; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; line-height: 1; box-sizing: border-box; }
.badge { height: 18px; }

/* cards: same height across a row, content at the top, footers at the bottom */
.dash { align-items: stretch !important; }
.an-grid { align-items: stretch; }
.dash > .card, .dash > section.card, .dash > form.card { display: flex; flex-direction: column; }
.dash > .card > .card-body, .dash > .card > .rows, .dash > .card > .weekstrip { flex: 0 0 auto; }
.dash > .card > .card-foot { margin-top: auto; }
.dash > .card > .more-link { margin-top: auto; }
.dash-side { align-content: start; }
.card-head { min-height: 52px; }
.facts .fact { min-height: 76px; }

/* nothing inside a grid column may push it wider than the screen */
.page, main, main > *, .dash > *, .split main > *, .platforms, .platform, .platform-body, .card, .rows, .row-link { min-width: 0; }
.platform textarea, .card textarea { max-width: 100%; }
.chips, .chips-group { min-width: 0; }
/* single-column grids never grow wider than their box (a grid's auto column otherwise stretches to its widest content) */
.stack, .platforms, .platform, .platform-body, .home, .skip-grid, .steer, .location-tag, .add-tag { grid-template-columns: minmax(0, 1fr); }
.mark-name { display: inline-flex; align-items: center; gap: 10px; }
.mark-name img { width: 32px; height: 32px; }
.sidebar .mark-name img { width: 36px; height: 36px; }

/* Add or remove photos: equal square tiles; a selected tile gets a green ring and a tick. */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; list-style: none; margin: 0; }
.pick { position: relative; aspect-ratio: 1; min-width: 0; }
.pick label { display: block; width: 100%; height: 100%; cursor: pointer; }
.pick img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r); border: 2px solid transparent; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick input:checked + img { border-color: var(--moss); }
.pick label:has(input:checked)::after {
  content: "\2713"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--moss); color: var(--ink); font-weight: 700; font-size: 0.8rem; display: grid; place-items: center; }
.pick input:focus-visible + img { outline: 2px solid var(--bone); outline-offset: 2px; }
.pick-flag { position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px; font-size: 0.72rem;
  background: rgba(10, 10, 10, 0.75); color: var(--warn); }
.pick-remove { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 26px; border-radius: 4px; font: inherit; font-size: 0.78rem;
  background: rgba(10, 10, 10, 0.75); color: var(--warn); border: 1px solid var(--oxblood); cursor: pointer; }
.hint.card-body + .pick-grid { padding-top: 0; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-row input { flex: 1 1 220px; min-width: 0; }

/* Voice page */
.voice-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.voice-pair { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .voice-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.voice-picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.voice-picks li { display: grid; grid-template-columns: 72px minmax(0, 1fr) 28px; align-items: center; gap: 10px; }
.voice-bar { height: 10px; border-radius: 5px; background: var(--sink); overflow: hidden; }
.voice-bar > span { display: block; height: 100%; background: var(--moss); }
.voice-text { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 12px; border-radius: var(--r); background: var(--sink);
  border: 1px solid var(--line-soft); font-family: var(--sans); font-size: 0.86rem; line-height: 1.5; max-height: 420px; overflow: auto; }
details summary { cursor: pointer; padding: 6px 0; font-weight: 600; }
:target { scroll-margin-top: 16px; }

/* Carousel arrows: only where there's a mouse (phones swipe). */
.reel-step { display: none; }
@media (hover: hover) and (pointer: fine) {
  .reel-step { display: grid; place-items: center; position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 10, 10, 0.72);
    color: var(--bone); font-size: 1.6rem; line-height: 1; cursor: pointer; }
  .reel-step[hidden] { display: none; }
  .reel-step.prev { left: 12px; } .reel-step.next { right: 12px; }
  .reel-step:hover { background: var(--panel); }
  .reel-step:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
}

/* Updates: the popup and the notes */
.update-pop { position: fixed; z-index: 20; inset: auto 16px 16px auto; max-width: min(460px, calc(100vw - 32px)); margin: 0;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--bone);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); display: grid; gap: 10px; }
.has-tabs .update-pop { bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); }
.update-pop h2 { margin: 0; font-size: 1.15rem; }
.update-pop .row { display: flex; flex-wrap: wrap; gap: 8px; }
.update-pop form { margin: 0; }
.update-notes { white-space: pre-wrap; max-height: 260px; overflow: auto; font-size: 0.92rem; line-height: 1.55; }
.row-line { display: grid; gap: 2px; padding: 10px 16px; }
