:root {
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif;
  font-size: clamp(16px, .28vw + 15px, 19px);
  color-scheme: light;
  --bg: #f5f3ff;
  --paper: #fbfaff;
  --paper-2: #f0edff;
  --ink: #171827;
  --muted: #67677a;
  --line: #d9d5ef;
  --accent: #5e5bd8;
  --accent-2: #3730a3;
  --accent-ink: #fff;
  --soft: #e6e3ff;
  --success: #3f735c;
  --danger: #a44747;
  --shadow: 0 14px 40px rgba(44, 39, 85, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); overflow-x: hidden; }
body { margin: 0; min-width: 320px; min-height: 100dvh; color: var(--ink); background: var(--bg); overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; opacity: .16; pointer-events: none; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"); }
button, input, textarea, select { font: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 2px; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100dvh; color: var(--ink); background: var(--bg); }
html[data-theme] body { background: var(--bg); color: var(--ink); }
.side-panel { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 250px; padding: 35px 22px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 13px; border: 0; padding: 4px; text-align: left; background: none; }
.brand-mark { position: relative; width: 43px; height: 43px; flex: none; border-radius: 43% 57% 52% 48%; background: var(--ink); transform: rotate(-4deg); }
.brand-mark i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--paper); left: 13px; top: 15px; box-shadow: 13px 0 var(--paper); }
.brand-mark b { position: absolute; width: 12px; height: 21px; left: 15px; top: -15px; border-radius: 80% 15% 80% 15%; background: var(--accent); transform: rotate(15deg); }
.brand-mark { overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line)); background: #ede4ff; transform: none; }
.brand-mark i, .brand-mark b { display: none; }
.brand-mark img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; display: block; object-fit: contain; object-position: center; background: transparent; }
.brand strong { display: block; font-family: "Kiwi Maru", serif; font-size: 1.05rem; letter-spacing: .03em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font: .6rem/1.2 ui-monospace, monospace; letter-spacing: .12em; }
.main-nav { display: grid; gap: 6px; margin-top: 48px; }
.main-nav button { position: relative; min-height: 58px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: 1fr 1fr; column-gap: 9px; align-items: center; padding: 9px 12px; border: 1px solid transparent; border-radius: 14px; text-align: left; background: transparent; color: var(--muted); }
.main-nav button > span { grid-row: 1 / 3; text-align: center; }
.nav-blob-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 48% 52% 46% 54%; background: color-mix(in srgb, var(--soft) 72%, var(--paper)); color: currentColor; }
.nav-blob-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.main-nav b { font-size: .85rem; color: inherit; }
.main-nav small { font-size: .68rem; opacity: .78; }
.main-nav button:hover { background: var(--paper-2); }
.main-nav button.active { color: var(--ink); border-color: var(--line); background: var(--paper); box-shadow: 0 5px 16px color-mix(in srgb, var(--ink) 5%, transparent); }
.main-nav button.active::after { content: ""; position: absolute; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.side-quote { margin: auto 8px 4px; color: var(--muted); font-family: "Kiwi Maru", serif; font-size: .75rem; line-height: 1.9; }

.app-main { min-height: 100vh; margin-left: 250px; padding: clamp(30px, 5vw, 72px) clamp(28px, 6vw, 90px) 80px; }
.view { display: none; max-width: 1100px; margin: 0 auto; animation: page-in .3s ease both; }
.view.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 34px; }
.page-head-aside { display: flex; align-items: end; gap: 12px; flex: none; }
.page-mascot { width: 86px; height: 86px; display: block; flex: none; filter: drop-shadow(0 7px 10px color-mix(in srgb, var(--accent) 16%, transparent)); }
.page-mascot svg { width: 100%; height: 100%; overflow: visible; }
.page-mascot.cat-mascot { width: 86px; height: 86px; padding: 5px; }
.page-mascot.cat-mascot img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
@media (min-width: 701px) { .page-mascot.cat-mascot { animation: desktop-mascot-breathe 4.6s ease-in-out infinite; transform-origin: 50% 100%; } .page-mascot.cat-mascot:hover { animation-duration: 1.35s; } }
@keyframes desktop-mascot-breathe { 0%,100% { transform: translateY(0) rotate(-1deg); } 48% { transform: translateY(-4px) rotate(1deg); } }
.fox-ear { fill: var(--accent-2); stroke: var(--accent-2); stroke-width: 4; stroke-linejoin: round; }
.fox-face { fill: #f4a936; stroke: var(--accent-2); stroke-width: 4; stroke-linejoin: round; }
.fox-muzzle { fill: var(--paper); stroke: var(--accent-2); stroke-width: 3.5; stroke-linejoin: round; }
.fox-eye, .fox-nose { fill: var(--accent-2); }
.fox-smile { fill: none; stroke: var(--accent-2); stroke-width: 3.5; stroke-linecap: round; }
.eyebrow { margin: 0 0 8px; color: var(--accent-2); font: 600 .68rem/1.2 ui-monospace, monospace; letter-spacing: .18em; text-transform: uppercase; }
.page-head h1 { margin: 0; font-family: "Kiwi Maru", serif; font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 500; letter-spacing: .05em; }
.page-head p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); font-size: .9rem; }
.date-stamp { min-width: 106px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); text-align: center; font-size: .72rem; background: var(--paper); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(310px, .88fr); gap: 22px; align-items: start; }
.column { display: grid; gap: 22px; }
.paper-card { position: relative; padding: clamp(20px, 2.5vw, 30px); border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--paper) 96%, transparent); box-shadow: var(--shadow); overflow: hidden; }
.paper-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08; background-image: repeating-linear-gradient(0deg, transparent 0 3px, var(--ink) 4px); }
.card-kicker { color: var(--accent-2); font: 600 .65rem/1 ui-monospace, monospace; letter-spacing: .14em; }
.card-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.card-title .title-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: 45% 55% 55% 45%; background: var(--soft); color: var(--accent-2); font-weight: 700; }
.blob-icon { width: 22px; height: 22px; }
.card-title h2 { margin: 0; font-family: "Kiwi Maru", serif; font-size: 1.05rem; font-weight: 500; }
.card-title p { margin: 4px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.6; }

