:root {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #102b43;
  background: #eef3f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #102b43;
  --teal: #4ac6b1;
  --ink: #102b43;
  --muted: #516477;
  --line: #dce6ee;
  --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button { font: inherit; }
[hidden] { display: none !important; }
.shell { width: min(100% - 48px, 1260px); margin-inline: auto; }
.skip-link {
  position: absolute; left: 12px; top: 12px; z-index: 2; padding: 10px 14px;
  color: var(--navy); background: white; border-radius: 6px; transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.masthead { background: var(--navy); color: #fff; border-bottom: 4px solid var(--teal); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 26px; }
.brand { display: flex; align-items: center; gap: 15px; min-width: 0; }
.brand-mark {
  width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center;
  border: 1px solid #44766f; border-radius: 13px; background: #194b51; color: #9ce9da;
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-caption { margin: 0 0 3px; color: #b5d8d4; font-size: .72rem; font-weight: 750; letter-spacing: .105em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.85rem); font-weight: 730; letter-spacing: -.027em; line-height: 1.12; }
.feed { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.feed-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid #53697b; border-radius: 999px; font-size: .76rem; line-height: 1.25; font-weight: 700; white-space: nowrap; }
.feed-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aebfce; }
.feed-pill[data-status="live"] { border-color: #4b867f; background: #19494c; color: #ddfff7; }
.feed-pill[data-status="live"]::before { background: #6bdfc5; }
.feed-pill[data-status="preview"] { border-color: #6e8aa4; background: #25475e; color: #e4f2ff; }
.feed-pill[data-status="preview"]::before { background: #a3c6ed; }
.feed-pill:is([data-status="stale"], [data-status="error"]) { border-color: #a57840; background: #513d2a; color: #fff1d8; }
.feed-pill:is([data-status="stale"], [data-status="error"])::before { background: #ffcb82; }
.feed-detail { color: #bfd0df; font-size: .77rem; line-height: 1.3; }

.workspace { padding-block: 28px 42px; }
.schedule-card, .legend-card { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 6px 20px #102b4309; }
.schedule-card { overflow: hidden; }
.week-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 24px; }
.week-overline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.week-kind { color: #136254; font-size: .72rem; font-weight: 790; text-transform: uppercase; letter-spacing: .1em; }
.week-timezone { color: var(--muted); font-size: .75rem; }
.week-timezone::before { content: "·"; margin-right: 8px; }
.week-description h2 { margin: 3px 0 0; font-size: clamp(1.3rem, 3vw, 1.88rem); letter-spacing: -.03em; line-height: 1.15; }
.view-controls { display: flex; margin-left: auto; padding: 2px; border: 1px solid #cddbe5; border-radius: 8px; background: #f1f5f8; }
.view-button { min-height: 35px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: .79rem; font-weight: 680; cursor: pointer; }
.view-button[aria-pressed="true"] { background: #fff; color: #145e51; box-shadow: 0 1px 3px #102b4322; }
.view-button:focus-visible, .month-week-link:focus-visible { outline: 2px solid #167e73; outline-offset: -2px; }
.week-controls { display: flex; flex: none; gap: 7px; }
.button {
  min-height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--ink); background: #fff; border: 1px solid #cddbe5; border-radius: 8px; cursor: pointer;
  font-size: .86rem; font-weight: 660; white-space: nowrap;
}
.button:not(:disabled):hover { background: #edf6f5; border-color: #8bbfb7; }
.button:focus-visible { outline: 3px solid #167e73; outline-offset: 2px; }
.button:disabled { color: #718499; background: #f1f5f8; opacity: .72; cursor: default; }
.button svg { width: 19px; height: 19px; }
.icon-button { width: 43px; padding: 0; }
.this-week:not(:disabled) { color: #145e51; background: #e9f6f2; border-color: #b3dcd3; }

.schedule-notice { margin: 0 24px 14px; padding: 11px 13px; background: #fbf3e5; border: 1px solid #e5cfac; border-radius: 8px; color: #654923; font-size: .88rem; }
.empty-state { display: grid; min-height: 230px; place-content: center; padding: 24px; text-align: center; background: #f6f9fc; border-block: 1px solid var(--line); }
.empty-state p { max-width: 420px; margin: 6px auto 0; color: var(--muted); line-height: 1.5; }
.empty-state .empty-title { margin: 0; color: var(--ink); font-weight: 730; }
.schedule-grid { overflow-x: auto; }
.month-week { overflow-x: auto; border-top: 1px solid var(--line); }
.month-week + .month-week { margin-top: 12px; }
.month-week h3 { margin: 0; }
.month-week-link { display: block; width: 100%; padding: 9px 23px; border: 0; background: #f5faf9; color: #145e51; text-align: left; text-decoration: underline; text-underline-offset: .18em; font-size: .82rem; font-weight: 720; cursor: pointer; }
.schedule-table { width: 100%; table-layout: fixed; min-width: 750px; border-collapse: collapse; font-size: .9rem; }
.schedule-table col.member-column { width: 16%; }
.schedule-table :is(th, td) { border-bottom: 1px solid var(--line); text-align: center; }
.schedule-table thead th { padding: 12px 5px 11px; color: var(--ink); background: #e8f0f7; border-top: 1px solid var(--line); }
.schedule-table thead th:is(.weekend, .today) { background: #e4f3f0; }
.schedule-table thead th.today { box-shadow: inset 0 3px #3ca995; }
.table-label, .day-name { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.day-date, .day-number { display: block; margin-top: 2px; color: #415b72; font-size: .84rem; font-weight: 640; }
.today :is(.day-date, .day-number) { color: #106151; }
.day-number, .shift-short-label { display: none; }
.schedule-table tbody :is(th, td) { padding: 5px; overflow-wrap: anywhere; }
.schedule-table :is(thead, tbody) .member { display: table-cell; padding-left: 23px; text-align: left; }
.schedule-table tbody th { font-weight: 720; }
.schedule-table tbody tr:nth-child(even) { background: #f5f8fb; }
.schedule-table tbody td.weekend { background: #e7f5f238; }
.schedule-table tbody td.today { background: #e7f5f26b; }
.schedule-table .outside-month { background: #f0f3f6; }
.outside-month .shift { filter: saturate(.5); }
.schedule-table thead th.holiday { color: #fff; background: #a82a32; }
.schedule-table thead th.holiday.outside-month { background: #943d46; }
.schedule-table tbody td.holiday { background: #ffcdcf; box-shadow: inset 1px 0 #d05a61, inset -1px 0 #d05a61; }
.schedule-table tbody td.holiday.outside-month { background: #f6d7d9; }
.holiday :is(.day-date, .day-number) { color: #fff; }
.holiday :is(.day-date, .day-number)::before, .holiday-key::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 1px; background: #b84339; transform: rotate(45deg); }
.holiday :is(.day-date, .day-number)::before { margin-right: 3px; vertical-align: .13em; background: #fff; }

.shift { display: inline-block; max-width: 100%; min-width: 32px; padding: 4px 8px; border: 1px solid transparent; border-radius: 7px; font-size: .81rem; font-weight: 740; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.shift-am { color: #155446; background: #e2f5ee; border-color: #c2e6da; }
.shift-pm { color: #244e78; background: #e5effd; border-color: #c7dcf5; }
.shift-oc { color: #55438c; background: #eee9fb; border-color: #ded2f5; }
.shift-we { color: #725117; background: #fbf2dd; border-color: #efdfb4; }
.shift-pl { color: #744563; background: #f8eaf2; border-color: #ecd2e3; }
.shift-off { color: #4b5e71; background: #eef2f6; border-color: #dde5ed; }
.shift-other { color: #3e566a; background: #edf2f6; border-color: #dbe4ec; }
.shift-empty { color: #647688; }
.shift-detail { min-height: 26px; cursor: pointer; text-decoration: underline dotted; text-underline-offset: .16em; }
.shift-detail:hover { border-color: #43887e; }
.shift-detail:focus-visible { outline: 2px solid #167e73; outline-offset: 2px; }
.shift-cell { cursor: pointer; }
.shift-cell:hover { border-color: #43887e; }
.shift-cell:focus-visible { outline: 2px solid #167e73; outline-offset: 2px; }
.shift-cell.shift-empty { background: transparent; border-color: transparent; }
.shift-with-note { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px; }
.shift-note-label { min-width: 0; }
.shift-note-marker { display: inline-flex; width: 13px; height: 14px; flex: 0 0 auto; align-items: center; justify-content: center; border: 1px solid #bf881c; border-radius: 3px; color: #775000; background: #ffe08c; }
.shift-note-marker svg { display: block; width: 10px; height: 11px; }

.schedule-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 24px; }
.schedule-footer p { margin: 0; color: var(--muted); font-size: .81rem; }
.refresh-button { min-height: 35px; font-size: .79rem; }
.refresh-button svg { width: 16px; height: 16px; }
.legend-card { margin-top: 14px; padding: 16px 23px; }
.legend-card h2 { margin: 0 0 9px; font-size: .83rem; }
.legend-list { display: flex; flex-wrap: wrap; gap: 8px 16px; list-style: none; margin: 0; padding: 0; }
.legend-list li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .76rem; }
.legend-list .shift { padding: 3px 6px; min-width: 30px; }
.holiday-key::before { margin-inline: 4px 2px; }
.team-editor-link { text-decoration: none; color: #155446; font-size: .84rem; }
.owner-sign-in { display: inline-block; margin-top: 12px; color: #155446; font-size: .79rem; }
.owner-sign-in:focus-visible { outline: 2px solid #167e73; outline-offset: 3px; }

.shift-dialog {
  width: min(100% - 32px, 460px); max-height: 85vh; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); background: #fff; box-shadow: 0 16px 48px #102b4340;
}
.shift-dialog::backdrop { background: #102b4380; }
.shift-dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 17px; border-bottom: 1px solid var(--line); }
.shift-dialog-header h2 { margin: 0; font-size: 1.18rem; }
.shift-dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.shift-dialog-close { min-height: 36px; flex: none; }
.shift-dialog-body { padding: 17px; }
.shift-dialog-body p { margin: 0; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.month-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px; }
.month-option { min-height: 42px; padding: 5px; border: 1px solid #cddbe5; border-radius: 8px; background: #fff; color: var(--ink); font-size: .87rem; font-weight: 660; cursor: pointer; }
.month-option:hover, .month-option[aria-current="true"] { border-color: #8bbfb7; background: #e9f6f2; color: #145e51; }
.month-option:focus-visible { outline: 2px solid #167e73; outline-offset: 2px; }

@media (max-width: 400px) {
  .month-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 810px) {
  .shell { width: min(100% - 16px, 1260px); }
  .masthead-inner { padding-block: 19px; flex-wrap: wrap; }
  .feed { flex: 1 0 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; text-align: left; }
  .brand { gap: 9px; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 9px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .brand-caption { font-size: .59rem; letter-spacing: .07em; }
  .feed-detail { max-width: none; font-size: .68rem; white-space: nowrap; }
  .workspace { padding-top: 16px; }
  .week-toolbar { padding: 12px 13px 10px; gap: 8px; flex-wrap: wrap; }
  .week-description { flex: 1 0 100%; }
  .view-controls { margin-left: 0; }
  .view-button { min-height: 31px; padding: 0 8px; }
  .week-controls { flex: 1; gap: 5px; }
  .week-controls .button { min-height: 37px; font-size: .78rem; }
  .week-controls .icon-button { width: 35px; }
  .week-controls .this-week { flex: 1; padding-inline: 6px; }
  .month-week-link { padding-inline: 9px; }
  .schedule-notice { margin-inline: 13px; }
  .schedule-table { min-width: 0; font-size: .78rem; }
  .schedule-table col.member-column { width: 20%; }
  .schedule-table thead th { padding: 6px 2px; }
  .schedule-table tbody :is(th, td) { padding: 2px; }
  .schedule-table :is(thead, tbody) .member { padding-left: 8px; }
  .table-label, .day-name { font-size: .63rem; letter-spacing: .04em; }
  .day-date, .shift-full-label { display: none; }
  .day-number { display: block; font-size: .68rem; }
  .shift-short-label { display: inline; font-size: .62rem; white-space: nowrap; }
  .schedule-table .shift { min-width: 24px; padding: 2px; font-size: .7rem; }
  .schedule-table .shift-with-note { gap: 2px; }
  .schedule-table .shift-note-marker { width: 10px; height: 11px; }
  .schedule-table .shift-note-marker svg { width: 8px; height: 9px; }
  .schedule-footer { padding: 9px 13px; }
  .legend-card { padding: 13px; }
}

@media (max-width: 365px) {
  .masthead-inner { gap: 7px; }
  .brand-mark { display: none; }
  .week-toolbar { column-gap: 6px; padding-inline: 9px; }
  .view-button { padding-inline: 6px; }
  .week-controls { min-width: 0; }
  .week-controls .icon-button { width: 32px; flex: none; }
  .schedule-table col.member-column { width: 22%; }
  .schedule-table :is(thead, tbody) .member { padding-left: 6px; }
}


#shift-edit-form { margin-top: 14px; }
#shift-edit-form label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 700; }
#shift-edit-text { display: block; width: 100%; min-height: 100px; margin-bottom: 10px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: #fff; font: inherit; line-height: 1.5; }
#shift-edit-text:focus-visible { outline: 3px solid #167e73; outline-offset: 2px; }
#shift-edit-status { margin-top: 8px; color: var(--muted); font-size: .85rem; }
.change-history { padding: 16px 24px; }
.history-status { margin: 0 0 12px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.history-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.history-entry { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fbfd; }
.history-entry-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; }
.history-cell-link { padding: 0; border: 0; background: transparent; color: #155446; text-align: left; font: inherit; font-size: .88rem; font-weight: 700; text-decoration: underline; cursor: pointer; }
.history-cell-link:focus-visible { outline: 2px solid #167e73; outline-offset: 3px; }
.history-time { color: var(--muted); font-size: .76rem; }
.history-entry .history-meta { margin: 5px 0 10px; color: var(--muted); font-size: .78rem; }
.history-values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.history-value { min-width: 0; }
.history-value-label { display: block; margin-bottom: 4px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.history-value-text { max-height: 160px; overflow: auto; margin: 0; padding: 8px; border: 1px solid #dce7ee; border-radius: 5px; background: #fff; color: var(--ink); font: inherit; font-size: .83rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-more { margin-top: 12px; }
.cell-history { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.cell-history h3 { margin: 0 0 10px; font-size: .95rem; }
.cell-history .history-status { margin-bottom: 10px; }
.cell-history .history-entry { padding: 10px; }
@media (max-width: 560px) {
  .change-history { padding: 13px; }
  .history-values { grid-template-columns: 1fr; gap: 8px; }
}

.editor-sign-in .sign-in-shell { width: min(100% - 24px, 480px); padding-top: 40px; }
.editor-sign-in .sign-in-body { padding: 22px; }
.editor-sign-in .sign-in-step { margin: 0 0 18px; font-size: 1.05rem; }
.editor-sign-in .delivery-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 20px; padding: 0; border: 0; }
.editor-sign-in .delivery-choices legend { margin-bottom: 8px; font-size: .87rem; color: var(--muted); }
.editor-sign-in .delivery-choice { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 650; }
.editor-sign-in .delivery-choice:has(input:checked) { border-color: #167e73; background: #edf6f5; color: #155446; }
.editor-sign-in .delivery-choice:has(input:disabled) { opacity: .6; cursor: default; }
.editor-sign-in .delivery-choice:focus-within { outline: 3px solid #167e73; outline-offset: 2px; }
.editor-sign-in .delivery-choice input { accent-color: #167e73; }
.editor-sign-in .sign-in-field { margin: 0 0 16px; }
.editor-sign-in .sign-in-field label { display: block; margin-bottom: 7px; font-size: .9rem; font-weight: 650; }
.editor-sign-in .sign-in-field input { width: 100%; min-height: 50px; border: 1px solid #aabdc9; border-radius: 8px; padding: 11px 12px; background: #fff; color: var(--ink); font: inherit; font-size: 1rem; }
.editor-sign-in .sign-in-field input:focus-visible { outline: 3px solid #167e73; outline-offset: 2px; }
.editor-sign-in .sign-in-consent { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 12px; font-size: .87rem; line-height: 1.5; }
.editor-sign-in .sign-in-consent input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; accent-color: #167e73; }
.editor-sign-in .sign-in-fine-print { margin-bottom: 17px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.editor-sign-in .sign-in-primary { width: 100%; min-height: 50px; margin-top: 4px; background: #155446; border-color: #155446; color: #fff; font-size: 1rem; }
.editor-sign-in .sign-in-primary:not(:disabled):hover { background: #0e4338; border-color: #0e4338; }
.editor-sign-in .sign-in-destination { margin-bottom: 18px; overflow-wrap: anywhere; color: var(--muted); }
.editor-sign-in .sign-in-field .sign-in-code { text-align: center; font-size: 1.65rem; letter-spacing: .25em; font-variant-numeric: tabular-nums; }
.editor-sign-in .sign-in-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.editor-sign-in .sign-in-actions .button { flex: 1 1 auto; min-height: 44px; font-size: .82rem; }
.editor-sign-in .sign-in-status { margin-top: 16px; font-size: .87rem; color: var(--muted); line-height: 1.5; }
.editor-sign-in .sign-in-back { display: inline-block; margin-top: 18px; color: #155446; font-size: .86rem; }
@media (max-width: 560px) {
  .editor-sign-in .sign-in-shell { padding-top: 18px; }
  .editor-sign-in .sign-in-body { padding: 18px; }
}
