/* ---------- Colors ---------- */
/* Variables let us change a color everywhere by editing it once.
   The "dark" block is used when Settings > Appearance is set to Dark
   (it sets <html data-theme="dark">). */
:root {
  --bg: #fbfaf8;            /* soft white (widget, pop-ups) */
  --surface: #f3f1ee;       /* hover, empty tiles, segmented controls */
  --field: #ffffff;         /* pure white: typing boxes, dropdowns, cards, the chosen option in a switch */
  --surface-hover: #eae7e2;
  --border: #e7e4df;        /* lines, dividers, input borders */
  --text: #1c1917;          /* main text */
  --muted: #78716c;         /* quiet icons, hints, inactive tabs */
  --accent: #1c1917;        /* ink black: Create, Save, active tab line, switches ON */
  --on-accent: #ffffff;     /* text and icons on top of the accent color */
  --danger: #dc2626;        /* Retry, Discard, Disconnect */
  --danger-soft: #fef2f2;   /* background behind danger things */
  --plan: #dcf5e6;          /* Plan mode button, "Saved to Notion" label */
  --plan-text: #166534;
  --plan-soft: #eefaf3;
  --plan-line: #a7e3c0;
  --saved: #16a34a;         /* "everything is saved" green */
  --toggle-off: #d6d3ce;
  --toggle-on: var(--accent);
  --overlay: rgba(28, 25, 23, 0.45);   /* dim layer behind pop-ups */
  --label-bg: rgba(28, 25, 23, 0.72);  /* dark see-through labels on photos */
  --draft: #b8b8b8;
  --scheduled: #f0a53c;
  --published: #5fb878;

  /* Fonts: Inter first; if it can't load, the device's own font is used */
  --font: "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Corner roundness */
  --r-control: 9px;         /* buttons and inputs */
  --r-card: 12px;           /* cards and menus */
  --r-popup: 16px;          /* pop-ups */
  --r-tile: 2px;            /* grid tiles */
  --r-label: 6px;           /* dark labels on tiles */
  --r-chip: 20px;           /* chips (status, pillar) */

  /* Soft shadows: only filled buttons, menus and pop-ups get one */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-menu: 0 2px 4px rgba(60, 45, 30, 0.05), 0 10px 24px rgba(60, 45, 30, 0.10);
  --shadow-popup: 0 4px 8px rgba(60, 45, 30, 0.06), 0 24px 48px rgba(60, 45, 30, 0.16);
  color-scheme: light;
}

/* Dark mode: "warm charcoal". Auto theme also uses this block when the device is dark. */
:root[data-theme="dark"] {
  --bg: #1a1816;
  --surface: #25221f;
  --field: #211e1b;         /* a step lighter than the background, so boxes still stand out */
  --surface-hover: #302c28;
  --border: #36312c;
  --text: #f2efea;
  --muted: #a39c93;
  --accent: #f2efea;        /* the accent flips to off-white */
  --on-accent: #1a1816;
  --danger: #f87171;
  --danger-soft: #3a1f1c;
  --plan: #1e3a2b;
  --plan-text: #86efac;
  --plan-soft: #18281f;
  --plan-line: #2f5a43;
  --saved: #4ade80;
  --toggle-off: #4a443e;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-menu: 0 2px 4px rgba(0, 0, 0, 0.3), 0 10px 24px rgba(0, 0, 0, 0.45);
  --shadow-popup: 0 4px 8px rgba(0, 0, 0, 0.35), 0 24px 48px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The HTML "hidden" attribute must always win, even over display:grid/flex */
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
/* Buttons and typing boxes don't copy the page font by themselves, so tell them to */
button, input, select, textarea { font-family: inherit; }

:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }

/* Hides the default file picker but keeps it working */
.visually-hidden {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* All the little line icons share this style */
.icon {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- The widget (everything lives inside it) ---------- */
.widget {
  --pad-top: 16px; --pad-x: 14px;      /* the ••• button uses these to sit exactly in the corner */
  position: relative;
  max-width: 600px; margin: 0 auto; padding: var(--pad-top) var(--pad-x) 48px;
}
/* Inside Notion: room for Notion's hover toolbar (top-right), so it never covers ••• or the icons */
html.in-embed .widget { --pad-top: 46px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  height: 34px;
  padding: 0 14px;
  gap: 6px;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--surface-hover); }
.btn-small { height: 30px; padding: 0 12px; font-size: 0.78rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent); opacity: 0.85; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); }

