:root {
  --cream: #fff4e0;
  --paper: #fffdf7;
  --ink: #1d1b3a;
  --pop: #ff5b3a;
  --pop-soft: #ffd9cf;
  --line: #1d1b3a;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.45 ui-rounded, "Nunito", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 80px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 360px; text-align: center; }
.mascot { font-size: 64px; display: inline-block; animation: hop 1.6s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-14px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .mascot { animation: none; } }

h1 { font-size: 30px; margin: 4px 0 2px; letter-spacing: -0.5px; }
h2 { font-size: 20px; margin: 0; }
.sub { margin: 0 0 16px; opacity: 0.7; }

.card {
  background: var(--paper);
  border: 2.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--line);
  padding: 16px;
}
input, select, textarea {
  width: 100%;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--pop); outline-offset: 2px; }

.btn {
  background: var(--pop);
  color: #fff;
  border: 2.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 16px;
  min-height: 44px;
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.err { color: #b3261e; font-weight: 700; margin: 8px 0 0; min-height: 1.4em; }

/* header + tabs */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.top h1 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 24px; }
.who { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.who button { background: var(--pop-soft); border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; min-height: 36px; font-weight: 700; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tab { background: var(--paper); border: 2.5px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 52px; font-weight: 800; font-size: 17px; box-shadow: 3px 3px 0 var(--line); }
.tab[aria-selected="true"] { background: var(--pop); color: #fff; }
.modes { display: flex; gap: 8px; margin-bottom: 14px; }
.mode { flex: 1; background: transparent; border: 2px solid var(--line); border-radius: 999px; min-height: 44px; font-weight: 800; }
.mode[aria-selected="true"] { background: var(--ink); color: var(--cream); }

/* lists */
.stack { display: grid; gap: 14px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.date { font-size: 13px; font-weight: 800; background: var(--pop-soft); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.item { border-top: 2px dashed rgba(29, 27, 58, 0.25); padding: 10px 0; }
.item:first-of-type { border-top: 0; }
.item .t { font-weight: 800; }
.item .time { color: var(--pop); font-weight: 800; margin-right: 6px; }
.item .meta { font-size: 13px; opacity: 0.65; }
.item .note { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.item a { color: var(--pop); font-weight: 700; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.row > * { flex: 0 0 auto; }
.row select { flex: 1 1 140px; width: auto; }
.vote { background: #fff; border: 2px solid var(--line); border-radius: 999px; min-height: 40px; padding: 2px 12px; font-weight: 800; }
.vote[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.voters { font-size: 12px; opacity: 0.7; margin-top: 4px; }
.del { background: none; border: 0; opacity: 0.55; min-height: 36px; padding: 0 8px; font-size: 14px; text-decoration: underline; }
.empty { text-align: center; opacity: 0.7; padding: 18px 8px; }
form.add { display: grid; gap: 8px; margin-top: 10px; }
form.add .two { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
details summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 10; }
