:root {
  color-scheme: light;
  --ink: #152e33; --muted: #4e666b; --subtle: #647d82; --deep: #17373c;
  --teal: #166b65; --teal-dark: #0a524b; --light-teal: #e5f2ef;
  --bg: #f3f7f7; --surface: #fff; --line: #dae5e5;
  --warn: #795009; --warn-bg: #fff4db;
  --danger: #962d3a; --danger-bg: #fbecef;
  font-family: "Avenir Next", "Inter", system-ui, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.44;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 730; line-height: 1.05; letter-spacing: -.055em; }
h2 { font-size: 1.35rem; letter-spacing: -.023em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid #31867a; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 10; top: .5rem; left: .5rem; background: white; color: var(--ink); padding: .65rem 1rem; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.app { min-height: 100vh; display: grid; grid-template-columns: 14.25rem minmax(0, 1fr); }
.sidebar {
  color: #ebf6f4; background: var(--deep); min-height: 100vh;
  display: flex; position: sticky; top: 0; height: 100vh; flex-direction: column; padding: 1.5rem 1rem;
}
.brand { display: flex; align-items: center; gap: .7rem; margin: .55rem .3rem 2.2rem; }
.brand strong { display: block; font-size: 1.25rem; letter-spacing: -.04em; font-weight: 720; }
.brand span:not(.icon) { display: block; color: #b4cdca; font-size: .75rem; }
.brand-mark {
  width: 2.6rem; height: 2.6rem; color: #134943; background: #a4d6c7; border-radius: .8rem;
  display: grid; place-items: center; flex: none;
}
.icon { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; position: relative; flex: none; }
.icon-calendar, .icon-date { border: 1.55px solid currentColor; border-radius: .19rem; }
.icon-calendar::before, .icon-date::before { content: ""; position: absolute; width: 100%; top: .25rem; border-top: 1.5px solid currentColor; }
.icon-calendar::after { content: ""; width: .18rem; height: .18rem; background: currentColor; box-shadow: .26rem 0 currentColor, -.26rem 0 currentColor; margin-top: .26rem; }
.icon-date::after { content: ""; width: .23rem; height: .23rem; background: currentColor; border-radius: 50%; margin-top: .28rem; }
.icon-check { border: 1.5px solid currentColor; border-radius: 50%; }
.icon-check::after { content: ""; width: .37rem; height: .21rem; border-left: 1.5px solid; border-bottom: 1.5px solid; transform: translateY(-1px) rotate(-45deg); }
.icon-lock { border: 1.5px solid currentColor; width: .9rem; height: .67rem; border-radius: .15rem; margin: .32rem .1rem 0; }
.icon-lock::before { content: ""; position: absolute; border: 1.5px solid currentColor; border-bottom: 0; width: .42rem; height: .28rem; bottom: 100%; border-radius: .35rem .35rem 0 0; }
.main-nav { display: grid; gap: .3rem; }
.nav-button { width: 100%; display: flex; align-items: center; gap: .68rem; padding: .7rem .75rem; background: transparent; border: 1px solid transparent; color: #d8eae7; text-align: left; font-size: .91rem; font-weight: 620; border-radius: .55rem; }
.nav-button:hover { background: #25484a; }
.nav-button[aria-current="page"] { background: #2e5454; border-color: #456a67; color: #fff; }
.nav-count { margin-left: auto; border-radius: 1rem; padding: .02rem .39rem; color: #8c2935; background: #f6d4d9; font-size: .75rem; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #426264; padding-top: 1rem; }
.workspace-status { display: flex; gap: .65rem; padding: 0 .75rem .5rem; font-size: .9rem; align-items: flex-start; }
.workspace-status small { display: block; color: #b4cdca; margin-top: .22rem; }
.logout { color: #c2d7d4; font-weight: 520; }
.main { min-width: 0; padding: 0 clamp(1rem, 3.2vw, 3.5rem) 3rem; }
.utility { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--muted); font-weight: 620; font-size: .87rem; min-height: 4.35rem; border-bottom: 1px solid var(--line); margin-bottom: clamp(1.35rem, 3.2vw, 2.8rem); }
.revision-label { font-size: .81rem; font-weight: 550; color: var(--subtle); text-align: right; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.3rem; margin-bottom: 1.65rem; }
.page-heading p { color: var(--muted); margin-top: .45rem; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.65rem; padding: .55rem .87rem; background: white; border: 1px solid #d3dfde; border-radius: .55rem; color: var(--ink); font-size: .9rem; font-weight: 670; text-decoration: none; }
.button:hover { background: #eef5f4; border-color: #aac6c3; }
.button.primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.button.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button.quiet { background: transparent; border-color: transparent; color: var(--teal-dark); }
.button.quiet:hover { background: var(--light-teal); }
.button.danger { color: var(--danger); border-color: #e8c4ca; }
.button.danger:hover { background: var(--danger-bg); }
.button.small { min-height: 2.2rem; padding: .35rem .55rem; }
.chevron { display: block; width: .55rem; height: .55rem; border-right: 1.6px solid; border-top: 1.6px solid; transform: rotate(45deg); }
.chevron.left { transform: rotate(-135deg); }
.toolbar { border: 1px solid var(--line); border-radius: .8rem; padding: .65rem .75rem; background: white; display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; justify-content: space-between; margin-bottom: 1rem; }
.period { display: flex; align-items: center; gap: .35rem; min-width: 0; flex-wrap: wrap; }
.period h2 { margin-left: .3rem; min-width: 8.6rem; }
.period input { width: 9.65rem; margin-left: .2rem; }
.segments { display: flex; border-radius: .55rem; background: #edf3f2; padding: .2rem; gap: .15rem; }
.segments button { min-height: 2.15rem; border: 1px solid transparent; color: var(--muted); background: transparent; border-radius: .42rem; padding: .28rem .68rem; font-size: .88rem; font-weight: 650; }
.segments button:hover { color: var(--teal-dark); }
.segments button[aria-pressed="true"] { color: var(--teal-dark); background: white; border-color: #dce8e6; box-shadow: 0 1px 3px #153e3210; }
.summary { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.15rem; margin: .2rem .15rem 1.1rem; color: var(--muted); font-size: .9rem; }
.summary strong { color: var(--ink); }
.summary .issue-link { color: var(--teal-dark); text-decoration: underline; text-underline-offset: .2rem; border: 0; background: transparent; font-size: inherit; padding: .08rem 0; }
.day-column { min-width: 0; border: 1px solid var(--line); background: #ebf2f2; border-radius: .7rem; overflow: hidden; }
.day-column.weekend { grid-column: span 1; }
.day-head { background: #fbfdfd; border-bottom: 1px solid var(--line); padding: .62rem .65rem .53rem; display: flex; justify-content: space-between; gap: .35rem; align-items: center; }
.day-head h3 { font-size: .95rem; letter-spacing: -.02em; }
.day-head time { display: block; color: var(--muted); font-size: .86rem; font-weight: 560; }
.day-content { padding: .46rem; display: grid; gap: .46rem; }
.day-notice, .absence-notice { padding: .4rem .46rem; border-radius: .4rem; font-size: .8rem; line-height: 1.34; }
.day-notice { color: var(--warn); background: var(--warn-bg); }
.absence-notice { color: #30584f; background: #e0eeea; }
.absence-notice span { font-weight: 690; }
.shift { background: white; border: 1px solid #dbe7e6; border-radius: .47rem; padding: .58rem .52rem; overflow-wrap: anywhere; }
.shift.marked { border-color: #d5a955; }
.shift.cancelled { color: var(--muted); background: #f8fbfb; }
.shift strong { font-size: .92rem; line-height: 1.22; display: block; }
.site-note { display: block; font-size: .79rem; color: var(--muted); margin-top: .2rem; }
.people-lines { display: grid; margin: .42rem 0 0; gap: .25rem; font-size: .86rem; }
.people-lines div { display: grid; grid-template-columns: minmax(2.9rem, auto) 1fr; gap: .23rem; }
.people-lines dt { color: var(--subtle); }
.people-lines dd { margin: 0; }
.person { display: inline; }
.person-color::before { content: ""; display: inline-block; border-radius: 50%; width: .49rem; height: .49rem; margin-right: .24rem; margin-bottom: .075rem; background-color: var(--person-color); box-shadow: inset 0 0 0 1px #00000022; }
.open { color: var(--warn); font-weight: 650; }
.empty-day { color: var(--muted); padding: .55rem .1rem; font-size: .9rem; }
.day-detail { max-width: 56rem; }
.day-detail .day-head { padding: .85rem 1rem; }
.day-detail .day-content { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); padding: .75rem; gap: .75rem; }
.day-detail .shift { padding: .9rem; }
.day-detail .shift strong { font-size: 1.05rem; }
.day-detail .day-notice, .day-detail .absence-notice { grid-column: 1 / -1; font-size: .88rem; }
.day-findings { grid-column: 1 / -1; font-size: .88rem; color: var(--warn); background: var(--warn-bg); border-radius: .45rem; margin: 0; padding: .6rem .65rem .6rem 1.7rem; }
.day-findings li + li { margin-top: .3rem; }
.error-finding { color: var(--danger); }
.table-wrap { background: white; border: 1px solid var(--line); border-radius: .8rem; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--muted); background: #e9f2f0; font-size: .85rem; font-weight: 680; }
th, td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
td { font-size: .91rem; }
tr:last-child td { border-bottom: 0; }
.date-cell { white-space: nowrap; }
.status { font-size: .8rem; display: inline-block; padding: .1rem .5rem; background: var(--light-teal); color: var(--teal-dark); border-radius: 1rem; white-space: nowrap; }
.status.pending { background: var(--warn-bg); color: var(--warn); }
.issue-table td:nth-child(2) { white-space: nowrap; }
.status.error { background: var(--danger-bg); color: var(--danger); }
.no-data { padding: 1.1rem; background: white; color: var(--muted); border: 1px solid var(--line); border-radius: .7rem; }
.alert { color: #264a45; border: 1px solid #bed8d1; background: #e8f3ef; border-radius: .55rem; padding: .7rem .8rem; margin-bottom: 1rem; font-size: .92rem; }
.alert.error { color: var(--danger); border-color: #e7c0c7; background: var(--danger-bg); }
.alert ul { margin: .35rem 0 0; padding-left: 1.25rem; }
input, select { min-height: 2.45rem; min-width: 0; max-width: 100%; padding: .4rem .53rem; color: var(--ink); background: #fff; border: 1px solid #b9cfcd; border-radius: .42rem; }
label { color: var(--ink); font-size: .9rem; font-weight: 630; }
dialog { width: min(55rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; border: 1px solid #bfd0cf; border-radius: 1rem; background: white; color: var(--ink); box-shadow: 0 25px 75px #102c3750; }
dialog::backdrop { background: #102c3777; }
.dialog-small { max-width: 34rem; }
.dialog-head { display: flex; padding: 1.2rem 1.25rem .85rem; justify-content: space-between; align-items: center; gap: .75rem; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 1.1rem 1.25rem; }
.dialog-body > p { color: var(--muted); margin-bottom: .9rem; }
.dialog-body [data-refresh] { margin-bottom: .9rem; }
.dialog-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; border-top: 1px solid var(--line); padding: .85rem 1.25rem; background: #f7fbfa; }
.editor-rows { display: grid; gap: .7rem; }
.editor-row { background: #f6faf9; border: 1px solid #d9e7e4; padding: .65rem; border-radius: .55rem; }
.editor-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.editor-fields label, .vacation-fields label { display: grid; gap: .22rem; align-content: start; }
.editor-fields .label-oris { grid-column: 1 / -1; max-width: 20rem; }
.editor-options { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .45rem; }
.check-option { display: flex; gap: .45rem; align-items: center; }
.check-option input { min-height: auto; width: 1rem; height: 1rem; margin: 0; accent-color: var(--teal); }
.vacation-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.vacation-fields .full { grid-column: 1 / -1; }
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; background: radial-gradient(ellipse at 35% 20%, #dcece6, #f5f8f8 70%); }
.login-card { width: min(100%, 27rem); padding: clamp(1.35rem, 5vw, 2.7rem); border: 1px solid var(--line); border-radius: 1.2rem; background: white; box-shadow: 0 18px 62px #24474612; }
.login-card .brand-mark { margin-bottom: 1.1rem; }
.login-card .eyebrow { font-weight: 650; font-size: .92rem; margin-bottom: .45rem; color: var(--teal-dark); }
.login-card p:not(.eyebrow) { margin-top: .5rem; color: var(--muted); }
.login-card form { margin-top: 1.2rem; display: grid; gap: .45rem; }
.login-card form button { margin-top: .45rem; }
@media (max-width: 1150px) {
  .app { grid-template-columns: 12.4rem minmax(0, 1fr); }
  .sidebar { padding-inline: .75rem; }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { position: relative; min-height: 0; height: auto; padding: .65rem 1rem .55rem; }
  .brand { margin: 0; padding-right: 5rem; }
  .brand-mark { width: 2.25rem; height: 2.25rem; }
  .brand strong { font-size: 1.05rem; }
  .sidebar-bottom { position: absolute; top: .56rem; right: .65rem; margin: 0; border: 0; padding: 0; }
  .workspace-status { display: none; }
  .logout { font-size: .8rem; padding: .55rem .45rem; }
  .main-nav { margin-top: .55rem; grid-template-columns: repeat(3, 1fr); gap: .22rem; }
  .nav-button { min-height: 2.4rem; gap: .31rem; padding: .35rem; justify-content: center; font-size: .79rem; }
  .nav-button .icon { width: .9rem; height: .9rem; }
  .nav-count { margin-left: 0; }
  .main { padding-bottom: 1.5rem; }
  .utility { min-height: 2.8rem; margin-bottom: 1.12rem; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
  .editor-fields { grid-template-columns: 1fr 1fr; }
  .toolbar { align-items: stretch; }
}
@media (max-width: 480px) {
  .main { padding-inline: .7rem; }
  .toolbar { gap: .5rem; padding: .45rem; }
  .period { gap: .25rem; width: 100%; }
  .period h2 { font-size: 1.08rem; min-width: 0; flex: 1; }
  .period input { width: 8.35rem; padding-inline: .25rem; font-size: .82rem; }
  .segments { width: 100%; }
  .segments button { flex: 1; }
  .day-detail .day-content { grid-template-columns: 1fr; }
  .dialog-head, .dialog-body, .dialog-footer { padding-inline: .7rem; }
  table th, table td { padding: .55rem; }
}

/* Give each weekday enough space for an entire clinical team. */
.month-mode { display: block; }
.month-mode .main { padding-inline: clamp(.65rem, 1.4vw, 1.6rem); padding-bottom: .65rem; }
.month-mode .utility { min-height: 1.7rem; margin: 0 0 .4rem; }
.month-mode .period h1 { margin-inline: .28rem .44rem; font-size: clamp(1.3rem, 1.9vw, 1.65rem); letter-spacing: -.035em; }
.month-mode .toolbar { padding: .25rem .35rem; margin: 0 0 .4rem; }
.month-mode .main .button, .month-mode .period input { min-height: 2.1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

@media (min-width: 761px) {
  .month-mode .sidebar {
    min-height: 0; height: auto; position: relative; display: flex; flex-direction: row;
    align-items: center; flex-wrap: wrap; gap: .45rem 1.35rem; padding: .36rem clamp(.65rem, 1.4vw, 1.6rem);
  }
  .month-mode .brand { margin: 0; gap: .5rem; }
  .month-mode .brand strong { font-size: 1rem; }
  .month-mode .brand-mark { width: 2rem; height: 2rem; border-radius: .5rem; }
  .month-mode .brand span:not(.icon) { font-size: .75rem; }
  .month-mode .main-nav { display: flex; gap: .2rem; }
  .month-mode .nav-button { width: auto; padding: .32rem .57rem; gap: .4rem; }
  .month-mode .sidebar-bottom { margin: 0 0 0 auto; padding: 0; border: 0; }
  .month-mode .workspace-status { display: none; }
}

/* Retain the roster font size on shorter laptop screens; reclaim space around the rows. */
@media (min-width: 62rem) and (max-height: 56rem) {
  .month-mode .sidebar { padding-block: .16rem; }
  .month-mode .utility {
    position: absolute; top: .32rem; right: 7rem; min-height: 1.7rem; margin: 0; border: 0;
  }
  .month-mode .utility > :first-child { display: none; }
  .month-mode .revision-label { color: #c3dcd8; }
  .month-mode .toolbar { margin-block: .25rem; padding-block: .1rem; }
}

.sheet-tools, #sheet-editbar { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem; margin:.4rem 0; }
.sheet-zoom { display:inline-flex; margin-right:.35rem; }
.sheet-zoom button { border-radius:0; min-width:2.1rem; }
.sheet-zoom button:first-child { border-radius:.45rem 0 0 .45rem; }
.sheet-zoom button:last-child { border-radius:0 .45rem .45rem 0; }
.sheet-zoom button + button { border-left:0; }
.sheet-tools [data-sheet-action="print"] { margin-left:auto; }
#sheet-editbar, #sheet-info:not([hidden]) { padding:.4rem .65rem; border:1px solid #ebcf88; border-radius:.4rem; background:#fff6d9; }
#sheet-editdate { font-weight:650; margin-right:.5rem; }
#sheet-info { margin:.4rem 0; }
#sheet-info.error { color:var(--danger); }
.sheet-scroll { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; background:white; border:1px solid #176a83; }
.sheet-paper { zoom:var(--sheet-zoom,1); min-width:76rem; color:#172f32; background:#fff; font:.875rem/1.2 Arial,Helvetica,sans-serif; border:.2rem solid #196b7d; }
.sheet-title { margin:0; padding:.35rem .65rem .2rem; font:bold 1.55rem/1.2 Arial,Helvetica,sans-serif; color:#196b7d; }
.sheet-notes { margin:0; padding:.08rem .65rem .3rem; font-size:.84rem; color:#345d64; }
.sheet-week { width:100%; table-layout:fixed; border-collapse:collapse; font-family:Arial,Helvetica,sans-serif; }
.sheet-role-col { width:4.2rem; }
.sheet-week th, .sheet-week td { padding:0; text-align:center; vertical-align:middle; font:inherit; white-space:pre-line; overflow-wrap:anywhere; border:1px solid #a5bfc3; }
.sheet-week thead th { background:#a9dfe8; font-weight:700; border-top:3px solid #196b7d; }
.sheet-week .sheet-role, .sheet-week .sheet-kw { background:#e8f5f7; color:#153941; padding:.15rem; font-weight:600; position:sticky; left:0; z-index:1; }
.sheet-week .sheet-kw { background:#a9dfe8; }
.sheet-week .day-start, .sheet-week .sheet-date { border-left:3px solid #196b7d; }
.sheet-week .sheet-value, .sheet-week .sheet-day {
  display:block; width:100%; min-height:1.35rem; padding:.09rem .12rem; margin:0; border:0; border-radius:0;
  text-align:center; background:transparent; color:inherit; font:inherit; white-space:pre-line; overflow-wrap:anywhere;
}
.sheet-week button:hover { box-shadow:inset 0 0 0 1px #176a83; }
.sheet-week button:focus-visible { outline-offset:-2px; }
.sheet-day { font-weight:700; }
.role-leave .sheet-value, .role-extra .sheet-value { min-height:1.12rem; font-size:.88em; }
.sheet-inline { width:100%; padding:0; min-height:1.35rem; border:1px solid #196b7d; border-radius:0; color:#112b30; background:white; font:inherit; text-align:center; }
.sheet-week .sheet-pending { box-shadow:inset 0 -3px #1b5c83; }
.sheet-focus .sidebar, .sheet-focus .utility { display:none; }
.sheet-focus .main { padding:.35rem; }
body.sheet-focus { min-height:100dvh; }
.sheet-focus .sheet-scroll { max-height:calc(100dvh - 7rem); overflow:auto; }
dialog.pdf-preview { width:min(76rem,96vw); max-width:96vw; }
.pdf-preview iframe { width:100%; height: min(70dvh, 56rem); display:block; border:0; }
.sheet-print-title { display:none; }
@media (max-width:760px) {
  .sheet-tools .button { min-height:2.65rem; }
  .sheet-tools [data-sheet-action="print"] { margin-left:0; }
  .sheet-scroll { touch-action:pan-x pan-y pinch-zoom; }
  .sheet-week .sheet-value, .sheet-week .sheet-day { min-height:1.8rem; }
  .sheet-week .sheet-inline { font-size:16px; min-height:1.8rem; }
  .sheet-focus .sheet-scroll { max-height:calc(100dvh - 12rem); }
}
@media print {
  @page { size:A4 landscape; margin:5mm; }
  body:has(.month-mode) { background:#fff; min-height:0; margin:0; }
  .month-mode { display:block; min-height:0; }
  .month-mode .sidebar,.month-mode .utility,.month-mode .toolbar,.month-mode .sheet-tools,
  .month-mode #sheet-editbar,.month-mode #sheet-info,.month-mode #page-message,
  .skip-link, dialog { display:none!important; }
  .month-mode .main { margin:0; padding:0; }
  .sheet-scroll, .sheet-focus .sheet-scroll { max-height:none; overflow:visible; border:0; }
  .sheet-paper { width:100%; min-width:0; zoom:1; border:1pt solid #196b7d; font:7.8pt/1.05 Arial,Helvetica,sans-serif; }
  .sheet-paper, .sheet-paper * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .sheet-title { font-size:17pt; padding:1mm 2mm; }
  .sheet-notes { font-size:8pt; padding:0 2mm 1mm; }
  .sheet-role-col { width:15mm; }
  .sheet-week { break-inside:avoid; page-break-inside:avoid; }
  .sheet-week th, .sheet-week td { font-size:inherit; }
  .sheet-week .sheet-role, .sheet-week .sheet-kw { position:static; font-size:7pt; }
  .sheet-week .sheet-value, .sheet-week .sheet-day { min-height:4.4mm; padding:.28mm; font-size:inherit; }
  .sheet-week .role-leave .sheet-value, .sheet-week .role-extra .sheet-value { min-height:3mm; }
  .sheet-week .day-start,.sheet-week .sheet-date { border-left-width:.8pt; }
  .sheet-week thead th { border-top-width:1.5pt; }
}
.sheet-paper { container-type:inline-size; }
.sheet-week { font-size:clamp(.75rem,.90cqw,.96rem); }
.sheet-tools [aria-pressed="true"] { background:#e3f2ee; border-color:#72a79e; }
@media print {
  .sheet-paper { container-type:normal; }
  .sheet-week { font-size:7.8pt; }
  .sheet-cell[data-saved] > * { display:none!important; }
  .sheet-cell[data-saved]::after { content:attr(data-saved); display:block; min-height:4.4mm; padding:.28mm; }
  .sheet-week .role-extra .sheet-cell::after { min-height:3mm; }
  .sheet-print-title { display:block; text-align:right; font-size:7pt; padding:1mm; }
}

/* Wochenbogen in der Gestaltung des Wochen-PDF. */
.week-mode .utility { min-height: 2.5rem; margin-bottom: .7rem; }
.week-mode .toolbar, .week-paper { max-width: 64rem; margin-inline: auto; }
.week-mode .toolbar { margin-bottom: .7rem; }
.week-mode .period h2 { min-width: 0; }
.week-paper {
  --week-ink: #142f35; --week-petrol: #245c66; --week-rule: #adc7cc;
  padding: .85rem clamp(.75rem, 2vw, 2rem) 1rem; border: 1px solid var(--line);
  background: white; color: var(--week-ink); font: 1rem/1.16 "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.week-head {
  display: grid; grid-template-columns: 31% minmax(0, 1fr);
  gap: .35rem 1rem; border-top: 3px solid #21859a; padding-top: .4rem; align-items: center;
}
.week-brand { grid-row: 1 / 4; padding: .25rem; color: var(--week-petrol); text-align: center; font-weight: bold; }
.week-brand img { display: block; width: min(100%, 9rem); max-height: 7.5rem; margin: auto; object-fit: contain; }
.week-heading, .week-caption, .week-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.week-heading h1 { font-size: clamp(1.65rem, 2.5vw, 2.25rem); letter-spacing: -.025em; }
.week-status {
  padding: .32rem .9rem; border-radius: .4rem; background: #e6f2f4; color: var(--week-petrol);
  text-transform: uppercase; font-size: .72rem; font-weight: bold;
}
.week-meta th, .week-meta td { border: 1px solid var(--week-rule); color: var(--week-ink); font-size: .86rem; }
.week-meta th { width: 33%; background: #d7eff2; padding: .18rem .55rem; }
.week-meta td { text-align: right; padding: 0; }
.week-meta td span { display: block; overflow-wrap: anywhere; padding: .18rem .55rem; }
.week-caption, .week-foot, .week-note { color: #47737c; font-size: .78rem; }
.week-caption { margin: .1rem 0 .4rem; }
.week-scroll { overflow-x: auto; }
.week-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 30.5rem; }
.week-table thead th { padding: .33rem .6rem; color: white; background: var(--week-petrol); font-size: .85rem; border: 0; }
.week-table thead th:nth-child(1) { width: 19%; }
.week-table thead th:nth-child(2) { width: 26%; }
.week-table thead th:nth-child(3) { width: 27.5%; }
.week-table tbody + tbody::before { content: ''; display: table-row; height: .25rem; }
.week-table tbody th, .week-table tbody td { border: 0; border-right: 1px solid var(--week-rule); border-bottom: 1px solid var(--week-rule); }
.week-table tbody td { font-size: 1rem; padding: .18rem .6rem; line-height: 1.12; overflow-wrap: anywhere; height: 1.85rem; font-style: italic; }
.week-table .week-site { font-weight: 700; font-style: normal; }
.week-table tbody tr:first-child > * { border-top: 1px solid var(--week-petrol); }
.week-table tbody tr:last-child > *, .week-table tbody th { border-bottom: 1px solid var(--week-petrol); }
.week-table tbody td:last-child { border-right-color: var(--week-petrol); }
.week-table tbody th {
  background: #edf6f7; color: var(--week-ink); padding: 0; vertical-align: top;
  border-left: 1px solid var(--week-petrol); box-shadow: inset 3px 0 #78b9c5;
}
.week-table .week-day-label {
  display: block; width: 100%; border: 0; padding: .38rem .55rem .3rem .68rem; text-align: left;
  background: transparent; color: inherit; font: inherit; font-size: 1rem;
}
.week-table th time { display: block; margin-top: .12rem; font-size: .78rem; font-weight: 400; color: #47737c; }
.week-table button time::after { content: '✎'; padding-left: .4em; }
.week-table th button:hover { background: #d7eff2; }
.week-table th button:focus-visible, .week-scroll:focus-visible { outline-offset: -3px; }
.week-table .week-notice td { background-color: #fff2cc; }
.week-table td.week-marked { background-color: #fce4df; }
.week-note, .week-foot { margin-top: .5rem; }
.week-findings { padding: 0; border: 0; background: transparent; color: var(--week-petrol); text-decoration: underline; }
@media (min-width: 761px) and (max-height: 950px) {
  .week-mode .utility { min-height: 1.7rem; margin-bottom: .35rem; }
  .week-mode .toolbar { padding: .25rem .5rem; margin-bottom: .4rem; }
  .week-paper { padding-block: .5rem; }
  .week-table tbody td { height: 1.65rem; padding-block: .09rem; font-size: .95rem; line-height: 1.05; }
}
@media (min-width: 761px) and (max-height: 820px) {
  .week-mode .utility { display: none; }
  .week-mode .toolbar { margin-top: .4rem; }
  .week-brand img { max-height: 6rem; }
  .week-head { row-gap: .15rem; padding-top: .2rem; }
  .week-heading h1 { font-size: 1.55rem; }
  .week-meta th, .week-meta td span { padding-block: .08rem; }
  .week-caption { margin-block: .1rem .25rem; }
  .week-table tbody td { height: 1.55rem; padding-block: .04rem; font-size: .88rem; line-height: 1; }
  .week-table .week-day-label { font-size: .88rem; }
}
@media (max-width: 760px) {
  .week-paper { padding: .5rem; }
  .week-head { grid-template-columns: 22% minmax(0, 1fr); column-gap: .5rem; }
  .week-heading h1 { font-size: 1.6rem; }
  .week-mode .period input { margin-left: 0; }
  .week-mode .toolbar .actions { margin-left: auto; }
  .week-table tbody th { position: sticky; left: 0; z-index: 1; }
  .week-table thead th:first-child { position: sticky; left: 0; z-index: 2; }
}
@media (max-width: 480px) {
  .week-mode .main { padding-inline: .5rem; }
  .week-mode .utility { min-height: 2rem; margin-bottom: .35rem; }
  .week-mode .toolbar { margin-bottom: .4rem; }
  .week-mode .segments { width: auto; flex: 1; }
  .week-mode .toolbar .button.primary { min-height: 2.2rem; padding-block: .32rem; }
  .week-brand { grid-row: 1; }
  .week-brand img { height: 3.2rem; }
  .week-meta, .week-caption { grid-column: 1 / -1; }
  .week-table { min-width: 21.5rem; }
  .week-table thead th:first-child { width: 24%; }
  .week-table thead th:nth-child(2) { width: 26%; }
  .week-table thead th:nth-child(3) { width: 25%; }
  .week-table thead th, .week-table tbody td { padding-inline: .26rem; }
  .week-table tbody td, .week-table .week-day-label { font-size: .86rem; }
  .week-table .week-day-label { padding-inline: .35rem .12rem; }
}

dialog:has(#week-preview) { width: min(53rem, calc(100vw - 1rem)); }
dialog:has(#week-preview) form { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); }
dialog:has(#week-preview) .dialog-body { overflow-y: auto; padding: .5rem; }
dialog:has(#week-preview) .dialog-footer { align-items: center; justify-content: space-between; }
dialog:has(#week-preview) .dialog-footer label { margin: 0; }