/* ---------- Quiet icon buttons (cloud, Refresh, Filter, Plan, •••) ---------- */
/* Small square buttons with no background and no shadow. When needed, a short label
   appears after the icon inside a soft pill ("Refreshing…", "Saved to Notion", "Plan mode"…). */
.tool {
  position: relative;
  height: 32px; min-width: 32px;
  padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-direction: row-reverse;         /* the icon first, then its words (like the Figma boards) */
  border: 0; border-radius: 8px;
  background: none; color: var(--muted);
  font-size: 0.78rem; font-weight: 500; white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tool:hover { background: var(--surface); color: var(--text); }
.tool-label {
  max-width: 0; opacity: 0; overflow: hidden;
  transition: max-width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}
.tool.show-label .tool-label, .tool-plan.on .tool-label { max-width: 150px; opacity: 1; margin: 0 3px 0 6px; }
/* When its words show, the button becomes a soft pill (Refresh: grey; cloud and Plan: green; Retry: red) */
.tool.show-label, .tool-plan.on { padding: 0 10px 0 9px; color: var(--text); background: var(--surface); }

/* ••• is a little darker than the other quiet icons */
.tool-more { color: var(--text); }

/* Plan turns green, with the words "Plan mode", while Plan mode is on */
.tool-plan.on, .tool-plan.on:hover { background: var(--plan); color: var(--plan-text); }

/* Refresh: the icon spins while it works */
.tool.busy .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Notion cloud. Check inside = everything saved. Fading = saving. Red "Retry" = not saved. */
.tool-sync { cursor: default; }
.tool-sync .cloud-check, .tool-sync .cloud-alert { display: none; }
.tool-sync.error .cloud-alert { display: inline; }       /* "!" inside the cloud when saving failed */
.tool-sync.saved { color: var(--saved); cursor: pointer; }
.tool-sync.saved .cloud-check { display: inline; }
.tool-sync.saved:hover { color: var(--saved); }
.tool-sync.saved.show-label, .tool-sync.saved.show-label:hover { background: var(--plan); color: var(--plan-text); }
.tool-sync.saving, .tool-sync.saving:hover { background: none; color: var(--muted); }
.tool-sync.saving .icon { animation: cloudPulse 1.4s ease-in-out infinite; }
.tool-sync.error, .tool-sync.error:hover { background: var(--danger-soft); color: var(--danger); cursor: pointer; }
@keyframes cloudPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Tooltip: a small name tag under the button when you point at it (or reach it with the Tab key) */
.tool[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 6px); right: 0;
  width: max-content; max-width: 220px;
  padding: 5px 9px; border-radius: var(--r-label);
  background: var(--accent); color: var(--on-accent);
  font-size: 0.72rem; font-weight: 400; line-height: 1.35;
  white-space: normal; text-align: left;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.12s;
  z-index: 45;
}
.tool[data-tip]:focus-visible::after { opacity: 1; visibility: visible; }
@media (hover: hover) {
  .tool[data-tip]:hover::after { opacity: 1; visibility: visible; transition-delay: 0.35s; }
}
.tool[aria-expanded="true"]::after { display: none; }   /* no tooltip on ••• while its menu is open */

/* ---------- Profile ---------- */
.profile { margin-bottom: 14px; }
.profile-top { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
}
.username { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; word-break: break-all; }
/* "12 posts  12 reels  12 stories": small, the numbers in dark text */
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.75rem; color: var(--muted); text-transform: lowercase; }
.stats strong { color: var(--text); font-size: 0.75rem; font-weight: 600; margin-right: 3px; }
.display-name { font-weight: 600; font-size: 0.82rem; margin-top: 12px; }
.bio { font-size: 0.8rem; line-height: 1.45; margin-top: 1px; white-space: pre-line; word-break: break-word; }

/* Website link under the bio */
.profile-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 0.8rem; }
.profile-links a { color: var(--text); font-weight: 600; text-decoration: none; word-break: break-all; }
.profile-links a:hover { text-decoration: underline; }

