/* ═══════════════════════════════════════════════════════════════
   Our Week — warm & cozy theme for two
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #faf4ee;
  --bg-glow: rgba(244, 63, 94, 0.07);
  --card: #ffffff;
  --ink: #45322c;
  --muted: #a28b80;
  --line: #f1e2d9;
  --rose: #e11d48;
  --rose-deep: #be123c;
  --rose-soft: #fff1f2;
  --amber: #d97706;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --p1: #e11d48;
  --p2: #d97706;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(190, 110, 90, 0.12);
  --shadow-sm: 0 2px 8px rgba(190, 110, 90, 0.10);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1310;
    --bg-glow: rgba(244, 63, 94, 0.08);
    --card: #271c17;
    --ink: #f6ece5;
    --muted: #b39c8f;
    --line: #3c2b24;
    --rose: #fb7185;
    --rose-deep: #f43f5e;
    --rose-soft: #3a2124;
    --amber: #fbbf24;
    --green: #4ade80;
    --green-soft: #1d2b20;
    --danger: #f87171;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -120px, var(--bg-glow), transparent 70%),
    var(--bg);
  min-height: 100vh;
}

h1 { font-size: 24px; margin: 4px 0 2px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 19px; margin: 0 0 14px; font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 13px; margin: 0 0 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
code { background: var(--rose-soft); color: var(--rose-deep); padding: 1px 5px; border-radius: 6px; font-size: 0.9em; }

/* ── Cards & buttons ─────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, opacity 0.15s;
  min-height: 44px;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}
.btn.primary:hover { box-shadow: 0 6px 18px rgba(244, 63, 94, 0.45); }
.btn.ghost {
  background: var(--rose-soft);
  color: var(--rose-deep);
  border-color: transparent;
}
.btn.ghost:hover { filter: brightness(0.97); }
.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn.wide { width: 100%; }
.btn.small-btn { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  appearance: none;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 12px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.icon-btn:hover { background: var(--rose-soft); color: var(--rose-deep); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.link-btn {
  appearance: none; border: none; background: none; padding: 0;
  color: var(--rose); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

/* ── Forms ───────────────────────────────────────────────────── */

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; color: var(--muted); }
.field > span em { font-style: normal; font-weight: 500; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-grid.three { grid-template-columns: 2fr 2fr 1.4fr; }

input[type="text"], input[type="password"], input[type="time"], input[type="date"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 18%, transparent);
}
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }
input[type="time"] { min-height: 44px; }
input[type="date"] { min-height: 44px; font-variant-numeric: tabular-nums; }

.check-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; margin: 10px 0; cursor: pointer; user-select: none;
}
.check-row input { width: 17px; height: 17px; accent-color: var(--rose); cursor: pointer; }

.error { color: var(--danger); font-size: 13.5px; font-weight: 600; margin: 10px 0 0; }

/* ── Screens ─────────────────────────────────────────────────── */

.screen { min-height: 100vh; }
.screen-center {
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%; max-width: 380px;
  padding: 30px 26px 26px;
  text-align: center;
  animation: rise 0.35s ease both;
}
.auth-card .field { text-align: left; margin-top: 14px; }

.logo {
  width: 58px; height: 58px;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.4);
}

