/* Seed Starter: a cottage-garden look. Cream paper scattered with little flowers, a chunky storybook
   display face (Caprasimo), a round friendly text face (Quicksand), petal pinks and leaf greens. */
:root {
  --bg: #fff6ef;
  --surface: #ffffff;
  --surface-2: #fdeae4;
  --text: #3d2a3b;
  --muted: #8b6f86;
  --faint: #c6aebf;
  --line: #f6d9df;
  --accent: #dc4a85;            /* rose */
  --accent-deep: #b3325f;
  --on-accent: #ffffff;
  --accent-soft: #ffe0ec;
  --accent-text: #b12b63;
  --leaf: #4f9d69;
  --leaf-soft: #dff3e2;
  --leaf-text: #2f7448;
  --sun: #f6b93b;
  --sun-soft: #fff0c9;
  --sun-text: #8a5a00;
  --lilac: #9b7fd1;
  --lilac-soft: #ece3fb;
  --lilac-text: #6a4bb0;
  --danger-text: #c02f3d;
  --shadow: 0 2px 0 rgba(220, 74, 133, .07), 0 10px 26px rgba(160, 80, 120, .09);
  --radius: 22px;
  --display: "Caprasimo", "Cooper Black", "Georgia", serif;
  --petals: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='.5'%3E%3Cg fill='%23f9bfd3'%3E%3Ccircle cx='34' cy='26' r='6'/%3E%3Ccircle cx='46' cy='34' r='6'/%3E%3Ccircle cx='42' cy='48' r='6'/%3E%3Ccircle cx='27' cy='48' r='6'/%3E%3Ccircle cx='22' cy='34' r='6'/%3E%3C/g%3E%3Ccircle cx='34' cy='38' r='5' fill='%23f8d56b'/%3E%3Cg fill='%23d5c4f3'%3E%3Ccircle cx='150' cy='118' r='5'/%3E%3Ccircle cx='160' cy='125' r='5'/%3E%3Ccircle cx='156' cy='137' r='5'/%3E%3Ccircle cx='144' cy='137' r='5'/%3E%3Ccircle cx='140' cy='125' r='5'/%3E%3C/g%3E%3Ccircle cx='150' cy='128' r='4' fill='%23fff3b0'/%3E%3Cg fill='%23ffd3a8'%3E%3Ccircle cx='82' cy='176' r='4.500'/%3E%3Ccircle cx='91' cy='182' r='4.500'/%3E%3Ccircle cx='88' cy='193' r='4.500'/%3E%3Ccircle cx='76' cy='193' r='4.500'/%3E%3Ccircle cx='73' cy='182' r='4.500'/%3E%3C/g%3E%3Ccircle cx='82' cy='186' r='3.500' fill='%23f6a5c0'/%3E%3Cg fill='%23bfe3c6'%3E%3Cpath d='M118 40c10-8 20-6 24 2-9 6-18 6-24-2z'/%3E%3Cpath d='M186 196c2-12 10-18 19-16-1 11-8 17-19 16z'/%3E%3Cpath d='M20 124c12 0 19 7 18 16-11 0-18-6-18-16z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1423;
    --surface: #2a1d31;
    --surface-2: #38273f;
    --text: #fbeef5;
    --muted: #c5a9c1;
    --faint: #8a6e88;
    --line: #47314d;
    --accent: #ff7fb0;
    --accent-deep: #c9477e;
    --on-accent: #3a0f24;
    --accent-soft: #4c2340;
    --accent-text: #ffa6c8;
    --leaf: #7fd49a;
    --leaf-soft: #1f3b2a;
    --leaf-text: #9be3b2;
    --sun-soft: #40300f;
    --sun-text: #f8cf73;
    --lilac-soft: #33264d;
    --lilac-text: #c7b2f5;
    --danger-text: #ff8f9a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg) var(--petals); background-size: 220px; color: var(--text);
  font: 500 16px/1.5 "Quicksand", ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(env(safe-area-inset-bottom) + 88px);
}
@media (prefers-color-scheme: dark) { body { background-blend-mode: soft-light; } }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; }
b { font-weight: 700; }
.ic { width: 18px; height: 18px; flex: none; }
.bloom { width: 1em; height: 1em; flex: none; }
[hidden] { display: none !important; }