/* ---------- Highlights ---------- */
.highlights {
  display: flex; gap: 14px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.highlights::-webkit-scrollbar { display: none; }
.highlight {
  flex: 0 0 auto; width: 54px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: none; border: 0; cursor: pointer;
  color: var(--text); font: inherit;
}
.hl-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  overflow: hidden;
  transition: transform 0.15s;
}
.highlight:hover .hl-circle { transform: scale(1.05); }
.hl-circle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface); }
.hl-new { font-size: 1.5rem; color: var(--muted); border-style: dashed; }
.hl-label { font-size: 0.68rem; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Action row + menu ---------- */
.actions {
  position: relative;       /* the Create menu is positioned relative to this row */
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  margin: 8px 0 12px;
}
.tools { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-left: auto; }

/* ••• sits in the top-right corner of the whole widget, level with the top of the profile */
.more-wrap { position: absolute; top: calc(var(--pad-top) + 1px); right: var(--pad-x); z-index: 41; }
/* Leave room on the right so nothing runs under ••• */
.profile-top { padding-right: 40px; }
.profile[hidden] + .highlights { margin-right: 40px; }
/* Grid-only view (no bio, no highlights): the toolbar is the top row, so ••• ends up at its end */
.profile[hidden] + .highlights[hidden] + .actions { margin-top: 0; padding-right: 36px; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 236px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-menu);
  padding: 6px;
  z-index: 40;
  animation: fadeUp 0.15s ease;
}
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.menu-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none; border: 0; border-radius: 8px;
  font: inherit; font-size: 0.85rem; color: var(--text);
  text-align: left; cursor: pointer;
}
a.menu-row { text-decoration: none; }
.menu-row[hidden] { display: none; }

/* Each row: small grey icon, the name, then a switch or a count on the right */
.menu-icon { width: 16px; height: 16px; color: var(--muted); }
.menu-label { flex: 1; min-width: 0; }
.create-menu { left: 0; right: auto; width: 210px; }

/* Filter menu: small grey group titles, a colored dot per choice, a check mark when ticked */
.filter-menu { max-height: min(70vh, 460px); overflow-y: auto; }
.menu-heading {
  padding: 6px 10px 4px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}
