/* Neutral graphite theme. Status colors retain their meaning in both palettes. */
:root{color-scheme:light}
/* Light surfaces: a cooler canvas, tinted sections and clearer boundaries. */
:root[data-theme=light]{--paper:#e8edf3;--line:#bcc9da;--accent-soft:#e2ebfa;--muted:#52647d}
[data-theme=light] :is(.panel,.stat,.calendar-column,.calendar-move-dialog){background:#fcfdff;border-color:#b9c7d9;box-shadow:0 2px 5px #2430470b}
[data-theme=light] .topbar{background:#f5f8fc;border-bottom-color:#bcc9da}
[data-theme=light] .stat{background:#f0f5fc;box-shadow:inset 0 2px #8da9d1,0 2px 5px #2430470b}
[data-theme=light] :is(.onboarding,.side-note,.telegram-preview){background:#e0eafa;border-color:#a9bddb}
[data-theme=light] :is(.filter-panel,.lunch-settings){background:#eef3f9;border-color:#b9c7d9}
[data-theme=light] :is(input,select,textarea){background:#fff;border-color:#9eafc5}
[data-theme=light] .button.secondary{background:#eaf0f8;border-color:#a8bad2;color:#304d75}
[data-theme=light] .button.secondary:hover{background:#dce6f4;border-color:#819dc4}
[data-theme=light] .button.danger{background:#fae8e9;border-color:#d9a5ad}
[data-theme=light] .segmented{background:#dce5f1;border-color:#b4c3d9}
[data-theme=light] .segmented a.selected{background:#fff;color:#254d8c;box-shadow:0 1px 4px #24304722}
[data-theme=light] .date-nav a{background:#f8fbff;border-color:#acbdd4}
[data-theme=light] th{background:#e2eaf4;color:#455c7a;border-bottom-color:#b5c5db}
[data-theme=light] :is(td,.appointment-row,.list-row,.log-row){border-color:#ccd7e5}
[data-theme=light] tbody tr:nth-child(even){background:#f1f5fa}
[data-theme=light] :is(tbody tr:hover,.appointment-row:hover){background:#e6eef9}
[data-theme=light] .schedule-modes label{background:#edf2f8;border-color:#b8c7da}
[data-theme=light] .schedule-modes label:has(input:checked){background:#dee9fb;border-color:#7e9fcf}
[data-theme=light] .schedule-day.working{background:#e1ebfa;border-color:#9eb7dc}
[data-theme=light] .schedule-day.resting{background:#eee2d7;border-color:#cbb49f}
[data-theme=light] .schedule-day.outside{border-color:transparent}
[data-theme=light] .schedule-day.today{border-color:var(--accent)}
[data-theme=light] :is(.booking-calendar.week.time-grid,.booking-calendar.day.time-grid){border-color:#aebed4;box-shadow:0 2px 5px #2430470b}
[data-theme=light] .time-day-heading{background:#e6edf7}
[data-theme=light] :is(.time-axis,.time-closed){background:#e1e8f2}
[data-theme=light] .time-day-body{background:#e4e7ed}
[data-theme=light] .time-hour-lines{background:repeating-linear-gradient(to bottom,#b9c7d9 0,#b9c7d9 1px,transparent 1px,transparent 36px,#dde5ef 36px,#dde5ef 37px,transparent 37px,transparent 72px)}
[data-theme=light] :is(.booking-calendar .calendar-day.day-off,.time-day.day-off .time-day-heading,.time-day.day-off .time-day-body){background:#eee2d7;border-color:#cbb49f}
[data-theme=light] .calendar-day.outside-month{background:#e5eaf1}
[data-theme=light] .calendar-event{background:#dce8fc;border-left-color:#4e79bd;color:#29476f;box-shadow:0 1px 3px #35548118}
[data-theme=light] .calendar-event.pending{background:#ffedc4;border-left-color:#ba8b2b;color:#735218}
[data-theme=light] :is(.calendar-event.cancelled,.calendar-event.expired,.calendar-event.rejected){background:#e5eaf1;border-left-color:#95a2b4;color:#52627a;opacity:1;box-shadow:none}
[data-theme=light] .calendar-drag{background:#f7faff;color:#2f5795}
[data-theme=light] .calendar-drag:hover{background:#c4d6f4}
[data-theme=light] :is(.time-buffer,.legend-buffer){background:repeating-linear-gradient(135deg,#9fb5d8 0,#9fb5d8 3px,#e2eafa 3px,#e2eafa 7px)}
[data-theme=light] .time-lunch-band{background:#f5e4b8eb;color:#6e501b;border-color:#c6a45b}
[data-theme=light] .legend-off{background:#eee2d7;border-color:#b99b81}
[data-theme=light] .legend-work{border-color:#91a5c0}
@media(max-width:760px){
  [data-theme=light] .panel:has(.mobile-card-table){background:none;border:0;box-shadow:none}
  [data-theme=light] .mobile-card-table tr{background:#fcfdff;border-color:#b4c4da;box-shadow:0 2px 5px #2430470b}
  [data-theme=light] .mobile-nav{background:#f6f9fd;border-color:#adbed5}
  [data-theme=light] .mobile-more-panel{background:#f6f9fd;border-color:#adbed5}
  [data-theme=light] .mobile-date-picker a{background:#f8fbff;border-color:#aebed4}
  [data-theme=light] .mobile-date-picker .day-off{background:#eee2d7;border-color:#cbb49f}
  [data-theme=light] .schedule-calendar .mobile-date-picker a:not(.day-off):not([aria-pressed=true]){background:#e1ebfa;border-color:#9eb7dc}
  [data-theme=light] .mobile-date-picker [aria-pressed=true]{background:var(--accent);border-color:#2d51bb;color:white}
}
:root[data-theme=dark]{
  color-scheme:dark;
  --ink:#e3e6eb;--muted:#abb1bb;--accent:#9ebeee;--accent-hover:#c3d8f4;
  --accent-soft:#303e51;--line:#454950;--paper:#27292d;--white:#303237;--nav:#1c1e22;
  --red:#efadb6;--amber:#d9b878;--surface:#303237;--surface-low:#24262a;
  --surface-hover:#383b41;--action:#426997;--action-hover:#527cac;
  --off:#352f2e;--off-line:#574944;--success-bg:#263e34;--success-text:#a6d8bd;
  --warning-bg:#443b2b;--warning-text:#ecd096;--danger-bg:#432e34;
}
.topbar-actions{display:flex;align-items:center;gap:24px;min-width:0}
.identity-name{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:138px;min-height:40px;padding:7px 12px;border:1px solid var(--line);border-radius:7px;background:var(--paper);color:var(--ink);font-size:12px;white-space:nowrap;flex-shrink:0}
.theme-toggle:hover{border-color:var(--accent);color:var(--accent)}
.theme-toggle[hidden]{display:none}.theme-toggle svg{flex-shrink:0}
[data-theme=dark] .theme-moon,[data-theme=light] .theme-sun{display:none}
.auth-theme{display:flex;justify-content:flex-end;max-width:1100px;margin:0 auto 16px}
[data-theme=dark] body{background:var(--paper);color:var(--ink)}
[data-theme=dark] :is(.panel,.stat,.calendar-column,.auth-layout,.calendar-move-dialog,.mobile-more-panel,.calendar-date-jump[open] form){background:var(--surface);border-color:var(--line);box-shadow:none}
[data-theme=dark] .topbar{background:var(--surface-low)}
[data-theme=dark] .sidebar{border-right-color:#36393f}
[data-theme=dark] .brand-icon{background:#b5c6df;color:#23262d}
[data-theme=dark] .nav-link{color:#bfc4ce}
[data-theme=dark] .nav-link>span{color:#aebcd0}
[data-theme=dark] :is(.nav-link.active,.nav-link:hover){background:#333c4a;color:#edf1f7}
[data-theme=dark] .nav-link.active{box-shadow:inset 3px 0 #92b4e1}
[data-theme=dark] :is(label,.person,.empty h2,.empty h3,.calendar-column h3){color:var(--ink)}
[data-theme=dark] :is(.stat>span,.stat small,.time small,.helptext,.footer,.footer a,.pagination,.list-row small,.link-button,.log-row small,.auth-links,.price small,.feature-list,.calendar-event small,.booking-date span,sup){color:var(--muted)}
[data-theme=dark] :is(.avatar,.tag,.service-icon,.empty-icon,.decor-circle){background:#354052;border-color:#4b5a71;color:#bed0eb}
[data-theme=dark] :is(.side-note,.onboarding,.telegram-preview,.secret){background:#2d3848;border-color:#43516a}
[data-theme=dark] :is(.side-note p,.onboarding p,.checklist a){color:#c2ccdc}
[data-theme=dark] .checklist a{border-color:var(--line)}
[data-theme=dark] .checklist .done{color:var(--muted)}
[data-theme=dark] .preview-button{color:var(--accent);border-color:var(--line)}
[data-theme=dark] :is(input,select,textarea){background:var(--surface-low);border-color:#5c626c;color:var(--ink)}
[data-theme=dark] :is(input,textarea)::placeholder{color:#9fa6b2;opacity:1}
[data-theme=dark] :is(input,select,textarea):focus{border-color:#9ebeee;outline:2px solid #6784ac80}
[data-theme=dark] :is(input[type=checkbox],input[type=radio]){accent-color:#719ace}
[data-theme=dark] .button{background:var(--action);border-color:#6585ad;color:#fff}
[data-theme=dark] .button:hover{background:var(--action-hover);border-color:#8ba9d0}
[data-theme=dark] .button.secondary{background:#383c43;border-color:#5c626c;color:var(--ink)}
[data-theme=dark] .button.secondary:hover{background:#454a53;border-color:#8993a1}
[data-theme=dark] .button.danger{background:var(--danger-bg);border-color:#815560;color:var(--red)}
[data-theme=dark] .button.danger:hover{background:#563640;border-color:#ab6a78;color:#ffd1d8}
[data-theme=dark] .badge{background:#41454d;color:#d4d8e0}
[data-theme=dark] :is(.badge.confirmed,.badge.completed,.notice.success){background:var(--success-bg);color:var(--success-text);border-color:#466b55}
[data-theme=dark] .badge.pending{background:var(--warning-bg);color:var(--warning-text)}
[data-theme=dark] :is(.badge.cancelled,.badge.expired,.badge.rejected,.badge.noshow,.notice.error,.errorlist){background:var(--danger-bg);color:var(--red);border-color:#815560}
[data-theme=dark] .notice{background:#2d3c50;color:#c2d7f3;border-color:#4d6382}
[data-theme=dark] th{background:var(--surface-low);color:#b6becb}
[data-theme=dark] :is(td,.appointment-row,.list-row,.log-row){border-color:var(--line)}
[data-theme=dark] :is(tbody tr:hover,.appointment-row:hover){background:var(--surface-hover)}
[data-theme=dark] .segmented{background:#202226;border-color:var(--line)}
[data-theme=dark] .segmented a{color:var(--muted)}
[data-theme=dark] .segmented a.selected{background:#414750;color:#eff2f7;box-shadow:0 1px 3px #0003}
[data-theme=dark] .date-nav a{background:var(--surface);border-color:#5c626c}
[data-theme=dark] .schedule-modes label{background:var(--surface-low)}
[data-theme=dark] .schedule-modes label:has(input:checked){background:var(--accent-soft);border-color:#6e8bac}
[data-theme=dark] .schedule-day.working{background:#303e51;border-color:#4a5e78}
[data-theme=dark] .schedule-day.resting{background:var(--off);border-color:var(--off-line)}
[data-theme=dark] .schedule-day.outside{border-color:transparent}
[data-theme=dark] .schedule-day.today{border-color:var(--accent)}
[data-theme=dark] :is(.booking-calendar.week.time-grid,.booking-calendar.day.time-grid){background:var(--surface);border-color:var(--line)}
[data-theme=dark] :is(.time-axis,.time-closed){background:var(--surface-low)}
[data-theme=dark] .time-day-body{background:#292729}
[data-theme=dark] .time-work-band{background:var(--surface)}
[data-theme=dark] .time-hour-lines{background:repeating-linear-gradient(to bottom,#4a4e56 0,#4a4e56 1px,transparent 1px,transparent 36px,#393d44 36px,#393d44 37px,transparent 37px,transparent 72px)}
[data-theme=dark] :is(.booking-calendar .calendar-day.day-off,.time-day.day-off .time-day-heading,.time-day.day-off .time-day-body){background:var(--off);border-color:var(--off-line)}
[data-theme=dark] .calendar-day.outside-month{background:var(--surface-low)}
[data-theme=dark] .calendar-off-label{color:#d4b7a6}
[data-theme=dark] .calendar-event{background:#2c405b;border-left-color:#8eb5ed;color:#dce8f8}
[data-theme=dark] .calendar-event.pending{background:#443b2b;border-left-color:#d9b878;color:#f0dbb2}
[data-theme=dark] :is(.calendar-event.cancelled,.calendar-event.expired,.calendar-event.rejected){background:#34363d;border-left-color:#777d89;color:#b7bdc8;opacity:1}
[data-theme=dark] .calendar-drag{background:#233247;color:#c3d8f4}
[data-theme=dark] .calendar-drag:hover{background:#4a6282}
[data-theme=dark] :is(.time-buffer,.legend-buffer){background:repeating-linear-gradient(135deg,#53617a 0,#53617a 3px,#303c50 3px,#303c50 7px)}
[data-theme=dark] .legend-work{background:var(--surface);border-color:#8b939f}
[data-theme=dark] .legend-off{background:var(--off);border-color:#987c6d}
[data-theme=dark] .legend-today{background:var(--surface)}
[data-theme=dark] .time-lunch-band{background:#49402ddd;color:#f1d59a;border-color:#887345}
[data-theme=dark] .schedule-lunch{color:#e5c88f}
[data-theme=dark] .time-drop-preview{background:#9ebeee30}
[data-theme=dark] .time-drop-preview>span{background:var(--action);color:#fff}
[data-theme=dark] .calendar-move-dialog::backdrop{background:#080a0dbb}
[data-theme=dark] .auth-story{background:#20252d;color:var(--ink)}
[data-theme=dark] .skip:focus{background:var(--surface)}
[data-theme=dark] :focus-visible{outline-color:#a7c6f1}
@media(max-width:760px){
  .topbar-actions{gap:10px}.theme-toggle{width:44px;min-height:44px;padding:8px}
  .theme-toggle [data-theme-label]{display:none}.identity-name{max-width:110px}
  .topbar .identity{gap:6px}.topbar>.topbar-actions{margin-left:auto}
  .topbar>span{max-width:90px;line-height:1.3}
  [data-theme=dark] :is(.mobile-nav,.mobile-more-panel){background:var(--surface-low);border-color:var(--line);box-shadow:0 -6px 24px #0002}
  [data-theme=dark] .mobile-nav [aria-current=page],[data-theme=dark] .mobile-more[open]>summary,[data-theme=dark] .mobile-more:has([aria-current=page])>summary{background:#354052;color:#c3d8f4}
  [data-theme=dark] .panel:has(.mobile-card-table){background:none;box-shadow:none}
  [data-theme=dark] .mobile-card-table tr{background:var(--surface);border-color:var(--line)}
  [data-theme=dark] .mobile-date-picker a{background:var(--surface);border-color:#565c65;color:var(--ink)}
  [data-theme=dark] .mobile-date-picker .day-off{background:var(--off);border-color:var(--off-line)}
  [data-theme=dark] .schedule-calendar .mobile-date-picker a:not(.day-off):not([aria-pressed=true]){background:var(--accent-soft)}
  [data-theme=dark] .mobile-date-picker [aria-pressed=true]{background:var(--action);color:white;border-color:#abc6eb}
}
