/* Yattalog — PoC v0.8 のデザインを本実装に移したもの。色はすべてトークンで持つ */
:root {
  --bg: #EEF1F6; --surface: #FFFFFF; --fg: #1B2333; --muted: #5B667A; --line: #D8DEE8;
  --accent: #1F6F5C; --accent-fg: #FFFFFF; --danger: #C2362B; --toast: #1B2333; --toast-fg: #F4F6FA;
  --scrim: rgba(17, 24, 39, .42); --shadow: 0 1px 2px rgba(17, 24, 39, .08), 0 6px 18px rgba(17, 24, 39, .06);
  --t-tomato: #FFD9D2; --t-tangerine: #FFE3C2; --t-sun: #FFF1B8; --t-leaf: #D7F0C8;
  --t-teal: #C9EEE6; --t-sky: #D3E6FF; --t-grape: #E4DAFF; --t-pink: #FFDCEB;
  --tile-fg: #1B2333; --dot: #1F6F5C;
  /* ふりかえりの草（決定 058）。g0 は記録なし、g1〜g4 は「すべて」の濃さ。s-* は1つのイベントに絞ったときの色（タイルより濃い） */
  --g0: #E3E8F0; --g1: #C4E6D9; --g2: #86CDB3; --g3: #3E9E7E; --g4: #1F6F5C;
  --s-tomato: #E4664F; --s-tangerine: #E88A3A; --s-sun: #D9A821; --s-leaf: #5FB043;
  --s-teal: #35A994; --s-sky: #4F8FDB; --s-grape: #8E6FD8; --s-pink: #DC74A6;
  --f-display: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --r: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161E; --surface: #1B212C; --fg: #E8ECF3; --muted: #98A2B3; --line: #2C3442;
    --accent: #5CC9A7; --accent-fg: #0E1A16; --danger: #FF7B6E; --toast: #E8ECF3; --toast-fg: #12161E;
    --scrim: rgba(0, 0, 0, .6); --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --t-tomato: #4A2A27; --t-tangerine: #4A3522; --t-sun: #463E1E; --t-leaf: #2A3F25;
    --t-teal: #1F3F3A; --t-sky: #22344D; --t-grape: #35294F; --t-pink: #4A2638;
    --tile-fg: #EEF1F6; --dot: #5CC9A7;
    --g0: #242C38; --g1: #1E4239; --g2: #2B6E5A; --g3: #3FA283; --g4: #6BD8B5;
    --s-tomato: #F07A64; --s-tangerine: #F09A50; --s-sun: #E6BD3C; --s-leaf: #74C25A;
    --s-teal: #4CC1AB; --s-sky: #6AA5EC; --s-grape: #A68BEA; --s-pink: #E88CB8; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.6; -webkit-tap-highlight-color: transparent;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.c-tomato { --tc: var(--t-tomato); } .c-tangerine { --tc: var(--t-tangerine); } .c-sun { --tc: var(--t-sun); } .c-leaf { --tc: var(--t-leaf); }
.c-teal { --tc: var(--t-teal); } .c-sky { --tc: var(--t-sky); } .c-grape { --tc: var(--t-grape); } .c-pink { --tc: var(--t-pink); }

.app { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 8px 120px; }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 8px; padding-block: 10px; background: var(--bg); }
.spacer { flex: 1; }
.logo { font-family: var(--f-display); font-weight: 800; font-size: 24px; margin: 0; flex: 1; display: flex; align-items: center; }
.logo-mark { width: 28px; height: 28px; margin-right: 8px; flex: none; }
.logo b { color: var(--accent); }
.logo-lg { font-size: 40px; flex: none; }
.pill { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; }
.pill[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.iconbtn { border: none; background: transparent; width: 40px; height: 40px; border-radius: 12px; font-size: 20px; display: inline-grid; place-items: center; text-decoration: none; }
.iconbtn:disabled, .iconbtn.disabled { opacity: .3; pointer-events: none; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; font-size: 13.5px; }
.banner span { flex: 1; min-width: 12em; }
.edit-hint, .note { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.error { color: var(--danger); font-weight: 700; font-size: 14px; }
.gap { margin-top: 18px; } .gap-t { margin-top: 10px; } .gap-b { margin-bottom: 14px; }

/* tabs */
.tabs-bar { display: flex; align-items: center; gap: 6px; margin: 0 -16px 12px; padding-right: 16px; }  /* 「＋」は、タブの並び（tablist）の外に置く */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0; padding: 2px 6px 4px 16px; flex: 1; min-width: 0; }
.review-page .tabs { margin: 0 -16px 12px; padding: 2px 16px 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tabs .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tabs button[aria-selected="true"] .n { color: var(--bg); opacity: .7; }
.tab-add { flex: none; width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.slide-l { animation: sl .22s ease-out; } .slide-r { animation: sr .22s ease-out; }
@keyframes sl { from { transform: translateX(24px); opacity: .4; } }
@keyframes sr { from { transform: translateX(-24px); opacity: .4; } }

/* grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 359px) { .grid { gap: 8px; } .tile .name { font-size: 11.5px; } .tile .ago { font-size: 19px; } }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; aspect-ratio: 1 / 1.08; width: 100%; border-radius: var(--r); background: var(--tc, var(--surface)); color: var(--tile-fg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 20px 8px 10px; border: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: transform .18s ease; }
.tile .emo { font-size: 30px; line-height: 1.1; }
.tile .name { font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; word-break: break-all; }
.tile .ago { font-family: var(--f-display); font-weight: 800; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .ago small { font-size: 12px; margin-left: 1px; }
.tile .ago.never { font-size: 14px; color: var(--muted); }  /* 薄くする（opacity）と、色つきのタイルの上で読みにくい */
.tile.today .ago { color: var(--accent); }
.tile.pressing { transform: scale(.93); }
.tile.pop { animation: pop .42s cubic-bezier(.3, 1.6, .5, 1); }
.tile.pending-net { opacity: .75; }
.tile.stamp::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; font-weight: 800; color: var(--accent);
  background: color-mix(in srgb, var(--tc, var(--surface)) 82%, transparent); border-radius: inherit; pointer-events: none; animation: stamp .7s ease-out forwards; }
@keyframes stamp { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: scale(1.08); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
.haptic { position: fixed; left: -100px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
@keyframes pop { 0% { transform: scale(.9); } 100% { transform: scale(1); } }
.tile.add { background: transparent; border: 2px dashed var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.streak { position: absolute; top: 6px; right: 6px; font-family: var(--f-display); font-weight: 800; font-size: 12px; line-height: 1; padding: 3px 6px 3px 4px; border-radius: 999px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.streak small { font-size: 10px; margin-left: 1px; }
.streak.pending { color: var(--muted); }
.streak.pending .fire { filter: grayscale(1); opacity: .55; }
.streak.burst { animation: burst .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes burst { 0% { transform: scale(.4) rotate(-15deg); } 60% { transform: scale(1.35) rotate(6deg); } 100% { transform: scale(1); } }
.tile .x { position: absolute; top: -6px; left: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 700; display: none; place-items: center; line-height: 1; }
.editing .tile:not(.add) { animation: wig .32s ease-in-out infinite alternate; touch-action: none; }
.editing li:nth-child(2n) .tile:not(.add) { animation-delay: -.16s; }
.editing .tile .x { display: grid; }
@keyframes wig { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
.tile.dragging { opacity: .35; animation: none; }
.ghost { position: fixed; pointer-events: none; z-index: 50; transform: scale(1.08); box-shadow: 0 12px 30px rgba(0, 0, 0, .25); animation: none !important; margin: 0; }
.tab-empty { margin-top: 12px; }

/* toast */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; position: relative; background: var(--toast); color: var(--toast-fg); border-radius: 14px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 6px; width: min(560px, calc(100% - 32px)); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast p { margin: 0; flex: 1; font-weight: 700; font-size: 14px; min-width: 0; }
.toast button { border: none; background: transparent; color: var(--toast-fg); font-weight: 700; padding: 6px 10px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.toast.stack { flex-wrap: wrap; padding: 12px 12px 14px 16px; row-gap: 2px; }
.toast.stack p { flex: 1 0 100%; }
.toast.stack button { padding: 6px 10px 6px 0; margin-right: 6px; }
.toast .meter { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--toast-fg); opacity: .35; transform-origin: left; animation: shrink var(--dur, 5s) linear forwards; }
.toast:hover .meter, .toast:focus-within .meter, .toast.hold .meter { animation-play-state: paused; }
@keyframes shrink { to { transform: scaleX(0); } }
.hint { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.hint button { color: var(--fg); }

/* sheet */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--surface); border-radius: 22px 22px 0 0; max-height: 88%; overflow: auto;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px)); max-width: 720px; margin: 0 auto; animation: up .22s ease-out; }
.sheet:focus { outline: none; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h2 { font-family: var(--f-display); font-size: 20px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.sub-h { font-size: 16px; margin: 16px 0 6px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; border: none; padding: 0; min-width: 0; }
.field label, .lbl { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 0; }
input[type=text], input[type=date], input[type=time], textarea, select { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; }
textarea { min-height: 84px; resize: vertical; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 16px; font-weight: 700; flex: 1; min-width: 120px; text-align: center; text-decoration: none; color: var(--fg); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.small { flex: 0 0 auto; min-width: 0; padding: 7px 12px; font-size: 13px; }
.links { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.seg button, .seg-radio span { display: block; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 4px; font-weight: 700; font-size: 14px; text-align: center; }
.seg button[aria-checked="true"], .seg-radio input:checked + span { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.seg-radio input, .chips input, .emo-opt input, .color-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio input:focus-visible + span, .chips input:focus-visible + span, .emo-opt input:focus-visible + span, .color-opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.pickbox { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.pf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.emojis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.emo-opt span { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid transparent; background: var(--bg); border-radius: 10px; font-size: 22px; cursor: pointer; }
.emo-opt input:checked + span { border-color: var(--accent); background: var(--surface); }
.emo-custom { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.emo-custom label { font-size: 13px; font-weight: 700; }
.emo-custom input { width: 64px; flex: 0 0 auto; text-align: center; font-size: 22px; padding: 6px 4px; }
.emo-custom input:not(:placeholder-shown) { border-color: var(--accent); background: var(--surface); }
.emo-custom input::placeholder { opacity: .35; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.color-opt span { display: block; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--tc); cursor: pointer; }
.color-opt input:checked + span { border: 3px solid var(--fg); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips input + span { display: flex; align-items: center; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.chips input:checked + span { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.inline-new { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.inline-new input { flex: 1; }
.catlist { list-style: none; margin: 0 0 12px; padding: 0; }
.catlist li { display: flex; align-items: center; gap: 4px; padding: 6px 0; border-top: 1px solid var(--line); }
.catlist li:first-child { border-top: none; }
.catlist form { flex: 1; min-width: 0; }
.catlist form { display: flex; gap: 6px; }
.catlist form input { flex: 1; padding-left: 8px; padding-right: 8px; }
.catlist form input.cat-emoji, .inline-new input.cat-emoji { width: 44px; flex: 0 0 auto; text-align: center; padding-left: 4px; padding-right: 4px; }
.cat-emoji::placeholder { opacity: .35; }
.chips .cat-emo { margin-right: 4px; }
.catlist .cnt { font-size: 12px; color: var(--muted); white-space: nowrap; padding: 0 4px; }
/* スマホの幅では、名前の欄を1行ぶん使い、件数とボタンを下の行に回す（同じ行だと、名前が途中で切れる） */
@media (max-width: 479px) { .catlist li { flex-wrap: wrap; } .catlist form { flex: 1 0 100%; } .catlist .cnt { margin-right: auto; } }
.menu { list-style: none; margin: 0; padding: 0; }
.menu button { width: 100%; text-align: left; border: none; background: transparent; padding: 13px 4px; border-top: 1px solid var(--line); }
.menu li:first-child button { border-top: none; }
.welcome { background: var(--surface); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.welcome h2 { font-family: var(--f-display); font-size: 18px; margin: 0 0 4px; }
.starter-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 359px) { .starter-list { grid-template-columns: minmax(0, 1fr); } }
.starter { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: var(--tc); color: var(--tile-fg); border: 2px solid transparent; cursor: pointer; min-height: 52px; }
.starter input { position: absolute; opacity: 0; pointer-events: none; }
.starter .emo { font-size: 22px; line-height: 1; }
.starter-name { font-size: 13px; font-weight: 700; line-height: 1.3; min-width: 0; }
.starter:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.starter:has(input:checked) .starter-name::after { content: " ✓"; color: var(--accent); }
.starter:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.starter.added { opacity: .5; cursor: default; }
.starter-note { margin-left: auto; font-size: 11px; white-space: nowrap; }
.steps { margin: 0 0 12px; padding-left: 1.4em; }
.steps li { margin: 8px 0; }
.inline-ico { vertical-align: -4px; }
.menu.gap li:first-child button { border-top: none; }
.offline { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; }
.offline h1 { font-family: var(--f-display); font-size: 22px; margin: 10px 0 0; }
.offline p { margin: 4px 0; max-width: 28em; }
.offline .btn { display: inline-block; flex: none; margin-top: 10px; }
.share-prev { display: grid; place-items: center; margin-bottom: 12px; }
.share-prev img { width: min(240px, 64%); height: auto; aspect-ratio: 1080 / 1350; border-radius: 14px; box-shadow: var(--shadow); background: var(--bg); }
.share-opt { font-weight: 500; margin-bottom: 6px; }
.share-opt input { accent-color: var(--accent); }
.recent-undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--bg); border-radius: 12px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }
.bullets { margin: 0 0 10px; padding-left: 1.3em; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; margin: 0 0 12px; }
.check input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--danger); }
.danger-zone { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.linkbtn { border: none; background: transparent; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; }
.page { padding: 16px; max-width: 560px; margin: 0 auto; }
.messages li.success { color: var(--fg); }
.menu a { display: block; padding: 13px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.menu li:first-child a { border-top: none; }
.menu a small { display: block; font-size: 12px; color: var(--muted); }
.legal { max-width: 680px; margin: 0 auto; padding: 16px 16px 48px; line-height: 1.8; }
.legal h1 { font-family: var(--f-display); font-size: 22px; margin: 8px 0 4px; }
.legal h2 { font-size: 16px; margin: 28px 0 6px; }
.legal ol, .legal ul { padding-left: 1.5em; margin: 6px 0; }
.legal li { margin: 4px 0; }
.legal-date, .legal-back, .legal-end { font-size: 13px; color: var(--muted); }
.legal-end { text-align: right; margin-top: 28px; }
.legal a { color: var(--accent); }
.legal .table-wrap { overflow-x: auto; margin: 8px 0; }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--surface); }
.secret { display: inline-block; margin-top: 4px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 15px; letter-spacing: .08em; word-break: break-all; user-select: all; }
.otp-form { max-width: 320px; margin-top: 16px; }
.otp-form input { font-size: 22px; letter-spacing: .2em; text-align: center; }
.legal table.wide { min-width: 520px; }
.login-legal a { color: inherit; }
.menu button small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.arch { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.arch-name { flex: 1; min-width: 0; }

/* detail */
.hero { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--tc); color: var(--tile-fg); margin-bottom: 14px; }
.hero .emo { font-size: 44px; }
.hero-text { min-width: 0; }
.hero h1 { margin: 0; font-family: var(--f-display); font-size: 22px; line-height: 1.3; word-break: break-all; }
.hero .sub { font-size: 13px; opacity: .8; }
.hero .big { margin-left: auto; text-align: right; font-family: var(--f-display); font-weight: 800; font-size: 30px; line-height: 1; white-space: nowrap; }
.hero .big small { font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* 最高連続があるときは 2×2（4つ並べると、スマホで値が詰まる） */
@media (min-width: 560px) { .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.stat .k { font-size: 11px; font-weight: 700; color: var(--muted); }
.stat .v { font-family: var(--f-display); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat .v small { font-size: 12px; }
.stat .v-sm { font-size: 14px; }
.card { background: var(--surface); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.card h2, .card h3 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head strong { font-family: var(--f-display); font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; font-variant-numeric: tabular-nums; }
.cal .dow { font-size: 11px; color: var(--muted); font-weight: 700; }
.cal .day { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; font-size: 13px; text-decoration: none; }
.cal .day.has { background: var(--dot); color: var(--accent-fg); font-weight: 700; }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--fg); }
.cal .day.sel { outline: 2px solid var(--fg); outline-offset: 1px; }
.cal .day.future { opacity: .3; }
.logs { list-style: none; margin: 0; padding: 0; }
.logs li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.logs li:first-child { border-top: none; }
.logs .when { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; white-space: nowrap; }
.logs .body { flex: 1; min-width: 0; }
.logs .c { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.logs .c.empty { color: var(--muted); }
.logs .ops { display: flex; gap: 4px; }
/* 狭い画面（日付に年が付く・時刻ありの記録）では、ボタンを下の行に回す（320px で「削除」がはみ出していた） */
@media (max-width: 359px) { .logs li { flex-wrap: wrap; } .logs .ops { width: 100%; justify-content: flex-end; } }
.season-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.season-head h2, .season-head h3 { margin: 0; }
.seg2 { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; }
.seg2 a { text-decoration: none; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.seg2 a[aria-current="true"] { background: var(--fg); color: var(--bg); }
.season-line { margin: 4px 0 6px; font-size: 14px; }
.season-line b { font-family: var(--f-display); color: var(--accent); font-size: 16px; }
.season-chart { position: relative; }
.season-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.sgrid { stroke: var(--line); stroke-width: 1; }
.sgrid.base { stroke: var(--muted); stroke-opacity: .5; }
.sax { fill: var(--muted); font-size: 10px; font-family: var(--f-body); }
.sax.fut { opacity: .4; }
.sval { fill: var(--fg); font-size: 11px; font-weight: 700; font-family: var(--f-display); }
.sbar { fill: var(--accent); fill-opacity: .55; }
.sbar.peak, .sbar.on { fill-opacity: 1; }
.shit { fill: transparent; cursor: pointer; outline: none; }
.shit:focus-visible { fill: var(--line); fill-opacity: .4; }
.tipping .sval { opacity: 0; }
.season-tip { position: absolute; top: 0; transform: translate(-50%, -100%); background: var(--toast); color: var(--toast-fg); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* login */
.login { max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 32px 16px; }
.login-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-tiles { display: flex; gap: 10px; margin-bottom: 6px; }
.login-tiles span { background: var(--tc); color: var(--tile-fg); border-radius: 16px; width: 76px; height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 26px; }
.login-tiles b { font-family: var(--f-display); font-size: 15px; }
.login-tiles span:nth-child(1) { transform: rotate(-4deg); }
.login-tiles span:nth-child(2) { transform: translateY(-8px) rotate(3deg); }
.login-copy { margin: 0; color: var(--muted); line-height: 1.8; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 16px; box-shadow: var(--shadow); }
.about { max-width: 440px; margin: 0 auto; padding: 8px 16px 56px; display: flex; flex-direction: column; gap: 18px; }
.about h2 { font-family: var(--f-display); font-size: 20px; margin: 18px 0 0; }
.about-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.about-steps li { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--r); padding: 14px; }
.about-steps h3 { margin: 0 0 2px; font-size: 16px; }
.about-steps p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.about-art { flex: 0 0 104px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.mini { position: relative; background: var(--tc); color: var(--tile-fg); border-radius: 12px; width: 50px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 18px; line-height: 1.2; }
.mini b { font-family: var(--f-display); font-size: 10px; }
.mini.done { width: 76px; height: 84px; font-size: 26px; border-radius: 16px; }
.mini.done b { font-size: 14px; color: var(--accent); }
.mini.done i { position: absolute; right: -6px; top: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-style: normal; font-weight: 800; font-size: 15px; display: grid; place-items: center; }
.mini-card { background: var(--t-sky); border-radius: 10px; padding: 6px; width: 72px; aspect-ratio: 4 / 5; display: block; }
.mini-card-in { background: #FFFFFF; color: #1B2333; border-radius: 7px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 20px; }
.mini-card-in b { font-family: var(--f-display); font-size: 12px; color: #1F6F5C; }
.mini-card-in em { font-style: normal; font-size: 7.5px; font-weight: 700; background: #D3E6FF; border-radius: 99px; padding: 1px 5px; }
.about-values { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.about-values li { font-size: 13.5px; color: var(--muted); line-height: 1.7; padding-left: 14px; border-left: 3px solid var(--accent); }
.about-values strong { display: block; color: var(--fg); font-size: 15px; }
.login-more { text-align: center; font-size: 13px; color: var(--muted); margin: 0; }
.login-legal { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
.login-note { font-size: 13px; font-weight: 700; padding: 10px 14px; margin: 0; background: var(--surface); border-radius: 12px; }
.messages { list-style: none; padding: 10px 14px; margin: 0; background: var(--surface); border-radius: 12px; color: var(--danger); font-weight: 700; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- ふりかえり（1年の草、決定 058） ---- */
.page-title { font-family: var(--f-display); font-weight: 800; font-size: 22px; margin: 0; flex: 1; }
.tabs a { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.tabs a[aria-current="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.review { background: var(--surface); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.review-sum { font-family: var(--f-display); font-weight: 800; font-size: 17px; margin: 0; }
.review-sum b { color: var(--accent); font-size: 22px; }
/* 草：縦が曜日（日曜が上）、横が週。スマホでは半年ほどが見え、古い方へ横にスクロールする */
.hm-wrap { display: flex; gap: 4px; min-width: 0; }
.hm-days, .hm-grid { display: grid; grid-template-rows: 14px repeat(7, 13px); gap: 3px; }
.hm-days span { font-size: 10px; line-height: 13px; color: var(--muted); }
.hm-scroll { flex: 1; min-width: 0; overflow-x: auto; direction: rtl; padding-bottom: 6px; scrollbar-width: thin; }
.hm-grid { direction: ltr; grid-auto-flow: column; grid-auto-columns: 13px; width: max-content; padding: 2px; }
.hm-m { font-size: 10.5px; line-height: 14px; color: var(--muted); white-space: nowrap; width: 0; overflow: visible; }
.hm { display: block; border-radius: 3px; background: var(--g0); }
.hm.l1 { background: var(--ev, var(--g1)); } .hm.l2 { background: var(--g2); } .hm.l3 { background: var(--g3); } .hm.l4 { background: var(--g4); }
.hm.future { visibility: hidden; }
.hm.sel { outline: 2px solid var(--fg); outline-offset: 1px; }
.review.c-tomato { --ev: var(--s-tomato); } .review.c-tangerine { --ev: var(--s-tangerine); } .review.c-sun { --ev: var(--s-sun); } .review.c-leaf { --ev: var(--s-leaf); }
.review.c-teal { --ev: var(--s-teal); } .review.c-sky { --ev: var(--s-sky); } .review.c-grape { --ev: var(--s-grape); } .review.c-pink { --ev: var(--s-pink); }
.review .legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 0; font-size: 11.5px; color: var(--muted); }
.review .legend .hm { width: 12px; height: 12px; }
.review-day { border-top: 1px solid var(--line); padding-top: 12px; }
.review-day h2 { font-family: var(--f-display); font-weight: 800; font-size: 15px; margin: 0 0 6px; }
.review-day ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.review-day li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.review-day li a { display: inline-flex; gap: 6px; font-weight: 700; text-decoration: none; }
.review-day li small { color: var(--muted); font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.review-day .t { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
/* そのイベントのくせ：よくやる曜日・時間帯・日にち（決定 060） */
.tend-card .season-head { flex-wrap: wrap; row-gap: 8px; margin-bottom: 10px; }
.seg2 button { border: none; background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.seg2 button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.tend-panel { display: flex; flex-direction: column; gap: 10px; }
.tend-panel[hidden] { display: none; }
.season-ctl { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.season-ctl .cal-head { margin: 0; gap: 6px; justify-content: flex-start; }
.season-range { margin-left: auto; }
.tend-panel .wd-head { font-family: var(--f-display); font-weight: 800; font-size: 15px; margin: 0; }
.tend-panel .note { margin: 0; font-size: 11.5px; }
.wbars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wbars.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.wbars.n4 .wcol { max-width: 40px; }
.wbar { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wbar .wn { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wbar .wcol { width: 100%; max-width: 28px; height: 72px; display: block; }
.wbar .wcol rect { fill: var(--g2); }
.wbar.peak .wcol rect { fill: var(--accent); }
.wbar .wd { font-family: var(--f-display); font-weight: 800; font-size: 13px; }
.wbar.peak .wn { color: var(--fg); font-weight: 700; }
.mdays { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.md { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--g0); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.md.l1 { background: var(--g1); color: var(--fg); } .md.l2 { background: var(--g2); color: var(--fg); }
.md.l3 { background: var(--g3); color: var(--accent-fg); } .md.l4 { background: var(--g4); color: var(--accent-fg); }
.note.since { margin: -6px 0 14px; font-size: 12.5px; }
.review + .review { margin-top: 12px; }
.ago h2 { font-family: var(--f-display); font-weight: 800; font-size: 15px; margin: 0; }
.ago ul, .ago ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ago li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ago li a { display: inline-flex; gap: 6px; font-weight: 700; text-decoration: none; }
.ago .t { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---- 実績（決定 063） ---- */
.ach { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ach li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--bg); min-width: 0; }
.ach .ach-emo { font-size: 28px; line-height: 1; flex: none; width: 36px; text-align: center; }
.ach li div { display: flex; flex-direction: column; min-width: 0; }
.ach b { font-family: var(--f-display); font-size: 14px; }
.ach small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.ach li.off .ach-emo { filter: grayscale(1) brightness(0); opacity: .22; }  /* まだのものは、シルエット */
.ach li.off b { color: var(--muted); }