.pace-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice-button { min-height: 64px; padding: 9px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); text-align: center; }
.choice-button b { display: block; font-size: .85rem; }
.choice-button small { display: block; margin-top: 4px; color: var(--muted); font-size: .65rem; }
.choice-button:hover, .choice-button.selected { border-color: var(--accent); background: var(--soft); color: var(--accent-2); }
.effect-note { margin: 15px 0 0; padding: 11px 13px; border-left: 3px solid var(--accent); color: var(--muted); font-size: .75rem; line-height: 1.6; background: var(--paper-2); }
.help-label { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; color: var(--muted); font-size: .69rem; }
.help-label span { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: .62rem; }
.mood-options { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 42px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: .77rem; }
.pill:hover, .pill.selected { border-color: var(--accent); background: var(--soft); color: var(--accent-2); }
.energy-wrap { margin-top: 20px; }
.energy-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; font-size: .8rem; }
.energy-head small { color: var(--muted); }
.energy-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.energy-button { min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-weight: 700; }
.energy-button.selected, .energy-button.filled { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

.section-line { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 15px; }
.section-line h2 { margin: 0; font-family: "Kiwi Maru", serif; font-size: 1rem; font-weight: 500; }
.section-line span { color: var(--muted); font-size: .72rem; }
.quick-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-bottom: 16px; }
.form-input, .form-select, .plain-textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.form-input, .form-select { min-height: 48px; padding: 10px 13px; }
.plain-textarea { min-height: 110px; padding: 13px; resize: vertical; line-height: 1.7; }
.form-input::placeholder, .plain-textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.primary-button, .secondary-button, .danger-button, .icon-button { border-radius: 13px; font-weight: 700; }
.primary-button { min-height: 48px; padding: 10px 18px; border: 1px solid var(--accent); color: var(--accent-ink); background: var(--accent); }
.primary-button:hover { background: var(--accent-2); border-color: var(--accent-2); }
.secondary-button { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); background: var(--paper); }
.secondary-button:hover { border-color: var(--accent); color: var(--accent-2); }
.danger-button { min-height: 44px; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); background: transparent; }
.icon-button { width: 42px; height: 42px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-button .blob-icon { width: 19px; height: 19px; vertical-align: middle; }
.icon-button:hover { background: var(--paper-2); color: var(--ink); }
.task-mini-list, .task-list { display: grid; gap: 9px; }
.task-mini, .task-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; min-width: 0; }
.task-mini { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.task-mini:last-child { border-bottom: 0; }
.check-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--accent-ink); font-weight: 700; }
.check-button:hover { border-color: var(--accent); }
.check-button.checked { border-color: var(--accent); background: var(--accent); }
.task-mini p, .task-row p { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.task-mini.done p, .task-row.done p { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.priority-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--accent); }
.empty-note { padding: 20px 0; color: var(--muted); text-align: center; font-size: .82rem; }
.link-button { padding: 3px; border: 0; border-bottom: 1px solid currentColor; color: var(--accent-2); background: transparent; font-size: .75rem; }

