/* Almanac — calm, cool and quiet. Tuned for iPhone 12 mini (375 x 812).
   Three cool main colors: indigo (潜る), jade (耕す), azure (休む). */

:root {
  color-scheme: light dark;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface2: #f7f8fa;
  --ink: #111418;
  --ink2: #5b6470;
  --ink3: #98a0aa;
  --line: #e3e7ec;
  --fill: #eceff3;
  --glass: rgba(255, 255, 255, 0.78);

  --dive: #5a4fd0;  --dive2: #8c82f0;  --dive-ink: #4a3fb8;  --dive-soft: #edebfc;
  --till: #1b8a6c;  --till2: #43bb95;  --till-ink: #146e56;  --till-soft: #ddf2ea;
  --rest: #1d88c4;  --rest2: #52b9ea;  --rest-ink: #166d9f;  --rest-soft: #dceffa;
  --accent: var(--dive);
  --tea: #6b5a48;

  --shadow-sm: 0 1px 2px rgba(17, 20, 24, 0.04);
  --shadow: 0 1px 2px rgba(17, 20, 24, 0.04), 0 8px 24px -10px rgba(17, 20, 24, 0.12);
  --shadow-lg: 0 12px 32px -8px rgba(17, 20, 24, 0.22), 0 0 0 0.5px rgba(17, 20, 24, 0.06);
  --backdrop: rgba(10, 14, 20, 0.36);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bar-h: 64px;
  --bar-gap: calc(var(--safe-b) + 10px);
  --num: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Zen Kaku Gothic New", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d10;
    --surface: #161a1f;
    --surface2: #1c2026;
    --ink: #f2f4f7;
    --ink2: #a3abb6;
    --ink3: #6b737e;
    --line: #262b32;
    --fill: #20252c;
    --glass: rgba(28, 32, 38, 0.8);
    --dive: #6a5fe0;  --dive2: #9a91f5;  --dive-ink: #b0a9f8;  --dive-soft: #221e48;
    --till: #1f9c7b;  --till2: #4cc9a2;  --till-ink: #6cd9b5;  --till-soft: #0f2a22;
    --rest: #2794d0;  --rest2: #63c3ef;  --rest-ink: #7fcbf2;  --rest-soft: #0e2636;
    --tea: #c7b29a;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
    --backdrop: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
::placeholder { color: var(--ink3); opacity: 0.6; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.sheet-open { overflow: hidden; }
p, ul, h1, h2, h3 { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input, textarea, select { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); }
.dim { color: var(--ink3); }
.small { font-size: 13px; line-height: 1.55; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.page {
  padding: calc(var(--safe-t) + 8px) 20px calc(var(--bar-h) + var(--bar-gap) + 40px);
  display: flex; flex-direction: column; gap: 14px;
}

/* The page's accent follows the day type shown on it. */
.page { --accent2: var(--dive2); --accent-soft: var(--dive-soft); --accent-ink: var(--dive-ink); }
.page[data-accent="till"] { --accent: var(--till); --accent2: var(--till2); --accent-soft: var(--till-soft); --accent-ink: var(--till-ink); }
.page[data-accent="rest"] { --accent: var(--rest); --accent2: var(--rest2); --accent-soft: var(--rest-soft); --accent-ink: var(--rest-ink); }

/* ---------- headers ---------- */
.dayhead { position: sticky; top: 0; z-index: 6; margin: calc(-1 * var(--safe-t) - 8px) -20px 0; padding: calc(var(--safe-t) + 14px) 20px 10px;
  display: flex; align-items: center; gap: 12px; background: linear-gradient(var(--bg) 78%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.dh-main { flex: 1; min-width: 0; }
.dh-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dh-date { font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: 0.01em; }
.dh-wd { font-size: 16px; font-weight: 700; color: var(--ink2); }
.dh-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-height: 22px; }
.today-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.rel-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 99px; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink2); font-size: 12px; font-weight: 700; }
.jump { font-size: 12px; font-weight: 700; color: var(--accent); }
.head-tp { height: 32px; padding: 0 14px 0 12px; font-size: 14px; }
.round { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); flex: none; }
.round .ic { width: 20px; height: 20px; stroke-width: 2; }
.round:active { transform: scale(0.94); }
.edge { position: fixed; top: 28%; height: 44%; width: 20px; z-index: 4; display: grid; place-items: center; color: var(--ink3); opacity: 0.55; }
.edge .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.edge.l { left: max(0px, calc(50vw - 240px)); }
.edge.r { right: max(0px, calc(50vw - 240px)); }
.edge:active { opacity: 1; color: var(--accent); }
.ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--t-soft); color: var(--t-ink); flex: none; }
.ico .ic { width: 18px; height: 18px; }
.ico.sm { width: 24px; height: 24px; border-radius: 8px; }
.ico.sm .ic { width: 14px; height: 14px; }
.sec-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13px !important; color: var(--ink) !important; letter-spacing: 0.04em !important; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 0 6px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink3); }
.top h1 { font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: 0.02em; }
.top-actions { display: flex; gap: 6px; }
.ib { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.ib .ic { width: 19px; height: 19px; }
.ib.accent { background: var(--accent); color: #fff; }
.ib:active { transform: scale(0.94); }

.nav { position: sticky; top: 0; z-index: 5; margin: calc(-1 * var(--safe-t) - 8px) -20px 0; padding: calc(var(--safe-t) + 8px) 20px 10px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  background: linear-gradient(var(--bg) 70%, transparent); }
.nav h2 { font-size: 16px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-right { display: flex; justify-content: flex-end; min-width: 72px; }
.back { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 14px 0 8px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.back .ic { width: 18px; height: 18px; stroke-width: 2.25; }
.back:active { transform: scale(0.96); }
.nav-act { height: 36px; padding: 0 16px; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700; }

/* ---------- sections, cards, lists ---------- */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 10px 2px -4px; }
.sec-h > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink3); }
.sec-h .count { font-family: var(--num); font-size: 12px; color: var(--ink3); }
.sec-h a, .sec-h button { font-size: 13px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 3px; }
.sec-h .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.note { margin: -6px 4px 0; font-size: 12px; line-height: 1.6; color: var(--ink3); }

.card { background: var(--surface); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.card-h { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink3); display: flex; align-items: center; gap: 6px; }
.card-h .ic { width: 15px; height: 15px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--ink2); margin: -6px -6px -6px 0; }
.x .ic { width: 16px; height: 16px; stroke-width: 2.2; }