.pin-input {
  text-align: center !important;
  font-size: 22px !important;
  letter-spacing: 0.35em;
  margin: 16px 0 14px;
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
.shake { animation: shake 0.5s ease; }

/* ── Topbar ──────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px;
  padding-top: 10px; padding-bottom: 10px;
  flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.brand-heart { color: var(--rose); }
.top-actions { display: flex; gap: 2px; margin-left: auto; }

.weeknav { display: flex; align-items: center; gap: 6px; margin-inline: auto; }
.weeknav-label { text-align: center; min-width: 150px; }
.weeknav-label strong { font-size: 14.5px; display: block; line-height: 1.2; }
.weeknav .icon-btn { width: 36px; height: 36px; }

/* ── Layout ──────────────────────────────────────────────────── */

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
#screen-app .wrap { padding-bottom: 40px; }

.identity-bar {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.identity-bar strong { color: var(--ink); }

/* ── Quick add ───────────────────────────────────────────────── */

.quick-add {
  margin-top: 14px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.quick-add input[type="text"] {
  border: none; background: transparent; font-size: 15.5px; padding: 6px 8px;
  box-shadow: none !important;
}
.quick-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-add select, .quick-add input[type="date"] { width: auto; min-width: 110px; flex: 1 1 120px; }
.quick-add .btn { flex: 0 0 auto; }

/* ── Stats ───────────────────────────────────────────────────── */

.stats-row {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 2px 10px;
}
.stats-row .muted { font-size: 13px; font-weight: 600; white-space: nowrap; }
.stats-bar {
  flex: 1; height: 6px; border-radius: 99px;
  background: var(--line); overflow: hidden;
}
.stats-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #f43f5e, #ec4899);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── Month board ───────────────────────────────────────────────── */

.month-board { display: flex; flex-direction: column; gap: 10px; }

.weekday-head {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  padding: 0 10px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.weekday-head span { text-align: center; }

.week-row {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px;
}

@keyframes glow-pulse {
  from {
    box-shadow:
      0 0 0 1.5px color-mix(in srgb, var(--rose) 40%, transparent),
      0 0 16px color-mix(in srgb, var(--rose) 22%, transparent),
      0 6px 20px rgba(244, 63, 94, 0.10);
  }
  to {
    box-shadow:
      0 0 0 1.5px color-mix(in srgb, var(--rose) 60%, transparent),
      0 0 30px color-mix(in srgb, var(--rose) 38%, transparent),
      0 6px 26px rgba(244, 63, 94, 0.18);
  }
}
/* the week that contains today glows from Monday to Sunday */
.week-row.current {
  border-color: color-mix(in srgb, var(--rose) 45%, transparent);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--rose) 6%, var(--card)),
    var(--card) 70%);
  animation: glow-pulse 3s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  .week-row.current { animation: none; }
}

.day-cell {
  min-width: 0;
  min-height: 118px;
  display: flex; flex-direction: column;
  border-radius: 10px;
  padding: 4px;
  transition: background 0.13s, opacity 0.13s;
}
.day-cell:hover { background: color-mix(in srgb, var(--rose) 4%, transparent); }
.day-cell.dim { opacity: 0.45; }
.day-cell.dim:hover { opacity: 0.85; }
.day-cell.today { background: var(--rose-soft); }

.day-head-cell {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 4px 5px;
}
.day-num {
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  flex: 0 0 auto;
}
.day-cell.today .day-num {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  color: #fff;
}
.day-wd { display: none; font-size: 10.5px; font-weight: 700; color: var(--muted); }

.today-pill {
  margin-left: auto;
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em;
  color: #fff; background: linear-gradient(135deg, #f43f5e, #ec4899);
  border-radius: 99px; padding: 2px 8px;
}

.cell-list {
  display: flex; flex-direction: column; gap: 3px;
  overflow-y: auto;
  max-height: 132px;
  padding-right: 2px;
}
.cell-empty { color: var(--muted); opacity: 0.55; font-size: 11px; text-align: center; padding: 7px 0; }

/* compact items inside month cells */
.month-board .item { padding: 4px 5px; border-radius: 8px; gap: 6px; }
.month-board .item-title {
  display: flex; align-items: center; min-width: 0; flex: 1;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.month-board .check { width: 17px; height: 17px; margin-top: 0; }
.month-board .check svg { width: 9px; height: 9px; }
.cell-text { overflow: hidden; text-overflow: ellipsis; }
.cell-time {
  color: var(--amber); font-weight: 800; font-size: 10px;
  margin-right: 4px; white-space: nowrap; font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.month-board .item-note-ico { margin-right: 3px; flex: 0 0 auto; }
.month-board .item-note-ico svg { width: 11px; height: 11px; }

.who-dot-cell {
  flex: 0 0 auto;
  width: 15px; height: 15px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 800; color: #fff;
}
.who-dot-cell.who-p1 { background: var(--p1); }
.who-dot-cell.who-p2 { background: var(--p2); }
.who-dot-cell.who-both { background: linear-gradient(135deg, var(--p1), var(--p2)); }

/* items */
.item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 8px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.13s;
}
.item:hover { background: var(--rose-soft); }
.check {
  appearance: none;
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin: 1px 0 0;
  border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  padding: 0;
}
.check:hover { border-color: var(--rose); transform: scale(1.08); }
.check svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.item.done .check { background: var(--green); border-color: var(--green); }
.item.done .check svg { opacity: 1; }

.item-main { flex: 1; min-width: 0; }
.item-title {
  font-size: 13.5px; font-weight: 650; word-wrap: break-word;
  overflow-wrap: anywhere;
}
.item.done .item-title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.item-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }

.chip {
  font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 99px;
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--line);
}
.chip.time { font-variant-numeric: tabular-nums; }