.timer-preview { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: var(--accent-ink); }
.timer-preview::after { opacity: .05; }
.timer-preview .card-kicker, .timer-preview .card-title p { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); }
.timer-preview .card-title .title-icon { color: var(--accent-ink); background: color-mix(in srgb, var(--accent-ink) 15%, transparent); }
.timer-preview strong { display: block; margin: 5px 0 4px; font: 500 clamp(2.4rem, 5vw, 4.3rem)/1 ui-monospace, monospace; letter-spacing: -.05em; }
.timer-preview > p { margin: 10px 0 19px; font-size: .8rem; }
.timer-preview .primary-button { border-color: var(--paper); color: var(--accent-2); background: var(--paper); }
.timer-preview .primary-button:hover { color: var(--ink); }
.memo-card textarea { min-height: 90px; }
.tomorrow-inbox { border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); background: linear-gradient(140deg, var(--paper), var(--soft)); }
.tomorrow-inbox p { margin: -5px 0 12px 50px; color: var(--ink); font-size: .82rem; line-height: 1.7; white-space: pre-wrap; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.toolbar .form-input { flex: 1 1 230px; }
.toolbar .form-select { width: auto; min-width: 120px; }
.task-row { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.task-row.future { border-style: dashed; background: color-mix(in srgb, var(--paper-2) 52%, var(--paper)); }
.task-row .row-actions { display: flex; gap: 3px; }
.task-row h3 { margin: 0; font-size: .9rem; font-weight: 500; overflow-wrap: anywhere; }
.task-row .task-meta { margin-top: 7px; }
.task-count-banner { padding: 16px 20px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; border-radius: 17px; background: var(--paper-2); }
.progress-track { width: 140px; max-width: 34vw; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.timer-layout { display: grid; grid-template-columns: minmax(350px, 1fr) minmax(280px, .72fr); gap: 22px; align-items: start; }
.timer-stage { min-height: 485px; display: grid; place-items: center; text-align: center; }
.timer-stage > div { width: 100%; display: flex; flex-direction: column; align-items: center; }
.timer-ring { --progress: 0deg; position: relative; width: min(330px, 72vw); margin-inline: auto; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress), var(--soft) 0); }
.timer-ring::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.timer-face { position: relative; z-index: 1; }
.timer-face .mode { color: var(--muted); font: 600 .7rem/1 ui-monospace, monospace; letter-spacing: .14em; }
.timer-face strong { display: block; margin: 14px 0 19px; font: 500 clamp(3rem, 8vw, 5.4rem)/1 ui-monospace, monospace; letter-spacing: -.08em; }
.timer-controls { display: flex; justify-content: center; gap: 9px; }
.timer-controls .primary-button { min-width: 118px; }
.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.preset { min-height: 66px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.preset b, .preset small { display: block; }
.preset small { margin-top: 3px; color: var(--muted); font-size: .66rem; }
.preset.selected { border-color: var(--accent); background: var(--soft); color: var(--accent-2); }
.custom-time { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(92px, 1fr); gap: 8px; margin-top: 13px; }
.custom-time .primary-button { grid-column: 1 / -1; width: 100%; }
.custom-time input { min-width: 0; width: 100%; }
.custom-minutes { position: relative; display: block; min-width: 0; }
.custom-minutes input { padding-right: 2.5rem; }
.custom-minutes span { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--muted); font-size: .82rem; font-weight: 700; pointer-events: none; }
.timer-history { display: grid; gap: 0; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: .76rem; }
.history-row:last-child { border: 0; }
.history-row p { margin: 0; }
.history-row time { color: var(--muted); }

.reflection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.reflection-card .plain-textarea { min-height: 145px; margin-top: 12px; }
.save-record { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 22px 0; }
.save-record p { margin: 0; color: var(--muted); font-size: .8rem; }
.record-actions, .journal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.record-actions { justify-content: flex-end; }
.journal-trends { margin: 22px 0; }
.trend-note { margin: -6px 0 15px; color: var(--muted); font-size: .72rem; }
.trend-chart { min-height: 115px; display: flex; align-items: end; gap: 8px; padding: 14px 8px 3px; overflow-x: auto; border-radius: 14px; background: var(--paper-2); }
.trend-item { min-width: 42px; display: grid; align-items: end; justify-items: center; gap: 5px; color: var(--muted); font-size: .6rem; }
.trend-item i { width: 18px; max-height: 85px; display: block; border-radius: 99px 99px 5px 5px; background: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 25%, transparent); }
.trend-item small { max-width: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-2); font-size: .55rem; }
.trend-empty { padding: 17px; color: var(--muted); font-size: .75rem; line-height: 1.7; border-radius: 14px; background: var(--paper-2); }
.record-history-head { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 14px; }
.record-history-head .section-line { flex: 1; margin: 0; }
.month-filter { display: grid; gap: 5px; min-width: 160px; color: var(--muted); font-size: .68rem; }
.month-filter .form-select { min-height: 40px; padding: 7px 10px; font-size: .75rem; }
.journal-list { display: grid; gap: 10px; }
details.journal-entry { border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
details.journal-entry summary { padding: 15px 17px; cursor: pointer; font-weight: 700; }
.journal-body { padding: 0 17px 17px; color: var(--muted); font-size: .78rem; line-height: 1.75; }
.journal-body h3 { color: var(--ink); font-size: .8rem; margin: 15px 0 3px; }
.journal-body > p { white-space: pre-wrap; }

.settings-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; align-items: start; }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.theme-card { position: relative; min-height: 105px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; text-align: left; background: var(--paper); }
.theme-card.selected { border: 2px solid var(--accent); padding: 13px; }
.theme-colors { display: flex; margin-bottom: 12px; }
.theme-colors i { width: 29px; height: 29px; margin-left: -5px; border: 2px solid var(--paper); border-radius: 50%; }
.theme-colors i:first-child { margin-left: 0; }
.theme-card b { font-size: .77rem; }
.theme-card small { display: block; margin-top: 3px; color: var(--muted); font-size: .63rem; }
.theme-card .theme-check { position: absolute; top: 10px; right: 10px; color: var(--accent); }
.setting-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border: 0; }
.setting-row b { display: block; font-size: .82rem; }
.setting-heading { display: inline-flex; align-items: center; gap: 6px; }
.setting-help { width: 22px; height: 22px; margin: 0; font-size: .72rem; }
.setting-row p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.setting-status { display: block; margin-top: 5px; color: var(--accent-2); font-size: .65rem; }
.notification-retry { display: grid; gap: .5rem; margin-top: .6rem; padding: .65rem; border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.notification-retry small { color: var(--ink-soft); font-size: .68rem; line-height: 1.55; }
.notification-retry .secondary-button { justify-self: start; min-height: 36px; font-size: .8rem; }
.test-push-button { margin-top: 9px; min-height: 38px; color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); background: var(--soft); font-size: .75rem; }
.notification-id-card { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.notification-id-card p { max-width: 42rem; margin: 4px 0 8px; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.notification-id-card code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; color: var(--accent-2); font-size: .72rem; letter-spacing: .03em; }
.notification-id-card .secondary-button { flex: 0 0 auto; min-height: 36px; padding: 8px 12px; font-size: .75rem; }
.notification-id-card.is-admin-device { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 76%, transparent); }
.identity-code-actions { display: grid; gap: 8px; justify-items: start; flex: 0 0 auto; }
.identity-history { margin: 12px 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 14px; background: var(--paper-2); color: var(--muted); font-size: .72rem; }
.identity-history summary { cursor: pointer; color: var(--accent-2); font-weight: 700; }
.identity-history ol { display: grid; gap: 7px; margin: 10px 0 0; padding-left: 20px; }
.identity-history li { display: grid; gap: 2px; }
.identity-history li b { color: var(--ink); overflow-wrap: anywhere; }
.identity-history li small { color: var(--muted); }
.identity-history-empty { margin: 10px 0; }
.admin-device-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: var(--paper); font-size: .63rem; font-weight: 800; letter-spacing: .04em; }
@media (max-width: 520px) { .notification-id-card { align-items: stretch; flex-direction: column; } .notification-id-card .secondary-button { align-self: flex-start; } .identity-code-actions { grid-template-columns: 1fr 1fr; align-items: center; } }
.switch { width: 50px; height: 29px; padding: 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--line); }
.switch i { display: block; width: 21px; height: 21px; border-radius: 50%; background: var(--paper); transition: transform .2s; }
.switch.on { border-color: var(--accent); background: var(--accent); }
.switch.on i { transform: translateX(20px); }
.page-copy, .card-title p, .effect-note, .setting-row p { transition: background .2s ease, color .2s ease, border-color .2s ease; }
.app-shell[data-copy-mode="direct"] .page-copy { padding: 8px 10px; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; color: var(--ink); font-weight: 800; background: var(--paper-2); }
.app-shell[data-copy-mode="direct"] .card-title p, .app-shell[data-copy-mode="direct"] .effect-note, .app-shell[data-copy-mode="direct"] .setting-row p { color: var(--ink); font-weight: 700; }
.app-shell[data-copy-mode="direct"] .card-title p::before { content: "操作："; color: var(--accent-2); }
.app-shell[data-copy-mode="direct"] .card-kicker { color: var(--accent-2); }
.copy-mode-row { border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line)); border-radius: 13px; padding: 12px; margin: 10px -2px; background: color-mix(in srgb, var(--soft) 38%, transparent); }
.data-note { color: var(--muted); font-size: .7rem; line-height: 1.7; }

 .toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; bottom: auto; width: max-content; max-width: min(180px, calc(100vw - 36px)); display: grid; gap: 4px; pointer-events: none; }