.list { background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px; width: 100%; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; border-top: 1px solid var(--line); }
a.row:active, button.row:active { background: var(--surface2); }
.row .k { flex: 1; min-width: 0; }
.row .v { color: var(--ink2); text-align: right; flex: none; }
.row .chev { color: var(--ink3); width: 16px; height: 16px; stroke-width: 2.25; }
.row .lead { color: var(--ink2); }
.t1 { font-size: 16px; line-height: 1.45; }
.t2 { font-size: 13px; line-height: 1.5; color: var(--ink2); margin-top: 1px; }
.row.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.lbl { font-size: 13px; color: var(--ink2); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 20px; border-radius: 99px; background: var(--fill); font-size: 15px; font-weight: 700; white-space: nowrap; transition: transform 0.12s ease; }
.btn .ic { width: 18px; height: 18px; }
.btn:active { transform: scale(0.97); }
.btn.pri { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn.wide { width: 100%; min-height: 52px; font-size: 16px; }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn.ghost { background: none; color: var(--accent); }
.btn.danger { background: none; color: #d23c4b; }
.btn:disabled { opacity: 0.4; }
.btns { display: flex; gap: 8px; }
.btns > .btn { flex: 1; }
.link { color: var(--accent); font-size: 14px; font-weight: 700; padding: 6px 0; align-self: center; display: inline-flex; align-items: center; gap: 4px; }

.seg { display: flex; background: var(--fill); border-radius: 12px; padding: 3px; gap: 2px; }
.row > .seg { flex: 1; }
.seg.tinted button.on { background: var(--accent); color: #fff; }
.seg button { flex: 1; min-height: 34px; border-radius: 9px; font-size: 14px; color: var(--ink2); white-space: nowrap; padding: 0 6px; font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(17, 20, 24, 0.12); font-weight: 700; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #343a43; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; background: var(--fill); font-size: 12px; font-weight: 500; color: var(--ink2); white-space: nowrap; }
.chip .ic { width: 13px; height: 13px; }
button.chip { font-size: 14px; padding: 7px 13px; color: var(--ink); }
button.chip.on { background: var(--ink); color: var(--bg); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; line-height: 1.6; }
.notice > .ic { color: var(--accent); margin-top: 2px; width: 18px; height: 18px; }
.notice .grow { flex: 1; }

/* ---------- day types ---------- */
[data-t="dive"] { --t: var(--dive); --t2: var(--dive2); --t-ink: var(--dive-ink); --t-soft: var(--dive-soft); }
[data-t="till"] { --t: var(--till); --t2: var(--till2); --t-ink: var(--till-ink); --t-soft: var(--till-soft); }
[data-t="rest"] { --t: var(--rest); --t2: var(--rest2); --t-ink: var(--rest-ink); --t-soft: var(--rest-soft); }
[data-t="none"] { --t: var(--ink3); --t2: var(--ink3); --t-ink: var(--ink2); --t-soft: var(--fill); }
.tp { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px 0 9px; border-radius: 99px; background: var(--t-soft); color: var(--t-ink); font-size: 13px; font-weight: 700; white-space: nowrap; flex: none; }
.tp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--t); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--t); flex: none; }

.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px 20px 18px; color: #fff;
  background: linear-gradient(140deg, var(--t) 0%, var(--t2) 120%); box-shadow: 0 16px 32px -18px var(--t); display: flex; flex-direction: column; gap: 16px; }