.menu-heading-note { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.filter-row .filter-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin: 0 4px 0 4px; }
.filter-row .filter-dot.none { background: none; border: 1px dashed var(--muted); }
.filter-row .filter-check { width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
.filter-row[aria-checked="true"] .filter-check { visibility: visible; }
.filter-row[aria-checked="true"] .menu-label { font-weight: 500; }
.filter-empty { padding: 4px 10px 8px; font-size: 0.78rem; color: var(--muted); }
/* While a filter is on, the filter button stays a soft pill that says "Filtered" */
.tool-filter.is-filtered { color: var(--text); background: var(--surface); padding: 0 10px 0 9px; }
.tool-filter.is-filtered .tool-label { max-width: 150px; opacity: 1; margin: 0 3px 0 6px; }
.create-row span { display: flex; flex-direction: column; gap: 1px; }
.create-row strong { font-weight: 600; }
.create-row small { font-size: 0.74rem; color: var(--muted); }
.menu-row:hover { background: var(--surface); }
.menu-row.danger { color: var(--danger); }

/* The little on/off switch (also used on the Settings page) */
.switch {
  width: 30px; height: 18px; border-radius: 9px;
  background: var(--toggle-off);
  position: relative; flex-shrink: 0;
  transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  transition: transform 0.2s, background 0.2s;
}
/* ON = the accent color (ink black in light mode, off-white in dark mode) */
[aria-checked="true"] > .switch { background: var(--toggle-on); }
[aria-checked="true"] > .switch::after { transform: translateX(12px); background: var(--on-accent); }

/* ---------- Plan bar ---------- */
/* In Plan mode the toolbar itself becomes the Plan bar:
   green "Plan mode" button on the left, Cancel and Save on the right.
   Create, the Notion cloud and Refresh are hidden while planning. */
.plan-actions { display: flex; gap: 8px; margin-left: auto; }
.widget.plan-on #addBtn,
.widget.plan-on #createMenu,
.widget.plan-on #filterBtn,
.widget.plan-on #filterMenu,
.widget.plan-on #syncStatus,
.widget.plan-on #refreshBtn { display: none; }
.widget.plan-on .tools { order: -1; margin-left: 0; }
.widget.plan-on .tool-plan { height: 34px; }
.widget.plan-on .tool-plan::after { right: auto; left: 0; }      /* its tooltip lines up on the left */

/* A white button with a thin border (Cancel, Keep editing) */
.btn-outline { background: var(--field); border-color: var(--border); }
.btn-outline:hover { background: var(--surface); }

/* ---------- Tabs ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 3px; }
.tab {
  flex: 1;
  position: relative;
  background: none; border: 0;
  padding: 12px 0;
  color: var(--muted);
  cursor: pointer;
  display: flex; justify-content: center;
  transition: color 0.15s;
}
.tab .icon { width: 20px; height: 20px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
/* The short underline under the active tab */
.tab::after {
  content: ""; position: absolute; bottom: -1px; left: 50%;
  width: 0; height: 2px; background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.2s;
}
.tab.active::after { width: 44px; }

/* ---------- Grids ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 3px; }
.story-grid { grid-template-columns: repeat(4, 1fr); }

/* Smooth fade used when switching views */
.view-enter { animation: fadeUp 0.25s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tile {
  position: relative;
  aspect-ratio: 3 / 4;                         /* Instagram's profile grid shape */
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.tile.tall { aspect-ratio: 9 / 16; }          /* Reels and Stories */
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.widget.plan-on .tile { cursor: grab; }       /* only in Plan mode do tiles feel draggable */

/* Small icon in the top-right corner: video or carousel */
.type-icon {
  position: absolute; top: 8px; right: 8px;
  width: 17px; height: 17px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  z-index: 3;
}
.type-icon svg { width: 100%; height: 100%; display: block; }

/* Pinned posts keep BOTH corner icons: the pin first, then the reel/carousel icon */
.pin-icon {
  position: absolute; top: 9px; right: 8px;
  width: 15px; height: 15px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  z-index: 3;
}
.pin-icon svg { width: 100%; height: 100%; display: block; }
.tile.has-type .pin-icon { right: 30px; }

/* Pointing at a tile (computers only): it dims slightly and shows the notes count */
.tile-hover {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(28, 25, 23, 0.35);
  color: #fff; font-size: 0.95rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
}
.tile-hover .icon { width: 20px; height: 20px; }
@media (hover: hover) {
  .tile:hover .tile-hover, .tile:focus-visible .tile-hover { opacity: 1; }
}
/* While a reel preview plays, don't dim the video (the notes count stays) */
.tile.previewing .tile-hover { background: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.tile.previewing .tile-hover .icon { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }

/* Plan mode labels on tiles: all the same dark see-through style */
.tile-label {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
  max-width: calc(100% - 12px);
  padding: 4px 6px;
  background: var(--label-bg); color: #fff;
  border-radius: var(--r-label);
  font-size: 10px; font-weight: 500; line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.date-badge { left: 6px; top: 6px; }                     /* top-left: "Nov 2" */
.status-label { left: 6px; bottom: 6px; }                /* bottom-left: "● Scheduled" */
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-name { overflow: hidden; text-overflow: ellipsis; }   /* long names end with "…" */
.notes-label { right: 6px; top: 6px; }                   /* top-right: speech bubble + number */
.notes-label .icon { width: 11px; height: 11px; stroke-width: 2.2; }
/* If the tile also has corner icons (pin, reel, carousel), the notes label sits just under them */
.tile.has-type .notes-label, .tile.is-pinned .notes-label { top: 32px; }

/* Content Pillars view: colored block with the pillar name */
.tile.pillar-tile { display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; }
.pillar-label {
  font-weight: 600;
  font-size: clamp(0.75rem, 2.4vw, 1.05rem);
  line-height: 1.25;
  word-break: break-word;
}
.tile.no-pillar { background: var(--surface); color: var(--muted); }
/* Pointing at a pillar block quickly fades it to the post's photo (no flip, no extra label) */
.tile .pillar-photo {
  position: absolute; inset: 0; z-index: 1;
  opacity: 0; transition: opacity 0.2s ease;
}
@media (hover: hover) {
  .tile.pillar-tile:hover .pillar-photo { opacity: 1; }
}

/* Visual feedback while dragging */
/* The tile you picked up fades where it was; the landing spot shows a dashed outline */
/* The tile you picked up lifts with a soft shadow; the landing spot becomes an empty box
   with a dashed ink-black outline (like the Plan mode board) */
.tile.dragging { z-index: 5; box-shadow: var(--shadow-popup); transform: translateY(-2px); opacity: 0.85; cursor: grabbing; }
.tile.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--bg); }
.tile.drag-over > * { opacity: 0; }

/* Floating copy that follows your finger during touch dragging */
.touch-ghost {
  position: fixed; z-index: 500;
  pointer-events: none;
  opacity: 0.9; margin: 0;
  transition: none;
  transform: scale(1.06) !important;
  border-radius: 4px;
  box-shadow: var(--shadow-popup);     /* the picked-up tile "lifts" with a soft shadow */
}

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 50px 16px; font-size: 0.92rem; }
/* Empty tab: icon, title, one line and a Create button */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 44px 16px 48px; margin-top: 10px;
  border: 1px dashed var(--border); border-radius: var(--r-card);
}
.empty-icon { display: flex; color: var(--muted); margin-bottom: 12px; }
.empty-icon .icon { width: 28px; height: 28px; stroke-width: 1.4; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-text { font-size: 0.85rem; line-height: 1.45; max-width: 260px; margin-bottom: 16px; }

/* "Showing 12 of 15 posts" line under the grid */
.limit-note { text-align: center; color: var(--muted); font-size: 0.78rem; margin-top: 12px; }
.limit-note a { color: var(--muted); }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 100;
}
.modal.hidden { display: none; }
/* While a pop-up is open, the page behind it doesn't scroll */
html.modal-open, html.modal-open body { overflow: hidden; }
.modal-content:focus { outline: none; }
#formModal { z-index: 110; }
#confirmModal { z-index: 200; }

.modal-content {
  background: var(--bg);
  border-radius: var(--r-popup);
  box-shadow: var(--shadow-popup);
  max-width: 480px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  position: relative;
}
.modal-content.tall-modal { max-width: 320px; }
.modal-content.media-modal { max-width: 420px; }
.modal-img { width: 100%; display: block; aspect-ratio: 3 / 4; object-fit: cover; background: var(--surface); }
.tall-modal .modal-img { aspect-ratio: 9 / 16; }
.square-modal .modal-img { aspect-ratio: 1 / 1; }       /* highlights */
video.modal-img { object-fit: contain; background: #000; }

/* Carousel in the details pop-up: swipe, use the arrows, or ← → keys */
.slider { position: relative; }
.slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.slides::-webkit-scrollbar { display: none; }
.slides .modal-img { flex: 0 0 100%; scroll-snap-align: start; }
.slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.85); color: #1c1917;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.slide-nav.prev { left: 10px; }
.slide-nav.next { right: 10px; }
.slide-nav[hidden] { display: none; }
.slide-count {
  position: absolute; top: 12px; left: 12px;
  background: var(--label-bg); color: #fff;
  padding: 2px 9px; border-radius: var(--r-label); font-size: 0.72rem;
}
.slide-dots { display: flex; justify-content: center; gap: 5px; padding: 10px 0 0; }
.slide-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: background 0.2s; }
.slide-dots span.on { background: var(--accent); }