/* ---------- navigation: tab bar on phones, side rail on wide screens ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px max(6px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 8px) max(6px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 2px solid var(--line); border-radius: 26px 26px 0 0;
}
#tabbar .brand { display: none; }
#tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; white-space: nowrap; }
#tabbar a span { display: grid; place-items: center; width: 54px; height: 32px; border-radius: 999px; transition: background .2s, transform .2s; }
#tabbar a .ic { width: 21px; height: 21px; }
#tabbar a.on { color: var(--accent-text); }
#tabbar a.on span { background: var(--accent-soft); transform: rotate(-4deg); }
body.logged-out #tabbar, body.logged-out .garland { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.titles { flex: 1; min-width: 0; }
#crumb { font-size: 12px; font-weight: 700; color: var(--leaf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#crumb:empty { display: none; }
.topbar h1 { font-size: 30px; line-height: 1.15; color: var(--accent-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; }
/* A vine with leaves and blossoms under the title. */
.garland {
  height: 22px; margin: 0 auto 6px; max-width: 900px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='22' viewBox='0 0 120 22'%3E%3Cpath d='M0 11c15-9 25 9 40 0s25 9 40 0 25 9 40 0' fill='none' stroke='%237fbf8f' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M22 9c2-6 8-7 11-4-2 5-7 7-11 4zM62 13c2 6 8 7 11 4-2-5-7-7-11-4zM100 9c2-6 8-7 11-4-2 5-7 7-11 4z' fill='%239fd3ab'/%3E%3Cg fill='%23f58fb5'%3E%3Ccircle cx='40' cy='7' r='3'/%3E%3Ccircle cx='44' cy='11' r='3'/%3E%3Ccircle cx='40' cy='15' r='3'/%3E%3Ccircle cx='36' cy='11' r='3'/%3E%3C/g%3E%3Ccircle cx='40' cy='11' r='2.200' fill='%23f8d56b'/%3E%3Cg fill='%23b79be8'%3E%3Ccircle cx='80' cy='7' r='3'/%3E%3Ccircle cx='84' cy='11' r='3'/%3E%3Ccircle cx='80' cy='15' r='3'/%3E%3Ccircle cx='76' cy='11' r='3'/%3E%3C/g%3E%3Ccircle cx='80' cy='11' r='2.200' fill='%23fff3b0'/%3E%3Cg fill='%23ffb866'%3E%3Ccircle cx='0' cy='7' r='3'/%3E%3Ccircle cx='4' cy='11' r='3'/%3E%3Ccircle cx='0' cy='15' r='3'/%3E%3Ccircle cx='120' cy='7' r='3'/%3E%3Ccircle cx='116' cy='11' r='3'/%3E%3Ccircle cx='120' cy='15' r='3'/%3E%3C/g%3E%3C/svg%3E") repeat-x center / 120px 22px;
}
main { max-width: 900px; margin: 0 auto; padding: 4px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }

