:root {
  font-family: "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  color: #f5f3ed;
  background: #0a0a0f;
  color-scheme: dark;
  --text: #f5f3ed;
  --muted: #aeb7c9;
  --gold: #edc785;
  --line: #30374b;
  --panel: #141827;
  --hover: #202639;
}
* { box-sizing: border-box; }
#preset-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:16px 0; }
.budget-preset,.session-button { border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--text); padding:11px; }
.budget-preset small { display:block; color:var(--muted); margin-top:4px; }
.budget-preset[aria-pressed="true"],.session-button { border-color:var(--gold); color:var(--gold); }
#session-bar { margin-top:12px; }
.session-button { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; max-width:100%; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  min-height: 100dvh;
  background: radial-gradient(ellipse at 76% -8%, #1a2549 0%, #111424 33%, #0a0a0f 72%);
}
aside {
  display: flex;
  flex-direction: column;
  padding: 34px 18px 24px;
  background: #0d1019b8;
  border-right: 1px solid #30374b80;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 11px; font-family: "Songti SC", SimSun, serif; font-size: 23px; font-weight: 700; }
.brand-mark { position: relative; width: 13px; height: 13px; flex: none; border: 1px solid var(--gold); transform: rotate(45deg); }
.brand-mark::after { content: ""; position: absolute; inset: 3px; background: var(--gold); }
nav { display: grid; gap: 5px; margin-top: 36px; }
nav button, .secondary-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
}
nav button:hover, .secondary-nav button:hover, .plain:hover { background: var(--hover); }
[data-view][aria-current] { color: var(--gold); background: #232534; border-color: #3e3a40; }
.secondary-nav { display: grid; gap: 4px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.secondary-nav .tool-link { min-height: 38px; color: var(--muted); }
.nav-icon { width: 15px; height: 15px; position: relative; flex: none; }
.today-icon { border: 1px solid currentColor; border-radius: 50%; }
.today-icon::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: currentColor; }
.list-icon::before { content: ""; position: absolute; width: 12px; height: 1px; top: 3px; left: 1px; background: currentColor; box-shadow: 0 4px currentColor, 0 8px currentColor; }
.habit-icon { border: 1px solid currentColor; border-radius: 4px; }
.habit-icon::after { content: ""; position: absolute; inset: 4px 3px 0; border-top: 1px solid currentColor; }
.local { margin: auto 0 0; padding: 24px 11px 0; color: var(--muted); font-size: .75rem; }
main { min-width: 0; padding: clamp(30px, 6vw, 83px) clamp(22px, 7vw, 110px) 52px; }
main > * { max-width: 790px; margin-inline: auto; }
.day-header { padding: 0 0 26px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.date { margin: 0 0 13px; color: var(--gold); font-size: .8125rem; letter-spacing: .1em; font-weight: 600; }
h1 { margin: 0; font-family: "Songti SC", "Noto Serif SC", SimSun, serif; font-size: clamp(2.5rem, 5.5vw, 4.6rem); letter-spacing: -.035em; line-height: 1.15; font-weight: 700; }
.summary { margin: 13px 0 0; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.summary:empty { display: none; }
.focus-card, .load-card {
  background: #141827;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: clamp(16px, 4vw, 25px);
  margin-bottom: 16px;
}
.focus-card { background: linear-gradient(120deg, #20253a, #141827 78%); }
.focus-status, .load-heading, .load-metrics { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.focus-status h2, .load-heading h2 { margin: 0; font-size: .875rem; font-weight: 650; }
.focus-status h2 { color: var(--gold); }
.focus-status button { color: var(--muted); font-size: .8125rem; }
#focus-task { margin: 6px 0 7px; font-size: clamp(1.3rem, 4vw, 2.25rem); font-family: "Songti SC", "Noto Serif SC", SimSun, serif; font-weight: 700; overflow-wrap: anywhere; }
#focus-detail, .load-metrics p, .load-date { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.45; }
#open-focus-task { padding-left: 0; min-height: 38px; margin: 5px 0 -5px; }
.load-heading h2 { font-size: 1.125rem; }
.load-card { margin-bottom: 12px; }
.load-metrics { margin-top: 4px; }
.load-metrics button { flex: none; }
.load-warning { margin: 0 0 8px; color: #f2bc9e; font-size: .875rem; }
.load-details summary { color: var(--muted); padding: 9px 0; font-size: .875rem; cursor: pointer; }
.demo-state { color: var(--muted); font-size: .75rem; }
#add-task { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 15px; border: 1px solid var(--line); border-radius: 11px; background: #1b2134; }
#add-task:focus-within { border-color: #8c7759; }
.add-icon { color: var(--gold); font-size: 1.35rem; line-height: 1; }
#add-task input { width: 100%; min-width: 0; border: 0; padding: 8px 3px; color: var(--text); background: transparent; }
#add-task input:focus-visible { outline-offset: 0; }
input::placeholder { color: var(--muted); }
button[type="submit"] { white-space: nowrap; min-height: 40px; border: 0; border-radius: 7px; background: var(--gold); color: #201913; padding: 8px 15px; font-size: .875rem; font-weight: 650; }
button[type="submit"]:hover { background: #f9dba5; }
#notice { margin-block: 5px 19px; color: var(--muted); font-size: .8125rem; }
#notice:empty { margin-block: 0 23px; }
.capture-detail { margin-left: 5px; }
.task-section { margin-bottom: 24px; }
.task-section h2, .departure h2 { font-size: 1rem; font-weight: 650; margin: 0 0 9px; }
.rows { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; }
.overdue .rows { background: #1b1921; border-color: #3a323d; }
.overdue .row-meta { color: #dfb58b; }
.row { display: flex; align-items: center; min-height: 57px; padding-left: 6px; gap: 1px; }
.row + .row { border-top: 1px solid var(--line); }
.check { position: relative; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: transparent; padding: 0; }
.check::before { content: ""; position: absolute; inset: 12px; border: 1px solid #8b95ab; border-radius: 50%; }
.check[aria-pressed="true"]::before { background: var(--gold); border-color: var(--gold); }
.check[aria-pressed="true"]::after { content: ""; position: absolute; inset: 18px 17px 19px; border: solid #201913; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.check:hover::before { border-color: var(--gold); }
.row-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; flex: 1; align-self: stretch; align-content: center; text-align: left; background: transparent; border: 0; padding: 10px 15px 10px 5px; color: inherit; }
.row-detail:focus-visible, .check:focus-visible { outline-offset: -3px; }
.row-detail:hover { background: #ffffff0a; }
.row-title, .row-meta { overflow-wrap: anywhere; grid-column: 1; }
.row-title { font-weight: 550; }
.row-meta, .empty { color: var(--muted); font-size: .8125rem; }
.chevron { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); }
.empty { margin: 0; padding: 16px; }
.departure { margin-top: 25px; padding: 15px 20px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); }
.departure h2 { margin: 0; }
.departure-heading, .dialog-header, .plan-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#departure-action { margin: 4px 0; font-size: 1.125rem; font-weight: 650; }
#departure-times, #departure-task { margin: 8px 0 0; font-size: .875rem; color: var(--muted); line-height: 1.55; }
#departure-times:empty, #departure-task:empty { display: none; }
#departure-task { color: var(--gold); overflow-wrap: anywhere; }
dialog { width: min(580px, calc(100% - 24px)); max-height: 90dvh; border: 1px solid var(--line); border-radius: 15px; padding: clamp(16px, 4vw, 30px); color: inherit; background: #171b2b; box-shadow: 0 22px 65px #0007; }
dialog::backdrop { background: #070911b8; }
.dialog-header { margin-bottom: 12px; }
.dialog-header h2, .plan-heading h3 { margin: 0; font-size: 1rem; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .8125rem; }
dialog input:not([type="checkbox"]) { min-height: 42px; padding: 8px 10px; min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #101423; color: var(--text); font-size: .875rem; }
dialog input.detail-title { font-size: 1.2rem; font-weight: 650; }
.dates, .departure-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px; margin-top: 12px; }
.dates:has(category-picker) { align-items: start; }
category-picker {
  --picker-accent: var(--gold);
  --picker-background: #101423;
  --picker-border: var(--line);
  --picker-highlight: #262b40;
  --picker-radius: 7px;
  display: block;
  position: relative;
  min-width: 0;
}
.picker-label { margin-bottom: 6px; color: var(--muted); font-size: .8125rem; }
.picker-field { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 42px; border: 1px solid var(--picker-border); border-radius: var(--picker-radius); background: var(--picker-background); }
.picker-field:focus-within { border-color: var(--picker-accent); }
dialog .picker-field input[type="text"] { flex: 1 1 112px; min-height: 40px; width: auto; border: 0; border-radius: var(--picker-radius); background: transparent; }
.picker-field input:focus-visible { outline-offset: -3px; }
.picker-chip { display: flex; align-items: center; gap: 2px; max-width: calc(100% - 8px); margin: 4px; padding-left: 8px; border-radius: 5px; background: var(--picker-highlight); color: var(--picker-accent); font-size: .8125rem; }
.picker-chip span { overflow-wrap: anywhere; }
.picker-chip button { min-width: 28px; min-height: 30px; border: 0; border-radius: 5px; background: transparent; color: inherit; font-size: 1rem; }
.picker-chip button:hover { background: #ffffff12; }
.picker-popup { position: absolute; z-index: 2; inset: calc(100% + 5px) 0 auto; border: 1px solid var(--picker-border); border-radius: var(--picker-radius); background: var(--picker-background); box-shadow: 0 12px 28px #0008; }
.picker-results { max-height: 170px; overflow-y: auto; padding: 3px; }
.picker-results:empty { display: none; }
.picker-option { padding: 9px 8px; border-radius: 4px; cursor: pointer; font-size: .875rem; overflow-wrap: anywhere; }
.picker-option:hover, .picker-option.active { background: var(--picker-highlight); }
.picker-option[aria-selected="true"] { color: var(--picker-accent); }
.picker-empty { padding: 9px 11px 2px; color: var(--muted); font-size: .8125rem; }
.departure-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-heading { margin: 20px 0 9px; }
.hint { color: var(--muted); font-size: .8125rem; line-height: 1.5; margin: 8px 0 15px; }
.step, .quick-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, .58fr) auto; align-items: center; gap: 6px; margin-top: 8px; }
.step { grid-template-columns: minmax(0, 1fr) minmax(116px, .58fr) minmax(63px, .35fr) auto; }
.quick-step { grid-template-columns: minmax(0, 1fr) auto; }
.project-field, .estimate-field { margin-top: 12px; }
.icon-button, .plain { min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--gold); padding: 8px; }
.icon-button { font-size: 21px; line-height: 1; min-width: 34px; }
.icon-button:hover { background: var(--hover); }
.danger, #edit-error, #habit-error, #departure-error { color: #ffaaa3; }
#edit-error, #habit-error, #departure-error { font-size: .8125rem; }
.dialog-actions { border-top: 1px solid var(--line); padding-top: 12px; }
.habit-days { display: flex; gap: 8px; flex-wrap: wrap; margin: 15px 0; border: 1px solid var(--line); border-radius: 8px; }
.habit-days label { display: flex; align-items: center; min-height: 34px; gap: 4px; }
.habit-days input { accent-color: var(--gold); }
@media (max-width: 700px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  aside { padding: max(8px, env(safe-area-inset-top)) 14px 5px; gap: 4px 10px; align-items: center; justify-content: space-between; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { font-size: 19px; padding: 0 3px; }
  nav {
    position: fixed;
    z-index: 4;
    inset: auto 0 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 5px 13px max(5px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #111424f5;
  }
  nav button { flex-direction: column; justify-content: center; padding: 6px 4px; gap: 4px; min-height: 52px; font-size: .75rem; white-space: nowrap; }
  .secondary-nav { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; border: 0; }
  .secondary-nav button, .secondary-nav .tool-link { padding: 4px 7px; gap: 0; min-height: 40px; font-size: .75rem; }
  .secondary-nav .nav-icon { display: none; }
  .local { display: none; }
  main { padding: 24px 16px calc(93px + env(safe-area-inset-bottom)); }
  .day-header { margin-bottom: 14px; padding-bottom: 15px; }
  .date { margin-bottom: 7px; }
  .summary { margin-top: 8px; }
  .focus-status button { min-height: 36px; }
}
@media (max-width: 460px) {
  .step { grid-template-columns: minmax(118px, 1fr) minmax(63px, .55fr) auto; }
  .step input:first-child { grid-column: 1 / -1; }
}