/* Video playing inside a tile (hover, or touch and hold) */
.tile-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none;
}
.tile.previewing .type-icon { opacity: 0; }

.modal-details { padding: 16px 16px 18px; }
.modal-details .comments { margin-top: 12px; padding-top: 12px; }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.modal-caption-row { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 10px; }
.modal-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; background: var(--surface);
  border: 1px solid var(--border);
}
.modal-avatar[hidden] { display: none; }
.modal-caption { margin: 5px 0 0; font-size: 0.92rem; line-height: 1.5; word-break: break-word; }
.modal-user { font-weight: 600; margin-right: 2px; }
.modal-user:empty { display: none; }
/* Date alone on the left (with a small calendar icon); a small "Canva" link on the right */
.modal-date {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--muted); font-size: 0.82rem;
}
.modal-date-text { display: inline-flex; align-items: center; gap: 6px; }
.modal-date-text .icon { width: 15px; height: 15px; }
.canva-open {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 0.82rem; text-decoration: none;
  flex-shrink: 0;
}
.canva-open span { text-decoration: underline; text-underline-offset: 2px; }
.canva-open:hover { color: var(--text); }

/* Soft chips at the top of the view pop-up: "● Scheduled" and the pillar name */
.soft-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-chip);
  background: var(--surface); color: var(--text);
  font-size: 0.75rem; font-weight: 500;
}
.soft-chip .status-dot { width: 6px; height: 6px; border-radius: 50%; }
.soft-chip.none { background: transparent; color: var(--muted); border: 1px dashed var(--border); }
.soft-chip[hidden] { display: none; }
.canva-open .icon { width: 15px; height: 15px; }
.canva-open[hidden] { display: none; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Notes in the view pop-up */
.comments { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.comments[hidden] { display: none; }
.comments-title { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
#commentCount { color: var(--muted); font-weight: 500; }
.no-notes { font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }
.no-notes[hidden] { display: none; }
.comment-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.comment { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.comment + .comment { border-top: 1px solid var(--border); }
.note-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.7rem; font-weight: 600;
}
.comment-body { flex: 1; min-width: 0; }
.note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 0.82rem; }
.note-head strong { font-weight: 600; }
/* "**Anna** Can we brighten the photo a bit?" then "2h ago · Edit · Delete" under it */
.note-text { font-size: 0.85rem; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.note-text strong { font-weight: 600; }
.comment-meta { font-size: 0.72rem; color: var(--muted); }
.note-actions { display: flex; align-items: baseline; gap: 12px; margin-top: 2px; }
.link-btn.quiet-link { color: var(--muted); text-decoration: none; font-size: 0.75rem; }
.link-btn.quiet-link:hover { color: var(--text); text-decoration: underline; }
.link-btn.quiet-link.strong { color: var(--text); font-weight: 600; }
.link-btn.danger-link:hover { color: var(--danger); }
.note-edit, .comment-form textarea {
  width: 100%; min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--r-control);
  background: var(--field); color: var(--text);
  font: inherit; font-size: 0.88rem; line-height: 1.4;
  resize: vertical;
}
.note-edit { margin-top: 4px; }
.comment-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.comment-form textarea { flex: 1; resize: none; }
.note-author { font-size: 0.74rem; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.note-author strong { color: var(--text); }
.note-author .quiet-link { font-size: 0.74rem; text-decoration: underline; text-underline-offset: 2px; }
.author-input {
  padding: 3px 8px; width: 150px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--field); color: var(--text); font: inherit; font-size: 0.78rem;
}
.link-btn.post-btn { color: var(--text); font-weight: 600; text-decoration: none; font-size: 0.88rem; }
.link-btn.post-btn:disabled { opacity: 0.35; cursor: default; }

.close-btn {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; background: rgba(255, 255, 255, 0.9); color: #1c1917;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.close-btn:hover { background: #fff; }

/* ---------- Forms (also used on the Settings page) ---------- */
.form-content { padding: 22px 22px 20px; max-width: 440px; }
.form-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  background: var(--field);
  font: inherit; color: var(--text);
}
.field textarea { resize: vertical; }
.field input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
.field label .optional { font-weight: 400; margin-left: 4px; opacity: 0.75; }
.field-note { font-size: 0.76rem; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.field label.file-btn { display: inline-flex; color: var(--text); font-size: 0.82rem; margin-bottom: 0; }

.img-preview {
  width: 100px; flex-shrink: 0;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border-radius: 9px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: 0.74rem; color: var(--muted);
}
.img-preview.portrait { aspect-ratio: 3 / 4; width: 90px; }
.img-preview.tall { aspect-ratio: 9 / 16; width: 80px; }
.img-preview.round { border-radius: 50%; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--danger); font: inherit; font-size: 0.78rem;
  text-decoration: underline; cursor: pointer;
}

/* ---------- The edit pop-up (Plan mode, and "+ Create") ---------- */
/* Matches the Figma "Pop-ups" board: title bar with ✕ (and Pin / Archive / Delete), the
   Photo / Carousel / Reel switch, ONE media box, caption, publish date + pillar, status,
   folded notes, and Cancel / Save changes pinned to the bottom. */
#formModal .form-content { padding: 0 16px 16px; max-width: 460px; }
/* Title bar with a thin line under it, right across the pop-up */
.form-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 -16px 14px; padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 4; background: var(--bg);
}
.form-head .form-title { margin: 0; font-size: 1rem; font-weight: 600; }
.form-close {
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: none; color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.form-close:hover { background: var(--surface); }
.form-close .icon { width: 20px; height: 20px; }
/* Pin / Archive / Delete (editing only) sit as small quiet icons next to the ✕ */
.form-head-tools { display: flex; align-items: center; gap: 2px; }
.form-head-tools .icon-btn {
  width: 32px; height: 32px; border: 0; background: none; color: var(--muted);
}
.form-head-tools .icon-btn svg { width: 17px; height: 17px; }
.form-head-tools .icon-btn:hover { background: var(--surface); color: var(--text); }
.form-head-tools .icon-btn.on { background: var(--surface); color: var(--text); }
.form-head-tools .icon-btn.danger { background: none; }
.form-head-tools .icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* Field titles: dark text, 12px medium */
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
#formModal .field label.field-label { font-size: 12px; color: var(--text); }
#formModal .field-label .optional { color: var(--muted); font-weight: 400; margin-left: 5px; opacity: 1; }
#formModal .field { margin-bottom: 16px; }

/* Post type: a segmented switch (Photo / Carousel / Reel); the chosen one is a white "pill" */
#formModal .type-seg {
  gap: 2px; padding: 3px;
  background: var(--surface); border-radius: var(--r-control);
}
#formModal .type-opt {
  height: 32px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: 0.82rem;
}
#formModal .type-opt .icon { display: none; }
#formModal .type-opt.on { background: var(--field); color: var(--text); font-weight: 500; box-shadow: var(--shadow-sm); border: 0; }