@media (min-width: 860px) {
  body { padding-bottom: 0; }
  #tabbar {
    top: 0; right: auto; width: 224px; display: flex; flex-direction: column; gap: 6px; padding: 22px 12px;
    border-top: 0; border-right: 2px solid var(--line); border-radius: 0; background: var(--surface);
  }
  #tabbar .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-family: var(--display); font-weight: 400; font-size: 21px; color: var(--accent-text); }
  #tabbar .brand img { width: 36px; height: 36px; border-radius: 12px; }
  #tabbar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px; font-size: 15px; }
  #tabbar a span { width: auto; height: auto; }
  #tabbar a.on { background: var(--accent-soft); }
  #tabbar a.on span { background: none; }
  #page { margin-left: 224px; }
  body.logged-out #page { margin-left: 0; }
  .topbar { max-width: 900px; margin: 0 auto; padding-top: 24px; }
  #toast { bottom: 28px !important; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 9px 17px; cursor: pointer;
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15px;
  white-space: nowrap; text-decoration: none; transition: transform .1s ease, box-shadow .1s ease;
}
.btn:active { transform: translateY(2px); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 3px 0 var(--accent-deep); }
.btn.primary:active { box-shadow: 0 1px 0 var(--accent-deep); }
.btn.danger { background: none; color: var(--danger-text); padding-left: 0; justify-content: flex-start; }
.btn.small { padding: 5px 13px; font-size: 13px; }
.btn.small .ic { width: 15px; height: 15px; }
.btn:disabled { opacity: .4; }
.icon-btn {
  border: 2px solid var(--line); background: var(--surface); color: var(--accent-text);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer; flex: none;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }

/* ---------- inputs ---------- */
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 0; font-size: 16px; color: var(--text); outline: none; }
.search:focus-within { border-color: var(--accent); }
input[type=text], input[type=number], input[type=password], input[type=date], textarea, select {
  width: 100%; min-width: 0; padding: 10px 13px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 16px; /* 16px stops iOS zooming in */
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 64px; resize: vertical; line-height: 1.5; display: block; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 700; min-width: 0; }
label small { font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 15px; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.error { color: var(--danger-text); font-size: 15px; margin: 0; }
.center { text-align: center; }
.colors { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.colors input[type=color] { width: 44px; height: 32px; padding: 2px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.dot { width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; }

/* ---------- sections and cards ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 4px 10px; min-height: 28px; }
.section-head h2 { font-size: 21px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.section-head h2::before { content: "✿"; color: var(--accent); font-family: system-ui, sans-serif; font-size: 16px; }
.section-head:nth-of-type(3n + 2) h2::before { color: var(--lilac); }
.section-head:nth-of-type(3n) h2::before { color: var(--sun); }
.section-head > a { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 700; color: var(--accent-text); text-decoration: none; }
.section-head > a .ic { width: 14px; height: 14px; }
.section-head > span { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 10px; }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.quiet { margin: 0; padding: 14px 16px; color: var(--muted); font-size: 15px; }
.tally { margin: 2px 4px 10px; color: var(--muted); font-size: 15px; }
.tally b { color: var(--accent-text); font-family: var(--display); font-weight: 400; font-size: 19px; }

.empty { text-align: center; color: var(--muted); padding: 40px 12px; max-width: 460px; margin: 0 auto; }
.empty-art { display: flex; justify-content: center; align-items: flex-end; gap: 4px; font-size: 64px; margin-bottom: 8px; }
.empty-art .bloom:nth-child(2) { font-size: 84px; margin-bottom: 10px; }
.empty-art .bloom { animation: sway 5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.empty-art .bloom:nth-child(2) { animation-delay: -1.7s; }
.empty-art .bloom:nth-child(3) { animation-delay: -3.1s; }
@keyframes sway { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@media (prefers-reduced-motion: reduce) { .empty-art .bloom { animation: none; } }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 22px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.empty-icon .ic { width: 30px; height: 30px; }
.empty-title { color: var(--accent-text); font-family: var(--display); font-size: 26px; margin: 0 0 4px; }
.empty .btn { margin-top: 12px; }

/* ---------- chips and segmented buttons ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 5px 15px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; }
.chip .ic { width: 14px; height: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.soft { border-color: transparent; background: var(--leaf-soft); color: var(--leaf-text); }
.chip.soft.on { background: var(--leaf); color: #fff; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button .ic { width: 16px; height: 16px; }
.seg button.on { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 4px rgba(120, 40, 80, .18); }

/* ---------- rows ---------- */
.rows { overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; width: 100%; padding: 11px 12px 11px 14px; border: 0; border-top: 2px dotted var(--line); background: none; text-align: left; text-decoration: none; cursor: pointer; }
.row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; display: grid; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.row-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main b i { font-weight: 500; color: var(--muted); }
.row-main span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main .note { font-style: italic; white-space: normal; color: var(--lilac-text); }
.chev { color: var(--faint); width: 16px; height: 16px; }
.emoji { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 19px; flex: none; }
.yr { font-family: var(--display); font-size: 17px; color: var(--accent-text); flex: none; width: 44px; }
.count { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--lilac-soft); color: var(--lilac-text); white-space: nowrap; }
.tag { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tag.indoor { background: var(--sun-soft); color: var(--sun-text); }
.tag.outdoor { background: var(--leaf-soft); color: var(--leaf-text); }
.swatch { width: 36px; height: 36px; border-radius: 12px 12px 12px 4px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .02em; flex: none; }
.swatch.none { background: #eadfc8; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .1); }
.tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--faint); background: none; color: transparent; display: grid; place-items: center; padding: 0; cursor: pointer; flex: none; }
.tick .ic { width: 16px; height: 16px; stroke-width: 3; }
.tick.on { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.row.sow { cursor: default; align-items: flex-start; }
.row.sow .tick, .row.sow .tag { margin-top: 3px; }
.row.sow.done .row-main b { color: var(--muted); }

/* ---------- the tray screen ---------- */
.work { display: grid; gap: 14px; }
.tools { padding: 12px; display: grid; gap: 10px; position: sticky; top: calc(env(safe-area-inset-top) + 62px); z-index: 5; }
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool-row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.tools .hint { font-size: 13px; }
.tools .btn.danger { padding-left: 12px; }
.sel-count { margin: 0; font-size: 15px; }
.seed-btn { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 18px; padding: 8px 10px 8px 8px; background: var(--accent-soft); text-align: left; cursor: pointer; }
.seed-btn > span:not(.swatch) { flex: 1; min-width: 0; display: grid; }
.seed-btn small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.seed-btn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-wrap { display: grid; gap: 10px; justify-items: center; }
/* A wooden tray filled with soil. */
.tray {
  position: relative; width: min(100%, 420px); aspect-ratio: 36 / 76; container-type: inline-size;
  background-color: #4a362a; border-radius: 8px; margin: 9px; cursor: copy;
  box-shadow: 0 0 0 9px #c98d5b, 0 0 0 11px #a86f42, 0 14px 30px rgba(120, 70, 40, .28);
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.5px), radial-gradient(rgba(0, 0, 0, .18) 1px, transparent 1.5px);
  background-size: 11px 11px, 17px 17px; background-position: 0 0, 5px 8px;
}
.tray.move { cursor: default; }
.blk {
  position: absolute; border: 0; padding: 0; margin: 0; border-radius: 4px; background: #eadfc8; color: #111;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3), inset 0 -2px 0 rgba(0, 0, 0, .12); font-weight: 800; line-height: 1; overflow: hidden; cursor: pointer;
  display: grid; place-items: center; font-size: 2.5cqw; letter-spacing: -0.02em; -webkit-user-select: none; user-select: none;
}
.blk.l { font-size: 5.2cqw; border-radius: 7px; }
.tray.move .blk { touch-action: none; cursor: grab; }
.blk.sel { outline: 3px solid #fff; outline-offset: -3px; box-shadow: inset 0 0 0 5px rgba(0, 0, 0, .55); z-index: 2; }
.blk.dragging { opacity: .88; z-index: 3; cursor: grabbing; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.legend .section-head { margin-top: 0; }
@media (min-width: 860px) {
  .work { grid-template-columns: minmax(260px, 320px) auto; grid-template-areas: "tools tray" "legend tray"; grid-template-rows: auto 1fr; align-items: start; column-gap: 28px; }
  .tools { grid-area: tools; position: static; }
  .tray-wrap { grid-area: tray; }
  .legend { grid-area: legend; }
  .tray { width: 420px; }
}

/* ---------- dahlias ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.stat { border-radius: 20px 20px 20px 6px; padding: 10px 6px; text-align: center; display: grid; }
.stat b { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 11px; font-weight: 700; }
.stat.bought, .register .bought { background: var(--sun-soft); color: var(--sun-text); }
.stat.planted, .register .planted { background: var(--leaf-soft); color: var(--leaf-text); }
.stat.saved, .register .saved { background: var(--accent-soft); color: var(--accent-text); }
.stat.survived, .register .survived { background: var(--lilac-soft); color: var(--lilac-text); }
.table-wrap { overflow-x: auto; }
.register { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.register th, .register td { padding: 8px 4px; text-align: center; white-space: nowrap; border-top: 2px dotted var(--line); }
.register thead th { border-top: 0; font-size: 10px; font-weight: 700; }
.register thead .year { font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--accent-text); background: var(--surface); }
.register td { font-weight: 700; min-width: 42px; }
.register td.first, .register thead .bought { border-left: 3px solid var(--surface); }
.register .name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding-left: 10px; min-width: 150px; max-width: 42vw; }
.register tbody .name { display: flex; align-items: center; gap: 8px; white-space: normal; cursor: pointer; }
.register tbody tr { cursor: pointer; }
.register .name b { display: block; font-weight: 700; line-height: 1.2; }
.register .name small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.register tfoot th, .register tfoot td { font-family: var(--display); font-weight: 400; font-size: 16px; }
.dahlia-dot { font-size: 30px; display: grid; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15)); }
.yeargrid { width: 100%; border-collapse: separate; border-spacing: 4px; }
.yeargrid th { font-size: 12px; color: var(--muted); font-weight: 700; }
.yeargrid tr > th:first-child { font-family: var(--display); font-weight: 400; font-size: 16px; color: var(--accent-text); text-align: left; }
.yeargrid input { padding: 8px 4px; text-align: center; }

/* ---------- sheets ---------- */
dialog.sheet {
  border: 2px solid var(--line); padding: 20px; width: min(460px, calc(100% - 24px)); border-radius: 28px;
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(80, 20, 50, .3);
}
dialog.sheet::backdrop { background: rgba(60, 20, 45, .4); }
.sheet form { display: grid; gap: 13px; }
.sheet h3 { font-size: 24px; color: var(--accent-text); overflow-wrap: anywhere; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; padding-bottom: 3px; }
.sheet.menu { display: grid; gap: 6px; }
.sheet.menu:not([open]), .sheet.picker:not([open]) { display: none; }
.sheet.menu h3 { margin-bottom: 8px; }
.menu-item { border: 0; border-radius: 16px; padding: 12px 14px; background: var(--surface-2); text-align: left; font-weight: 700; cursor: pointer; }
.menu-item.danger { color: var(--danger-text); }
.menu-item.cancel { background: none; text-align: center; color: var(--muted); }
.sheet.picker { display: grid; gap: 10px; max-height: min(640px, calc(100% - 24px)); grid-template-rows: auto auto minmax(0, 1fr) auto; }
.pick-list { overflow-y: auto; display: grid; gap: 4px; align-content: start; }
.pick { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 6px; border-radius: 14px; text-align: left; font-weight: 700; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick.new { color: var(--accent-text); padding-left: 14px; }
.pick.new .ic { margin-right: 8px; }
@media (max-width: 520px) {
  dialog.sheet { margin: auto auto 10px; width: calc(100% - 16px); max-width: none; max-height: calc(100% - 20px); padding-bottom: calc(env(safe-area-inset-bottom) + 18px); }
}

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 92px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18); z-index: 30; max-width: calc(100% - 32px);
}

/* ---------- login ---------- */
.login { max-width: 340px; margin: 12vh auto 0; text-align: center; display: grid; gap: 12px; }
.login img { width: 84px; height: 84px; border-radius: 26px; margin: 0 auto 4px; }
.login h2 { margin: 0 0 8px; font-size: 34px; color: var(--accent-text); }
.login .btn { padding: 12px; }
