:root[data-theme="e"] {
  --bg:#eef0f2; --paper:#fff; --ink:#15181c; --muted:#5b616a; --ink3:#6d757f;
  --line:#d5d9de; --rail:#b9bec5; --now:#c74b12; --accent:#15181c;
  --soft:#e3e6ea; --danger:#c33120; --save-ink:#fff; --scrim:#15181c73;
  --cut:#2e6bd9; --wash:#057b82; --perm:#a96c00; --dye:#b22e69; --care:#277945; --pending:#68717d;
}
:root[data-theme="e"][data-color-scheme="dark"] {
  --bg:#0e1013; --paper:#191c20; --ink:#eef0f2; --muted:#a6acb4; --ink3:#9a9fa8;
  --line:#31373e; --rail:#424952; --now:#ff7a3d; --accent:#eef0f2;
  --soft:#272b31; --danger:#ff8a79; --save-ink:#0e1013; --scrim:#0009;
  --cut:#77a5ff; --wash:#3cc3c8; --perm:#f0a93a; --dye:#ea6aa4; --care:#62c27a; --pending:#a9b0b9;
}
[data-theme="e"] .app,[data-theme="e"] .top{background:var(--bg)}
[data-theme="e"] .top{padding-top:env(safe-area-inset-top)}
[data-theme="e"] .theme-heading{display:flex;align-items:center;padding:7px max(6px,env(safe-area-inset-right)) 6px max(16px,env(safe-area-inset-left))}
[data-theme="e"] .date-nav{flex:1;display:grid;grid-template-columns:minmax(0,1fr) 44px 44px}
[data-theme="e"] .date-nav button,[data-theme="e"] .toolbar button{border:0;background:none;padding:4px}
[data-theme="e"] #choose-date{grid-column:1;grid-row:1;min-width:0;text-align:left;padding:0}
[data-theme="e"] #previous{grid-column:2;grid-row:1}
[data-theme="e"] #next{grid-column:3;grid-row:1}
[data-theme="e"] #date-title{display:block;font-size:27px;white-space:nowrap;font-weight:800;letter-spacing:-.6px;line-height:1.05}
[data-theme="e"] #year-title{display:block;font-size:17px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
[data-theme="e"] #year-title b{color:var(--ink)}
[data-theme="e"] .toolbar{display:flex;align-items:center}
[data-theme="e"] :is(#today,#open-backup,#open-settings,.toolbar button span,.table-head,.day-foot){display:none}
[data-theme="e"] #day-rows{padding:2px max(12px,env(safe-area-inset-right)) 24px env(safe-area-inset-left)}
[data-theme="e"] .cut{--project-color:var(--cut)}
[data-theme="e"] .wash{--project-color:var(--wash)}
[data-theme="e"] .perm{--project-color:var(--perm)}
[data-theme="e"] .dye{--project-color:var(--dye)}
[data-theme="e"] .care{--project-color:var(--care)}
[data-theme="e"] :is(.pending,.custom){--project-color:var(--pending)}
[data-theme="e"] .rail-entry{display:grid;grid-template-columns:70px 18px minmax(0,1fr);position:relative}
[data-theme="e"] .rail-time{text-align:right;padding-top:6px;font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}
[data-theme="e"] .rail-time small{display:block;font-size:17px;font-weight:500;color:var(--ink3)}
[data-theme="e"] .rail-track{position:relative}
[data-theme="e"] .rail-track::before{content:"";position:absolute;inset:0 auto 0 8px;width:2px;background:var(--rail)}
[data-theme="e"] .rail-track::after{content:"";position:absolute;left:3px;top:12px;width:12px;height:12px;border-radius:50%;border:3px solid var(--project-color);background:var(--bg)}
[data-theme="e"] .rail-card{border:0;border-left:6px solid var(--project-color);border-radius:3px;min-height:var(--card-height,52px);margin:2px 0;padding:4px 10px 4px 11px;display:flex;justify-content:center;flex-direction:column;line-height:1.18;background:var(--paper)}
[data-theme="e"] .rail-first{display:flex;align-items:baseline;gap:7px;min-width:0;max-width:100%}
[data-theme="e"] .rail-name,[data-theme="e"] .rail-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
[data-theme="e"] .rail-name{font-size:20px;font-weight:750;flex:0 1 auto}
[data-theme="e"] .rail-project{font-size:17px;font-weight:700;color:var(--project-color);flex:0 1 auto}
[data-theme="e"] .pending .rail-project{border:1.5px dashed var(--ink3);padding:0 5px;border-radius:3px;font-weight:500}
[data-theme="e"] :is(.rail-gender,.rail-duration){font-size:17px;color:var(--muted);white-space:nowrap}
[data-theme="e"] .rail-duration{margin-left:auto}
[data-theme="e"] .rail-detail{font-size:17px;color:var(--muted);min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
[data-theme="e"] .gap .rail-time{font-size:17px;font-weight:600;color:var(--ink3);padding-top:11px}
[data-theme="e"] .gap .rail-track::before{background:repeating-linear-gradient(var(--rail) 0 4px,transparent 4px 8px)}
[data-theme="e"] .gap .rail-track::after{display:none}
[data-theme="e"] .gap-slot{display:flex;align-items:center;gap:5px;margin:2px 0;padding:4px 8px;border:1.5px dashed var(--line);border-radius:3px;background:transparent;color:var(--muted);line-height:1.15;font-size:17px}
[data-theme="e"] .gap-plus{font-weight:700}
[data-theme="e"] .rail-entry.now .rail-time,[data-theme="e"] .rail-now{color:var(--now);font-weight:800}
[data-theme="e"] .now .slot-row{outline:1.5px solid var(--now);outline-offset:-1.5px;background:color-mix(in srgb,var(--now) 8%,var(--paper));color:var(--now)}
[data-theme="e"] .now .gap-slot{border-color:var(--now);border-style:solid}
[data-theme="e"] .rail-legend{display:flex;gap:12px;flex-wrap:wrap;padding:12px 0 0 88px;color:var(--muted);font-size:17px}
[data-theme="e"] .rail-legend span::before{content:"";display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:100%;background:var(--project-color)}
[data-theme="e"] #editor{width:min(100%,540px);max-width:100%;border-radius:14px 14px 0 0}
[data-theme="e"] #editor::backdrop{background:var(--scrim)}
[data-theme="e"] #editor .sheet::before{content:"";height:5px;width:40px;margin:8px auto 0;background:var(--line);border-radius:3px;flex:none}
[data-theme="e"] #editor .sheet-head{padding:6px 12px 4px 18px}
[data-theme="e"] #edit-title{font-size:24px;overflow-wrap:anywhere}
[data-theme="e"] #edit-time{font-size:17px}
[data-theme="e"] .editor-field{margin:7px 0 12px}
[data-theme="e"] :is(.editor-field>label,.editor-field>legend,.editor-label,.field-heading label){color:var(--muted)}
[data-theme="e"] .duration-paper-label{display:none}
[data-theme="e"] #duration-grid{display:grid;grid-auto-flow:column;grid-auto-columns:44px;gap:3px;overflow-x:auto;scrollbar-width:thin;padding-bottom:2px}
[data-theme="e"] .duration-tile{display:grid;grid-template-rows:23px 46px;min-width:0;color:var(--muted);font-size:16px}
[data-theme="e"] .duration-tile button{box-sizing:border-box;width:100%;border:0;border-radius:3px;background:var(--soft);padding:0}
[data-theme="e"] .duration-tile button.selected{background:var(--project-color,var(--pending));opacity:1}
[data-theme="e"] .duration-tile button.taken{background:repeating-linear-gradient(45deg,var(--line) 0 4px,transparent 4px 8px);opacity:1}
[data-theme="e"] #duration-help{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap;font-size:17px}
[data-theme="e"] #duration-help b{color:var(--ink)}
[data-theme="e"] #quick-projects{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
[data-theme="e"] #quick-projects button{height:48px;border-radius:3px;border:1.5px solid var(--line);font-size:18px;font-weight:650;padding:0 8px;display:flex;align-items:center;gap:7px;min-width:0;overflow:hidden}
[data-theme="e"] #quick-projects button:not(.pending)::before{content:"";height:22px;width:6px;border-radius:2px;background:var(--project-color);flex:none}
[data-theme="e"] #quick-projects button.selected{background:color-mix(in srgb,var(--project-color) 12%,var(--paper));color:var(--ink);border-color:var(--project-color);box-shadow:inset 0 0 0 1px var(--project-color)}
[data-theme="e"] #quick-projects .pending{border-style:dashed;color:var(--muted)}
[data-theme="e"] .editor-fields .segmented{gap:2px;background:var(--soft);border-radius:4px;padding:3px}
[data-theme="e"] .editor-fields .segmented label{border:0;background:transparent;border-radius:3px;font-size:18px;color:var(--muted)}
[data-theme="e"] .editor-fields .segmented label:has(input:checked){background:var(--paper);color:var(--ink);box-shadow:0 1px 2px #0003}
[data-theme="e"] .editor-fields :is(input:not([type=radio]),textarea){border-radius:3px;font-size:18px}
[data-theme="e"] .editor-fields #contact{min-height:50px}
[data-theme="e"] .editor-fields #notes{min-height:76px;resize:none}
[data-theme="e"] #editor .sheet-actions button{min-height:52px;border-radius:4px}
[data-theme="e"] #delete-appointment{flex:none;padding-inline:6px;border:0}
[data-theme="e"] #save-appointment{background:var(--accent);color:var(--save-ink);font-size:19px}