/* ONE media box: small preview on the left; buttons, "or" and the link box on the right */
.media-box {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px;
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--field);
}
.media-main { display: flex; gap: 12px; align-items: stretch; }
#formModal .single-media { flex-shrink: 0; }
#formModal .single-media[hidden] { display: none; }
#formModal .img-preview {
  position: relative;
  width: 84px; height: auto;
  aspect-ratio: 3 / 4;
  margin: 0;
  border-radius: var(--r-control);
  background: var(--surface);
  font-size: 0.66rem; padding: 4px;
}
#formModal .img-preview img { position: absolute; inset: 0; }
#formModal .img-preview.portrait { aspect-ratio: 3 / 4; width: 84px; }
#formModal .img-preview.tall { aspect-ratio: 9 / 16; width: 70px; }
#formModal .img-preview.round { width: 84px; aspect-ratio: 1 / 1; border-radius: 50%; }
.media-side { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.media-actions { display: flex; flex-direction: column; gap: 6px; }
.media-actions[hidden] { display: none; }
.media-actions .btn { width: 100%; height: 34px; gap: 7px; }
.media-actions .btn .icon { width: 16px; height: 16px; }
.media-actions .link-btn { align-self: flex-start; color: var(--muted); }
.media-or { text-align: center; color: var(--muted); font-size: 0.72rem; line-height: 1; }
.link-input {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-control);
  background: var(--field); color: var(--text); font-size: 0.82rem;
}
.link-input.checking { opacity: 0.5; pointer-events: none; }
#formModal #slideMedia .field-label { margin-bottom: 8px; }
#formModal #mediaNote { margin: 0; font-size: 0.72rem; }
/* After pasting a link: grey chip, a hint, and "Remove link" */
.link-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.link-chips[hidden] { display: none; }
.link-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-chip);
  background: var(--surface); color: var(--text);
  font-size: 0.75rem; font-weight: 500;
}
.link-chip .icon { width: 13px; height: 13px; }
#formModal .link-chips .field-note { margin: 0; font-size: 0.72rem; line-height: 1.4; }
.link-chips .link-btn { color: var(--muted); font-size: 0.72rem; }
.link-chips .link-btn:hover { color: var(--danger); }

