:root {
  --bg: #f4f1ec; --card: #fff; --ink: #1f1d1a; --muted: #6f6a62;
  --accent: #d9480f; --accent-ink: #fff; --line: #e4dfd6; --danger: #c92a2a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; }
.topbar h1 { margin: 0; font-size: 1.4rem; letter-spacing: -0.02em; white-space: nowrap; }
.usermenu { position: relative; min-width: 0; }
#user-btn { display: flex; align-items: center; gap: 6px; max-width: 100%; }
#user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { font-size: 0.75rem; opacity: 0.7; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 160px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); display: flex; flex-direction: column; }
.menu button { background: none; color: var(--ink); text-align: left; padding: 9px 12px; }
.menu button:hover { background: var(--bg); filter: none; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(400px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,0.35); }
dialog h3 { margin-top: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.items .sub { display: block; font-size: 0.78rem; color: var(--muted); }
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 1.15rem; }
  #user-btn { padding: 7px 10px; font-size: 0.85rem; }
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.narrow { max-width: 380px; margin: 60px auto; }
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; padding: 0 24px 24px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; padding: 0 16px 16px; } }
h2 { margin: 0 0 12px; font-size: 1.15rem; }
h3 { margin: 20px 0 8px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
label { display: block; margin-bottom: 12px; font-size: 0.9rem; }
input[type=email], input[type=password], input:not([type]) {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; margin-top: 4px;
}
.row { display: flex; gap: 8px; }
.row input { margin-top: 0; }
button { font: inherit; padding: 9px 14px; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; white-space: nowrap; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--danger); }
button.big { font-size: 1.1rem; padding: 12px 36px; margin-top: 12px; }
button.x { background: none; color: var(--muted); padding: 2px 8px; }
button.x:hover { color: var(--danger); }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--danger); font-size: 0.9rem; min-height: 1em; margin: 4px 0; }
.list-nav { list-style: none; padding: 0; margin: 14px 0 0; }
.list-nav li { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.list-nav li:hover { background: var(--bg); }
.list-nav li.active { background: var(--ink); color: #fff; }
.list-nav .meta { font-size: 0.8rem; opacity: 0.7; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.list-head h2 { margin: 0; }
.actions { display: flex; gap: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.items { list-style: none; padding: 0; margin: 10px 0 0; }
.items li { display: flex; justify-content: space-between; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.items li.picked { color: var(--muted); text-decoration: line-through; }
.spinner-col { display: flex; flex-direction: column; align-items: center; }
.spinner-col h3 { align-self: flex-start; }
.wheel-wrap { position: relative; width: 100%; max-width: 420px; }
#wheel { width: 100%; height: auto; display: block; }
.pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--ink); z-index: 1; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); }
.result { font-size: 1.5rem; font-weight: 700; min-height: 1.6em; margin: 14px 0 0; text-align: center; }
.picks-box { width: 100%; margin-top: 8px; }
.picks-head { display: flex; justify-content: space-between; align-items: center; }
button.small { padding: 4px 10px; font-size: 0.85rem; }
.items .when { display: block; font-size: 0.78rem; color: var(--muted); }
