/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --radius: 16px;
  --radius-sm: 11px;
  --topbar-h: 60px;
  --shadow: 0 1px 2px rgba(30, 20, 60, .06), 0 6px 20px rgba(30, 20, 60, .07);
  --shadow-pop: 0 4px 12px rgba(20, 12, 50, .14), 0 18px 40px rgba(20, 12, 50, .18);
}

/* Palettes are chosen with <html data-palette="...">. Every colour is a
   light-dark() pair, so one set of tokens serves both schemes: Auto follows
   the device, and <html data-theme="light|dark"> forces one. The first
   palette is the default. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Blossom: Cherry Blossom pink + Deep Twilight navy */
:root, :root[data-palette="blossom"] {
  --bg: light-dark(#fdf1f4, #1a1265);
  --surface: light-dark(#ffffff, #231a78);
  --surface-2: light-dark(#fbe3ea, #2d2391);
  --stage: light-dark(#f5d3dd, #110a49);
  --border: light-dark(#f0d2db, #3b309c);
  --text: light-dark(#1a1265, #fbe6ec);
  --text-dim: light-dark(#5d5790, #b6a9e3);
  --accent: light-dark(#1a1265, #f9a8bb);
  --accent-text: light-dark(#ffe6ec, #1a1265);
  --accent-soft: light-dark(#fde0e8, color-mix(in srgb, #f9a8bb 16%, #231a78));
  --danger: light-dark(#c2185b, #ff8fa8);
}

/* Storm: Storm Blue + Rose Quartz + Petal Whisper */
:root[data-palette="storm"] {
  --bg: light-dark(#fff2fc, #1d3346);
  --surface: light-dark(#ffffff, #264359);
  --surface-2: light-dark(#f6e8f4, #2f5169);
  --stage: light-dark(#d9e7f4, #14263a);
  --border: light-dark(#ecd3e8, #3a5d78);
  --text: light-dark(#2a4d69, #ffedfb);
  --text-dim: light-dark(#5c7891, #a9c0d6);
  --accent: light-dark(#3c6a8a, #a7c7e3);
  --accent-text: light-dark(#ffffff, #14293b);
  --accent-soft: light-dark(#e0edf8, color-mix(in srgb, #a7c7e3 16%, #264359));
  --danger: light-dark(#b3365a, #ff9aae);
}

/* Charcoal: soft charcoal + coral */
:root[data-palette="charcoal"] {
  --bg: light-dark(#f3f1ea, #373737);
  --surface: light-dark(#ffffff, #414141);
  --surface-2: light-dark(#eae7df, #4b4b4b);
  --stage: light-dark(#deddd5, #2b2b2b);
  --border: light-dark(#dcd9cf, #575757);
  --text: light-dark(#373737, #ecebe4);
  --text-dim: light-dark(#6c6a65, #aaa9a3);
  --accent: light-dark(#d94643, #e05350);
  --accent-text: light-dark(#ffffff, #1f0d0d);
  --accent-soft: light-dark(#fbe3e0, color-mix(in srgb, #e05350 18%, #414141));
  --danger: light-dark(#b42b2a, #ff8a80);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
}

.screen { display: flex; flex-direction: column; min-height: 100dvh; }
.screen.hidden { display: none; }

.ico { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--topbar-h);
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
/* One slim row: logo doubles as the back button, post title sits on the right. */
.editor-topbar { min-height: 52px; padding: calc(env(safe-area-inset-top, 0px) + 4px) 14px 4px 6px; gap: 8px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  height: 44px;
  padding: 0 10px 0 6px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.back:hover { background: var(--surface-2); }
.back:active { background: var(--border); }
.back .wordmark { width: 72px; height: 28px; }

.brand { display: flex; }
.wordmark {
  display: block;
  width: 92px;
  height: 36px;
  background: var(--text);
  -webkit-mask: url("../icons/wordmark.svg") left center / contain no-repeat;
  mask: url("../icons/wordmark.svg") left center / contain no-repeat;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
}
.btn-icon:hover { background: var(--surface-2); }
.btn-icon:active { background: var(--border); }

.post-name-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  background: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  padding: 4px 10px;
  text-align: right;
  text-overflow: ellipsis;
}
.post-name-input:hover { background: var(--surface-2); }
.post-name-input:focus { outline: none; background: var(--surface); border-color: var(--accent); }

/* ---------- Layout ---------- */
.home-content, .editor-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 40px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.005em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent);
}
.btn-primary:hover { opacity: .93; }
.btn-quiet { background: var(--surface-2); color: var(--text); }
.btn-quiet:hover { background: var(--border); }
.btn-small { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---------- Home ---------- */
.home-intro h2 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -.025em;
  font-weight: 700;
  text-wrap: balance;
}
.home-intro p { margin-top: 8px; color: var(--text-dim); text-wrap: pretty; }

.post-list { display: flex; flex-direction: column; gap: 10px; }

.post-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 6px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.post-card:active { background: var(--surface-2); }

.post-card .thumbs { position: relative; width: 74px; height: 62px; flex-shrink: 0; }
.post-card .thumbs span {
  position: absolute;
  top: 0;
  width: 46px;
  height: 62px;
  border-radius: 9px;
  background: var(--surface-2) center / cover;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.post-card .thumbs span:nth-child(2) { left: 14px; }
.post-card .thumbs span:nth-child(3) { left: 28px; }
.post-card .thumbs span:nth-child(1) { z-index: 3; }
.post-card .thumbs span:nth-child(2) { z-index: 2; }
.post-card .thumbs span:nth-child(3) { z-index: 1; }
.post-card .meta { flex: 1; min-width: 0; }
.post-card .name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-card .sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

.empty-state { display: none; margin-top: 8px; }
.empty-state.visible { display: block; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.steps b { font-weight: 700; }
.steps span { font-size: 14px; color: var(--text-dim); }
.privacy { margin-top: 14px; text-align: center; font-size: 13px; color: var(--text-dim); }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.panel > * + * { margin-top: 14px; }
.panel h2 { font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; }
.count { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Collapsible panels (Photos, Fine-tune) */
.collapsible > summary, .fine-tune > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker { display: none; }
.chev {
  width: 9px;
  height: 9px;
  margin: 0 4px 3px 2px;
  border-right: 2.2px solid var(--text-dim);
  border-bottom: 2.2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform .18s ease;
  flex-shrink: 0;
}
details[open] > summary .chev { transform: rotate(-135deg); margin-bottom: -2px; }
.collapsible > summary .count { margin-left: 0; }
.collapsible > summary .photo-mini { margin-left: auto; }
.fine-tune > summary h2 { flex: 1; }
details[open] > summary { margin-bottom: 14px; }
.collapsible[open] > summary .photo-mini { display: none; }
.collapsible[open] > summary .chev { margin-left: auto; }
.collapsible:not([open]) > summary .chev { margin-left: 0; }

.photo-mini { display: flex; }
.photo-mini span {
  width: 24px;
  height: 30px;
  margin-left: -8px;
  border-radius: 6px;
  background: var(--surface-2) center / cover;
  border: 2px solid var(--surface);
}
.photo-mini span:first-child { margin-left: 0; }

/* ---------- Photo grid ---------- */
.photo-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.photo-strip:empty { display: none; }

.photo-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: box-shadow .15s ease;
}
.photo-thumb.dragging { cursor: grabbing; z-index: 5; box-shadow: var(--shadow-pop); }
.photo-strip { position: relative; }
.drop-indicator {
  position: absolute;
  z-index: 6;
  width: 5px;
  margin-left: -2.5px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--accent) 2px, transparent 2.5px) 0 0 / 5px 9px repeat-y;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo-thumb .remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(20, 14, 10, .62);
  color: #fff;
  cursor: pointer;
}
.photo-thumb .remove-btn svg { width: 14px; height: 14px; }
.photo-thumb .order-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(20, 14, 10, .62);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.add-photo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 12px;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
.add-photo-tile.disabled { opacity: .45; cursor: default; }
.photo-strip:empty + .add-photo-tile { margin-top: 0; min-height: 96px; }

.hint { font-size: 13px; color: var(--text-dim); text-wrap: pretty; }
.status:empty { display: none; }

/* ---------- Preview (pins under the top bar while you scroll) ---------- */
.preview-sticky {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  margin: 0 -16px;
  padding: 2px 16px 14px;
  background: linear-gradient(var(--bg) 78%, transparent);
}
.preview-card {
  background: var(--stage);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.preview-wrap {
  display: flex;
  align-items: center;
  min-height: 190px;
  padding: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.preview-wrap::-webkit-scrollbar { display: none; }
#preview-canvas {
  display: block;
  height: 162px;
  width: auto;
  max-width: none;
  flex-shrink: 0;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
#preview-canvas[hidden], .preview-empty[hidden] { display: none; }
.preview-empty { width: 100%; text-align: center; color: var(--text-dim); font-size: 14px; }

/* ---------- Form controls ---------- */
.field { border: 0; margin-inline: 0; padding: 0; min-width: 0; }
.field + .field, .field + .bg-image { margin-top: 18px; }
.field legend, .field-label {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}
.field legend small, .field-label small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}

input[type="range"] { flex: 1; min-width: 0; height: 28px; accent-color: var(--accent); }
.range-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-dim); }

/* Segmented radio groups with a tiny picture of each option */
.seg { display: grid; gap: 8px; }
.seg-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.seg-opt { position: relative; display: block; cursor: pointer; }
.seg-opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.seg-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 100%;
  padding: 10px 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: border-color .12s ease, background .12s ease, color .12s ease, box-shadow .12s ease;
}
.seg-face svg { width: 100%; max-width: 44px; height: 32px; }
.seg-3 .seg-face svg { max-width: 28px; height: 28px; }
.seg-face .fr { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .4; }
.seg-face .ph { fill: currentColor; }
.seg-face .ph.b { opacity: .55; }
.seg-face .ln { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.seg-face small { display: block; font-size: 11px; font-weight: 500; opacity: .8; line-height: 1.2; }
.seg-face.inline { flex-direction: row; gap: 8px; padding: 12px 8px; font-size: 14px; }
.seg-face.inline svg { width: 22px; height: 22px; max-width: none; }

.seg-opt:hover .seg-face { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.seg-opt input:checked + .seg-face {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.seg-opt input:focus-visible + .seg-face { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* Background swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent) inset;
  cursor: pointer;
}
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .12s ease, transform .12s ease;
}
.swatch:has(input:checked)::after { opacity: 1; transform: none; }
.swatch:has(input:focus-visible)::after { opacity: 1; border-style: dashed; }
.swatch.custom {
  background: conic-gradient(#e86a5b, #f2b94b, #7fc482, #5aa6e0, #a07be0, #e86a5b);
}
.swatch.custom input { padding: 0; border: 0; }
.bg-image { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- Export ---------- */
.export-panel > * + * { margin-top: 14px; }
.export-result > * + * { margin-top: 14px; }
.export-head { display: grid; gap: 10px; }
.export-head p { font-weight: 700; }
.export-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.export-item {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
  aspect-ratio: 4 / 5;
}
.export-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.export-item .num {
  position: absolute;
  top: 5px;
  left: 5px;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(20, 14, 10, .66);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.export-item .dl {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(20, 14, 10, .66);
  color: #fff;
}
.export-item .dl svg { width: 15px; height: 15px; }
.support {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  text-align: center;
  text-decoration: none;
}

/* ---------- Menu, dialog, toast ---------- */
.menu {
  position: fixed;
  z-index: 60;
  min-width: 212px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  animation: pop .12s ease-out;
  transform-origin: top right;
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button .ico { width: 20px; height: 20px; color: var(--text-dim); }
.menu hr { margin: 4px 6px; border: 0; border-top: 1px solid var(--border); }
.menu .danger { color: var(--danger); }
.menu .danger .ico { color: var(--danger); }

.dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
.dialog::backdrop { background: rgba(20, 12, 6, .45); backdrop-filter: blur(2px); }
.dialog h3 { font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.dialog p { margin-top: 8px; color: var(--text-dim); font-size: 15px; text-wrap: pretty; }
.dialog p:empty { display: none; }
.dialog input[type="text"] {
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 16px;
}
.dialog input[type="text"]:focus { outline: none; border-color: var(--accent); }
.dialog input[type="text"][hidden] { display: none; }
.dialog-actions { display: flex; gap: 10px; margin-top: 18px; }
.dialog-actions .btn { flex: 1; }
.dialog .btn-danger { background: var(--danger); color: #fff; box-shadow: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  z-index: 70;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
  animation: pop .16s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Palette picker (temporary, for choosing a colour scheme) ---------- */
.palette-picker { margin-top: 18px; text-align: center; }
.palette-picker p { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.palette-picker .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.palette-picker button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.palette-picker button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.palette-picker .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15) inset;
}

/* ---------- Settings (home) ---------- */
.settings > * + * { margin-top: 18px; }
.settings .palette-picker { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Tip jar ---------- */
.support-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
}
.support-card .ico { width: 28px; height: 28px; color: var(--accent); }
.support-card b { display: block; font-weight: 700; }
.support-card small { display: block; margin-top: 1px; font-size: 13px; color: var(--text-dim); }
.support-card:active { transform: scale(.99); }

/* ---------- Privacy notice ---------- */
.privacy-notice { font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.privacy-notice > * + * { margin-top: 10px; }
.privacy-notice .lead { color: var(--text); font-size: 15px; }
.privacy-notice h3 { margin-top: 18px; font-size: 14px; font-weight: 700; color: var(--text); }
.privacy-notice ul { padding-left: 18px; }
.privacy-notice li + li { margin-top: 5px; }
.privacy-notice .fine { font-size: 13px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); cursor: pointer; }
.switch-row input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.switch-row b { display: block; font-weight: 700; }
.switch-row small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-dim); }
.switch-row.disabled { opacity: .6; cursor: default; }
