:root {
  color-scheme: light;
  --paper: #faf7f1;
  --surface: #fffdfa;
  --ink: #292f42;
  --muted: #62697a;
  --line: #e9e1d5;
  --orange: #ffae7d;
  --orange-strong: #f8a06a;
  --orange-text: #963c20;
  --blue: #eaf2fb;
  --blue-strong: #42628e;
  --green: #e6f1e8;
  --green-text: #37664e;
  --red: #a63e3c;
  --shadow: 0 3px 8px #34251909;
  --radius: 21px;
  --content: 940px;
  --nav-space: calc(70px + env(safe-area-inset-bottom, 0px));
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .40; }
button, a, label { touch-action: manipulation; }
a { color: inherit; }
button, input, select, textarea { border-radius: 12px; }
button, h1, h2, p, ul, fieldset { margin: 0; }
ul { list-style: none; padding: 0; }
button { border: 0; }
input, textarea, select { min-width: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #335a96;
  outline-offset: 3px;
}
h1, h2 { color: var(--ink); overflow-wrap: anywhere; }
h1 { font-size: clamp(1.7rem, 1.02rem + 2.65vw, 2.48rem); line-height: 1.22; letter-spacing: -.065em; font-weight: 900; }
h2 { font-size: 1.06rem; letter-spacing: -.025em; line-height: 1.3; font-weight: 800; }
.icon { display: inline-block; flex: none; width: 22px; height: 22px; vertical-align: middle; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 9; inset: 9px auto auto 9px; padding: 9px 16px; border-radius: 12px; background: white; }
.app-header { border-bottom: 1px solid #ece3d8; background: #fffcf6; padding-top: env(safe-area-inset-top, 0px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(var(--content), 100% - 40px); min-height: 72px; margin: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 1.24rem; font-weight: 900; text-decoration: none; letter-spacing: -.065em; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 38px; height: 38px; color: #502c1d; border: 1px solid #eeb786; border-radius: 13px; background: #ffc69a; box-shadow: inset 0 -2px #e797632a; }
.brand-icon .icon { width: 24px; height: 24px; stroke-width: 1.85; }
.brand-todo { color: #a34624; font-size: .93rem; margin-inline-start: 5px; letter-spacing: -.04em; }
.offline-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid #e8dfd4; border-radius: 40px; font-size: .78rem; font-weight: 750; color: var(--muted); white-space: nowrap; }
.offline-badge.available { background: #edf4e9; color: #3f664c; border-color: #dce8d9; }
.offline-badge .icon { width: 17px; height: 17px; }

.page { width: min(var(--content), 100% - 40px); margin: 0 auto; padding: 35px 0 calc(var(--nav-space) + 30px); min-height: 80vh; }
.page:focus, h1[tabindex="-1"]:focus { outline: 0; }
.home-heading, .page-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-heading { align-items: center; }
.page-heading h1 { display: flex; align-items: center; gap: 12px; }
.page-heading p { color: var(--muted); margin-top: 7px; font-size: .91rem; }
.heading-icon { display: inline-grid; flex: none; place-items: center; width: 43px; height: 43px; border: 1px solid #f2d8c2; border-radius: 15px; color: var(--orange-text); background: #fff0e3; }
.heading-icon .icon { width: 24px; height: 24px; }
.date-line { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; color: var(--orange-text); font-size: .91rem; font-weight: 800; letter-spacing: .015em; }
.date-line .icon { width: 18px; height: 18px; }
.heading-period { color: #b94a24; }
.today-count { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 5px 12px; border: 1px solid #dce8db; border-radius: 999px; color: var(--green-text); background: #edf4e9; font-size: .86rem; font-weight: 740; }
.today-count strong { font-size: 1.12rem; line-height: 1; font-variant-numeric: tabular-nums; }
.today-count .icon { width: 17px; height: 17px; stroke-width: 2.5; }

.mascot-card { --scene-light: #eaf4ff; --scene-edge: #ccdff5; --scene-ink: #3a5781; isolation: isolate; position: relative; display: grid; grid-template-columns: minmax(0, 238px) minmax(0, 1fr); align-items: center; min-height: 234px; padding: 13px 38px 14px 28px; gap: 21px; border: 1px solid var(--scene-edge); border-radius: 26px; background: radial-gradient(ellipse at 20% 105%, var(--scene-edge) 0, transparent 61%), linear-gradient(108deg, var(--scene-light), #f9fcff); overflow: hidden; margin-bottom: 20px; }
.mascot-card[data-scene="rest"] { --scene-light: #f0f5e9; --scene-edge: #d7e6cf; --scene-ink: #46674a; }
.mascot-card[data-scene="nap"] { --scene-light: #eeecfa; --scene-edge: #dcdcf1; --scene-ink: #544777; }
.mascot-card[data-scene="alert"] { --scene-light: #fff1ed; --scene-edge: #f2d7d3; --scene-ink: #884b43; }
.mascot-card[data-scene="party"] { --scene-light: #fff5df; --scene-edge: #f0dfb6; --scene-ink: #7b541e; }
.mascot-card[data-scene="surprise"] { --scene-light: #f5edfe; --scene-edge: #e5d5f5; --scene-ink: #684684; }
.mascot-card::before, .mascot-card::after { position: absolute; z-index: -1; border-radius: 50%; content: ''; pointer-events: none; }
.mascot-card::before { top: -65px; left: -61px; width: 270px; height: 258px; background: #ffffff50; }
.mascot-card::after { right: -112px; bottom: -126px; width: 352px; height: 237px; border: 1px solid #fff; box-shadow: 0 0 0 16px #ffffff50, 0 0 0 34px #ffffff33; }
.sky-deco { position: absolute; color: #b46429; pointer-events: none; }
.sky-spark { left: 42px; top: 33px; transform: rotate(-10deg); }
.sky-spark .icon { width: 31px; height: 31px; fill: #ffe3a6; stroke-width: 1.2; }
.sky-spark-small { top: 33px; right: 26px; color: #6686b5; }
.sky-spark-small .icon { width: 15px; height: 15px; }
.mascot-desk { display: grid; place-items: center; min-width: 0; }
.mascot-art { display: grid; position: relative; place-items: center; width: 100%; height: 173px; padding: 0; background: transparent; }
.mascot-halo { position: absolute; width: 82%; height: 89%; border-radius: 48%; background: radial-gradient(ellipse at 47% 40%,#fff9 0, #fff4 56%,transparent 73%); }
.mascot-puppet { position: absolute; isolation: isolate; inset: 0 0 9px; transform-origin: 50% 67%; pointer-events: none; }
.mascot-image, .mascot-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mascot-image { filter: drop-shadow(0 3px 0 #476aa41a); }
.mascot-layer { opacity: 0; }
.mascot-blink { animation: mascot-blink 7.8s step-end infinite; }
.is-speaking .mascot-mouth { animation: mascot-mouth 470ms step-end infinite; }
.mascot-shadow { position: absolute; bottom: 0; left: 28%; width: 44%; height: 9px; border-radius: 50%; background: #536fb536; animation: mascot-shadow 5.8s ease-in-out infinite; }
.mascot-fallback { color: var(--blue-strong); display: grid; place-items: center; border-radius: 50%; background: #f7fbff; width: 62px; height: 62px; }
.mascot-status { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 5px; border-radius: 99px; padding: 2px 8px; background: #fff9; color: var(--scene-ink); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.mascot-status .icon { width: 14px; height: 14px; }
.mascot-prop:not(:empty) { position: absolute; z-index: 1; right: 2%; top: 8%; display: inline-grid; place-items: center; min-width: 31px; min-height: 31px; border: 1px solid var(--scene-edge); border-radius: 12px; background: #fffefa; color: var(--scene-ink); box-shadow: 0 3px 0 #79654f18; font-weight: 900; transform: rotate(9deg); }
.mascot-prop .icon { width: 18px; height: 18px; }
[data-scene="nap"] .mascot-prop:not(:empty) { display: flex; gap: 2px; background: none; border: 0; box-shadow: none; align-items: end; transform: rotate(-11deg); }
[data-scene="nap"] .mascot-prop span { display: inline-block; animation: mascot-z 3.5s ease-in-out infinite; }
[data-scene="nap"] .mascot-prop span:nth-child(2) { font-size: .75em; animation-delay: .2s; }
[data-scene="nap"] .mascot-prop span:nth-child(3) { animation-delay: .4s; }
[data-event="rare_double"] .mascot-image { filter: drop-shadow(12px 1px 0 #9774c548); }
[data-scene="surprise"] .mascot-prop:not(:empty), [data-scene="party"] .mascot-prop:not(:empty) { animation: desk-prop-in 590ms ease-out; }
.motion-float { animation: mascot-hover 5.8s ease-in-out infinite; }
.motion-bounce { animation: mascot-bounce 640ms ease-out; }
.motion-wiggle { animation: mascot-wiggle 530ms ease-out; }
[data-scene="nap"] .mascot-puppet { animation: mascot-sleep 4.4s ease-in-out infinite; }
.stage-paused * { animation-play-state: paused !important; }
@keyframes mascot-hover { 0%, 100% { transform: translateY(-1px) rotate(-1.5deg); } 42% { transform: translateY(-8px) rotate(1.3deg); } 75% { transform: translateY(-3px) rotate(.4deg); } }
@keyframes mascot-shadow { 0%, 100% { transform: scaleX(1); opacity: .66; } 42% { transform: scaleX(.82); opacity: .4; } }
@keyframes mascot-blink { 0%, 32%, 81%, 86% { opacity: 0; } 30%, 79%, 84% { opacity: 1; } }
@keyframes mascot-mouth { 0%, 44%, 83% { opacity: 0; } 21%, 66% { opacity: 1; } }
@keyframes mascot-sleep { 0%, 100% { transform: translateY(2px) scaleY(.97) rotate(-5deg); } 50% { transform: translateY(-1px) scaleY(1.015) rotate(-3deg); } }
@keyframes mascot-z { 0%, 100% { transform: translateY(1px); opacity: .65; } 45% { transform: translateY(-6px); opacity: 1; } }
@keyframes desk-prop-in { from { transform: translateY(11px) scale(.65) rotate(-12deg); opacity: 0; } }
@keyframes mascot-bounce { 0%, 100% { transform: translateY(0); } 42% { transform: translateY(-10px) rotate(-3deg); } 70% { transform: translateY(2px) rotate(2deg); } }
@keyframes mascot-wiggle { 20%, 60% { transform: rotate(-3deg); } 40%, 80% { transform: rotate(3deg); } }
.speech { position: relative; z-index: 1; min-width: 0; padding: 15px 19px 5px; margin-block: 3px; background: #fffefa; border: 1px solid var(--scene-edge); border-radius: 18px; box-shadow: 0 4px 0 #6485be16; }
.speech::before { content: ''; position: absolute; width: 15px; height: 15px; transform: rotate(45deg); top: 36%; left: -8px; border-bottom: 1px solid var(--scene-edge); border-left: 1px solid var(--scene-edge); background: #fffefa; }
.speech-label { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 9px; margin-bottom: 5px; }
.speech-label strong { color: #a54622; font-size: .87rem; }
.speech-label span { color: var(--muted); font-size: .75rem; }
.speech-badge { margin-bottom: 5px; }
.speech-badge span { display: inline-block; border-radius: 7px; padding: 2px 7px; background: #fff2d8; color: #77521f; font-size: .78rem; font-weight: 850; overflow-wrap: anywhere; }
[data-event^="rare_"] .speech-badge span { color: #653f83; background: #f2e7fa; }
.speech p { font-size: clamp(1rem, .89rem + .41vw, 1.2rem); font-weight: 800; line-height: 1.52; letter-spacing: .015em; overflow-wrap: anywhere; }
.speech-actions { display: flex; align-items: center; justify-content: space-between; gap: 3px; }
.talk-next, .talk-skip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; color: var(--scene-ink); background: transparent; font-size: .84rem; font-weight: 800; padding: 0 4px; }
.talk-next .icon { width: 15px; height: 15px; }
.talk-skip { min-width: 44px; margin-right: -5px; color: var(--muted); }
.talk-skip .icon { width: 15px; height: 15px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.home-primary, .home-side, .home-task-groups { display: grid; align-content: start; gap: 15px; min-width: 0; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 12px 16px; min-height: 54px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.section-icon { display: inline-grid; flex: none; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: var(--orange-text); background: #fff0e3; }
.section-icon .icon { width: 19px; height: 19px; }
.section-icon.overdue { color: #a2403c; background: #faebe8; }
.section-icon.upcoming { color: var(--blue-strong); background: #eaf2fc; }
.section-icon.done { color: var(--green-text); background: #e7f1e6; }
.count-chip { flex: none; font-size: .78rem; line-height: 1.4; font-weight: 800; color: var(--muted); background: #f3efe8; border-radius: 20px; padding: 2px 7px; white-space: nowrap; }
.text-button { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 5px; color: var(--orange-text); background: transparent; font-size: .81rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #c88a68; }
.button { display: inline-flex; min-height: 44px; justify-content: center; align-items: center; text-align: center; gap: 6px; padding: 7px 14px; border: 1px solid transparent; border-radius: 12px; white-space: nowrap; font-size: .9rem; font-weight: 800; }
.button .icon { width: 19px; height: 19px; }
.primary { color: #40271c; background: var(--orange); border-color: #ec9b66; box-shadow: inset 0 -2px #d67e4729; }
.secondary { color: var(--ink); border-color: var(--line); background: #fffdf8; }
.danger-plain { color: var(--red); background: transparent; }
.danger-button { color: white; background: #a4433d; }
.quick-add { display: flex; min-width: 0; align-items: center; gap: 8px; border: 1px solid #eacbb4; background: #fffbf4; box-shadow: var(--shadow); border-radius: 17px; padding: 7px 8px 7px 10px; }
.quick-icon { color: #a54a28; display: inline-grid; place-items: center; flex: none; border: 1px dashed #dfa27e; border-radius: 10px; width: 35px; height: 35px; background: #fff2e6; }
.quick-icon .icon { width: 20px; height: 20px; }
.quick-add input { flex: 1; width: 0; min-height: 46px; border: 0; padding: 4px 0; background: transparent; font-size: 1rem; }
input::placeholder, textarea::placeholder { color: #777785; opacity: 1; }
.quick-add .button { min-width: 63px; }
.empty { display: flex; align-items: center; gap: 13px; padding: 18px 16px 22px; }
.empty-icon { flex: none; display: grid; place-items: center; width: 47px; height: 47px; border-radius: 15px; background: #f8f3eb; color: #956141; }
.empty-icon .icon { width: 23px; height: 23px; }
.empty strong { display: block; font-size: .94rem; overflow-wrap: anywhere; }
.empty p { font-size: .83rem; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.task-list, .history-list, .folder-list, .completed-preview ul { padding: 0 10px 9px; }
.task-row { display: flex; align-items: center; gap: 3px; min-width: 0; min-height: 57px; border-top: 1px solid #f0e9df; }
.task-row:first-child, .history-row:first-child, .folder-row:first-child { border-top: 0; }
.square-button { display: inline-grid; place-items: center; flex: none; width: 44px; min-height: 44px; padding: 0; background: transparent; color: var(--muted); font-weight: 800; }
.square-button .icon { width: 20px; height: 20px; }
.checkbox-art { display: grid; place-items: center; width: 23px; height: 23px; border: 1.7px solid #a6aeba; border-radius: 7px; background: white; }
.checkbox-art .icon { width: 15px; height: 15px; visibility: hidden; color: var(--green-text); stroke-width: 2.7; }
.check-button:focus-visible .checkbox-art .icon { visibility: visible; }
.task-content { flex: 1; min-width: 0; min-height: 46px; text-align: left; padding: 8px 0; background: transparent; border-radius: 6px; }
.task-content strong { display: block; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; margin-top: 3px; font-size: .81rem; font-weight: 700; min-width: 0; }
.folder-tag, .due, .reminder-tag { display: inline-flex; align-items: center; gap: 3px; }
.folder-tag { min-width: 0; max-width: 100%; overflow-wrap: anywhere; border-radius: 7px; padding: 1px 5px; }
.folder-tag .icon, .due .icon, .reminder-tag .icon { width: 14px; height: 14px; }
.due { color: var(--blue-strong); }
.due.late { color: var(--red); }
.reminder-tag { color: #71478a; }
.reminder-list { display: grid; gap: 4px; padding: 0 13px 12px; }
.reminder-list button { text-align: left; min-height: 44px; width: 100%; padding: 6px 9px; border: 1px solid #eae3f2; background: #f7f1fb; color: #71478a; overflow-wrap: anywhere; font-size: .91rem; font-weight: 740; }
.star-button { color: #778092; }
.star-button.starred { color: #8a5416; }
.star-button.starred .icon { fill: #ffd486; }
.row-order { display: flex; flex: none; }
.row-order .square-button { width: 44px; }
.completed-preview li { display: flex; align-items: center; gap: 7px; min-height: 39px; padding: 3px 6px; color: var(--green-text); }
.completed-preview li .icon { width: 16px; height: 16px; stroke-width: 2.5; }
.completed-preview li span { flex: 1; overflow-wrap: anywhere; color: var(--ink); }
.completed-preview li time { font-size: .8rem; color: var(--muted); }
.summary-card .section-head { padding-bottom: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.summary-card .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 13px 13px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 69px; padding: 8px 10px; border: 1px solid #e8e2d9; border-radius: 13px; text-align: left; color: var(--ink); background: #f8f4ec; overflow-wrap: anywhere; }
.stat-day { background: #fff0e5; border-color: #f5dfd0; color: #843b20; }
.stat-weekly { background: #edf4fb; border-color: #dfe9f6; color: #3b5b88; }
.stat-monthly { background: #edf4e9; border-color: #e0eadc; color: #38604b; }
.stat-all { background: #fff5dc; border-color: #f4e8c8; color: #765016; }
.stat[aria-pressed="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.stat-label { display: flex; align-items: center; gap: 3px; font-size: .79rem; font-weight: 800; }
.stat-label .icon { width: 16px; height: 16px; }
.stat-number { margin-top: 2px; font-size: clamp(1.21rem,1.02rem + .65vw,1.72rem); line-height: 1.15; font-weight: 900; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat-number small { font-size: .7rem; font-weight: 750; letter-spacing: 0; }
.quote-card { min-width: 0; border: 1px dashed #e7bc90; border-radius: var(--radius); background: #fff4de; padding: 14px 17px; color: #69472c; }
.quote-card > div { display: flex; align-items: center; gap: 7px; }
.quote-card .icon { width: 16px; height: 16px; color: #9b5f26; }
.quote-card h2 { color: #7c4827; font-size: .83rem; }
.quote-card p { margin: 5px 0; font-size: 1rem; font-weight: 750; overflow-wrap: anywhere; }
.quote-card cite { display: block; text-align: right; font-size: .77rem; font-style: normal; color: #705846; }

.filter-card { margin-bottom: 15px; padding: 15px; display: grid; gap: 12px; }
.search-field { display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.search-field > .icon { width: 20px; height: 20px; color: var(--muted); }
.search-field input { width: 100%; min-height: 44px; padding: 4px 2px; border: 0; background: transparent; }
.filter-chips, .chart-control { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; background: #fbf8f2; color: #555d70; font-size: .86rem; font-weight: 760; white-space: nowrap; }
.chip[aria-pressed="true"] { background: #ffe9d8; color: #853a20; border-color: #efa97f; box-shadow: inset 0 -1px #e6a07940; }
.filter-selects { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-selects label { position: relative; min-width: 0; flex: 1 1 130px; }
.filter-selects label:first-child .icon:not(.select-icon) { position: absolute; z-index: 1; pointer-events: none; left: 11px; top: 13px; width: 19px; height: 19px; color: var(--blue-strong); }
.filter-selects label:first-child select { padding-left: 38px; }
select { appearance: none; text-overflow: ellipsis; }
.filter-selects select, .select-shell select { width: 100%; padding-right: 32px; }
.select-shell { position: relative; display: block; min-width: 0; }
.select-icon { position: absolute; pointer-events: none; top: calc(50% - 9px); right: 11px; width: 18px; height: 18px; color: var(--muted); }
.filter-selects select, .sheet-form :is(input:not([type="radio"],[type="checkbox"]), select, textarea) { border: 1px solid #ddd7ce; background: #fff; min-height: 45px; padding: 8px 11px; font-size: 1rem; }
.sheet-form select, .filter-selects select { padding-right: 34px; }
.list-help { padding: 0 16px 10px; color: var(--muted); font-size: .84rem; }
.folder-row { display: flex; align-items: center; gap: 1px; border-top: 1px solid #f0e9df; min-width: 0; }
.folder-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 61px; text-align: left; background: transparent; padding: 6px 5px; }
.folder-open strong, .folder-open small, .setting-row small { display: block; overflow-wrap: anywhere; }
.folder-open small, .setting-row small { font-size: .83rem; color: var(--muted); line-height: 1.4; }
.folder-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; }
.folder-icon .icon { width: 23px; height: 23px; }
.tone-orange { color: #894823; background: #ffead9; }
.tone-blue { color: #365780; background: #e8f1fc; }
.tone-green { color: #375c49; background: #e6f1e7; }
.tone-pink { color: #904c65; background: #fbeaf0; }
.tone-violet { color: #644a89; background: #efeaf9; }
.tone-sand { color: #6e512f; background: #f3ebda; }

.record-summary { margin-bottom: 15px; }
.record-summary .stat { min-height: 83px; padding: 11px 15px; }
.chart-card, .history-card, .settings-card { margin-bottom: 15px; }
.chart-control { padding: 0 16px; }
.bars { --plot-height: 128px; display: grid; grid-template-columns: 22px repeat(7,minmax(0,1fr)); gap: clamp(3px,1.1vw,12px); margin: 23px 17px 1px; }
.bars-30 { grid-template-columns: 22px repeat(30,minmax(0,1fr)); gap: clamp(1px,.44vw,5px); }
.bars-month { grid-template-columns: 22px repeat(12,minmax(0,1fr)); gap: clamp(2px,.8vw,10px); }
.bar-axis { display: flex; flex-direction: column; justify-content: space-between; height: var(--plot-height); color: var(--muted); font-size: .76rem; text-align: right; }
.bar-column { display: flex; flex-direction: column; min-width: 0; text-align: center; }
.bar-area { display: grid; place-items: end center; position: relative; height: var(--plot-height); border-bottom: 1px solid #dedbdf; background: repeating-linear-gradient(to top,transparent 0 24%,#eae6ed 24.2% 25%); }
.bar { width: min(88%,35px); min-height: 3px; height: calc(100% * var(--ratio)); border-radius: 5px 5px 1px 1px; background: #b2c7e6; }
.last-bar .bar { background: #e89a65; }
.zero-bar, .last-bar .zero-bar { background: #d8d9e4; }
.bar-area small { position: absolute; bottom: calc(100% * var(--ratio)); font-size: .73rem; line-height: 1.15; font-weight: 800; }
.bar-label { align-self: center; padding-top: 5px; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.last-bar .bar-label { color: var(--orange-text); font-weight: 800; }
.chart-empty { padding: 4px 16px; color: var(--muted); font-size: .84rem; }
.chart-details { margin: 3px 16px 6px; color: var(--muted); font-size: .84rem; }
.chart-details summary { display: list-item; min-height: 44px; padding: 11px 0; cursor: pointer; }
.chart-details table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.chart-details :is(th,td) { text-align: left; border-bottom: 1px solid var(--line); padding: 4px 6px; }
.history-row { display: flex; align-items: center; min-height: 59px; gap: 4px; min-width: 0; border-top: 1px solid #f0e9df; padding-left: 5px; }
.history-check { display: grid; flex: none; place-items: center; width: 32px; height: 32px; margin-right: 4px; border-radius: 10px; color: var(--green-text); background: var(--green); }
.history-check .icon { width: 19px; height: 19px; stroke-width: 2.2; }
.history-row > div { flex: 1; min-width: 0; padding: 6px 0; overflow-wrap: anywhere; }
.history-row p { color: var(--muted); font-size: .82rem; }
.record-options { margin-left: -5px; }
.deleted-note { color: var(--muted); font-size: .78rem; padding-inline: 5px; white-space: nowrap; }
.history-more { margin: 0 13px 13px; }

.settings-card { padding-bottom: 12px; }
.settings-card fieldset { padding: 2px 16px 10px; }
.chatter-help { margin-top: 7px; color: var(--muted); font-size: .83rem; }
.settings-card legend, .sheet-form legend { font-size: .9rem; font-weight: 800; }
fieldset { min-width: 0; padding: 0; border: 0; }
.segmented { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: 5px; }
.segmented label, .color-choice { position: relative; cursor: pointer; min-width: 0; }
.segmented input, .color-choice input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; height: 44px; border-radius: 11px; border: 1px solid var(--line); font-size: .9rem; font-weight: 750; background: #fbf8f2; }
.segmented input:checked + span { border-color: #e9a57a; color: #863b20; background: #ffe9d8; }
.segmented input:focus-visible + span, .color-choice input:focus-visible + span { outline: 3px solid #335a96; outline-offset: 2px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 61px; margin: 0 16px; padding: 8px 0; border-top: 1px solid #f0e9df; cursor: pointer; }
.setting-row strong { font-size: .96rem; }
.switch { appearance: none; position: relative; flex: none; cursor: pointer; width: 48px; height: 44px; margin: 0; overflow: visible; }
.switch::before { content: ''; position: absolute; inset: 9px 0; border-radius: 20px; border: 1px solid #cfd1d2; background: #e8e7e5; }
.switch::after { content: ''; position: absolute; top: 12px; left: 4px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #c8c3bb; background: white; }
.switch:checked::before { background: #e8925b; border-color: #b65d31; }
.switch:checked::after { transform: translateX(20px); border-color: #ac592f; }
.settings-card > p { padding: 0 16px 8px; font-size: .87rem; color: var(--muted); }
.settings-buttons { display: flex; align-items: stretch; flex-wrap: wrap; gap: 7px; margin: 7px 16px; }
.settings-buttons .button { white-space: normal; }
.settings-card > .danger-plain { margin-left: 12px; }

.bottom-nav { position: fixed; inset: auto 0 0; z-index: 4; background: #fffcf7; border-top: 1px solid #e9dfd3; box-shadow: 0 -3px 14px #46382c0a; padding: 5px max(8px,env(safe-area-inset-right, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(8px,env(safe-area-inset-left, 0px)); }
.nav-inner { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; width: min(580px,100%); margin: auto; }
.nav-inner a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60px; line-height: 1.2; gap: 3px; border-radius: 13px; color: #555e70; font-weight: 800; font-size: .76rem; white-space: nowrap; text-decoration: none; }
.nav-inner a[aria-current="page"] { color: #8a3d22; background: #ffe9d8; }
.nav-icon { display: grid; place-items: center; }
.nav-icon .icon { width: 23px; height: 23px; }
.notice-stack { position: fixed; inset: auto 12px calc(var(--nav-space) + 10px); z-index: 6; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
body:has(#main[data-page="settings"]) .update-notice { display: none; }
.notice { display: flex; align-items: center; min-height: 48px; max-width: min(100%,620px); gap: 8px; padding: 3px 4px 3px 11px; border: 1px solid #343a51; border-radius: 13px; background: #343a51; color: #fffaf1; box-shadow: 0 7px 18px #29233235; font-size: .88rem; pointer-events: auto; }
.notice-error { background: #883c36; border-color: #883c36; }
.notice > span { overflow-wrap: anywhere; }
.notice-copy { min-width: 0; overflow-wrap: anywhere; }
.notice-copy > span, .notice-copy small, .notice-award-label { display: block; }
.notice-copy small { margin-top: 3px; color: #f0e9e6; font-size: .76rem; }
.notice-copy small b { color: #ffe4bd; }
.notice-award { border-color: #876221; background: #56432f; }
.notice-award-label { color: #ffdf9d; }
.notice > .icon { width: 18px; height: 18px; }
.notice-close { color: inherit; }
.notice-close .icon { width: 16px; height: 16px; }
.notice-action { flex: none; min-height: 44px; padding: 4px 8px; color: #ffe0b8; background: #ffffff14; font-weight: 800; }
.notice :is(button,a):focus-visible { outline-color: #ffe1ad; }
.confetti { position: fixed; inset: auto 50% calc(var(--nav-space) + 26px); z-index: 9; pointer-events: none; }
.confetti i { position: absolute; display: block; width: 7px; height: 10px; border-radius: 2px; background: #ed975c; animation: confetti-puff 790ms ease-out both; }
.confetti i:nth-child(3n) { background: #85addd; }
.confetti i:nth-child(3n+1) { background: #edbb58; }
.confetti[data-festival] i { animation-duration: 1160ms; }
.confetti[data-festival] i:nth-child(even) { width: 9px; height: 9px; border-radius: 2px 50% 2px 50%; background: #f4bd56; }
.confetti[data-festival="total"] i:nth-child(3n) { width: 11px; height: 11px; border-radius: 50%; background: #d8a4e9; }
@keyframes confetti-puff { from { opacity: 1; transform: translate(0,0) rotate(0); } to { opacity: 0; transform: translate(var(--x),var(--y)) rotate(var(--turn)); } }

#sheet { width: min(540px,calc(100% - 28px)); max-height: calc(100dvh - 28px); margin: auto; border: 1px solid #e9dace; padding: 0; border-radius: 22px; background: #fffcf7; color: var(--ink); box-shadow: 0 14px 55px #26263747; overscroll-behavior: contain; }
#sheet::backdrop { background: #24294073; }
.sheet-handle { display: none; }
.sheet-header { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 8px 12px 7px 17px; border-bottom: 1px solid var(--line); background: #fffcf7; }
.sheet-header h2 { font-size: 1.21rem; }
.sheet-form { display: grid; gap: 10px; padding: 13px 17px 16px; }
.sheet-form label:not(.color-choice) { min-width: 0; display: block; font-size: .87rem; font-weight: 800; }
.sheet-form :is(input:not([type="radio"],[type="checkbox"]),select,textarea) { display: block; width: 100%; margin-top: 2px; }
.sheet-form textarea { resize: vertical; }
.sheet-form input[type="date"], .sheet-form input[type="datetime-local"], .sheet-form input[type="time"] { appearance: none; text-align: left; min-width: 0; }
.sheet-form input:disabled { background: #f1eee8; opacity: .68; }
.required, .field-hint { color: var(--muted); font-size: .73rem; font-weight: 670; }
.required { color: var(--orange-text); }
.form-grid { display: grid; grid-template-columns: minmax(0,1.12fr) minmax(0,1fr); gap: 8px; }
.sheet-form label.sheet-check { display: flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; }
.sheet-check input { margin: 0 3px; width: 19px; height: 19px; accent-color: #be663d; }
.sheet-check .icon { width: 17px; height: 17px; color: #876033; }
.sheet-footer { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.sheet-footer .button { white-space: normal; }
.sheet-remove { justify-self: start; padding-left: 3px; }
.colors { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 4px; margin: 4px 0; }
.color-choice > span { display: grid; place-items: center; min-height: 44px; border-radius: 9px; border: 2px solid transparent; }
.color-choice input:checked + span { border-color: currentColor; }
.form-error { color: var(--red); font-weight: 750; font-size: .87rem; }
.confirm-detail { font-size: .96rem; overflow-wrap: anywhere; }
.restore-preview { padding: 8px 11px; margin: 0; border-radius: 10px; background: #f5efe5; }
.restore-preview div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 9px; font-size: .86rem; }
.restore-preview dd { margin: 0; font-weight: 800; }
.loading, .startup-error { padding: 24px; }
.startup-error .button { margin-top: 14px; }
.startup-error p { color: var(--muted); margin-top: 4px; }

@media (hover: hover) {
  .primary:hover { background: var(--orange-strong); }
  .secondary:hover, .square-button:not(:disabled):hover, .nav-inner a:not([aria-current]):hover, .chip:not([aria-pressed="true"]):hover { background: #f4eee4; }
  .check-button:hover .checkbox-art .icon { visibility: visible; }
  .task-content:hover strong, .folder-open:hover strong { text-decoration: underline; text-underline-offset: 3px; }
  .talk-next:hover, .talk-skip:hover { background: #edf4fb; }
  .today-count:hover { background: #e0eddb; }
  .notice-close:hover { background: #ffffff25 !important; }
}
@media (max-width: 670px) {
  .header-inner, .page { width: calc(100% - max(30px,env(safe-area-inset-left,0px) + env(safe-area-inset-right,0px) + 18px)); }
  .header-inner { min-height: 60px; }
  .page { padding-top: 21px; }
  .home-heading, .page-heading { margin-bottom: 15px; }
  .home-grid { grid-template-columns: 1fr; gap: 13px; }
  .home-primary, .home-side, .home-task-groups { gap: 13px; }
  .mascot-card { min-height: 176px; grid-template-columns: minmax(80px,32%) minmax(0,1fr); gap: 9px; padding: 11px 12px 11px 7px; border-radius: 21px; margin-bottom: 13px; }
  .mascot-art { height: 115px; }
  .mascot-shadow { bottom: 3px; height: 6px; }
  .mascot-status { margin-top: 3px; padding-inline: 5px; font-size: .71rem; }
  .mascot-status .icon { width: 12px; height: 12px; }
  .mascot-prop:not(:empty) { right: 0; min-width: 24px; min-height: 24px; border-radius: 8px; }
  .mascot-prop .icon { width: 14px; height: 14px; }
  .sky-spark { left: 9px; top: 18px; }
  .sky-spark .icon { width: 19px; height: 19px; }
  .sky-spark-small { right: 7px; top: 4px; }
  .speech { padding: 9px 9px 0 11px; border-radius: 13px; }
  .speech::before { width: 10px; height: 10px; left: -6px; }
  .speech-label { column-gap: 6px; margin-bottom: 3px; }
  .speech-label strong { font-size: .82rem; }
  .speech-label span { font-size: .71rem; }
  .speech p { font-size: .98rem; }
  .talk-next { padding: 0; }
  .talk-skip { margin-right: -5px; }
  .summary-card .stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .record-summary .stat { padding-inline: 9px; min-height: 70px; }
  .page-heading p { font-size: .85rem; }
  .page-heading h1 { gap: 7px; }
  .heading-icon { width: 36px; height: 36px; border-radius: 12px; }
  .heading-icon .icon { width: 21px; height: 21px; }
  #sheet { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding-bottom: env(safe-area-inset-bottom,0px); border-radius: 21px 21px 0 0; }
  .sheet-handle { display: block; margin: 7px auto 0; width: 34px; height: 4px; border-radius: 5px; background: #e0d7cf; }
  .sheet-header { padding-block: 0 4px; }
}
@media (max-width: 370px) {
  .header-inner, .page { width: calc(100% - 24px); }
  .header-inner { gap: 6px; }
  .brand { gap: 6px; font-size: 1.13rem; }
  .brand-icon { width: 34px; height: 34px; }
  .offline-badge { padding-inline: 8px; font-size: .73rem; }
  .offline-badge .icon { display: none; }
  .home-heading { gap: 6px; }
  .home-heading h1 { font-size: 1.61rem; }
  .today-count { padding-inline: 7px; font-size: .74rem; gap: 3px; }
  .today-count .icon { width: 13px; height: 13px; }
  .mascot-card { padding-right: 9px; grid-template-columns: minmax(72px,30%) minmax(0,1fr); }
  .mascot-art { height: 104px; }
  .section-head { padding-inline: 11px; }
  .stat-grid { gap: 4px; }
  .stat, .record-summary .stat { padding-inline: 5px; }
  .stat-label .icon { width: 13px; height: 13px; }
  .chip { padding-inline: 9px; }
  .filter-card { padding-inline: 10px; }
  .task-row { gap: 0; }
  .task-list, .history-list, .folder-list { padding-inline: 5px; }
  .page-heading .button { padding-inline: 8px; }
  .quick-add { padding-left: 7px; gap: 6px; }
  .quick-icon { width: 29px; height: 33px; }
  .quick-add input { font-size: .99rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .mascot-card * { animation: none !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
.reduce-motion .mascot-card * { animation: none !important; }