.hero::after { content: ""; position: absolute; right: -10px; bottom: -6px; width: 220px; height: 140px; opacity: 0.22; pointer-events: none; background-repeat: no-repeat; background-size: contain; background-position: right bottom; }
.hero[data-t="dive"]::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 140' fill='none' stroke='white' stroke-width='1.6'%3E%3Ccircle cx='180' cy='140' r='30'/%3E%3Ccircle cx='180' cy='140' r='58'/%3E%3Ccircle cx='180' cy='140' r='86'/%3E%3Ccircle cx='180' cy='140' r='114'/%3E%3C/svg%3E"); }
.hero[data-t="till"]::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 140' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M60 140 140 20M90 140 170 20M120 140 200 20M150 140 230 20M180 140 260 20'/%3E%3C/svg%3E"); }
.hero[data-t="rest"]::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 140' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M0 80c18-12 37-12 55 0s37 12 55 0 37-12 55 0 37 12 55 0'/%3E%3Cpath d='M0 104c18-12 37-12 55 0s37 12 55 0 37-12 55 0 37 12 55 0'/%3E%3Cpath d='M0 128c18-12 37-12 55 0s37 12 55 0 37-12 55 0 37 12 55 0'/%3E%3C/svg%3E"); }
.hero[data-t="none"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.hero-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; opacity: 0.8; }
.hero-label { font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: 0.04em; }
.hero[data-t="none"] .hero-label { font-size: 22px; }
.hero-desc { font-size: 13px; opacity: 0.88; margin-top: 2px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; position: relative; z-index: 1; }
.hero .btns { position: relative; z-index: 1; }
.hbtn { min-height: 46px; border-radius: 99px; padding: 0 18px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: rgba(255, 255, 255, 0.2); color: #fff; }
.hbtn.solid { background: #fff; color: var(--t-ink); }
.hbtn.sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.hbtn:active { transform: scale(0.97); }
.hero[data-t="none"] .hbtn { background: var(--fill); color: var(--ink); }
.hero[data-t="none"] .hbtn.solid { background: var(--ink); color: var(--bg); }

/* ---------- week strip ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border-radius: 20px; padding: 10px 6px 12px; box-shadow: var(--shadow-sm); }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wd-l { font-size: 11px; color: var(--ink3); font-weight: 500; }
.wd-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--num); font-size: 16px; font-weight: 600; }
.wd.today .wd-n { background: var(--ink); color: var(--bg); }
.wd.past .wd-n { color: var(--ink3); }
.wd i { width: 16px; height: 4px; border-radius: 2px; background: var(--t); opacity: 0.9; }
.wd i[data-t="none"] { background: transparent; }

/* ---------- tea ---------- */
.tea { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; padding: 24px 24px 12vh; text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, var(--surface) 0%, var(--bg) 70%); }
.tea-date { font-size: 13px; color: var(--ink3); font-weight: 700; letter-spacing: 0.1em; }
.tea-cup { width: 84px; height: 84px; color: var(--tea); }
.tea-btn { min-width: 248px; min-height: 64px; padding: 0 32px; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: 18px; font-weight: 700; letter-spacing: 0.1em; box-shadow: var(--shadow-lg); transition: transform 0.12s ease; }
.tea-btn:active { transform: scale(0.97); }

/* ---------- tasks ---------- */
.tlist { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.75px solid var(--ink3); flex: none; display: grid; place-items: center; color: transparent; }
.check .ic { width: 14px; height: 14px; stroke-width: 3; }
.task.done .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.task.done .tt { color: var(--ink3); text-decoration: line-through; text-decoration-thickness: 1px; }
.tt { flex: 1; min-width: 0; text-align: left; font-size: 16px; line-height: 1.45; display: flex; align-items: center; gap: 8px; min-height: 34px; }
.tt span { min-width: 0; overflow-wrap: anywhere; }
.size { flex: none; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--fill); color: var(--ink2); }
.first { flex: none; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.task { flex-direction: column; align-items: stretch; gap: 0; }
.task-main { display: flex; align-items: center; gap: 12px; }
.subs { margin: 6px 0 2px 36px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.sub { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.sub .check { width: 20px; height: 20px; }
.sub .tt { font-size: 14px; min-height: 30px; }
.sub.done .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.sub.done .tt { color: var(--ink3); text-decoration: line-through; }
.pct { flex: none; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 8px; border-radius: 6px; }
.parent { display: block; font-size: 11px; color: var(--ink3); line-height: 1.4; }
.tt-text { min-width: 0; overflow-wrap: anywhere; }
.complete { text-align: center; padding: 18px 0 8px; font-family: var(--num); font-size: 22px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent); }
.done-box { border-radius: 18px; background: var(--fill); padding: 12px 14px 4px; }
.done-box .subs { border-top-color: transparent; }
.sub-row .tt { min-height: 30px; }
.sub-row.done .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.sub-row.done .tt { color: var(--ink3); text-decoration: line-through; }
.ev-row .check { flex: none; }
.ev-row.done .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-row.done .t1 { color: var(--ink3); text-decoration: line-through; }
.ag-ev.done { text-decoration: line-through; color: var(--ink3); }
.done-box .task { background: none; box-shadow: none; padding: 6px 0; min-height: 40px; }
.day-h { display: flex; align-items: center; gap: 8px; margin: 6px 2px -2px; font-size: 13px; font-weight: 700; }

.fab { position: fixed; right: max(20px, calc(50vw - 220px)); bottom: calc(var(--bar-h) + var(--bar-gap) + 16px); z-index: 19; width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent2)); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 24px -10px var(--accent); }
.fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.fab:active { transform: scale(0.94); }

