/* Opt-in palettes. Existing default pastel CSS remains the default. */
:root:not([data-theme="pastel"])[data-theme]{--ink:var(--theme-ink);--muted:var(--theme-muted);--green:var(--theme-accent);--green-dark:var(--theme-accent);--line:var(--theme-line);--row-hover:var(--theme-hover);--axis-grid:var(--theme-line);--axis-boundary:var(--theme-boundary);--weekend-saturday:var(--theme-saturday);--weekend-sunday:var(--theme-sunday);color-scheme:light;background-color:var(--theme-bg)}
:root[data-theme="hacker"]{color-scheme:dark}
[data-theme]:not([data-theme="pastel"]) #workspace{background-color:var(--theme-bg);color:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) :is(.app-header,.sheet-panel,.sheet-tabs,.sheet-tab-bar,.ribbon-panel,.menu-panel,.settings-dialog,.action-menu,dialog,.shortcut-tooltip,.date-picker-title,.date-picker-grid){background-color:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme]:not([data-theme="pastel"]) :is(.ribbon-tabs,.menu-bar,.settings-nav,.quick-toolbar,.pane-title,.sheet-footer,.axis-group,.time-segment,.axis-week,.calendar-heading,.calendar-scope-tabs){background-color:var(--theme-header);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme]:not([data-theme="pastel"]) :is(#schedule-table,#gantt-table,.holiday-table) :is(td,th){background-color:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme]:not([data-theme="pastel"]) #schedule-table thead th,[data-theme]:not([data-theme="pastel"]) #gantt-table thead th{background-color:var(--theme-header);color:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) #workspace :is(input,textarea,select){color:var(--theme-ink);background-color:transparent;border-color:var(--theme-line)}
[data-theme]:not([data-theme="pastel"]) #workspace :is(select,textarea){background-color:var(--theme-surface)}
[data-theme]:not([data-theme="pastel"]) :is(#sheet-body,#chart-body) tr.group-row>td{background-color:var(--theme-group);color:var(--theme-ink)}
/* Finished rows: same background as the rest, grey text only (사용자 2026-11-07). */
[data-theme]:not([data-theme="pastel"]) :is(#sheet-body,#chart-body) tr.completed-row>td{color:var(--theme-muted)}
[data-theme]:not([data-theme="pastel"]) :is(#sheet-body,#chart-body) tr:not(.virtual-spacer)>td{box-shadow:inset 0 -1px var(--theme-line)}
[data-theme]:not([data-theme="pastel"]).grid-hidden #chart-body tr:not(.virtual-spacer)>td{box-shadow:none}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.cell-current{background-color:var(--theme-selected)!important}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.cell-current::after{border-color:var(--theme-accent)}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.is-editing,[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.is-editing input{background-color:var(--theme-surface)!important;color:var(--theme-ink);outline-color:var(--theme-accent)}
[data-theme]:not([data-theme="pastel"]) #chart-body :is(.bar,.actual-bar){background-color:var(--theme-bar)}
[data-theme]:not([data-theme="pastel"]) #chart-body .progress-fill{background-color:var(--theme-accent)}
[data-theme]:not([data-theme="pastel"]) #chart-body .completed-row :is(.bar,.actual-bar,.progress-fill){background-color:var(--theme-complete)}
[data-theme]:not([data-theme="pastel"]) #chart-body .bar-label{color:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) #dependency-lines .edge-line{stroke:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) #dependency-arrow path{fill:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) #workspace :is(.quiet,.ribbon-note,.pane-title span,.axis-zoom,.sheet-tab-help,.bottom-hint,.saved-state){color:var(--theme-muted)}
[data-theme]:not([data-theme="pastel"]) #workspace :is(.primary,.login-submit){background-color:var(--theme-accent);color:var(--theme-surface)}
[data-theme]:not([data-theme="pastel"]) #sheet-body td.progress-behind{background-color:#713a27;color:#fff}
[data-theme]:not([data-theme="pastel"]) #sheet-body td.progress-on-track{background-color:var(--theme-group)}
[data-theme]:not([data-theme="pastel"]) #workspace .ribbon-group b{color:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) #gantt-table .saturday{background-color:var(--theme-saturday)}
[data-theme]:not([data-theme="pastel"]) #gantt-table .sunday{background-color:var(--theme-sunday)}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.progress-on-track:not(.invalid){background-color:var(--theme-group)!important;color:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.progress-behind:not(.invalid){background-color:#fff0db!important;color:#793a0c}
[data-theme="hacker"] #schedule-table #sheet-body td.progress-behind:not(.invalid){background-color:#713a27!important;color:#fff}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.progress-behind input{color:inherit}
[data-theme]:not([data-theme="pastel"]) #workspace .ribbon-tabs>b{color:var(--theme-accent)}
[data-theme]:not([data-theme="pastel"]) #workspace .segmented{background-color:var(--theme-surface);border-color:var(--theme-line)}
[data-theme]:not([data-theme="pastel"]) #workspace .segmented button.selected{background-color:var(--theme-accent);color:var(--theme-surface)}
[data-theme]:not([data-theme="pastel"]) #workspace .sheet-tabs [role=tab]{background-color:var(--theme-header);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme]:not([data-theme="pastel"]) #workspace .sheet-tabs [aria-selected=true]{background-color:var(--theme-selected);border-color:var(--theme-accent)}
[data-theme]:not([data-theme="pastel"]) #workspace .pane-divider{background-color:var(--theme-line);border-color:var(--theme-line)}
[data-theme]:not([data-theme="pastel"]) #workspace .pane-scroll{scrollbar-color:var(--theme-line) var(--theme-bg)}

[data-theme]:not([data-theme="pastel"]) #workspace :is(.calendar-view,.holiday-editor,.holiday-import){background-color:var(--theme-surface);color:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) #workspace :is(.calendar-heading p,.holiday-import p,#calendar-scope-note,#calendar-message){color:var(--theme-muted)}
[data-theme]:not([data-theme="pastel"]) #workspace :is(button:focus-visible,input:focus-visible,select:focus-visible){outline-color:var(--theme-accent)}
/* Idle task inputs only receive events; the overflow span paints text once.
   Theme ink must never expose the duplicate single-cell text underneath. */
[data-theme] #workspace #sheet-body .level-cell input[data-cell-idle]{color:transparent}
[data-theme]:not([data-theme="pastel"]) #workspace .ribbon-group button:not([data-today-color]){background-color:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}

/* U2a 선명(기본): 그룹=연노랑 막대·진한 노랑 테두리, 작업=연파랑 막대·파랑 테두리, 실제 일정=막대 가운데 가는 선. */
[data-theme="vivid"] #chart-body .bar.task-bar{background-color:#d6e6f5;border:1px solid #3d7bbf;border-radius:1px;top:3px;height:calc(var(--row-h) - 6px)}
[data-theme="vivid"] #chart-body .bar.group{background-color:#fbe7a1;border:1px solid #c99a1e;border-radius:1px;top:3px;height:calc(var(--row-h) - 6px)}
[data-theme="vivid"] #chart-body .bar.group:before{display:none}
[data-theme="vivid"] #chart-body .bar.task-bar.uncertain-bar{background-color:#fff;border:1px dashed #3d7bbf}
[data-theme="vivid"] #chart-body tr.completed-row .bar.bar{background-color:#e5e5e5;border-color:#a3a3a3}
[data-theme="vivid"] #chart-body .bar-label{color:#111827}
[data-theme="vivid"] #chart-body tr.group-row .bar-label{font-weight:700}
[data-theme="vivid"] #chart-body tr.completed-row .bar-label{color:#9ca3af}
[data-theme="vivid"] #chart-body tr td .actual-bar.actual-bar{top:calc(var(--row-h)/2 - var(--actual-line,3px)/2);height:var(--actual-line,3px);background-color:#0a84ff;border-radius:0;z-index:2}
[data-theme="vivid"] #schedule-table #sheet-body tr.group-row>td,[data-theme="vivid"] #schedule-table #sheet-body tr.group-row>td input{font-weight:700}
[data-theme="vivid"] #chart-body .progress-fill{background-color:#9cc0e6}
/* U2b 선명: 표 실적 칸 = 간트 선 색과 같은 뜻(빨강 늦음 · 파랑 계획대로 · 초록 앞섬). */
[data-theme="vivid"] #schedule-table #sheet-body td.progress-behind.progress-behind:not(.invalid){background-color:#ffd9d6!important;color:#b00000;font-weight:700}
[data-theme="vivid"] #schedule-table #sheet-body td.progress-on-track.progress-on-track:not(.invalid){background-color:#e3edf9!important;color:#1d4f91}
[data-theme="vivid"] #schedule-table #sheet-body td.progress-ahead.progress-ahead:not(.invalid){background-color:#d6efd9!important;color:#1b6b2a}
/* 실적 선(사용자 2026-11-02 23:46): 파랑·빨강·초록 모두 같은 굵기. --actual-line은 app.mjs가 정수 장치 픽셀로 계산해 보기 크기·배율에서 행마다 굵기가 흔들리지 않게 한다. */

/* 연결선 선택·마우스 올림·모순 표시가 테마 기본 선 색에 덮이지 않게(Sites41 운영 확인: 선택 시 화살표만 바뀜). */
[data-theme]:not([data-theme="pastel"]) #dependency-lines .edge-selected .edge-line,[data-theme]:not([data-theme="pastel"]) #dependency-lines .dependency-edge:focus-visible .edge-line{stroke:#b4642c}
[data-theme]:not([data-theme="pastel"]) #dependency-lines .dependency-edge:hover .edge-line{stroke:#a86c38}
[data-theme]:not([data-theme="pastel"]) #dependency-lines .dependency-edge.edge-contradiction .edge-line{stroke:url(#dependency-warning-gradient)}
/* 머리글 시인성(사용자 2026-11-02 01:43, FHD·100%): 칸 크기는 그대로, 글자만 진하고 조금 크게. 주말은 원색 계열. */
[data-theme="vivid"] #schedule-table thead th{color:#1f2937;font-weight:600;font-size:13px}
[data-theme="vivid"] #gantt-table thead :is(.axis-group,.axis-year,.axis-period){color:#111827;font-weight:700}
[data-theme="vivid"] #gantt-table thead .axis-leaf .axis-date{color:#111827;font-weight:700;font-variant-numeric:tabular-nums}
[data-theme="vivid"] #gantt-table thead .axis-leaf.two-lines .axis-date{font-size:var(--leaf-date,11px);line-height:13px}
[data-theme="vivid"] #gantt-table thead .axis-leaf .axis-weekday{color:#374151;font-weight:600}
[data-theme="vivid"] #gantt-table thead .axis-leaf.two-lines .axis-weekday{font-size:var(--leaf-weekday,10px);line-height:11px}
[data-theme="vivid"] #gantt-table thead .axis-leaf:not(.two-lines) .axis-date{font-size:var(--leaf-date,10px)}
[data-theme="vivid"] #gantt-table thead .time-segment small{color:#374151;font-weight:600}
[data-theme="vivid"] #gantt-table thead :is(.axis-leaf,.time-segment).saturday :is(.axis-date,.axis-weekday,small),[data-theme="vivid"] #gantt-table thead :is(.axis-leaf,.time-segment).saturday{color:#1d4ed8}
[data-theme="vivid"] #gantt-table thead :is(.axis-leaf,.time-segment).sunday :is(.axis-date,.axis-weekday,small),[data-theme="vivid"] #gantt-table thead :is(.axis-leaf,.time-segment).sunday{color:#c81e1e}
/* 행 선택 표시가 테마 바탕색에 덮여 안 보이던 문제(사용자 2026-11-02 10:26). 선택 행은 테마 선택색, 행 번호는 진하게. */
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.selected-cell:not(.is-editing){background-color:var(--theme-selected)!important}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.row-number.selected{background-color:var(--theme-accent)!important;color:var(--theme-surface)!important;font-weight:700}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.selected-cell input[data-cell-idle]{background:transparent}

/* Hierarchy guides vs grid (사용자 2026-11-03 00:22): only cells a guide or a task name really occupies fade (guideCellLevels), plus cells a name spills across. All other cells keep the normal grid. */
[data-theme]:not([data-theme="pastel"]) #hierarchy-guides path{stroke:#5b6472}
[data-theme]:not([data-theme="pastel"]) #schedule-table #sheet-body td.level-cell:is(.soft-grid,.spill-through){border-right-color:color-mix(in srgb,var(--theme-line) 40%,var(--theme-surface));border-bottom-color:color-mix(in srgb,var(--theme-line) 55%,var(--theme-surface));box-shadow:inset 0 -1px color-mix(in srgb,var(--theme-line) 55%,var(--theme-surface))}
[data-theme]:not([data-theme="pastel"]) #sheet-body .pre-name-toggle.is-locked .lock-shackle{stroke:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) #sheet-body .pre-name-toggle.is-locked .lock-body{fill:var(--theme-ink)}
/* Hover/focus in the blue themes (사용자 2026-11-02 23:00: green hover clashed with the blue design). */
[data-theme]:not([data-theme="pastel"]) :is(.sheet-toolbar button,.history-actions button:not(:disabled),.date-cell-menu button:enabled,.date-picker-nav button:enabled,.sheet-tabs [role=tab],#add-sheet,.menu-panel .menu-item:not(:disabled),.menu-panel .menu-check,.header-icon,#settings-close,#sheet-body .pre-name-toggle):hover{background-color:var(--theme-hover)!important}
[data-theme]:not([data-theme="pastel"]) :is(.menu-button:hover,.menu-button[aria-expanded=true]){background-color:var(--theme-selected)!important;color:var(--theme-ink)!important}
[data-theme]:not([data-theme="pastel"]) :is(.date-picker-grid button:enabled,.sheet-starter-choices button,.drive-choice:not(:disabled)):hover{background-color:var(--theme-hover)!important;border-color:var(--theme-accent)!important}
[data-theme]:not([data-theme="pastel"]) :is(.pane-divider:hover,.pane-divider:focus){background-color:var(--theme-accent)!important}
[data-theme]:not([data-theme="pastel"]) :is(.column-resizer:hover,.column-resizer:focus){background-color:color-mix(in srgb,var(--theme-accent) 45%,transparent)!important}
[data-theme]:not([data-theme="pastel"]) :is(.date-cell-menu button:focus-visible,.menu-panel .menu-item:focus-visible,button:focus-visible){background-color:var(--theme-hover)}
[data-theme]:not([data-theme="pastel"]) #dependency-lines :is(.dependency-port:hover,.port-source){fill:var(--theme-accent);stroke:color-mix(in srgb,var(--theme-accent) 70%,#000)}
/* Row menu (위에 추가·아래에 추가·행 삭제) in the blue themes. */
[data-theme]:not([data-theme="pastel"]) :is(.action-menu,.date-cell-menu){border-color:var(--theme-line)!important;box-shadow:0 6px 18px rgba(17,24,39,.14)!important}
[data-theme]:not([data-theme="pastel"]) .action-menu button{color:var(--theme-ink)}
[data-theme]:not([data-theme="pastel"]) :is(.action-menu button:hover,.action-menu button:focus){background-color:var(--theme-selected)!important;outline:1px solid var(--theme-accent)!important}
/* Selected rows win over completed-row grey and the progress judgement colour (사용자 23:00). */
[data-theme]:not([data-theme="pastel"]) #workspace #schedule-table #sheet-body td.selected-cell.selected-cell.selected-cell:not(.is-editing){background-color:var(--theme-selected)!important}
[data-theme]:not([data-theme="pastel"]) .action-menu hr{border-top-color:var(--theme-line)}
[data-theme]:not([data-theme="pastel"]) .action-menu button:disabled:hover{background-color:transparent!important;outline:0!important}
/* Multi-cell range in the blue themes (was green). */
[data-theme]:not([data-theme="pastel"]) #sheet-body td.range-selected::before{background:color-mix(in srgb,var(--theme-accent) 13%,transparent);border-color:var(--theme-accent)}
