:root { color-scheme: light; font-family: system-ui, "Malgun Gothic", sans-serif; color: #222b24; background: #f5f6f2; }
* { box-sizing: border-box; }
body { margin: 0; }
header { background: #21392d; color: white; }
.wrap { max-width: 1160px; padding-inline: 24px; margin: auto; }
.brand { padding-block: 17px; font-weight: 750; }
.brand span { opacity: .76; font-weight: 500; margin-left: 10px; font-size: .85rem; }
main { padding-block: 25px 48px; }
h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.3rem); }
h2 { margin: 0 0 14px; font-size: 1.13rem; }
.muted { color: #586459; }
.layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { background: white; border: 1px solid #dae0d8; border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 5px; font-size: .87rem; font-weight: 650; }
.date-field { position: relative; display: flex; flex-wrap: wrap; align-items: end; gap: 5px; }
.date-field[hidden] { display: none; }
.date-field label { flex: 1 1 8rem; }
.date-picker { position: absolute; inset-block-end: 0; inset-inline-start: 0; width: 1px; opacity: 0; pointer-events: none; }
.date-picker.date-picker-visible { position: static; width: 100%; opacity: 1; pointer-events: auto; }
.field-note { margin: 5px 0 0; font-size: .82rem; }
.store-default { grid-column: 1 / -1; }
.store-default button { margin-top: 7px; }
#store-default-status:empty { margin: 0; }
input, select, button { font: inherit; border-radius: 7px; min-height: 40px; }
input, select { min-width: 0; width: 100%; padding: 7px 9px; background: white; color: inherit; border: 1px solid #aebaae; }
input[type=checkbox] { width: 20px; min-height: 20px; accent-color: #28503a; }
button { padding: 7px 12px; border: 1px solid #28503a; color: white; background: #28503a; cursor: pointer; font-weight: 650; }
button.secondary { color: #234733; background: #eef4ee; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #26613d; outline-offset: 2px; }
.actions { margin-block: 12px; }
.schedule-header { margin-top: 20px; }
.schedule-header h2 { margin: 0; }
.schedule-copy { background: #f5f8f4; padding: 10px 12px; }
.copy-options, .copy-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.copy-options label { flex: 1 1 9rem; }
.copy-days { padding: 0; border: 0; }
#copy-targets { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.copy-target { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.copy-target:has(input:disabled) { color: #586459; }
.copy-target input { margin: 0; }
#copy-preview, #copy-status { margin: 6px 0; font-size: .87rem; }
#copy-status:empty { margin: 0; }
.schedule-note { margin: 8px 0; font-size: .87rem; }
fieldset { border: 1px solid #dfe5dd; border-radius: 7px; margin: 8px 0; min-width: 0; }
.day-toggle { display: flex; align-items: center; }
.times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.times[hidden] { display: none; }
.legacy-breaks p { margin: 8px 0 2px; font-size: .87rem; }
.day-work-time { margin: 8px 0 2px; color: #405448; font-size: .87rem; }
#contract-result-dialog {
  box-sizing: border-box;
  width: min(48rem, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(14px, 4vw, 24px);
  border: 1px solid #c9d4c7;
  border-radius: 10px;
  overflow: auto;
  overscroll-behavior: contain;
}
#contract-result-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.result-dialog-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.result-dialog-header h2 { margin: 0; }
#contract-result-dialog button { min-height: 44px; }
#result .contract-section { min-width: 0; overflow-x: auto; }
#server-draft-heading { scroll-margin-top: 16px; }
@media print { #contract-result-dialog { display: none !important; } }
.weekly-work-time { margin: 12px 0; font-weight: 650; }
.contract-fields { margin-block: 18px; padding: 12px; }
.contract-notice { font-size: .88rem; }
.contract-section { margin-top: 18px; }
.contract-section h3 { margin: 0 0 7px; padding-bottom: 5px; border-bottom: 1px solid #b9c8bb; font-size: 1rem; }
.contract-section p { margin: 7px 0; font-size: .88rem; }
.contract-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 5px 10px; margin: 0; font-size: .88rem; }
.contract-details dt { font-weight: 650; }
.contract-details dd { margin: 0; overflow-wrap: anywhere; }
.contract-schedule { width: 100%; border-collapse: collapse; font-size: .82rem; }
.contract-schedule th, .contract-schedule td { padding: 5px; border: 1px solid #d5dfd6; text-align: left; vertical-align: top; }
.contract-schedule thead { background: #eef4ee; }
.contract-schedule th:first-child { white-space: nowrap; }
.contract-breaks { white-space: pre-line; }
.contract-wages { margin-block: 8px; }
.contract-wages th:first-child { white-space: normal; }
.contract-wages th:not(:first-child), .contract-wages td { text-align: right; }
.contract-wages td:last-child { overflow-wrap: anywhere; }
.notice { background: #fff4dc; padding: 9px; border-radius: 6px; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } .wrap { padding-inline: 14px; } }

@media screen and (max-width: 600px) {
  #owner-workspace .panel { padding: 14px; }
  #owner-workspace label { font-size: .9375rem; line-height: 1.4; }
  #owner-workspace :is(input:not([type=checkbox]), select, button) {
    min-height: 44px;
    font-size: 1rem;
  }
  #owner-workspace .day-toggle { min-height: 44px; gap: 6px; }
  #owner-workspace .copy-target { padding-inline: 4px; }
  #owner-workspace .copy-actions > button { flex: 1 1 auto; }
  #owner-workspace #contract-form button[type=submit] { width: 100%; }
  #owner-workspace :is(.field-note, .schedule-note, .day-work-time, #copy-preview, #copy-status) {
    font-size: .9375rem;
    line-height: 1.45;
  }
  #owner-workspace .times input { padding-inline: 5px; }
  #result :is(.contract-details, .contract-section p, .contract-notice) { font-size: .9375rem; line-height: 1.5; }
  #result .contract-schedule { font-size: .875rem; line-height: 1.4; }
  #result .contract-schedule :is(th, td) { padding: 5px 4px; overflow-wrap: anywhere; }
  #result .contract-wages td:not(:last-child) { white-space: nowrap; }
}

@media screen and (max-width: 360px) {
  #owner-workspace .fields { grid-template-columns: minmax(0, 1fr); }
}