/* Publish date and Content pillar side by side; "Fri · in 3 days" under the date */
.side-by-side { gap: 12px; }
.side-by-side .field { margin-bottom: 16px; }
#formModal .field input[type="date"], #formModal .field select { height: 38px; padding: 0 10px; background: var(--field); }
#formModal .field input, #formModal .field select, #formModal .field textarea { font-size: 0.85rem; }
#formModal .form-error:empty { display: none; }
.date-hint { margin-top: 5px; }
.date-hint.soon { color: var(--plan-text); }
@media (max-width: 600px) { .field-row.side-by-side { flex-direction: row; gap: 10px; } }
@media (max-width: 360px) { .field-row.side-by-side { flex-direction: column; gap: 0; } }

/* Status: always a dropdown, with a colored dot before the name */
.status-select { position: relative; }
.status-select .status-dot {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; pointer-events: none;
}
#formModal .status-select select { padding-left: 28px; }

/* Post Type: Photo / Carousel / Reel buttons */
.type-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-control);
  background: var(--bg); color: var(--muted);
  font: inherit; font-size: 0.84rem; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.type-opt:hover { color: var(--text); }
.type-opt.on { border: 1.5px solid var(--accent); color: var(--text); font-weight: 500; }
.type-opt .icon { width: 18px; height: 18px; }

/* Caption box with the character counter in the corner */
.caption-box { position: relative; }
.caption-box textarea { padding-bottom: 26px; line-height: 1.45; }
.char-count { position: absolute; right: 12px; bottom: 9px; font-size: 0.72rem; color: var(--muted); pointer-events: none; }

/* Notes inside the edit pop-up: a foldable section */
.form-notes { margin: 4px 0 6px; }
.form-notes .comments { margin-top: 4px; }
.comments.collapsible .comments-title {
  cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text);
}
.comments.collapsed .comment-form, .comments.collapsed .note-author { display: none; }
.comments.collapsible .comments-title::after {
  content: ""; margin-left: auto;
  width: 7px; height: 7px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg); transition: transform 0.15s;
}
.comments.collapsible .comments-title::after { transform: rotate(-135deg); }          /* open: arrow points up */
.comments.collapsible.collapsed .comments-title::after { transform: rotate(45deg); }    /* folded: arrow points down */
.form-notes .comments { border-top: 0; padding-top: 0; }
.form-notes .comments.collapsible .comments-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 0; padding: 4px 0 10px; }
.comments.collapsed .comment-list, .comments.collapsed .no-notes { display: none; }

