:root[data-theme="b"] {
  --bg:#fff; --paper:#fff; --ink:#14213d; --muted:#5b6782; --ink3:#7484a1;
  --line:#d5e0f0; --accent:#1d4f91; --soft:#edf3fb; --margin:#e2425a;
  --red:#c8102e; --blue:#1d4f91; --danger:#c8102e; --navy:#14213d;
  --hl:#ffe76a; --hlrow:#fffbe0; --save-ink:#fff;
  --pole:repeating-linear-gradient(-55deg,#c8102e 0 9px,#fff 9px 15px,#1d4f91 15px 24px,#fff 24px 30px);
  --paper-margin:64px; --paper-row:50px;
  --cols:var(--paper-margin) 62px 25px 99px minmax(0,1fr);
}
:root[data-theme="b"][data-color-scheme="dark"] {
  --bg:#0f1a2c; --paper:#0f1a2c; --ink:#e8eef8; --muted:#a6b4cf; --ink3:#92a2bf;
  --line:#304365; --accent:#86adff; --soft:#1e3050; --margin:#ff687b;
  --red:#ff7e8e; --blue:#86adff; --navy:#e8eef8; --danger:#ff8c9b;
  --hl:#685400; --hlrow:#292618; --save-ink:#14213d;
}
[data-theme="b"] .app{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
[data-theme="b"] .top{padding-top:env(safe-area-inset-top)}
[data-theme="b"] .theme-heading::before,[data-theme="b"] #editor .sheet::before{content:"";display:block;height:7px;background:var(--pole);flex:none}
[data-theme="b"] .date-nav{justify-content:space-between;padding:2px 4px 1px;min-height:74px}
[data-theme="b"] .date-nav button,[data-theme="b"] .toolbar button{background:none;border:0}
[data-theme="b"] .date-nav>button:not(#choose-date){width:48px;color:var(--muted)}
[data-theme="b"] #choose-date{padding:1px 3px 5px;max-width:100%;white-space:nowrap}
[data-theme="b"] #date-title small{display:block;color:var(--margin);letter-spacing:.5em;padding-left:.5em;font-size:14px;margin:2px 0}
[data-theme="b"] .paper-date{font-size:17px;color:var(--muted);font-weight:400}
[data-theme="b"] .paper-date b{display:inline-block;min-width:1.4em;font-size:30px;font-weight:800;line-height:1.12;margin:0 3px;border-bottom:2px solid var(--ink);color:var(--ink);font-variant-numeric:tabular-nums}
[data-theme="b"] .paper-date b:last-child{min-width:1.05em}
[data-theme="b"] #year-title,[data-theme="b"] #open-day-menu{display:none}
[data-theme="b"] .toolbar{position:fixed;z-index:5;left:50%;bottom:0;transform:translateX(-50%);width:min(100%,640px);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:3px double var(--ink);padding:4px max(6px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));background:var(--paper)}
[data-theme="b"] .toolbar button{height:58px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;font-size:14px;font-weight:650}
[data-theme="b"] .toolbar #today{color:var(--margin)}
[data-theme="b"] .table-head,[data-theme="b"] .slot-row{display:grid;grid-template-columns:var(--cols);gap:6px;align-items:center;padding-right:10px}
[data-theme="b"] .table-head{position:sticky;top:var(--header-height,81px);z-index:1;background:var(--paper);padding-block:7px;border-top:2px solid var(--ink);border-bottom:1px solid var(--ink);font-size:14px;color:var(--muted);white-space:nowrap}
[data-theme="b"] #day-rows{position:relative}
[data-theme="b"] .table-head::before,[data-theme="b"] #day-rows::before{content:"";position:absolute;left:var(--paper-margin);top:0;bottom:0;border-left:1.5px solid var(--margin);z-index:1;pointer-events:none}
[data-theme="b"] .table-head span:first-child,[data-theme="b"] .slot-row .time{padding-left:12px}
[data-theme="b"] .table-head span:nth-child(2),[data-theme="b"] .project-name{padding-left:10px}
[data-theme="b"] .slot-row{font-size:17px;min-height:var(--paper-row);position:relative;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:2px 10px 2px 0;background:var(--paper);line-height:1.19}
[data-theme="b"] .slot-row:active{background:var(--soft)}
[data-theme="b"] .slot-row>:is(span,strong){min-width:0}
[data-theme="b"] .time{font-variant-numeric:tabular-nums;color:var(--ink3);font-weight:500}
[data-theme="b"] .occupied .time{color:var(--ink);font-weight:700}
[data-theme="b"] .off-grid .time::after{content:"·";color:var(--margin)}
[data-theme="b"] :is(.cut,.wash){--project-color:var(--blue)}
[data-theme="b"] :is(.perm,.dye){--project-color:var(--red)}
[data-theme="b"] :is(.care,.custom){--project-color:var(--navy)}
[data-theme="b"] .pending{--project-color:var(--ink3)}
[data-theme="b"] .stamp{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;transform:rotate(-2deg);border:1.5px solid var(--project-color);color:var(--project-color);border-radius:4px;padding:0 4px;font-weight:800}
[data-theme="b"] .pending .stamp{border-style:dashed;font-weight:600;transform:none}
[data-theme="b"] .gender{text-align:center;font-weight:700}
[data-theme="b"] .contact{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:15px;color:var(--muted);font-variant-numeric:tabular-nums}
[data-theme="b"] .contact-as-name{font-size:17px;color:var(--ink);grid-column:4/-1}
[data-theme="b"] .customer{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;color:var(--ink);line-height:1.16}
[data-theme="b"] .customer strong{font-weight:750}
[data-theme="b"] .booking-line{position:absolute;left:100px;top:-1px;bottom:-1px;border-left:2px solid var(--project-color);pointer-events:none}
[data-theme="b"] .booking-line.start{top:calc(50% + 15px)}
[data-theme="b"] .booking-line.end{bottom:51%}
[data-theme="b"] .booking-line.end::after{content:"";position:absolute;left:-6px;top:100%;border:5px solid transparent;border-top:8px solid var(--project-color)}
[data-theme="b"] .until{grid-column:3/-1;font-size:17px;color:var(--muted)}
[data-theme="b"] .slot-row.now{background:var(--hlrow)}
[data-theme="b"] .now .time{color:var(--ink);font-weight:800}
[data-theme="b"] .now .time span{background:linear-gradient(transparent 12%,var(--hl) 12%,var(--hl) 88%,transparent 88%);padding:0 2px;margin-left:-2px}
[data-theme="b"] .now .time small{display:block;color:var(--margin);font-size:11px}
[data-theme="b"] #toast,[data-theme="b"] #undo-toast{bottom:calc(90px + env(safe-area-inset-bottom))}
[data-theme="b"] body:has(#undo-toast:not([hidden])) #toast{bottom:calc(151px + env(safe-area-inset-bottom))}
[data-theme="b"] #editor{width:min(100%,540px);max-width:100%;border-radius:14px 14px 0 0}
[data-theme="b"] #editor::backdrop{background:#0f1a2c73}
[data-theme="b"] #editor .sheet-head{padding:10px 18px 1px}
[data-theme="b"] #editor .sheet-head p{font-size:17px}
[data-theme="b"] #edit-time b{color:var(--ink);font-size:20px}
[data-theme="b"] .editor-fields{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 12px}
[data-theme="b"] .editor-fields>*{grid-column:1/-1}
[data-theme="b"] #field-gender{grid-column:1}
[data-theme="b"] #field-duration{grid-column:2}
[data-theme="b"] :is(.editor-field>label,.editor-field>legend,.editor-label,.field-heading label){color:var(--margin);font-size:14px;letter-spacing:.06em}
[data-theme="b"] #custom-project,[data-theme="b"] .duration-rail-label,[data-theme="b"] .gender-unspecified{display:none}
[data-theme="b"] #quick-projects{gap:8px;max-width:330px}
[data-theme="b"] #quick-projects button,[data-theme="b"] #duration-grid button{min-height:44px;padding:3px 10px;border-radius:6px;border:1.5px solid var(--project-color,var(--navy));color:var(--project-color,var(--navy));background:transparent;font-size:17px;font-weight:750}
[data-theme="b"] #quick-projects button{min-width:64px}
[data-theme="b"] #quick-projects .selected,[data-theme="b"] #duration-grid .selected{background:var(--project-color,var(--navy));color:var(--paper)}
[data-theme="b"] .editor-fields .segmented{gap:8px}
[data-theme="b"] .editor-fields .segmented label{flex:none;width:48px;height:48px;border-radius:50%;background:transparent;border:1.5px solid var(--ink3);font-size:20px;color:var(--muted)}
[data-theme="b"] .editor-fields .segmented label:has(input:checked){border:2.5px solid var(--red);color:var(--red)}
[data-theme="b"] #duration-grid{display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));gap:5px}
[data-theme="b"] #duration-grid button{padding:3px 2px}
[data-theme="b"] #duration-help{font-size:13px}
[data-theme="b"] .editor-fields :is(input:not([type=radio]),textarea){border:0;border-bottom:1.4px solid var(--ink);border-radius:0;padding:6px 0;background:transparent}
[data-theme="b"] #notes{min-height:44px;height:48px}
[data-theme="b"] #editor .sheet-actions{border-top:0}
[data-theme="b"] #save-appointment{background:var(--navy);border-color:var(--navy);color:var(--save-ink);min-height:54px;font-size:19px;border-radius:8px;letter-spacing:.18em}
@media (max-width:380px) {
  :root[data-theme="b"]{--cols:var(--paper-margin) 60px 24px 93px minmax(0,1fr)}
}

[data-theme="b"] #customer-suggestions button{display:flex;align-items:center;justify-content:space-between;gap:8px;border:0;background:none;padding:0;color:var(--blue)}
[data-theme="b"] #customer-suggestions .apply-customer{border:1px solid var(--blue);border-radius:6px;padding:8px 10px;min-width:54px;min-height:44px;display:grid;place-items:center;flex:none}

[data-theme="b"] .overlap-with-times{grid-template-columns:calc(var(--paper-margin) + 2px) minmax(0,1fr)}
[data-theme="b"] .overlap-tick{min-height:var(--paper-row);padding-right:4px}
[data-theme="b"] .overlap-tick .time{color:var(--ink);font-weight:700}
[data-theme="b"] .overlap-tick.now{background:var(--hlrow)}
[data-theme="b"] .end-time-only :is(.duration-label,#duration-grid,#duration-help){display:none}
[data-theme="b"] .end-time-only .end-time-picker{margin-top:0}
[data-theme="b"] #end-time-label{color:var(--margin);font-size:14px;letter-spacing:.06em}
