/* ---------- 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: #faf8f4;            /* warm white */
  --surface: #f1ece3;       /* soft beige (buttons, empty tiles) */
  --surface-hover: #e8e1d5;
  --border: #e3dccf;
  --text: #2f2a24;
  --muted: #8c8274;
  --danger: #b2473e;
  --danger-soft: #f8e5e2;
  --plan: #b9e4cc;          /* Plan mode "ON" green */
  --plan-text: #1e5a3c;
  --plan-soft: #eef8f2;
  --plan-line: #8fcfae;
  --toggle-off: #cfc7b8;
  --toggle-on: #5fb878;
  --overlay: rgba(47, 42, 36, 0.55);
  --draft: #b8b8b8;
  --scheduled: #f0a53c;
  --published: #5fb878;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1c1915;
  --surface: #2a2620;
  --surface-hover: #353029;
  --border: #3b352d;
  --text: #f1ece3;
  --muted: #a39a8b;
  --danger: #e1786e;
  --danger-soft: #3b2420;
  --plan: #2f5a43;
  --plan-text: #c9f0d9;
  --plan-soft: #1f2d25;
  --plan-line: #3f7a5a;
  --toggle-off: #4a443a;
  --overlay: rgba(0, 0, 0, 0.7);
  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: "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

: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 { max-width: 600px; margin: 0 auto; padding: 16px 14px 48px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 0.82rem;
  height: 34px;
  padding: 0 14px;
  gap: 6px;
  border-radius: 9px;
  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-icon { width: 38px; padding: 0; }
.btn-small { height: 30px; padding: 0 12px; font-size: 0.78rem; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--text); opacity: 0.85; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); }

/* Plan button turns green while Plan mode is ON */
.btn-plan.on { background: var(--plan); color: var(--plan-text); font-weight: 600; }
.btn-plan.on:hover { background: var(--plan); opacity: 0.9; }

/* Refresh icon spins once when clicked */
.icon.spin { animation: spin 0.6s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Profile ---------- */
.profile { margin-bottom: 14px; }
.profile-top { display: flex; align-items: center; gap: 22px; }
.avatar {
  width: 84px; height: 84px; flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
}
.username { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; word-break: break-all; }
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.85rem; color: var(--muted); }
.stats strong { color: var(--text); font-size: 1rem; margin-right: 3px; }
.display-name { font-weight: 700; font-size: 0.92rem; margin-top: 12px; }
.bio { font-size: 0.9rem; line-height: 1.45; margin-top: 2px; white-space: pre-line; word-break: break-word; }

/* Instagram and website links under the bio */
.profile-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 0.85rem; }
.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: 16px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.highlights::-webkit-scrollbar { display: none; }
.highlight {
  flex: 0 0 auto; width: 68px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer;
  color: var(--text); font: inherit;
}
.hl-circle {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 3px;
  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.72rem; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Action row + menu ---------- */
.actions {
  position: relative;       /* the menu is positioned relative to this row */
  display: flex; flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 12px;
}
.menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  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; justify-content: space-between; align-items: center;
  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; }

/* Notion status ("Saving…", "Saved to Notion ✓", "Retry") */
.sync-status {
  border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  border-radius: 20px; padding: 6px 12px;
  font: inherit; font-size: 0.75rem; cursor: pointer; white-space: nowrap;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.sync-status[hidden] { display: none; }
.sync-status.saved { color: var(--plan-text); background: var(--plan-soft); border-color: var(--plan-line); }
.sync-status.error { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.create-menu { left: 0; right: auto; width: 210px; }
.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;
}
[aria-checked="true"] > .switch { background: var(--toggle-on); }
[aria-checked="true"] > .switch::after { transform: translateX(12px); }

/* ---------- Plan bar ---------- */
.plan-bar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  background: var(--plan-soft);
  border: 1px solid var(--plan-line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  animation: fadeUp 0.2s ease;
}
.plan-title { font-size: 0.8rem; font-weight: 600; color: var(--plan-text); margin-bottom: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.75rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.plan-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- 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: 24px; height: 24px; }
.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(--text);
  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); }

/* Soft dashed outline around the grid while Plan mode is on */
.widget.plan-on .grid {
  outline: 2px dashed var(--plan-line);
  outline-offset: 4px;
  border-radius: 2px;
}

