.duty-page{--duty-warning:#fff3df;--duty-danger:#a73a36}.duty-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:20px}.duty-heading .eyebrow{margin:0 0 10px}.duty-heading .lead{margin:10px 0 0}.duty-badge,.duty-count{display:inline-flex;border-radius:20px;padding:5px 12px;background:var(--surface);font-size:12px;font-weight:700;white-space:nowrap}.duty-heading>.duty-badge{background:var(--teal)}.duty-panel{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:20px;margin-bottom:18px;box-shadow:var(--shadow)}.duty-panel h2{margin:0 0 14px}.duty-page summary{font-weight:700;cursor:pointer;min-height:30px}.duty-page summary .duty-caption{float:right;font-weight:400}.duty-caption{font-size:12px;color:var(--muted);line-height:1.6}.duty-page label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;min-width:0}.duty-page input,.duty-page select,.duty-page textarea{font:inherit;color:var(--navy);border:1px solid var(--control-border);border-radius:6px;background:var(--white);padding:9px;width:100%;min-height:40px}.duty-page textarea{resize:vertical;min-height:82px;line-height:1.5}.duty-page button{font:600 12px var(--font-body);color:var(--navy);background:var(--white);border:1px solid var(--control-border);border-radius:6px;padding:10px 13px;min-height:40px;cursor:pointer}.duty-page button.primary{background:var(--navy);color:var(--white);border-color:var(--navy)}.duty-page button:hover:not(:disabled){background:var(--surface)}.duty-page button.primary:hover:not(:disabled){background:#304a78}.duty-page :disabled{opacity:.55;cursor:not-allowed}.duty-page :is(button,input,select,textarea,summary):focus-visible{outline:3px solid var(--teal);outline-offset:2px}.duty-groups{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.duty-group{background:#f6f8fb;border:1px solid var(--line);padding:14px;border-radius:8px;min-width:0}.duty-group-title{display:flex;align-items:center;justify-content:space-between;gap:5px;border-bottom:2px solid var(--teal);padding-bottom:12px;margin-bottom:12px}.duty-group-title h2{font-size:14px;margin:0}.duty-group ol{list-style:none;padding:0;margin:0 0 14px}.duty-group li{margin-bottom:10px}.duty-person input{background:white}.duty-person-actions{display:flex;gap:4px;justify-content:flex-end;margin-top:4px}.duty-person-actions button{padding:4px 10px;min-height:32px}.duty-availability{padding:5px 0;border-bottom:1px solid var(--line)}.duty-availability summary{font-size:11px;font-weight:500;min-height:24px}.duty-page input[type=checkbox]{width:16px;min-height:16px;accent-color:var(--navy)}.duty-availability label:has([type=checkbox]),.duty-checkbox{flex-direction:row;align-items:center}.duty-group>button{width:100%;margin-top:10px}.duty-settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.duty-month-controls,.duty-actions,.duty-history{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end}.duty-month-controls{padding-bottom:18px;border-bottom:1px solid var(--line)}.duty-month-controls label:first-of-type{min-width:135px}.duty-month-controls input{max-width:90px}.duty-actions{padding-top:18px}.duty-history{margin-top:18px}.duty-history label{flex:1;min-width:180px}.duty-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:22px 0}.duty-stat{border:1px solid var(--line);border-top:3px solid var(--teal);border-radius:8px;background:white;padding:16px}.duty-stat strong{display:block;font-size:28px;line-height:1.2;font-weight:700}.duty-stat span{font-size:12px;color:var(--muted)}.duty-validation ul{max-height:250px;overflow:auto;padding-left:20px;font-size:12px}.duty-validation li{margin:6px 0}.duty-summary-groups{display:grid;grid-template-columns:1fr 1fr;gap:20px}.duty-summary-groups section{min-width:0;overflow:auto}.duty-summary-groups h3{font-size:14px}.duty-summary-groups table{width:100%;border-collapse:collapse;font-size:12px}.duty-summary-groups :is(th,td){padding:7px;text-align:left;border-bottom:1px solid var(--line);overflow-wrap:anywhere}.duty-table-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:15px}.duty-table-heading .eyebrow{margin:0 0 8px}.duty-table-heading h2{font-size:21px;margin:0}.duty-table-heading p{font-size:12px}.duty-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:11px}.duty-legend span{padding:4px 8px;border-radius:4px}.weekend-key,.duty-weekend{background:#e5f3f1}.holiday-key,.duty-holiday{background:#ffe9bf}.gap-key{background:var(--duty-warning)}.duty-table-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:6px;max-width:100%}.duty-table{border-collapse:collapse;width:100%;min-width:850px;font-size:12px;table-layout:fixed}.duty-table th,.duty-table td{border:1px solid var(--line);padding:8px;vertical-align:middle;text-align:left;overflow-wrap:anywhere}.duty-table thead th{background:var(--navy);color:white;font-size:12px;padding:12px 8px}.duty-table thead th:nth-child(1){width:105px}.duty-table thead th:nth-child(2){width:104px}.duty-table tbody th{font-weight:500}.duty-table select{border-color:var(--line);font-size:12px;min-height:36px;padding:6px;width:100%}.duty-table td.duty-gap{background:var(--duty-warning)}.duty-table td.duty-conflict{box-shadow:inset 0 0 0 2px var(--duty-danger)}.duty-message{padding:0;font-size:13px;overflow-wrap:anywhere}.duty-message:not(:empty){background:white;border-left:3px solid var(--teal);padding:12px 16px;margin-bottom:16px;border-radius:4px}.duty-message.error{border-color:var(--duty-danger);color:#8d302c;background:#fff4f2}.duty-message.success{background:#e5f3f1}.duty-account{display:flex;justify-content:flex-end;align-items:center;gap:14px;font-size:12px;margin-bottom:14px}.duty-auth-form{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end}.duty-auth-form label{flex:1;min-width:170px}.oncall-schedule-link{background:white;border:1px solid var(--line);border-radius:var(--radius);padding:16px;margin:18px 0}.oncall-schedule-link summary{font-weight:600;cursor:pointer}.oncall-schedule-link a{color:var(--navy);font-weight:700;text-underline-offset:3px}@media(max-width:850px){.duty-groups{grid-template-columns:repeat(2,minmax(0,1fr))}.duty-summary-groups{grid-template-columns:1fr}}@media(max-width:540px){.duty-heading{display:block}.duty-heading>.duty-badge{margin-top:12px}.duty-panel{padding:14px}.duty-groups,.duty-settings-grid{grid-template-columns:1fr}.duty-stats{grid-template-columns:1fr 1fr;gap:8px}.duty-stat{padding:12px}.duty-actions{display:grid;grid-template-columns:1fr}.duty-actions>*{width:100%}.duty-month-controls>button{flex:1}.duty-history>button{flex:1}.duty-page summary .duty-caption{float:none;display:block}.duty-account{justify-content:space-between}}@media print{body:has(.duty-page) :is(.top,#nav,footer){display:none}body:has(.duty-page) main{max-width:none;margin:0}body:has(.duty-page) .duty-page :is(.duty-account,.duty-residents,.duty-settings,.duty-toolbar,.duty-validation,.duty-heading,.duty-message,.duty-stats){display:none}body:has(.duty-page) .duty-table-scroll{overflow:visible}body:has(.duty-page) .duty-table{min-width:0}body:has(.duty-page) tr{break-inside:avoid}body:has(.duty-page) thead{display:table-header-group}}
.duty-message{white-space:pre-line}
.duty-guidance{margin:14px 0 0;padding:12px 14px;border:1px solid var(--duty-danger);border-radius:8px;background:#fff1f0;color:var(--duty-danger);white-space:pre-line;line-height:1.8;text-align:right;overflow-wrap:anywhere}

@media screen{.oncall-page>.duty-page{margin-top:30px;padding:clamp(18px,3vw,28px);background:var(--white);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);min-width:0}}.oncall-page .duty-heading h2{font-size:23px;line-height:1.2;margin:0 0 7px}

/* Keep wide tables inside the page and provide comfortable Safari touch controls. */
@media screen{
  .duty-page,.duty-panel,.duty-heading>div,.duty-roster{min-width:0;max-width:100%}
  .duty-heading>div{overflow-wrap:anywhere}
  .duty-table-scroll{-webkit-overflow-scrolling:touch}
}
@media screen and (max-width:1100px){
  .duty-groups{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media screen and (pointer:coarse){
  .duty-page input,.duty-page select,.duty-page textarea,.duty-table select{font-size:16px}
  .duty-page button,.duty-page summary,.duty-page input:not([type=checkbox]),.duty-page select{min-height:44px}
  .duty-person-actions button{min-width:44px}
  .duty-availability label:has([type=checkbox]),.duty-checkbox{min-height:44px}
  .duty-page input[type=checkbox]{flex-shrink:0}
}
@media screen and (max-width:540px){
  .duty-groups{grid-template-columns:minmax(0,1fr)}
  .duty-table-heading{flex-wrap:wrap}
  .duty-month-controls label{flex:1}
  .duty-month-controls input{max-width:100%}
}