/* ---------- dive ring ---------- */
.ring { position: relative; width: 210px; height: 210px; align-self: center; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: var(--fill); }
.ring-bar { stroke: url(#ringGrad); transition: stroke-dashoffset 0.6s ease; }
.ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-c b { font-family: var(--num); font-size: 40px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.05; color: var(--ink); }
.ring-c b.done { font-family: inherit; font-size: 28px; font-weight: 700; color: var(--dive-ink); }
.ring-c small { font-size: 12px; color: var(--ink3); margin-top: 6px; letter-spacing: 0.04em; }
.dive-state { text-align: center; font-size: 14px; font-weight: 700; }
.dive-state.idle { color: var(--ink3); font-weight: 500; }

/* ---------- rest ---------- */
.place-name { font-size: 22px; font-weight: 700; line-height: 1.35; }
.went { display: inline-flex; align-items: center; gap: 6px; color: var(--rest-ink); font-weight: 700; }

/* ---------- calendar ---------- */
.cal { background: var(--surface); border-radius: 22px; padding: 12px 10px 14px; box-shadow: var(--shadow-sm); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow span { text-align: center; font-size: 11px; color: var(--ink3); padding-bottom: 6px; font-weight: 500; }
.cc { position: relative; height: 50px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink); }
.cc[data-t] { background: color-mix(in srgb, var(--t) 9%, var(--surface)); color: var(--t-ink); }
.cc[data-t].full { background: color-mix(in srgb, var(--t) 24%, var(--surface)); }
.cc.has-ev { box-shadow: inset 0 0 0 2px var(--t, var(--ink3)); }
.cc .cdot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cc:active { transform: scale(0.94); }
.cc .cn { font-family: var(--num); font-size: 16px; font-weight: 600; line-height: 1; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; margin-top: 2px; }
.cc.today .cn { background: var(--ink); color: var(--bg); }
.cc.today { gap: 2px; }
.cc.out { visibility: hidden; }
.cc.past { opacity: 0.5; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; background: var(--fill); font-size: 12px; font-weight: 700; color: var(--ink2); align-self: flex-start; }
.status.draft { background: var(--dive-soft); color: var(--dive-ink); }

.ag-date { width: 36px; flex: none; text-align: center; line-height: 1.1; }
.ag-date b { display: block; font-family: var(--num); font-size: 19px; font-weight: 600; }
.ag-date small { font-size: 11px; color: var(--ink3); }
.ag-date.today b { color: var(--accent); }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ag-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ag-line .txt { font-size: 14px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); }
.ag-ev .ic { width: 14px; height: 14px; }
.row.past { opacity: 0.5; }

/* type picker tiles (calendar quick sheet, day page) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { border-radius: 18px; padding: 14px 10px; min-height: 86px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left; background: var(--t-soft); color: var(--t-ink); }
.tile b { font-size: 17px; }
.tile small { font-size: 11px; line-height: 1.4; opacity: 0.85; }
.tile.on { background: linear-gradient(140deg, var(--t), var(--t2)); color: #fff; box-shadow: 0 10px 20px -12px var(--t); }
.tile:active { transform: scale(0.97); }

/* ---------- forms ---------- */
.name-card { gap: 6px; position: relative; overflow: hidden; }
.name-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.attr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.attr { font-size: 14px; padding: 7px 12px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.chip.attr .ic { width: 15px; height: 15px; color: var(--t-ink); }
.chip.attr.on { background: var(--t); color: #fff; box-shadow: none; }
.chip.attr.on .ic { color: #fff; }
.name-field { width: 100%; border: 0; background: none; outline: none; font-size: 22px; font-weight: 700; padding: 2px 0 4px; border-bottom: 2px solid var(--line); border-radius: 0; }
.name-field:focus { border-bottom-color: var(--accent); }
.field { width: 100%; min-height: 48px; border: 0; border-radius: 14px; background: var(--fill); padding: 12px 14px; font-size: 16px; outline: none; }
.field:focus { box-shadow: 0 0 0 2px var(--accent); }
textarea.field { min-height: 88px; resize: vertical; line-height: 1.6; }
.row input.bare, .row select.bare, .row textarea.bare { border: 0; background: none; outline: none; font-size: 16px; text-align: right; color: var(--ink2); min-width: 0; flex: 1; }
.row input.bare.left, .row textarea.bare { text-align: left; color: var(--ink); }
.row textarea.bare { min-height: 64px; resize: vertical; line-height: 1.6; }
.row input[type="date"].bare { -webkit-appearance: none; appearance: none; flex: none; min-height: 34px; padding: 4px 12px; border-radius: 10px; background: var(--fill); color: var(--ink); text-align: center; font-family: var(--num); }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--fill); transition: background 0.2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.stepper { display: inline-flex; align-items: center; background: var(--fill); border-radius: 12px; flex: none; }
.stepper button { width: 40px; height: 34px; display: grid; place-items: center; font-size: 18px; color: var(--ink2); }
.stepper span { min-width: 68px; text-align: center; font-size: 14px; font-weight: 700; }
.daysel { display: flex; flex-direction: column; gap: 8px; }
.dayrow { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 6px; }
.dayrow .d { font-size: 13px; font-weight: 700; white-space: nowrap; }
.travel { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 10px; border-radius: 10px; background: var(--fill); color: var(--ink3); font-size: 12px; font-weight: 700; }
.travel.on { background: var(--dive-soft); color: var(--dive-ink); }
.travel .ic { width: 16px; height: 16px; }

/* ---------- floating tab bar ---------- */
.tabbar { position: fixed; z-index: 20; left: 14px; right: 14px; margin: 0 auto; max-width: 452px; bottom: var(--bar-gap); height: var(--bar-h);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px; border-radius: 32px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-lg); }
.tabbar a { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 26px; white-space: nowrap; color: var(--ink3); font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }
.tabbar a .ic { width: 22px; height: 22px; stroke-width: 1.8; }
.tabbar a.on { background: var(--ink); color: var(--bg); }

/* ---------- sheets ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: var(--backdrop); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.18s ease; }
.sheet { width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg);
  border-radius: 26px 26px 0 0; padding: 8px 18px calc(var(--safe-b) + 18px); display: flex; flex-direction: column; gap: 12px; animation: up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); transition: transform 0.2s ease; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; }
.sheet-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.sheet-nav h3 { font-size: 16px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-nav .spacer { width: 72px; }
.sheet-d { font-size: 14px; color: var(--ink2); line-height: 1.7; padding: 0 2px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 16px; min-height: 56px; position: relative; color: inherit; }
.opt + .opt::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; border-top: 1px solid var(--line); }
.opt:active { background: var(--surface2); }
.opt .grow { flex: 1; min-width: 0; }
.opt .now { font-size: 12px; color: var(--ink3); }
.opt.on { background: var(--dive-soft); }
.diff { display: flex; align-items: center; gap: 8px; }
.diff .d { width: 84px; font-size: 14px; font-weight: 700; flex: none; }
.diff .ic { width: 16px; height: 16px; color: var(--ink3); }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--bar-h) + var(--bar-gap) + 18px); transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 48px); padding: 11px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.5; text-align: center; pointer-events: none; box-shadow: var(--shadow-lg); }

.empty { padding: 28px 16px; text-align: center; color: var(--ink2); font-size: 14px; line-height: 1.8; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty-t { font-size: 17px; font-weight: 700; color: var(--ink); }
.stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat div { background: var(--surface); border-radius: 18px; padding: 14px 12px; text-align: center; box-shadow: var(--shadow-sm); }
.stat b { display: block; font-family: var(--num); font-size: 26px; font-weight: 600; color: var(--t-ink, var(--ink)); }
.stat small { font-size: 12px; color: var(--ink2); }