.who-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 800;
  padding: 1px 7px 1px 3px; border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--bg); color: var(--muted);
}
.who-dot {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 800; color: #fff;
}
.who-p1 .who-dot { background: var(--p1); }
.who-p2 .who-dot { background: var(--p2); }
.who-both .who-dot { background: linear-gradient(135deg, var(--p1), var(--p2)); }
.who-both { background: var(--rose-soft); border-color: transparent; color: var(--rose-deep); }

.item-note-ico { color: var(--muted); flex: 0 0 auto; }
.item-note-ico svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

.item-pencil { color: var(--muted); opacity: 0; transition: opacity 0.15s; flex: 0 0 auto; margin-top: 2px; }
.item:hover .item-pencil, .item:focus-within .item-pencil { opacity: 0.8; }
.item-pencil svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
@media (hover: none) { .item-pencil { opacity: 0.45; } }

/* thin pretty scrollbars in month cells */
.cell-list::-webkit-scrollbar { width: 6px; }
.cell-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.cell-list { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ── Footer ──────────────────────────────────────────────────── */

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 26px 0 10px;
}
.app-footer .heart { color: var(--rose); }

/* ── Modals ──────────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(43, 22, 16, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fade 0.18s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%; max-width: 470px;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  padding: 20px;
  animation: rise 0.25s ease both;
}
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.spacer { flex: 1; }

/* identity modal */
.identity-buttons { display: flex; gap: 10px; margin-top: 14px; }
.identity-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  font: inherit; font-weight: 800; font-size: 15px; color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.identity-btn:hover { border-color: var(--rose); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.identity-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}

/* settings */
.settings-card { max-width: 540px; }
.settings-section { border-top: 1px solid var(--line); padding: 16px 0; }
.settings-section:first-of-type { border-top: none; padding-top: 4px; }
.settings-section .btn { margin-top: 2px; }