.toast { width: fit-content; max-width: 100%; justify-self: end; padding: 4px 7px; border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: 7px; color: var(--ink); background: var(--paper); box-shadow: 0 4px 12px rgba(0,0,0,.1); animation: toast-in .2s ease both; font-size: .58rem; line-height: 1.25; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 18px max(12px, env(safe-area-inset-bottom)); overflow: hidden; overscroll-behavior: contain; background: rgba(15, 15, 20, .45); backdrop-filter: blur(4px); }
.modal { width: min(500px, 100%); max-height: min(720px, calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); max-height: min(720px, calc(100svh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); padding: 25px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 25px 70px rgba(0,0,0,.24); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
body.modal-open { overflow: hidden; }
.modal h2 { margin: 0 0 19px; font-family: "Kiwi Maru", serif; font-size: 1.2rem; }
.modal-form { display: grid; gap: 13px; } .modal input, .modal select { font-size: 16px; }
.modal label { display: grid; gap: 6px; color: var(--muted); font-size: .72rem; }
.modal-help { margin: -2px 0 2px; color: var(--muted); font-size: .7rem; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.mobile-nav { display: none; }

/* Themes: charts supplied as visual direction, adjusted for readable UI contrast. */
:root[data-theme="indigo"], .app-shell[data-theme="indigo"] { --bg:#f5f3ff; --paper:#fbfaff; --paper-2:#ece9ff; --ink:#151724; --muted:#62627a; --line:#d8d5ef; --accent:#6563df; --accent-2:#3730a3; --accent-ink:#fff; --soft:#e4e2ff; }
:root[data-theme="starlight"], .app-shell[data-theme="starlight"] { --bg:#fffaf1; --paper:#fffdf8; --paper-2:#fff2cb; --ink:#182442; --muted:#5f687d; --line:#e5dcc7; --accent:#e29bbd; --accent-2:#1a315f; --accent-ink:#fff; --soft:#fae0ec; }
:root[data-theme="moon"], .app-shell[data-theme="moon"] { --bg:#f5f6f2; --paper:#fcfcf9; --paper-2:#eef0df; --ink:#1b263b; --muted:#657083; --line:#d9ddd4; --accent:#a8aa36; --accent-2:#314967; --accent-ink:#111827; --soft:#e7e9c3; }
:root[data-theme="chocomint"], .app-shell[data-theme="chocomint"] { --bg:#f6fbf7; --paper:#fffefa; --paper-2:#e0f2ea; --ink:#3c2921; --muted:#75665f; --line:#ded9cf; --accent:#c92736; --accent-2:#684735; --accent-ink:#fff; --soft:#d8efe6; }
:root[data-theme="candy"], .app-shell[data-theme="candy"] { --bg:#fff9fb; --paper:#fffefe; --paper-2:#fff1cf; --ink:#1f3448; --muted:#657587; --line:#e9dce2; --accent:#e66ba9; --accent-2:#13799b; --accent-ink:#fff; --soft:#d9f3f6; }
:root[data-theme="night-indigo"], .app-shell[data-theme="night-indigo"] { color-scheme: dark; --bg:#11121c; --paper:#1a1b2a; --paper-2:#23243b; --ink:#f3f1ff; --muted:#b4b2ca; --line:#393a55; --accent:#8b89ff; --accent-2:#b8b5ff; --accent-ink:#10111b; --soft:#302f61; --shadow:0 16px 45px rgba(0,0,0,.22); }
:root[data-theme="night-cocoa"], .app-shell[data-theme="night-cocoa"] { color-scheme: dark; --bg:#211c1a; --paper:#2d2724; --paper-2:#3a302c; --ink:#f4ebe5; --muted:#c7b5aa; --line:#53443d; --accent:#db9b8a; --accent-2:#ffd0c2; --accent-ink:#261a17; --soft:#553a35; --shadow:0 16px 45px rgba(0,0,0,.24); }
:root[data-theme="night-sapphire"], .app-shell[data-theme="night-sapphire"] { color-scheme: dark; --bg:#101929; --paper:#16243a; --paper-2:#1e3150; --ink:#eef5ff; --muted:#afc0d7; --line:#344a67; --accent:#c3be6f; --accent-2:#f0e99b; --accent-ink:#162032; --soft:#354568; --shadow:0 16px 45px rgba(0,0,0,.25); }

@media (max-width: 1100px) {
  .custom-time { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .side-panel { width: 205px; padding-inline: 16px; }
  .brand small, .main-nav small { display: none; }
  .app-main { margin-left: 205px; padding-inline: 24px; }
  .home-grid, .timer-layout, .settings-grid { grid-template-columns: 1fr; }
  .reflection-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .side-panel { display: none; }
  body, .app-shell { min-height: 100dvh; }
  .app-main { min-height: 0; margin-left: 0; padding: 26px 16px calc(108px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; margin-bottom: 24px; }
  .page-head-aside { align-items: flex-start; }
  .page-mascot { width: 58px; height: 58px; margin-top: -8px; }
  .date-stamp { display: none; }
  .page-head h1 { font-size: 1.65rem; }
  .paper-card { padding: 19px; border-radius: 19px; }
  .mobile-nav { position: fixed; z-index: 80; display: grid; grid-template-columns: repeat(5, 1fr); left: 10px; right: 10px; bottom: calc(9px + env(safe-area-inset-bottom)); min-height: 70px; padding: 7px; border: 1px solid var(--line); border-radius: 22px; background: color-mix(in srgb, var(--paper) 96%, transparent); box-shadow: 0 12px 38px rgba(0,0,0,.18); backdrop-filter: blur(18px); }
  .mobile-nav button { display: grid; place-items: center; gap: 1px; min-width: 0; min-height: 55px; padding: 4px 1px; border: 0; border-radius: 15px; color: var(--muted); background: transparent; font-size: .58rem; }
  .mobile-nav button span { line-height: 1; }
  .mobile-nav .nav-blob-icon { width: 27px; height: 27px; }
  .mobile-nav .nav-blob-icon svg { width: 16px; height: 16px; }
  .mobile-nav button.active { color: var(--accent-2); background: var(--soft); }
  .toast-region { top: calc(8px + env(safe-area-inset-top)); right: 8px; max-width: min(170px, calc(100vw - 16px)); }
  .pace-options { gap: 6px; }
  .choice-button { min-height: 70px; padding-inline: 3px; }
  .choice-button b { font-size: .78rem; }
  .energy-options { gap: 6px; }
  .energy-button { min-height: 50px; }
  .quick-form { grid-template-columns: 1fr; }
  .quick-form .primary-button { width: 100%; }
  .timer-stage { min-height: 390px; }
  .timer-layout { grid-template-columns: minmax(0,1fr); }
  .theme-grid { grid-template-columns: 1fr; }
  .toolbar .form-select { flex: 1; }
  .task-row { grid-template-columns: auto 1fr; }
  .task-row .row-actions { grid-column: 2; justify-content: flex-end; }
  .save-record { align-items: stretch; flex-direction: column; }
  .record-actions, .journal-actions { flex-direction: column; }
  .record-actions button, .journal-actions button { width: 100%; }
  .record-history-head { align-items: stretch; flex-direction: column; }
  .month-filter { min-width: 0; }
  .tomorrow-inbox p { margin-left: 0; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.sound-controls { display: grid; gap: 9px; padding: 14px 0 16px; border-bottom: 1px dashed var(--line); }
.sound-controls label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .72rem; }
.sound-controls label b { color: var(--ink); font-size: .78rem; }
.sound-controls input[type="range"] { width: 100%; accent-color: var(--accent); }
.sound-controls .form-select { min-height: 44px; }
.sound-controls .secondary-button { justify-self: start; }
.break-suggestion { margin-bottom: 22px; border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: linear-gradient(140deg, var(--paper), var(--soft)); }
.break-suggestion .card-title { margin-bottom: 12px; }
.break-suggestion-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.break-suggestion-actions .link-button { margin-left: 2px; }
@media (max-width: 680px) {
  .break-suggestion-actions { align-items: stretch; flex-direction: column; }
  .break-suggestion-actions .primary-button, .break-suggestion-actions .link-button { width: 100%; }
}

/* Compact help affordances and user-provided black-cat sprite. */
.cat-mascot { overflow: visible; display: grid; place-items: center; padding: 3px; border: 1px solid color-mix(in srgb, var(--accent) 58%, var(--line)); border-radius: 28px; background: var(--soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--paper) 72%, transparent), 0 9px 22px color-mix(in srgb, var(--accent-2) 22%, transparent); }
.cat-mascot img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; display: block; border-radius: calc(28px - 4px); object-fit: contain; object-position: center; background: transparent; }
.cat-mascot.is-running img { object-position: center; }
.page-mascot.cat-mascot.is-idle { animation: desktop-mascot-breathe 4.6s ease-in-out infinite; transform-origin: 50% 100%; }
.cat-mascot-rest img { object-position: center 42%; }
.card-title > div { min-width: 0; flex: 1; }
.card-title .card-subtitle { display: none; }
.help-button, .inline-help { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); border-radius: 50%; color: var(--accent-2); background: var(--paper); font-family: "Kiwi Maru", serif; font-weight: 700; }
.help-button:hover, .inline-help:hover { border-color: var(--accent); background: var(--soft); }
.inline-help { width: 25px; height: 25px; margin-left: auto; font-size: .75rem; }
.help-modal { position: relative; display: grid; gap: 18px; padding-top: 32px; }
.help-modal h2 { margin: 0; }
.help-modal p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.85; }
.help-modal p strong { color: var(--ink); font-weight: 700; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--paper); font-size: 1.2rem; }
.help-modal .primary-button { justify-self: end; }

.changelog-link { display: flex; align-items: center; gap: 6px; margin: 16px auto 0; border: none; background: none; color: var(--muted); font-size: .78rem; cursor: pointer; padding: 6px 4px; }
.changelog-link:hover { color: var(--accent-2); }
.changelog-icon { font-size: .9rem; }
.changelog-arrow { font-size: 1rem; margin-left: auto; }
.changelog-list { display: grid; gap: 4px; }
.changelog-entry { padding: 14px 0; border-bottom: 1px solid var(--line); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-entry-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.changelog-version { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--accent-2); font-size: .72rem; font-weight: 700; }
.changelog-date { color: var(--muted); font-size: .68rem; }
.changelog-changes { margin: 0; padding: 0 0 0 18px; display: grid; gap: 4px; }
.changelog-changes li { color: var(--ink); font-size: .8rem; line-height: 1.7; }

@media (max-width: 680px) {
  html, body { min-height: 100%; overflow-x: clip; }
  body.modal-open { position: fixed; width: 100%; overflow: hidden; }
  .modal-backdrop { align-items: center; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  .modal { max-height: calc(100vh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100svh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 22px 18px 18px; border-radius: 20px; touch-action: pan-y; }
  .help-modal { gap: 14px; }
  .help-modal p { line-height: 1.7; }
  .modal-close { position: sticky; top: -12px; z-index: 2; justify-self: end; margin: -8px -5px -34px auto; background: color-mix(in srgb, var(--paper) 94%, transparent); }

  .app-shell { min-height: 100dvh; }
  .mobile-nav { position: fixed !important; inset: auto 10px max(9px, env(safe-area-inset-bottom)) !important; bottom: max(9px, env(safe-area-inset-bottom)) !important; transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0); will-change: transform; backface-visibility: hidden; -webkit-backface-visibility: hidden; contain: paint; }
  .app-main { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
  .help-button { width: 27px; height: 27px; margin-top: 2px; }
  .help-modal .primary-button { width: 100%; }
  .page-head-aside .page-mascot.cat-mascot.is-idle { animation: mobile-mascot-breathe 3.7s ease-in-out infinite !important; transform-origin: 50% 100%; }
}
@keyframes mobile-mascot-breathe { 0%,100% { transform: translateY(0) rotate(-1deg); } 52% { transform: translateY(-3px) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) { .page-mascot.cat-mascot { animation: none !important; } }


/* 上部バー左端の三本線から開く、共通の左ドロワーメニュー。 */
.side-panel { transform: translateX(-105%); transition: transform .22s ease; z-index: 2147482900; width: min(21rem, 88vw); padding-top: 24px; box-shadow: 16px 0 40px rgba(0,0,0,.14); }
body.neo-menu-open .side-panel { transform: translateX(0); }
.app-main { margin-left: 0; }
.neo-menu-toggle { align-self: flex-start; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 22px; line-height: 1; }
.neo-menu-close { width: 34px; height: 34px; margin: 0 0 14px auto; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink); font-size: 23px; line-height: 1; }
.page-head { align-items: flex-start; }
.page-head > div:nth-child(2) { min-width: 0; flex: 1; }
@media (max-width: 700px) { .app-main { padding: 24px 16px 92px; } .page-head { gap: 12px; } .page-head-aside { gap: 8px; } .page-mascot { width: 58px; height: 58px; } .date-stamp { display: none; } }

/* モバイル幅でも、下部タブではなく上部三本線から同じ左ドロワーを使う。 */
.side-panel { display: flex !important; }
.mobile-nav { display: none !important; }


/* Bレビュー: 三本線は見出し幅を奪わず、ページタイトルの開始位置を固定する。 */
.page-head { position: relative; padding-left: 52px; }
.neo-menu-toggle { position: absolute; left: 0; top: 0; }
.page-head h1 { white-space: nowrap; overflow: visible; }
@media (max-width: 430px) { .page-head h1 { font-size: clamp(1.2rem, 5.2vw, 1.42rem); letter-spacing: -.02em; } }


/* 左ドロワー内の更新履歴・問い合わせフォーム導線。 */
.side-support { display: grid; gap: 7px; margin: 24px 0 0; padding-top: 18px; border-top: 1px dashed var(--line); }
.side-support button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--paper-2); color: var(--ink); text-align: left; font-size: .78rem; font-weight: 700; }
.side-support button:hover { background: var(--soft); }
.side-support button span { width: 18px; text-align: center; color: var(--accent-2); }
