:root {
  color-scheme: light;
  --ink: #34271f;
  --muted: #74685f;
  --paper: #f4f0e9;
  --card: #fffdfa;
  --line: #dfd6cb;
  --coffee: #835235;
  --coffee-dark: #603921;
  --soft: #eee5d9;
  --danger: #a03132;
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, a, input, select, summary, [tabindex] { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--coffee); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.2; font-weight: 650; letter-spacing: -.035em; }
h2 { font-size: 1.2rem; line-height: 1.35; font-weight: 650; }
small { font-size: .875rem; }
input, select { width: 100%; min-width: 0; min-height: 48px; padding: 11px 13px; border: 1px solid #baad9e; border-radius: 9px; background: var(--card); color: var(--ink); }
input[readonly] { background: var(--soft); }
input::placeholder { color: #8c8075; }
label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: .875rem; font-weight: 650; padding: 0 0 12px; }
.site-header { min-height: 100px; max-width: 1536px; margin: auto; padding: 20px 40px; display: flex; gap: 40px; align-items: center; border-bottom: 1px solid var(--line); }
.brand { font: bold 2.35rem/.95 Georgia, "Times New Roman", serif; letter-spacing: -.09em; flex-shrink: 0; }
.brand span { display: block; margin-top: 9px; letter-spacing: .11em; font: 500 .65rem/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; text-transform: uppercase; }
.main-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.main-nav a { padding: 10px 15px; font-size: .9375rem; border-radius: 9px; color: var(--muted); }
.main-nav a[aria-current] { background: var(--ink); color: white; }
.main-nav a:hover:not([aria-current]) { background: var(--soft); }
.account { margin-left: auto; display: flex; gap: 13px; align-items: center; }
.account-role { font-size: .875rem; color: var(--muted); }
.page { max-width: 1536px; padding: 36px 40px 52px; min-height: calc(100vh - 180px); margin: auto; }
.site-footer { max-width: 1456px; margin: 0 auto; padding: 20px 0; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.site-footer span:first-child { font-family: Georgia, serif; font-size: 1rem; font-weight: bold; }
.eyebrow { display: block; font-size: .75rem; font-weight: 650; letter-spacing: .1em; color: var(--coffee); margin-bottom: 10px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.page-description { color: var(--muted); max-width: 740px; margin: -9px 0 28px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.button { display: inline-flex; justify-content: center; align-items: center; text-align: center; min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: 9px; font-size: .875rem; font-weight: 600; line-height: 1.5; transition: background .15s ease, border-color .15s ease; }
.primary { background: var(--coffee); color: white; }
.primary:hover { background: var(--coffee-dark); }
.secondary { background: var(--card); border-color: var(--line); }
.secondary:hover { background: var(--soft); border-color: #b7a58e; }
.quiet { background: transparent; }
.quiet:hover { background: var(--soft); }
.danger { color: var(--danger); }
.full { width: 100%; }
.muted { color: var(--muted); font-size: .875rem; }
.tabs { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; width: fit-content; margin-bottom: 24px; background: #eae2d7; }
.tabs a { padding: 9px 29px; font-weight: 600; font-size: .9375rem; border-radius: 7px; color: var(--muted); }
.tabs a[aria-current] { background: var(--card); color: var(--ink); box-shadow: 0 2px 4px #30200f12; }
.period-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.period-title { display: flex; align-items: center; gap: 16px; }
.period-title h2 { font-size: 1.1875rem; font-variant-numeric: tabular-nums; }
.period-title .muted { display: block; margin-top: 4px; }
.calendar-mark { width: 46px; height: 48px; display: grid; place-items: center; background: var(--soft); border-top: 5px solid var(--coffee); border-radius: 7px; font: 600 1.4rem Georgia, serif; }
.period-controls { display: flex; gap: 8px; flex-shrink: 0; }
.employee-picker { display: flex; align-items: center; gap: 14px; margin: 22px 0; }
.employee-picker label { margin: 0; }
.employee-picker select { width: 300px; max-width: 100%; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 24px 0 32px; border-bottom: 1px solid var(--line); padding-bottom: 23px; }
.stats > div { padding: 2px 24px; border-right: 1px solid var(--line); }
.stats > div:first-child { padding-left: 0; }
.stats > div:last-child { border-right: 0; }
.stat-value { display: block; font-size: 1.85rem; font-weight: 650; line-height: 1.3; letter-spacing: -.035em; overflow-wrap: anywhere; }
.stat-value small { font-size: 1.1rem; font-weight: 500; }
.stat-label { display: block; margin-top: 5px; color: var(--muted); font-size: .875rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { font-size: 1.125rem; }
.table-wrap { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; scrollbar-color: #af9b85 var(--soft); }
table { width: 100%; border-spacing: 0; border-collapse: separate; text-align: left; }
.roster { table-layout: fixed; width: max-content; min-width: 100%; font-variant-numeric: tabular-nums; }
.roster th, .roster td { width: 96px; min-width: 96px; border-bottom: 1px solid var(--line); border-right: 1px solid #ece4da; vertical-align: middle; padding: 7px; }
.roster th { text-align: center; background: #f8f4ee; }
.roster tbody tr:last-child td, .roster tbody tr:last-child th { border-bottom: 0; }
.roster .name-column { width: 178px; min-width: 178px; position: sticky; left: 0; z-index: 2; text-align: left; padding: 15px; font-size: .9375rem; overflow-wrap: anywhere; background: var(--card); border-right: 1px solid #c8b8a5; }
.roster thead .name-column { background: #f8f4ee; }
.roster .total-column { width: 100px; min-width: 100px; text-align: center; background: #f8f4ee; }
.total-column strong { display: block; font-size: .9375rem; }
.total-column .muted { display: block; margin-top: 5px; }
.roster .weekend { background: #eee8df; }
.day-number { display: block; font-size: 1rem; }
.weekday { display: block; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.shift-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 94px; padding: 8px 4px; gap: 5px; border-radius: 7px; text-align: center; overflow-wrap: anywhere; }
.shift-cell strong { font-size: .875rem; line-height: 1.35; font-weight: 650; }
.shift-cell > span { font-size: .75rem; line-height: 1.25; }
.shift-cell:hover { box-shadow: inset 0 0 0 2px var(--coffee); }
.shift-cell .cell-plus { font-size: 1.3rem; color: #9c8e7e; font-weight: 400; }
.empty-cell:hover { background: #fffaf3; }
.point-0 { background: #eee0d1; color: #613e22; }
.point-1 { background: #e9e5d7; color: #514f2b; }
.point-2 { background: #eee0db; color: #713f35; }
.point-3 { background: #dde7e5; color: #32534c; }
.mobile-roster { display: none; }
.personal-table { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.personal-table th, .personal-table td { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.personal-table thead th { font-size: .875rem; background: #ece4d8; }
.personal-table tbody th { font-size: .9375rem; font-weight: 600; }
.personal-table tbody tr:last-child > * { border-bottom: 0; }
.personal-table .day-off { background: #f4f0e9; color: var(--muted); }
.weekday-inline { font-size: .8125rem; margin-left: 11px; color: var(--muted); }
.weekend-text { color: var(--coffee); }
.point-label { display: inline-block; padding: 5px 10px; border-radius: 6px; font-size: .875rem; }
.panel { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.empty-state { margin-top: 24px; text-align: center; padding: 44px 24px; }
.empty-state p { max-width: 500px; margin: 14px auto 22px; color: var(--muted); }
.empty-number { display: block; font: 2.6rem Georgia, serif; margin-bottom: 16px; color: var(--coffee); }
.empty-state h1 { font-size: 1.6rem; }
.centered { justify-content: center; }
.management-grid { display: grid; grid-template-columns: 1.2fr 1fr; align-items: start; gap: 24px; max-width: 1100px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack > .eyebrow { margin-bottom: -15px; }
.align-start { align-self: start; }
.field { width: 100%; }
.count { min-width: 30px; padding: 3px 9px; background: var(--soft); border-radius: 6px; font-size: .875rem; text-align: center; }
.employee-list { margin: 0; padding: 0; list-style: none; }
.employee-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 0; border-top: 1px solid var(--line); }
.employee-name { display: flex; align-items: center; gap: 13px; min-width: 0; }
.employee-name strong { overflow-wrap: anywhere; }
.employee-name small { display: block; color: var(--muted); margin-top: 3px; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: var(--soft); color: var(--coffee); font-weight: 650; }
.time-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.location-card summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; list-style: none; }
summary::-webkit-details-marker { display: none; }
.location-card summary strong { font-size: 1.125rem; overflow-wrap: anywhere; }
.location-card summary small { display: block; color: var(--muted); margin-top: 8px; line-height: 1.8; }
.edit-label { font-size: .875rem; color: var(--coffee); font-weight: 600; }
.location-edit { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 22px; }
.delete-location { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.narrow { width: 100%; max-width: 650px; margin-left: auto; margin-right: auto; }
.back-link { display: inline-block; color: var(--coffee); font-size: .9375rem; margin-bottom: 24px; padding: 5px 0; }
.form-hint { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.employee-list + .form-hint { margin-top: 18px; }
.shift-duration { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--soft); border-radius: 9px; font-size: .9375rem; }
.shift-duration output { font-weight: 650; }
.delete-shift { margin-top: 20px; text-align: right; }
.notice { padding: 14px 18px; border: 1px solid #b9c7ad; background: #e9efe2; border-radius: 10px; margin-bottom: 24px; color: #394d2c; }
.notice.error { border-color: #d8a5a5; background: #fbeeed; color: var(--danger); font-size: .9375rem; }
.login-shell { min-height: 65vh; max-width: 1050px; margin: auto; display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 85px; }
.login-intro h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(2.6rem, 4vw, 3.7rem); letter-spacing: -.05em; line-height: 1.15; }
.login-intro p { margin-top: 24px; color: var(--muted); max-width: 350px; }
.login-rule { width: 60px; height: 2px; background: var(--coffee); margin: 36px 0 18px; }
.login-form { padding: 36px; box-shadow: 0 15px 50px #4e36200b; }
.login-form h2 { margin-bottom: 26px; font-size: 1.55rem; }
.login-form input { margin-bottom: 20px; }
.login-form button { margin-top: 8px; }
.print-only { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 50; left: 20px; top: -100px; padding: 12px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 15px; }
@media (max-width: 1100px) {
  .site-header { padding: 18px 24px; gap: 24px; }
  .page { padding: 28px 24px 44px; }
  .site-footer { margin: 0 24px; }
  .account-role { display: none; }
  .page-heading { align-items: flex-start; }
  .page-heading > .actions { justify-content: flex-end; max-width: 340px; }
  .desktop-hint { max-width: 380px; text-align: right; }
  .login-shell { gap: 40px; }
}
@media (max-width: 760px) {
  .site-header { min-height: 80px; padding: 17px 18px; gap: 17px; flex-wrap: wrap; }
  .brand { font-size: 2rem; }
  .main-nav { order: 3; width: 100%; border-top: 1px solid var(--line); padding-top: 14px; gap: 5px; }
  .main-nav a { flex: 1; text-align: center; font-size: .875rem; padding: 9px; }
  .account { margin-left: auto; }
  .page { padding: 25px 16px 36px; }
  .site-footer { margin: 0 16px; flex-wrap: wrap; font-size: .75rem; }
  .page-heading { display: block; margin-bottom: 22px; }
  .page-heading > .actions { margin-top: 18px; max-width: none; justify-content: flex-start; }
  .page-heading > .button { margin-top: 17px; }
  .actions .button { flex: 1 1 auto; }
  .tabs { width: 100%; margin-bottom: 18px; }
  .tabs a { flex: 1; text-align: center; }
  .period-bar { padding: 17px; display: block; }
  .period-title { gap: 12px; }
  .period-title h2 { font-size: 1rem; }
  .calendar-mark { width: 37px; height: 43px; font-size: 1.2rem; flex-shrink: 0; }
  .period-controls { margin-top: 16px; }
  .period-controls .button { flex: 1; padding: 9px 6px; font-size: .8125rem; }
  .employee-picker { flex-wrap: wrap; gap: 9px; }
  .employee-picker label { width: 100%; }
  .employee-picker select { flex: 1; width: 160px; }
  .stats { margin: 20px 0 23px; padding-bottom: 19px; }
  .stats > div { padding: 2px 12px; }
  .stat-value { font-size: 1.5rem; }
  .stat-value small { font-size: .875rem; }
  .stat-label { font-size: .8125rem; }
  .desktop-table, .desktop-hint { display: none; }
  .mobile-roster { display: flex; flex-direction: column; gap: 16px; }
  .employee-card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
  .employee-card summary { padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; list-style: none; }
  .employee-card summary strong { font-size: 1.125rem; overflow-wrap: anywhere; }
  .employee-card summary small { color: var(--muted); display: block; margin-top: 4px; }
  .expand-icon { font-size: 1.5rem; color: var(--coffee); }
  .employee-card[open] .expand-icon { transform: rotate(45deg); }
  .mobile-days { display: grid; gap: 8px; padding: 0 12px 12px; }
  .mobile-day { display: flex; align-items: center; gap: 13px; border-radius: 9px; min-height: 77px; padding: 11px 13px; }
  .mobile-date { width: 50px; flex-shrink: 0; border-right: 1px solid #6e564431; }
  .mobile-date strong { display: block; font-size: 1.25rem; line-height: 1.2; }
  .mobile-date > span { font-size: .75rem; }
  .mobile-shift { flex: 1; min-width: 0; }
  .mobile-shift strong { display: block; font-size: .9375rem; }
  .mobile-shift small { display: block; margin-top: 2px; overflow-wrap: anywhere; }
  .mobile-day.day-off { background: #f3efe8; color: #75685b; }
  .section-heading { gap: 8px; align-items: flex-start; }
  .personal-table, .personal-table tbody { display: block; background: none; border: 0; overflow: visible; }
  .personal-table thead { display: none; }
  .personal-table tbody { display: grid; gap: 12px; }
  .personal-table tr { display: grid; gap: 10px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
  .personal-table th, .personal-table td { display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 0; padding: 0; font-size: .9375rem; min-width: 0; }
  .personal-table th { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
  .personal-table td::before { content: attr(data-label); font-size: .875rem; color: var(--muted); }
  .personal-table .point-label { text-align: right; overflow-wrap: anywhere; }
  .personal-table .day-off td:nth-last-child(-n+2) { display: none; }
  .management-grid { grid-template-columns: 1fr; gap: 18px; }
  .panel { padding: 22px 18px; }
  .employee-list li { align-items: flex-start; }
  .avatar { display: none; }
  .employee-list .button { padding: 9px 8px; }
  .time-grid { gap: 12px; }
  .narrow .page-heading h1 { font-size: 1.75rem; }
  .login-shell { grid-template-columns: 1fr; gap: 28px; padding: 20px 0; max-width: 420px; min-height: 0; }
  .login-intro h1 { font-size: 2.5rem; }
  .login-intro p { margin-top: 14px; }
  .login-rule, .login-intro > .muted { display: none; }
  .login-form { padding: 26px 22px; }
  .notice { padding: 13px; font-size: .9375rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: white; color: black; font-size: 10pt; }
  .no-print, .skip-link, .mobile-roster, .employee-picker { display: none !important; }
  .page { max-width: none; padding: 0; min-height: 0; }
  .page-heading { margin-bottom: 10px; }
  h1 { font-size: 18pt; }
  .eyebrow { color: #555; font-size: 8pt; }
  .period-bar { border: 0; padding: 0; border-radius: 0; background: white; }
  .period-title h2 { font-size: 12pt; }
  .stats { display: flex; margin: 12px 0; padding: 0 0 9px; gap: 30px; }
  .stats > div { padding: 0; border: 0; }
  .stat-value { font-size: 12pt; }
  .stat-label { font-size: 8pt; }
  .desktop-table { display: block; overflow: visible; border-radius: 0; border: 0; }
  .roster { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
  .roster th, .roster td { width: auto; min-width: 0; padding: 2px 1px; border: 1px solid #999; font-size: 7pt; }
  .roster .name-column { position: static; width: 24mm; min-width: 0; padding: 4px; border: 1px solid #999; font-size: 8pt; }
  .roster .total-column { width: 15mm; min-width: 0; }
  .roster .total-column strong, .roster .total-column .muted { font-size: 7pt; }
  .shift-cell { min-height: 0; padding: 2px 0; gap: 4px; background: none; color: black; }
  .shift-cell strong { font-size: 6.5pt; }
  .shift-cell > span { font-size: 6pt; }
  .day-number { font-size: 8pt; }
  .weekday { font-size: 6.5pt; }
  .print-only { display: inline; }
  .personal-table { display: table; border-collapse: collapse; border: 1px solid #aaa; }
  .personal-table thead { display: table-header-group; }
  .personal-table tbody { display: table-row-group; }
  .personal-table tr { display: table-row; padding: 0; }
  .personal-table th, .personal-table td, .personal-table .day-off td:nth-last-child(-n+2) { display: table-cell; padding: 4px 8px; font-size: 9pt; border-bottom: 1px solid #bbb; }
  .personal-table td::before { display: none; }
  .point-label { background: none; color: black; padding: 0; font-size: 9pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  .stats, .period-bar, .page-heading { break-inside: avoid; }
}