.funnel-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 99px;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--muted);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-pill.st-running { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: var(--green-soft); }
.status-pill.st-running .dot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.status-pill.st-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.status-pill.st-error .dot { background: var(--danger); }
.status-pill.st-unavailable { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.status-pill.st-unavailable .dot { background: var(--amber); }

.funnel-logs {
  margin: 10px 0 0;
  background: #241a17;
  color: #f3e0d7;
  border-radius: 12px;
  padding: 12px 14px;
  font: 11.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  height: 170px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.funnel-logs::-webkit-scrollbar { width: 6px; }
.funnel-logs::-webkit-scrollbar-thumb { background: #4a382f; border-radius: 99px; }

.db-path { word-break: break-all; }

/* ── Toasts ──────────────────────────────────────────────────── */

#toasts {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  width: max-content; max-width: min(92vw, 420px);
}
.toast {
  background: var(--ink);
  color: var(--bg);
  font-size: 13.5px; font-weight: 650;
  padding: 10px 18px;
  border-radius: 99px;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease both;
  max-width: 100%;
  text-align: center;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── View tabs (calendar / spinner) ──────────────────────────── */

.view-tabs {
  display: flex; gap: 4px;
  margin-top: 14px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.view-tab {
  flex: 1;
  appearance: none; border: none; background: transparent;
  font: inherit; font-weight: 800; font-size: 14px;
  color: var(--muted);
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.view-tab svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.view-tab:hover { color: var(--rose-deep); }
.view-tab[aria-selected="true"] {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  color: #fff;
  box-shadow: 0 3px 10px rgba(244, 63, 94, 0.35);
}

/* ── Wheel spinner ───────────────────────────────────────────── */

.spin-card {
  margin-top: 14px;
  padding: 18px 16px 20px;
  text-align: center;
}
.spin-sub { font-size: 13.5px; font-weight: 700; margin: 0 0 2px; }

.wheel-wrap {
  position: relative;
  width: min(100%, 400px);
  margin: 16px auto 4px;
  display: flex; justify-content: center;
}
.wheel-wrap::before {
  /* soft halo under the wheel */
  content: "";
  position: absolute; inset: -12px;
  background: radial-gradient(closest-side, rgba(244, 63, 94, 0.10), transparent 75%);
  border-radius: 50%;
  pointer-events: none;
}
#wheel { position: relative; display: block; }

.wheel-pointer {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 3;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 23px solid var(--rose-deep);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.28));
}

.spin-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 2;
  width: 94px; height: 94px;
  border-radius: 50%;
  border: 6px solid var(--card);
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  color: #fff;
  font-family: inherit; font-weight: 900; font-size: 17px; letter-spacing: 0.07em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.spin-btn:hover { box-shadow: 0 8px 26px rgba(244, 63, 94, 0.55); }
.spin-btn:active { transform: translate(-50%, -50%) scale(0.94); }
.spin-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.spin-hint { margin: 12px auto 0; max-width: 360px; }

.spin-result {
  position: relative;
  margin-top: 14px;
  padding: 16px 46px 16px 18px;
}
.spin-result.pop { animation: pop-in 0.4s cubic-bezier(0.18, 1.35, 0.4, 1) both; }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.spin-dismiss { position: absolute; top: 7px; right: 7px; }
.spin-result-label {
  font-size: 11.5px; font-weight: 900;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--rose);
}
.spin-result-title {
  font-size: 21px; font-weight: 800; letter-spacing: -0.01em;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.spin-result-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Wheel entry list (below the wheel) ──────────────────────── */

.wheel-card {
  margin-top: 14px;
  padding: 14px 16px 10px;
}
.wheel-add {
  display: flex; gap: 8px; align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.wheel-add input[type="text"] {
  flex: 1 1 auto; min-width: 0;
  border: 1.5px solid var(--line);
  background: transparent;
  border-radius: 12px;
  font: inherit; font-size: 14.5px;
  padding: 10px 12px;
  min-height: 44px;
  color: var(--ink);
  transition: border-color 0.15s;
}
.wheel-add input[type="text"]::placeholder { color: var(--muted); }
.wheel-add input[type="text"]:focus { outline: none; border-color: var(--rose); }
.wheel-add .btn { flex: 0 0 auto; }

.wheel-list {
  list-style: none;
  margin: 4px 0 0; padding: 0;
  max-height: 264px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}
.wheel-list::-webkit-scrollbar { width: 6px; }
.wheel-list::-webkit-scrollbar-track { background: transparent; }
.wheel-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  border-radius: 99px;
}

.wheel-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  animation: pop-in 0.22s ease both;
}
.wheel-entry:last-child { border-bottom: none; }
.wheel-entry .who-dot-cell { flex: 0 0 auto; }
.wheel-entry-title {
  flex: 1 1 auto; min-width: 0;
  font-weight: 600; font-size: 14.5px;
  overflow-wrap: anywhere;
}
.wheel-entry-x {
  appearance: none; border: none; background: none; cursor: pointer;
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.wheel-entry-x svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round;
}
.wheel-entry-x:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.wheel-empty { text-align: center; padding: 20px 0 12px; margin: 0; }
.wheel-foot { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.danger-link { color: var(--danger); }

/* small screens */
@media (max-width: 639px) {
  .topbar-inner { justify-content: space-between; }
  .weeknav { order: 3; width: 100%; justify-content: center; margin-top: 2px; }
  .brand { font-size: 16px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .field-grid.two { grid-template-columns: 1fr 1fr; }

  /* month board: each week becomes a stack of day rows */
  .weekday-head { display: none; }
  .week-row { grid-template-columns: 1fr; gap: 0; padding: 6px; }
  .day-cell { min-height: 0; flex-direction: row; align-items: flex-start; gap: 8px; padding: 6px 4px; }
  .day-cell + .day-cell { border-top: 1px solid var(--line); }
  .day-cell.dim { display: none; }  /* keep phones focused on this month */
  .day-head-cell { width: 62px; flex: 0 0 auto; padding: 2px 0 0 4px; }
  .day-wd { display: inline; }
  .cell-list { max-height: none; overflow: visible; }
  .month-board .item-title { font-size: 13px; }
}
