:root {
  color-scheme: light;
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  color: #19253a;
  background: #f5f7fb;
  --navy: #182742;
  --muted: #566578;
  --line: #e0e6ef;
  --blue: #315ca4;
  --danger: #ad2d3a;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #547cc7; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h2 { font-size: 1.18rem; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1280px; margin: auto; min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 40px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand > span { font-size: 1.35rem; font-weight: 850; letter-spacing: .135em; line-height: 1.02; }
.brand small { display: block; margin-top: 5px; font-size: .72rem; letter-spacing: .07em; color: var(--muted); }
.shop { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 48%; padding: 7px 12px; color: #32445f; border: 1px solid var(--line); background: #f8fafd; border-radius: 9px; font-weight: 650; font-size: .875rem; }
.shop svg { flex: none; }.shop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { width: min(100%, 1120px); min-height: 72vh; margin: auto; padding: 38px 28px calc(105px + env(safe-area-inset-bottom)); }
main:focus { outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 25px; gap: 12px; }
.eyebrow { color: var(--blue); font-size: .78rem; letter-spacing: .15em; font-weight: 820; margin-bottom: 8px; }
h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); letter-spacing: -.03em; line-height: 1.12; }
.subtitle { margin-top: 10px; font-size: .925rem; color: var(--muted); }
button.primary, button.secondary, button.danger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; padding: 0 15px; min-height: 44px; font-size: .9rem; font-weight: 750; white-space: nowrap; }
button.primary { background: var(--navy); color: white; box-shadow: 0 2px 4px #15244226; }
button.primary:hover { background: #263c61; }
button.secondary { background: white; color: var(--navy); border-color: var(--line); }
button.secondary:hover { background: #eff4fb; }
button.danger { background: var(--danger); color: white; }
button:disabled { cursor: wait; opacity: .65; }
.hero { min-height: 149px; border-radius: 15px; overflow: hidden; position: relative; isolation: isolate; padding: 27px 30px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 32px; background: #172641; color: white; box-shadow: 0 6px 15px #15244220; }
.hero::before { content: ""; z-index: -1; position: absolute; inset: 0; background: radial-gradient(ellipse at 100% 0%, #35507780, transparent 70%), repeating-linear-gradient(128deg, transparent 0 31px, #ffffff09 32px 33px, transparent 34px 46px); mask-image: linear-gradient(90deg, transparent 35%, black); }
.hero-content p { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 680; color: #d3def0; }
.hero-content p span { margin-left: 3px; font-size: .75rem; color: #dce7ff; border: 1px solid #7183a2; padding: 2px 6px; border-radius: 4px; }
.hero h2 { margin-top: 9px; font-size: clamp(1.46rem, 3.2vw, 2.1rem); letter-spacing: -.02em; }
.hero-progress { background: #ffffff0d; padding: 15px 17px; border-radius: 10px; border: 1px solid #ffffff25; }
.progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .85rem; }
.progress-label span { white-space: nowrap; color: #dce5f4; }
.progress-label b { color: white; font-size: 1.1rem; }
progress { width: 100%; height: 7px; margin-top: 10px; display: block; accent-color: #9bbaff; border-radius: 999px; border: 0; background: #576a8a; }
progress::-webkit-progress-bar { background: #576a8a; border-radius: 999px; }
progress::-webkit-progress-value { background: #9bbaff; border-radius: 999px; }
.section-heading { margin: 29px 0 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 21px; }
.metric { --tone: #335da6; --tint: #ecf2fd; min-width: 0; display: flex; flex-direction: column; text-align: left; gap: 7px; padding: 14px 16px; background: #fff; color: #26354b; border: 1px solid var(--line); border-radius: 12px; min-height: 119px; }
.metric.overdue { --tone: #ab3443; --tint: #fbe9eb; background: #fff6f6; border-color: #f1c7ce; }
.metric.today { --tone: #965014; --tint: #fff0dd; }
.metric.done { --tone: #26704f; --tint: #e7f5ed; }
.metric:hover, .metric[aria-pressed="true"] { border-color: var(--tone); }
.metric[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--tone); }
.metric-top { display: flex; justify-content: space-between; align-items: center; width: 100%; color: var(--tone); }
.metric-icon, .empty-icon { display: grid; place-items: center; background: var(--tint, #edf2fa); color: var(--tone, #537099); border-radius: 9px; width: 34px; height: 34px; }
.metric-name { font-size: .875rem; font-weight: 750; }
.metric > strong { font-size: 1.62rem; line-height: 1; font-variant-numeric: tabular-nums; }
.metric.overdue > strong { color: var(--tone); }
.metric small { color: var(--muted); font-size: .77rem; font-weight: 650; }
.panel { background: white; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.panel-head { min-height: 63px; padding: 13px 19px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.panel-head p { color: var(--muted); font-size: .83rem; margin-top: 4px; }
.text-link { color: var(--blue); font-weight: 750; font-size: .875rem; padding: 12px 4px; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.empty { min-height: 145px; padding: 20px; display: grid; gap: 9px; place-content: center; justify-items: center; text-align: center; color: var(--muted); font-size: .9rem; }
.empty-icon { width: 43px; height: 43px; }
.count { font-size: .85rem; color: var(--muted); }
.task-list, .category-list { padding: 0; margin: 0; list-style: none; }
.task-row { display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 8px 19px; min-height: 65px; }
.task-row + .task-row, .category-list li + li { border-top: 1px solid #edf0f5; }
.task-title { text-align: left; border: 0; padding: 7px 0; background: none; color: inherit; min-height: 44px; overflow-wrap: anywhere; }
.task-title:hover strong { text-decoration: underline; }
.task-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; color: var(--muted); font-size: .82rem; margin-top: 3px; }
.completion-note { display: block; margin-top: 4px; color: var(--muted); white-space: pre-wrap; }
.late { color: var(--danger); font-weight: 750; }.due-today { color: #965014; }
.check-button { display: grid; place-items: center; min-width: 44px; height: 44px; background: white; border: 1px solid #c5d1e0; color: #526b8a; border-radius: 10px; }
.check-button:hover, .check-button.is-done { color: #1e6547; background: #e8f6ee; border-color: #a5cdb7; }
.badge { min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 0 10px; font-size: .875rem; white-space: nowrap; font-weight: 700; }
.badge:hover { border-color: currentColor; }
.badge.todo { background: #eaf1fd; color: #285490; }.badge.doing { background: #f0eafd; color: #633e9c; }.badge.hold { background: #edf0f4; color: #4e5866; }.badge.done { background: #e6f5ec; color: #226847; }
.bottom { position: fixed; z-index: 2; inset: auto 0 0; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px #26394f09; }
.bottom > div { margin: auto; max-width: 670px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bottom a { min-height: 66px; display: flex; gap: 9px; align-items: center; justify-content: center; padding: 6px 2px; color: #5a6980; border-top: 3px solid transparent; }
.bottom a[aria-current="page"] { color: #244d91; border-color: #315ca4; background: #f1f5fd; }
.bottom a:hover { background: #f3f6fa; }.bottom strong, .bottom small { display: block; }
.bottom strong { font-size: .72rem; letter-spacing: .065em; }.bottom small { font-size: .76rem; margin-top: 2px; }
.settings-panel + .settings-panel { margin-top: 16px; }
.settings-body { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 16px 19px; }
.settings-body > label { width: min(100%, 320px); }.settings-body .field-error { width: 100%; }
.app-info { display: grid; gap: 5px; }.app-info p { color: var(--muted); }
.category-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 19px; overflow-wrap: anywhere; }
.swatch { width: 15px; height: 15px; border-radius: 50%; background: var(--category); border: 1px solid #0004; }
label { display: grid; gap: 5px; min-width: 0; font-weight: 700; font-size: .9rem; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #bfcbdb; color: #19253a; background: white; border-radius: 8px; font-size: 1rem; font-weight: 450; }
select { appearance: none; padding-right: 28px; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23566578' stroke-width='1.5'/%3E%3C/svg%3E") right 10px center / 12px 8px no-repeat; }
input[type="color"] { width: 72px; } textarea { resize: vertical; }
dialog { padding: 0; width: min(510px, calc(100% - 24px)); max-height: 92dvh; border: 1px solid var(--line); border-radius: 14px; color: inherit; background: white; box-shadow: 0 20px 70px #0b16304d; }
dialog::backdrop { background: #111c36a0; }
.dialog-head, .dialog-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 16px; background: white; }
.dialog-head { border-bottom: 1px solid var(--line); }.dialog-actions { border-top: 1px solid var(--line); justify-content: flex-end; position: sticky; bottom: 0; }
.close { background: none; border: 0; color: var(--muted); font-size: 1.5rem; width: 44px; height: 44px; border-radius: 8px; }.close:hover { background: #edf2f8; }
.dialog-body { display: grid; gap: 13px; padding: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dialog-item { font-weight: 780; overflow-wrap: anywhere; }
.record-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .79rem; }
.danger-link { width: fit-content; padding: 0; min-height: 44px; color: var(--danger); background: none; border: 0; font-weight: 720; text-decoration: underline; }
.field-error { color: var(--danger); font-size: .875rem; }.field-error:empty { display: none; }
.toast { position: fixed; z-index: 4; bottom: calc(78px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px); width: max-content; color: white; background: var(--navy); padding: 11px 16px; border-radius: 9px; box-shadow: 0 3px 12px #111c3550; }
.load-error { padding: 25px; }
@media (max-width: 600px) {
  .top-inner { min-height: 62px; padding-inline: 16px; }
  main { padding: 24px 14px calc(88px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; align-items: start; }
  .page-head > button { margin-top: 13px; padding-inline: 9px; }
  .subtitle { font-size: .875rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding: 17px; gap: 12px; }
  .hero-progress { padding: 10px 12px; }.hero h2 { margin-top: 6px; }
  .section-heading { margin-top: 19px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .metric { padding: 9px 11px; min-height: 101px; gap: 5px; }
  .panel-head, .task-row { padding-inline: 11px; }
  .task-row { gap: 8px; }.badge { padding-inline: 6px; }
  .bottom a { flex-direction: column; gap: 2px; text-align: center; min-height: 62px; }
  .bottom small { margin-top: 0; }
}
.task-category { display: inline-flex; align-items: center; gap: 5px; }
.task-category .swatch { width: 8px; height: 8px; flex: none; }
.editor-group, .completion-confirm { border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; min-width: 0; }
.editor-group summary, .settings-group summary { cursor: pointer; font-weight: 750; min-height: 44px; padding: 11px 0; }
.editor-group[open], .completion-confirm { padding-bottom: 12px; }
.editor-group[open] > summary { margin-bottom: 6px; }
.editor-group > label, .editor-group > p { margin-bottom: 10px; }
.editor-group summary span { color: var(--muted); font-size: .85rem; margin-left: 6px; }
.field-stack, .automation-settings { display: grid; gap: 12px; min-width: 0; }
.automation-settings { padding: 15px 19px 19px; }
.automation-settings > button { justify-self: start; }
.automation-settings > label:not(.check-label) { width: min(100%, 320px); }
.settings-group summary { padding-inline: 19px; }
.settings-group summary h2 { display: inline; margin-left: 3px; }
.settings-group[open] summary { border-bottom: 1px solid var(--line); }
.field-hint { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.deadline-detail { display: grid; gap: 4px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: .9rem; }
.day-checks { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.check-label { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.check-label input, .subtask-entry input[type="checkbox"] { flex: none; width: 21px; height: 21px; min-height: 0; accent-color: var(--blue); }
.schedule-preview { background: #f1f5fd; border-radius: 8px; padding: 9px 12px; font-size: .84rem; }
.schedule-preview ol { margin: 6px 0 0; padding-left: 20px; }
.schedule-preview li + li { margin-top: 5px; }
.subtask-list { list-style: none; padding: 0; margin: 0; }
.subtask-list li { display: grid; gap: 5px; padding: 7px 0; }
.subtask-list li + li { border-top: 1px solid var(--line); }
.subtask-entry { display: flex; gap: 8px; align-items: center; }
.subtask-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.subtask-actions button { min-height: 36px; padding-inline: 8px; }
.work-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.work-day { display: flex; flex-direction: column; background: #eff4fb; border-radius: 5px; padding: 3px 1px; color: #285490; }
.work-day.closed { background: #fff0f0; color: #922d39; }
.work-day.unknown { background: #fff0dc; color: #795116; }
.work-day small { font-size: .72rem; }
@media (max-width: 380px) {
  .automation-settings .form-grid { grid-template-columns: 1fr; }
  .dialog-actions { flex-wrap: wrap; }
}
.data-summary { margin: 0; }
.data-summary > div { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.data-summary dt { font-weight: 700; }
.data-summary dd { margin: 0; overflow-wrap: anywhere; }
.data-actions, .recovery-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.recovery-actions { margin-top: 12px; }
#recovery-result { margin-top: 12px; }
#data-panel input[type="file"] { display: block; padding: 8px; }
#data-panel .automation-settings > label { width: 100%; }
.calendar-controls { display: grid; gap: 11px; padding: 15px; }
.calendar-modes { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; background: #f0f3f8; border-radius: 10px; }
.calendar-modes button { min-height: 39px; padding: 4px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--navy); font-weight: 700; }
.calendar-modes button[aria-pressed="true"] { background: var(--navy); color: white; }
.calendar-period { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.calendar-period > .secondary { padding-inline: 9px; min-width: 44px; }
.calendar-prev svg { transform: rotate(180deg); }
.calendar-jump { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; color: var(--navy); background: transparent; border: 0; min-height: 44px; min-width: 0; padding: 4px; border-radius: 7px; font-size: clamp(.89rem, 2.7vw, 1.24rem); font-weight: 800; }
.calendar-jump:hover { background: #f0f3f8; }
.calendar-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.calendar-options label { display: flex; align-items: center; gap: 6px; }
.calendar-options select { min-width: 104px; }
.calendar-filters { border-top: 1px solid var(--line); padding-top: 7px; }
.calendar-filters summary { cursor: pointer; font-weight: 680; padding: 5px 0; color: var(--navy); }
.calendar-filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 8px; padding-top: 8px; }
.calendar-filter-fields button { justify-self: start; }
.calendar-body { touch-action: pan-y; }
.calendar-month { border-collapse: collapse; table-layout: fixed; width: 100%; }
.calendar-month th { background: #f5f7fa; color: var(--muted); border: 1px solid var(--line); height: 31px; font-size: .8rem; }
.calendar-month th.sun { color: #963437; } .calendar-month th.sat { color: #31578a; }
.calendar-cell { width: calc(100% / 7); height: 113px; vertical-align: top; padding: 2px; border: 1px solid var(--line); background: #fff; }
.calendar-cell.closed { background: #fff5f5; }
.calendar-cell.unknown { background: #fffbef; }
.calendar-cell.calendar-out { background: #f5f7fa; }
.calendar-cell.calendar-today { box-shadow: inset 0 0 0 2px #45699c; background: #eef4ff; }
.calendar-cell-top { display: flex; align-items: start; justify-content: space-between; gap: 0; }
.calendar-cell-top button { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; min-width: 23px; max-width: 100%; padding: 1px 3px; border: 0; border-radius: 5px; background: transparent; color: var(--navy); font-weight: 750; }
.calendar-out .calendar-cell-top button { color: var(--muted); }
.calendar-today .calendar-cell-top button { background: var(--navy); color: white; }
.calendar-closed, .calendar-open { flex: none; font-size: .67rem; border-radius: 4px; padding: 2px 1px; color: #922d39; background: #ffe6e7; }
.calendar-open { color: #275643; background: #e1f3e9; }
.calendar-holiday { display: block; color: #922d39; font-size: .64rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.calendar-cell-items { display: grid; gap: 2px; min-width: 0; }
.calendar-chip { display: grid; gap: 1px; width: 100%; min-width: 0; border: 1px solid #d8e0ec; border-inline-start: 3px solid var(--accent); border-radius: 5px; background: #f6f8fc; padding: 2px; color: #1a2a42; text-align: left; font-size: .7rem; }
.chip-title { display: block; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.chip-symbols { display: inline; margin-inline-end: 2px; color: #355783; font-weight: 800; }
.calendar-chip.late-chip .chip-symbols { color: #98313c; }
.calendar-chip.done { background: #edf4ef; }
.calendar-chip.done strong { color: #466454; text-decoration: line-through; }
.calendar-chip.projected { border-block-style: dashed; border-inline-end-style: dashed; }
.chip-meta { font-size: .65rem; line-height: 1.2; color: #4b5e79; overflow-wrap: anywhere; }
.chip-meta:empty { display: none; }
.calendar-cell .chip-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.calendar-cell .calendar-chip { min-height: 27px; }
.calendar-cell .chip-meta { overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-more { display: block; width: 100%; min-height: 24px; border: 0; border-radius: 4px; padding: 0; background: transparent; color: #244778; font-size: .63rem; text-align: left; overflow-wrap: anywhere; }
.calendar-more:hover, .calendar-cell-top button:hover { background: #dfe9f7; color: var(--navy); }
.calendar-wide-row, .calendar-wide-more { display: none; }
.calendar-agenda { display: grid; gap: 9px; padding: 0 14px 13px; }
.calendar-agenda-day { min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.calendar-agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; background: #f5f7fa; }
.calendar-agenda-day.closed .calendar-agenda-head { background: #fff1f2; }
.calendar-agenda-day.unknown .calendar-agenda-head { background: #fff7e7; }
.calendar-agenda-head h3 { font-size: .92rem; margin: 0; }
.calendar-agenda-head p, .calendar-no-tasks { font-size: .82rem; color: var(--muted); }
.calendar-agenda-items { display: grid; gap: 6px; padding: 7px; }
.calendar-agenda .calendar-chip { min-height: 43px; padding: 6px 8px; font-size: .91rem; }
.calendar-agenda .chip-meta { font-size: .77rem; }
.calendar-no-tasks { margin: 9px; }
.calendar-notes { display: grid; gap: 4px; padding: 10px 14px 13px; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.calendar-warning { color: #774a17; }
.calendar-detail { display: grid; gap: 9px; overflow-wrap: anywhere; }
.calendar-detail h3, .calendar-detail .eyebrow { margin: 0; }
.calendar-detail-text { white-space: pre-wrap; }
.calendar-checklist { margin: 4px 0; padding-left: 18px; }
@media (min-width: 760px) {
  .calendar-controls { grid-template-columns: minmax(160px, 1fr) minmax(265px, 1.25fr) auto; align-items: center; }
  .calendar-filters { grid-column: 1 / -1; }
}
@media (min-width: 650px) {
  .calendar-filter-fields { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
  .calendar-agenda.week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-cell { height: 131px; padding: 4px; }
  .calendar-holiday { font-size: .77rem; }
  .calendar-chip { padding: 3px 4px; font-size: .78rem; }
  .calendar-more { font-size: .73rem; }
  .calendar-wide-row, .calendar-wide-more { display: block; }
  .calendar-narrow-more, .calendar-more-narrow { display: none; }
}
@media (max-width: 360px) {
  .calendar-cell { padding: 1px; }
  .calendar-cell .calendar-chip { padding: 1px; border-inline-start-width: 2px; font-size: .64rem; }
}
