body[data-work-page] [hidden] { display: none !important; }
body[data-work-page] #main { box-sizing: border-box; }
body[data-work-page] :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
body[data-work-page] [aria-invalid="true"] { border: 2px solid var(--error-fg-color); }
.work-main { max-width: 980px; margin: 0 auto; padding: 16px; }
.work-main h2 { margin: 0 0 12px; font-size: calc(var(--font-size) + 2px); font-weight: 700; }
#work-state, #work-targets-state { overflow-wrap: anywhere; }
#work-state:empty, #work-targets-state:empty { display: none; }
#work-retry, #work-targets-retry { width: 44px; height: 44px; }
.work-toolbar, .work-date-navigation, .work-month-navigation { display: flex; align-items: center; gap: 12px; }
.work-toolbar { justify-content: space-between; margin-bottom: 12px; }
.work-toolbar a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box; min-height: 44px; max-width: 100%; padding: 6px 12px; border: 1px solid var(--border-color); border-radius: var(--border-radius-compact); background: var(--element-bg-color); color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.work-toolbar > a { width: max-content; height: 44px; min-height: 44px; margin: 0; box-sizing: border-box; flex: 0 0 auto; white-space: nowrap; }
.work-toolbar > a { max-width: none; overflow-wrap: normal; }
.work-toolbar a:hover { background: var(--button-hover-color); }
.work-date-navigation, .work-month-navigation { justify-content: center; margin: 12px 0 20px; }
.work-date-navigation label, .work-month-navigation label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.work-date-navigation button, .work-month-navigation button { width: 44px; min-width: 44px; height: 44px; padding: 0; }
.work-date-navigation input, .work-month-navigation input { box-sizing: border-box; width: min(230px, calc(100vw - 150px)); min-height: 44px; }
.work-section { margin-top: 16px; }
.work-field { display: grid; gap: 6px; min-width: 0; }
.work-field input, .work-field select { box-sizing: border-box; width: 100%; max-width: 100%; min-height: 44px; }
.work-entries { width: 100%; border-collapse: collapse; table-layout: fixed; }
.work-entries th, .work-entries td { padding: 9px 8px; border-bottom: 1px solid currentColor; vertical-align: middle; text-align: left; overflow-wrap: anywhere; }
.work-entries thead { background: var(--table-header-bg-color); }
.work-entries col.work-entries-sub { width: 100px; }
.work-entries col.work-entries-time { width: 90px; }
.work-entries col.work-entries-action { width: 50px; min-width: 50px; max-width: 50px; }
.work-entries .work-entries-action-header, .work-entries .work-entries-action-cell { padding: 5px; text-align: center; }
.work-entries .work-entries-action-cell button { display: block; width: 40px; height: 40px; margin: 0 auto; padding: 0; }
.work-entries td select, .work-entries td input { box-sizing: border-box; width: 100%; max-width: 100%; min-height: 44px; }
.work-entries .work-entries-empty { padding: 18px 8px; text-align: center; }
.work-entry-create { display: grid; grid-template-columns: minmax(0, 1fr) 110px 100px 48px 48px; gap: 12px; align-items: end; margin-bottom: 12px; }
.work-entry-create input, .work-entry-create select { margin: 0; }
#quick-now, #entry-new-add { box-sizing: border-box; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; }
.work-day-status { margin: 16px 0 0; }
.work-day-status-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; align-items: end; }
.work-day-status-fields select { box-sizing: border-box; width: 100%; max-width: 100%; min-height: 44px; }
.work-flag { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.work-flag input { width: 20px; height: 20px; margin: 0; flex: none; }
.work-note { display: grid; gap: 6px; min-width: 0; }
.work-note textarea { box-sizing: border-box; width: 100%; max-width: 100%; min-height: 120px; resize: vertical; }
.work-save { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 12px; padding: 8px 14px; }
.work-calendar { overflow-x: auto; }
.work-weekdays, .work-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; list-style: none; margin: 0; padding: 0; }
.work-week { grid-column: 1 / -1; min-width: 0; }
.work-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; list-style: none; margin: 0; padding: 0; }
.work-weekend, .work-weekend-days { display: contents; list-style: none; }
.work-weekdays { margin-bottom: 5px; text-align: center; font-weight: 700; }
.work-weekdays li { padding: 7px 2px; }
.work-weekdays .work-weekend-heading { display: none; }
.work-day-item, .work-day-placeholder { min-width: 0; min-height: 120px; }
.work-day { position: relative; display: flex; flex-direction: column; gap: 5px; box-sizing: border-box; min-height: 120px; height: 100%; padding: 7px; border: 1px solid var(--border-color); border-radius: var(--border-radius-calendar); background: var(--element-bg-color); color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.work-day:hover { background: var(--button-hover-color); }
.work-day.is-weekend { background: color-mix(in srgb, var(--element-bg-color) 88%, var(--calendar-weekend-color)); }
.work-day.is-holiday { background: color-mix(in srgb, var(--element-bg-color) 82%, var(--calendar-holiday-color)); }
.work-day.is-marked { box-shadow: inset 0 3px var(--workdaytype-color); }
.work-day.is-today { border: 2px solid var(--calendar-today-color); }
.work-day-heading { font-weight: 700; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
.work-day-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; color: color-mix(in srgb, var(--main-text-color) 72%, var(--main-bg-color)); }
.work-day-duration, .work-estimate { margin-top: auto; border-top: 1px solid var(--border-color); padding-top: 4px; font-weight: 700; }
.work-estimate { color: color-mix(in srgb, var(--main-text-color) 60%, var(--main-bg-color)); font-style: italic; }
.work-note-mark { position: absolute; top: -1px; right: 6px; font-size: 13px; color: var(--calendar-note-color); }
.work-oncall-mark { position: absolute; top: 1px; right: 6px; font-size: 12px; color: var(--calendar-note-color); }
.work-day.has-note .work-oncall-mark { right: 24px; }
.work-manage-section { min-width: 0; margin: 0 0 16px; padding: 16px; border: 1px solid var(--border-color); border-radius: var(--border-radius-section); }
.work-manage-section > p { overflow-wrap: anywhere; }
.work-manage-section form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 720px; }
.work-manage-section button, #work-retry, #work-targets-retry { box-sizing: border-box; min-height: 44px; }
.work-manage-section form > button { justify-self: start; padding: 8px 14px; }
.work-color-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.work-color-pair > div { display: grid; gap: 6px; }
.work-color-pair input[type="color"] { box-sizing: border-box; width: 100%; min-height: 44px; }
.work-danger { border-color: var(--error-fg-color); color: var(--error-fg-color); }
#work-targets-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr)); gap: 12px; align-items: end; }
#work-targets-save { display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; min-height: 44px; padding: 8px 14px; }
.work-summary { width: 100%; margin-top: 16px; border-collapse: collapse; }
.work-summary caption { text-align: left; font-weight: 700; padding: 8px 0; }
.work-summary th, .work-summary td { padding: 8px 5px; text-align: right; border-bottom: 1px solid var(--border-color); }
.work-summary th:first-child, .work-summary td:first-child { text-align: left; }
.work-summary thead { background: var(--table-header-bg-color); }
@media (max-width: 700px) {
   .work-main { padding: 10px; }
   .work-entries th, .work-entries td { padding: 7px 4px; }
   .work-entries col.work-entries-sub { width: 90px; }
   .work-entries col.work-entries-time { width: 80px; }
   .work-entries col.work-entries-action { width: 46px; min-width: 46px; max-width: 46px; }
   .work-entries .work-entries-action-header, .work-entries .work-entries-action-cell { padding: 2px; }
   .work-entry-create { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 6px; }
   .work-entry-create-type { grid-column: 1 / 4; grid-row: 1; }
   .work-entry-create-sub { grid-column: 4 / 7; grid-row: 1; }
   .work-entry-create-time { grid-column: 1 / 5; grid-row: 2; }
   #quick-now { grid-column: 5; grid-row: 2; justify-self: end; }
   #entry-new-add { grid-column: 6; grid-row: 2; justify-self: end; }
   .work-day-status-fields { grid-template-columns: 1fr; }
   .work-calendar { overflow-x: visible; }
   .work-weekdays { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 5px; }
   .work-weekdays li { display: grid; place-items: center; }
   .work-weekdays li:nth-child(6), .work-weekdays li:nth-child(7) { display: none; }
   .work-weekdays .work-weekend-heading { display: grid; grid-column: 6; white-space: nowrap; }
   .work-days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
   .work-week { display: block; }
   .work-week-days { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(110px, auto); gap: 5px; list-style: none; margin: 0; padding: 0; }
   .work-weekend { display: block; grid-column: 6; grid-row: 1; min-width: 0; }
   .work-weekend-days { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 3px; height: 100%; list-style: none; margin: 0; padding: 0; }
   .work-day-item, .work-day-placeholder { min-height: 0; }
   .work-day { height: auto; min-height: 110px; padding: 5px 3px; gap: 2px; line-height: 1.15; }
   .work-day.is-weekend { height: 100%; min-height: 0; padding: 3px; gap: 1px; }
   .work-day.is-weekend .work-day-times, .work-day.is-weekend .work-day-duration.is-placeholder { display: none; }
   .work-day-heading { padding-bottom: 2px; white-space: nowrap; }
   .work-day-times { grid-template-columns: 1fr; font-size: 0.7rem; line-height: 1.1; }
   .work-day-duration, .work-estimate { padding-top: 2px; font-size: 0.7rem; }
   .work-estimate::before { content: "Vsl. "; }
   .work-note-mark { right: 3px; font-size: 11px; }
   .work-oncall-mark { right: 3px; font-size: 10px; }
   .work-day.has-note .work-oncall-mark { right: 17px; }
   .work-manage-section { padding: 12px; }
   .work-color-pair { grid-template-columns: minmax(0, 1fr); }
   .work-summary { font-size: 0.9rem; }
   .work-summary th, .work-summary td { padding: 7px 3px; }
}