/* Bottom bar: Cancel + Save, always visible at the bottom of the pop-up however long the post is */
.editor-actions {
  display: flex; align-items: center; gap: 8px;
  justify-content: flex-end;
  margin: 6px -16px -16px; padding: 12px 16px 14px;
  border-top: 1px solid var(--border);           /* a thin line right across the pop-up */
  position: sticky; bottom: -16px; z-index: 3;
  background: var(--bg);
}
.editor-actions .btn { height: 36px; padding: 0 14px; font-size: 0.85rem; }
.icon-btn {
  width: 42px; height: 42px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--r-control);
  background: var(--bg); color: var(--text); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--surface); }
.icon-btn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.icon-btn.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.icon-btn.danger:hover { filter: brightness(0.97); }

/* Highlights: pick a story as the cover */
.story-picker { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; }
.story-pick {
  flex: 0 0 58px; aspect-ratio: 9 / 16;
  padding: 0; border: 2px solid transparent; border-radius: 8px;
  overflow: hidden; background: var(--surface); cursor: pointer;
}
.story-pick:hover, .story-pick:focus-visible { border-color: var(--text); }
.story-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Carousel photos in the form */
.slide-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.slide-strip:empty { display: none; }
.slide-thumb {
  position: relative; flex: 0 0 72px;
  aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden;
  background: var(--surface);
  cursor: grab;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform 0.15s, opacity 0.15s;
}
.slide-thumb img, .slide-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.slide-thumb.dragging { opacity: 0.4; transform: scale(0.94); }
.slide-thumb.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; transform: scale(1.04); }
.slide-play {
  position: absolute; right: 6px; bottom: 5px;
  color: #fff; font-size: 0.7rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}
.slide-thumb .slide-num {
  position: absolute; left: 4px; bottom: 4px;
  background: var(--label-bg); color: #fff;
  font-size: 0.65rem; padding: 1px 6px; border-radius: var(--r-label);
}
.slide-thumb button {
  position: absolute; top: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.9); color: #1c1917;
  font-size: 0.8rem; line-height: 1; cursor: pointer; padding: 0;
}
.slide-thumb .slide-del { right: 4px; }
.slide-thumb .slide-left { left: 4px; }

/* ---------- Live Canva designs ---------- */
/* The design is drawn 3× bigger and shrunk to fit, so Canva's own buttons stay small.
   Clicks go to the tile (to open the pop-up), not to Canva. */
.tile-canva {
  position: absolute; top: 0; left: 0;
  width: 300%; height: calc(300% + 140px);   /* the extra height pushes Canva's toolbar out of view */
  transform: scale(0.3334); transform-origin: 0 0;
  border: 0; pointer-events: none;
  background: transparent;             /* the photo underneath shows until the design appears */
}
/* Size known: JavaScript sets the exact size and zoom (see layoutCanvaFrames) */
.tile-canva.fitted { transform-origin: 0 0; }
.modal-canva { border: 0; width: 100%; display: block; aspect-ratio: 3 / 4; background: var(--surface); }
.tall-modal .modal-canva { aspect-ratio: 9 / 16; }

/* ---------- Archived ---------- */
.archive-bar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  background: var(--surface); border-radius: 12px;
  padding: 10px 12px; margin: 10px 0 6px;
}
.archive-title { font-size: 0.85rem; font-weight: 600; }
.archive-note { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.older-note { margin: -2px 2px 6px; }
#olderSection .grid + .grid { margin-top: 3px; }
.archive-subtitle { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin: 14px 2px 4px; }
.menu-count { color: var(--muted); font-size: 0.8rem; }
.menu-note { font-size: 0.74rem; color: var(--muted); line-height: 1.4; padding: 4px 12px 8px; max-width: 240px; }

.form-error { color: var(--danger); font-size: 0.85rem; min-height: 1.2em; margin-bottom: 10px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.confirm-content { max-width: 360px; padding: 24px; }
.confirm-content p { margin-bottom: 20px; line-height: 1.5; }
/* With a bold title ("Discard changes?"): smaller grey text under it, and a filled red button */
.confirm-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.has-title .confirm-content { max-width: 320px; padding: 22px 22px 20px; }
.has-title .confirm-content p { color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.has-title #confirmOk { background: var(--danger); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
.has-title #confirmOk:hover { opacity: 0.9; }
:root[data-theme="dark"] .has-title #confirmOk { color: #1a1816; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-menu);
  padding: 10px 18px; border-radius: 24px;
  font-size: 0.85rem;
  max-width: 90vw; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Mobile layout ---------- */
@media (max-width: 600px) {
  .widget { --pad-top: 12px; --pad-x: 8px; padding-bottom: 40px; }
  .story-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { flex-direction: column; gap: 0; }
}

/* Respect people who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