/* 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: 20px; height: 20px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}
.type-icon svg { width: 100%; height: 100%; display: block; }

/* Status circle (bottom-right). Used on tiles and in the legend. */
.dot {
  display: inline-block;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.tile .dot { position: absolute; right: 8px; bottom: 8px; }
.dot.Draft { background: var(--draft); }
.dot.Scheduled { background: var(--scheduled); }
.dot.Published { background: var(--published); }

/* Short date label (top-left), only in Plan mode */
.date-badge {
  position: absolute; left: 8px; top: 8px;
  background: rgba(47, 42, 36, 0.7);
  color: #fff;
  padding: 2px 9px;
  border-radius: 8px;
  font-size: 0.72rem;
  pointer-events: none;
}

/* 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); }

/* Visual feedback while dragging */
.tile.dragging { opacity: 0.35; transform: scale(0.95); cursor: grabbing; }
.tile.drag-over { outline: 3px dashed var(--plan-line); outline-offset: -3px; transform: scale(1.03); }

/* 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;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 50px 16px; font-size: 0.92rem; }

/* "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; }
#formModal { z-index: 110; }
#confirmModal { z-index: 200; }

.modal-content {
  background: var(--bg);
  border-radius: 14px;
  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: #2f2a24;
  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: rgba(47, 42, 36, 0.7); color: #fff;
  padding: 2px 9px; border-radius: 10px; 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(--text); }

/* 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: 18px 20px 22px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal-caption-row { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.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; line-height: 1.5; word-break: break-word; }
.modal-user { font-weight: 600; margin-right: 2px; }
.modal-user:empty { display: none; }
.modal-date { color: var(--muted); font-size: 0.9rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }

/* Notes & feedback in the details pop-up */
.comments { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.comments[hidden] { display: none; }
.comments-title { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.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: 700;
}
.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; }
.note-text { font-size: 0.88rem; line-height: 1.45; word-break: break-word; white-space: pre-wrap; margin-top: 2px; }
.comment-meta { font-size: 0.72rem; color: var(--muted); }
.note-actions { display: flex; gap: 14px; margin-top: 4px; }
.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: 14px;
  background: var(--bg); 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; border-radius: 20px; }
.note-author { font-size: 0.74rem; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.note-author .quiet-link { font-size: 0.74rem; }
.author-input {
  padding: 3px 8px; width: 150px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); 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; }

/* Comment count on a tile (Plan mode) */
.comment-badge {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(47, 42, 36, 0.7); color: #fff;
  padding: 1px 7px; border-radius: 8px;
  font-size: 0.7rem; pointer-events: none;
}
.close-btn {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.85); color: #2f2a24;
  font-size: 1.4rem; cursor: pointer;
}
.status { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; color: #fff; }
.status.Published { background: var(--published); }
.status.Scheduled { background: var(--scheduled); }
.status.Draft { background: var(--draft); }
.pillar-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }

/* ---------- 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: 9px;
  background: var(--bg);
  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; }

.image-row { display: flex; gap: 14px; align-items: center; }
.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; }
.media-buttons { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.media-buttons .field-note { margin-top: 0; }
.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--danger); font: inherit; font-size: 0.78rem;
  text-decoration: underline; cursor: pointer;
}

/* 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(--plan-line); 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: rgba(47, 42, 36, 0.75); color: #fff;
  font-size: 0.65rem; padding: 1px 6px; border-radius: 6px;
}
.slide-thumb button {
  position: absolute; top: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.9); color: #2f2a24;
  font-size: 0.8rem; line-height: 1; cursor: pointer; padding: 0;
}
.slide-thumb .slide-del { right: 4px; }
.slide-thumb .slide-left { left: 4px; }

.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; }
.spacer { flex: 1; }
.confirm-content { max-width: 360px; padding: 24px; }
.confirm-content p { margin-bottom: 20px; line-height: 1.5; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg);
  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 { padding: 12px 8px 40px; }
  .avatar { width: 76px; height: 76px; }
  .profile-top { gap: 18px; }
  .grid { gap: 2px; }
  .story-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { flex-direction: column; gap: 0; }
  .plan-actions { width: 100%; }
  .plan-actions .btn { flex: 1; }
}

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