:root[data-theme="d"] {
  --bg:#fff; --paper:#fff; --ink:#111214; --muted:#55585e; --ink3:#676a70;
  --line:#e4e5e7; --strong-rule:#cfd1d4; --soft:#f3f3f2; --accent:#111214;
  --accent-ink:#fff; --now:#c73220; --danger:#c73220; --scrim:#1112146b;
}
:root[data-theme="d"][data-color-scheme="dark"] {
  --bg:#121314; --paper:#18191b; --ink:#f1f1ef; --muted:#b4b6ba; --ink3:#a3a5aa;
  --line:#2a2b2d; --strong-rule:#45474c; --soft:#1c1d1f; --accent:#f1f1ef;
  --accent-ink:#121314; --now:#ff6c54; --danger:#ff806b; --scrim:#0009;
}
[data-theme="d"] .app,[data-theme="d"] .top{background:var(--bg)}
[data-theme="d"] .top{padding-top:env(safe-area-inset-top)}
[data-theme="d"] .theme-heading{display:grid;grid-template-columns:44px minmax(0,1fr) 88px 44px;align-items:center;padding:12px max(6px,env(safe-area-inset-right)) 4px max(6px,env(safe-area-inset-left))}
[data-theme="d"] .date-nav{display:contents}
[data-theme="d"] .date-nav button,[data-theme="d"] .toolbar button{background:none;border:0;padding:0}
[data-theme="d"] #previous{grid-column:1;grid-row:1}
[data-theme="d"] #choose-date{grid-column:2;grid-row:1;text-align:left;min-width:0;white-space:nowrap}
[data-theme="d"] #next{grid-column:4;grid-row:1}
[data-theme="d"] .toolbar{grid-column:3;grid-row:1;display:flex}
[data-theme="d"] .toolbar svg{vertical-align:middle}
[data-theme="d"] #open-day-menu svg{transform:rotate(90deg)}
[data-theme="d"] #date-title{font-size:28px;font-weight:800;letter-spacing:-.5px}
[data-theme="d"] #year-title{font-size:20px;font-weight:600;color:var(--muted);margin-left:7px}
[data-theme="d"] :is(#today,#open-backup,#open-settings,.toolbar span,.table-head,.day-foot){display:none}
[data-theme="d"] #theme-overview{position:sticky;top:var(--header-height,60px);z-index:1}
[data-theme="d"] .schedule-overview{padding:7px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));background:var(--bg);border-bottom:2px solid var(--ink)}
[data-theme="d"] .schedule-cells{height:22px}
[data-theme="d"] .schedule-cells i{background:var(--line)}
[data-theme="d"] .schedule-cells .is-booked{background:var(--ink)}
[data-theme="d"] .schedule-cells .joins-previous{margin-left:-2px}
[data-theme="d"] .schedule-now-tick{position:absolute;top:-5px;bottom:-5px;width:3px;background:var(--now);border-radius:2px}
[data-theme="d"] .schedule-scale span:not(:first-child){transform:translateX(-50%)}
[data-theme="d"] .schedule-scale span:last-child{left:auto!important;right:0;transform:none}
[data-theme="d"] .ledger-summary{color:var(--muted);font-size:17px;margin-top:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
[data-theme="d"] .ledger-summary b{color:var(--ink)}
[data-theme="d"] #day-rows{padding-inline:env(safe-area-inset-left) env(safe-area-inset-right);padding-bottom:40px}
[data-theme="d"] .ledger-row{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:stretch;padding:0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:var(--bg);position:relative}
[data-theme="d"] .ledger-time{padding:9px 0 0 16px;font-size:18px;font-variant-numeric:tabular-nums;color:var(--ink3)}
[data-theme="d"] .occupied .ledger-time{color:var(--ink);font-size:20px;font-weight:700}
[data-theme="d"] .ledger-time small{display:block;font-size:18px;font-weight:500;color:var(--ink3);margin-top:20px}
[data-theme="d"] .ledger-body{display:flex;flex-direction:column;justify-content:flex-start;gap:3px;min-width:0;padding:10px 12px;border-left:4px solid var(--ink)}
[data-theme="d"] .long-booking .ledger-body{border-left-width:8px}
[data-theme="d"] .ledger-row .booking-head{flex-wrap:wrap;gap:3px 8px}
[data-theme="d"] .ledger-row .booking-name{font-size:20px}
[data-theme="d"] .ledger-row .booking-project{border:1.5px solid var(--ink);font-weight:700;padding-inline:7px}
[data-theme="d"] .ledger-row .booking-project.pending{border-color:var(--ink3);border-style:dashed;color:var(--muted);font-weight:500}
[data-theme="d"] :is(.ledger-length,.booking-gender){font-size:17px;color:var(--muted);white-space:nowrap}
[data-theme="d"] .empty .ledger-body{border:0;align-items:center;flex-direction:row;color:var(--ink3);padding:0}
[data-theme="d"] .empty .ledger-body i{font-style:normal;padding-inline:1px 5px}
[data-theme="d"] .ledger-row.now{background:color-mix(in srgb,var(--now) 8%,var(--bg))}
[data-theme="d"] .ledger-row.now .ledger-time{color:var(--now);font-weight:750}
[data-theme="d"] .ledger-now{align-self:flex-start;background:var(--now);color:#fff;padding:1px 6px;white-space:nowrap}
[data-theme="d"] .empty .ledger-now{align-self:center;margin-right:5px}
[data-theme="d"] #editor{width:min(100%,540px);max-width:100%;border-radius:0;border-top:3px solid var(--ink)}
[data-theme="d"] #editor::backdrop{background:var(--scrim)}
[data-theme="d"] #editor .sheet-head{padding:10px 16px;border-bottom:1px solid var(--line)}
[data-theme="d"] #edit-title{font-size:24px}
[data-theme="d"] #edit-time{font-size:17px}
[data-theme="d"] .editor-fields{padding:0 16px}
[data-theme="d"] .editor-field{display:grid;grid-template-columns:64px minmax(0,1fr);padding:12px 0;border-bottom:1px solid var(--line);position:relative}
[data-theme="d"] .editor-field>*{grid-column:2}
[data-theme="d"] .editor-field>:is(label,.editor-label){grid-column:1;grid-row:1;padding-top:9px;color:var(--muted)}
[data-theme="d"] .editor-field>label#duration-controls{grid-column:2;grid-row:auto}
[data-theme="d"] #field-project{min-height:98px}
[data-theme="d"] #field-project .field-heading{display:contents}
[data-theme="d"] #field-project .field-heading label{grid-column:1;grid-row:1;padding-top:9px;color:var(--muted)}
[data-theme="d"] #field-project #custom-project{position:absolute;left:0;top:50px;padding:2px 0}
[data-theme="d"] #field-project #project{grid-column:2;grid-row:2;margin-top:6px}
[data-theme="d"] :is(#quick-projects,.editor-fields .segmented){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
[data-theme="d"] #quick-projects button,[data-theme="d"] .editor-fields .segmented label{background:none;border:1.5px solid var(--strong-rule);border-radius:0;min-width:0;min-height:46px;font-size:17px;font-weight:650;padding:4px}
[data-theme="d"] #quick-projects button.pending{border-style:dashed}
[data-theme="d"] #quick-projects button.selected,[data-theme="d"] .editor-fields .segmented label:has(input:checked){color:var(--accent-ink);background:var(--ink);border-color:var(--ink)}
[data-theme="d"] .duration-rail-label{display:none}
[data-theme="d"] .duration-paper-label{font-size:0}
[data-theme="d"] .duration-paper-label::after{content:"时长";font-size:17px}
[data-theme="d"] .slot-stepper button{border:1.5px solid var(--strong-rule);border-radius:0;background:none}
[data-theme="d"] .slot-stepper output{min-width:76px;border-block:1.5px solid var(--strong-rule)}
[data-theme="d"] .ledger-duration-map{margin-top:10px;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;height:14px}
[data-theme="d"] .ledger-duration-map i{background:var(--line)}
[data-theme="d"] .ledger-duration-map .is-selected{background:var(--ink)}
[data-theme="d"] .ledger-duration-map .is-booked{background:repeating-linear-gradient(45deg,var(--strong-rule) 0 3px,transparent 3px 6px)}
[data-theme="d"] #duration-help{line-height:1.3}
[data-theme="d"] #field-gender{display:block;padding-left:64px;min-width:0}
[data-theme="d"] #field-gender legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
[data-theme="d"] .ledger-gender-label{display:block;position:absolute;left:0;top:23px;color:var(--muted);font-size:17px;font-weight:650}
[data-theme="d"] #field-gender .segmented{grid-column:1;gap:0}
[data-theme="d"] .editor-fields :is(input:not([type=radio]),textarea){border-radius:0;background:none;font-size:18px}
[data-theme="d"] #field-contact input{border:0;border-bottom:2px solid var(--ink);padding-inline:2px}
[data-theme="d"] #field-notes textarea{resize:none;border-color:var(--strong-rule)}
[data-theme="d"] #delete-appointment{margin-block:10px 6px;border:0;padding-inline:0}
[data-theme="d"] #editor .editor-actions{display:grid;grid-template-columns:1fr 2fr;gap:8px;padding-inline:16px}
[data-theme="d"] #editor .editor-actions button{min-height:52px;border-radius:0;font-size:19px}
[data-theme="d"] #save-appointment{background:var(--ink);color:var(--accent-ink);border-color:var(--ink)}
