:root {
  --primary: #d92332;
  --primary-dark: #b71926;
  --primary-soft: #fff1f3;
  --primary-soft-strong: #ffe5e8;
  --navy: #172033;
  --navy-soft: #293750;
  --background: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --surface-muted: #f0f2f5;
  --border: #e4e8ef;
  --border-strong: #d8dde6;
  --text: #172033;
  --text-soft: #687386;
  --text-muted: #9ca5b4;
  --success: #138a49;
  --success-soft: #edf9f1;
  --warning: #a56605;
  --warning-soft: #fff7e4;
  --danger: #c12c23;
  --danger-soft: #fff1ef;
  --info: #2165cf;
  --info-soft: #eef5ff;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-xs: 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-sm: 0 6px 18px rgba(16, 24, 40, .07);
  --shadow-nav: 0 -10px 28px rgba(16, 24, 40, .1);
  --content-max: 680px;
  --header-height: 78px;
  --bottom-nav-height: 76px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--background); color: var(--text); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(217,35,50,.45); outline-offset: 2px; }
.hidden, [hidden] { display: none !important; }
.app-shell { position: relative; width: 100%; min-height: 100vh; min-height: 100dvh; background: var(--background); }
.app-main { width: 100%; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--bottom-nav-height) + 34px); }
.app-content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 18px 16px 32px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  border-bottom: 1px solid rgba(228,232,239,.92);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.app-header-content { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: var(--content-max); min-height: var(--header-height); margin: 0 auto; padding: 10px 16px; }
.app-brand { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.app-brand-logo { display: block; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; box-shadow: 0 7px 18px rgba(217,35,50,.18); }
.app-brand-text { min-width: 0; }
.app-kicker, .section-kicker, .card-label, .state-kicker { margin: 0; color: var(--primary); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.app-brand-text h1 { margin: 2px 0 1px; font-size: 20px; line-height: 1.08; letter-spacing: -.035em; }
#headerMeta { max-width: 230px; margin: 0; overflow: hidden; color: var(--text-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.app-header-actions { display: flex; align-items: center; gap: 7px; }
.header-action-button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--text-soft); font-size: 20px; cursor: pointer; }
.header-action-button:active { background: var(--surface-soft); }
.header-action-button:disabled { opacity: .45; }

.offline-banner { position: sticky; top: var(--header-height); z-index: 80; max-width: var(--content-max); margin: 0 auto; padding: 8px 14px; background: var(--warning-soft); color: var(--warning); font-size: 11px; font-weight: 700; text-align: center; }
.state-view { display: grid; min-height: calc(100vh - var(--header-height)); min-height: calc(100dvh - var(--header-height)); place-items: center; padding: 24px 16px calc(var(--bottom-nav-height) + 24px); }
.state-card { width: min(100%, 440px); padding: 28px 22px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); text-align: center; }
.state-card h2 { margin: 9px 0 7px; font-size: 22px; }
.state-card p { color: var(--text-soft); font-size: 12px; line-height: 1.65; }
.sign-in-logo { width: 78px; height: 78px; border-radius: 22px; box-shadow: 0 12px 28px rgba(217,35,50,.18); }
.google-button { display: grid; min-height: 44px; margin-top: 18px; place-items: center; }
.error-message { color: var(--danger) !important; font-weight: 700; }
.sign-in-card #authRetryButton { margin-top: 12px; }
.spinner, .mini-spinner { border-style: solid; border-color: rgba(217,35,50,.16); border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
.spinner { width: 38px; height: 38px; margin: 0 auto 14px; border-width: 4px; }
.mini-spinner { width: 20px; height: 20px; flex: 0 0 20px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.compact-loading-card { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 110px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text-soft); font-size: 12px; }

.app-page { display: none; }
.app-page.active { display: block; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 2px 2px 18px; }
.page-header h2 { margin: 4px 0 3px; font-size: 24px; letter-spacing: -.04em; }
.page-description { margin: 0; color: var(--text-soft); font-size: 11px; line-height: 1.45; }
.page-header-badge { flex: 0 0 auto; margin-top: 7px; padding: 7px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 800; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.035em; }
.section-meta { color: var(--text-muted); font-size: 9px; }
.content-section { width: 100%; margin: 18px 0 23px; }

.home-welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 2px 18px; padding: 4px 2px; }
.home-greeting { margin: 0 0 4px; color: var(--text-soft); font-size: 11px; }
.home-user-line { display: flex; align-items: center; gap: 8px; }
.home-user-line h2 { margin: 0; font-size: 25px; letter-spacing: -.045em; }
.home-welcome > div:first-child > p:last-child { margin: 4px 0 0; color: var(--text-soft); font-size: 11px; }
.role-badge { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 9px; font-weight: 800; }
.home-avatar img { width: 58px; height: 58px; border-radius: 18px; box-shadow: 0 8px 22px rgba(217,35,50,.16); }
.home-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.home-quick-button { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); text-align: left; cursor: pointer; }
.home-quick-button:active { transform: scale(.985); background: var(--surface-soft); }
.home-quick-button:nth-child(3) { grid-column: 1 / -1; }
.home-quick-icon { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 18px; }
.home-quick-content { display: flex; min-width: 0; flex-direction: column; }
.home-quick-content small { color: var(--text-soft); font-size: 9px; }
.home-quick-content strong { margin-top: 2px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.duty-card, .metric-card, .leave-order-card, .calendar-shell, .form-card, .more-menu-item, .more-system-card, .leave-progress-card, .empty-card, .migration-notice, .pending-swap-card, .pending-adjustment-card, .push-setting-card { border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.duty-card { overflow: hidden; border-radius: var(--radius-lg); }
.duty-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px; background: linear-gradient(135deg, #fff 30%, #fff4f5); }
.duty-card-top h3 { margin: 4px 0 2px; font-size: 19px; }
.duty-card-top p:last-child { margin: 0; color: var(--text-soft); font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; padding: 6px 9px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 9px; font-weight: 800; white-space: nowrap; }
.status-pill.is-current { background: var(--success-soft); color: var(--success); }
.duty-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--border); }
.duty-metrics > div { min-width: 0; padding: 10px 8px; background: var(--surface); text-align: center; }
.duty-metrics span { display: block; color: var(--text-soft); font-size: 9px; }
.duty-metrics strong { margin-top: 2px; color: var(--text); font-size: 21px; }
.duty-metrics small { margin-left: 2px; color: var(--text-soft); font-size: 9px; }
.duty-assignment-list { display: grid; gap: 6px; padding: 13px 14px; }
.duty-assignment-row { display: grid; grid-template-columns: 64px minmax(0,1fr); align-items: center; min-height: 35px; padding: 6px 10px; border-radius: 10px; background: var(--surface-soft); }
.duty-assignment-row span { color: var(--primary); font-size: 10px; font-weight: 800; }
.duty-assignment-row strong { overflow-wrap: anywhere; font-size: 13px; }
.duty-status-list { display: grid; gap: 7px; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.duty-status-row { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 8px; font-size: 10px; line-height: 1.5; }
.duty-status-row span { color: var(--text-soft); font-weight: 700; }
.duty-status-row strong { font-weight: 600; }

.metric-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.metric-card { min-height: 92px; padding: 14px; border-radius: var(--radius-md); }
.metric-card-primary { border-color: rgba(217,35,50,.18); background: var(--primary-soft); }
.metric-label { color: var(--text-soft); font-size: 10px; }
.metric-value { display: flex; align-items: baseline; gap: 4px; margin-top: 14px; }
.metric-value strong { font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.metric-value small { color: var(--text-soft); font-size: 11px; }

.leave-order-card { padding: 15px; border-radius: var(--radius-md); }
.leave-order-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.leave-order-top h3 { margin: 4px 0 0; font-size: 16px; }
.leave-order-progress { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: 13px; }
.leave-order-progress > div { min-width: 0; padding: 9px 7px; border-radius: 10px; background: var(--surface-soft); text-align: center; }
.leave-order-progress span { display: block; color: var(--text-soft); font-size: 8px; }
.leave-order-progress strong { display: block; margin-top: 3px; overflow-wrap: anywhere; font-size: 10px; }
.leave-order-message { margin: 12px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.55; white-space: pre-line; }

.month-switch { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-bottom: 9px; padding: 5px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.month-switch button { min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); font-size: 11px; font-weight: 800; }
.month-switch button.active { background: var(--primary-soft); color: var(--primary); }
.source-note { margin: 0 2px 10px; color: var(--text-soft); font-size: 10px; }
.calendar-shell { overflow: hidden; border-radius: var(--radius-lg); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekdays { padding: 10px 7px 7px; background: var(--navy); color: rgba(255,255,255,.76); font-size: 10px; font-weight: 700; text-align: center; }
.calendar-weekdays span:first-child { color: #ffb9bf; }
.calendar-grid { gap: 4px; padding: 7px; background: var(--surface); }
.calendar-day { position: relative; min-width: 0; min-height: 68px; padding: 6px 3px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-soft); text-align: center; }
.calendar-day.empty { background: transparent; }
.calendar-day.today { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(217,35,50,.2); }
.calendar-day-number { display: block; margin-bottom: 5px; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.calendar-duty { display: block; overflow: hidden; font-size: 11px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.calendar-day.duty-working { background: #eef4ff; }
.calendar-day.duty-leave { background: #fff6e8; }
.calendar-day.duty-off { background: #f0f2f5; }
.calendar-day.duty-public { background: #ecfaf1; }
.calendar-day.duty-swap { background: #f6f0ff; }
.calendar-day.duty-extra { background: #fff2ea; }
.month-section { margin-top: 28px; }

.progress-list { display: grid; gap: 10px; }
.leave-progress-card { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; padding: 15px; border-radius: var(--radius-md); }
.leave-progress-card h3 { margin: 4px 0 2px; font-size: 15px; }
.leave-progress-card p { margin: 0; color: var(--text-soft); font-size: 10px; }
.leave-progress-card > strong { color: var(--primary); font-size: 19px; }
.leave-progress-card-split { align-items: start; }
.leave-progress-metrics { display: grid; grid-template-columns: auto auto; gap: 3px 9px; align-items: baseline; text-align: right; }
.leave-progress-metrics span { color: var(--text-soft); font-size: 9px; }
.leave-progress-metrics strong { color: var(--primary); font-size: 16px; white-space: nowrap; }
.leave-progress-metrics small { grid-column: 1 / -1; color: var(--text-soft); font-size: 9px; }
.leave-extra-summary { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; margin-bottom: 12px; padding: 14px 16px; border: 1px solid rgba(217,35,50,.18); border-radius: var(--radius-md); background: var(--primary-soft); }
.leave-extra-summary span { color: var(--text-soft); font-size: 11px; }
.leave-extra-summary strong { color: var(--primary); font-size: 21px; }
.leave-extra-summary small { grid-column: 1 / -1; color: var(--text-soft); }
.group-badge { color: var(--primary); font-size: 9px; font-weight: 900; }
.progress-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-muted); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

.migration-notice { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 13px; border-radius: var(--radius-md); background: var(--warning-soft); color: var(--warning); }
.migration-notice > span { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; background: rgba(255,255,255,.7); font-size: 18px; }
.migration-notice strong { font-size: 12px; }
.migration-notice p { margin: 3px 0 0; font-size: 10px; line-height: 1.45; }
.form-card { padding: 15px; border-radius: var(--radius-md); }
.form-card.is-locked { opacity: .78; }
.form-card-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.form-card-heading h3 { margin: 4px 0 0; font-size: 17px; }
.form-field { display: grid; gap: 6px; margin-top: 12px; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface-soft); color: var(--text-soft); }
.form-field textarea { resize: vertical; }
.primary-button, .secondary-button { min-height: 46px; padding: 10px 14px; border-radius: 12px; font-weight: 800; }
.primary-button { margin-top: 16px; border: 0; background: var(--primary); color: #fff; }
.primary-button:disabled { background: #c9ced7; }
.secondary-button { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.full-button { width: 100%; }
.coming-pill { display: inline-flex; flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 8px; font-weight: 900; }

.page-info-card { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; padding: 14px; border: 1px solid #d9e5f8; border-radius: var(--radius-md); background: #eef5ff; box-shadow: none; }
.page-info-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; background: #fff; color: #2f6fc2; }
.page-info-card small { display: block; color: var(--text-soft); font-size: 10px; }
.page-info-card strong { display: block; margin-top: 1px; font-size: 13px; }
.page-info-card p { margin: 3px 0 0; color: var(--text-soft); font-size: 11px; line-height: 1.5; white-space: pre-line; }

.records-shortcut { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 68px; margin-top: 12px; padding: 12px 13px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); text-align: left; }
.records-shortcut > span { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; background: var(--surface-soft); color: var(--primary); font-size: 19px; }
.records-shortcut div { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.records-shortcut strong { font-size: 13px; }
.records-shortcut small { margin-top: 1px; color: var(--text-soft); font-size: 10px; }
.records-shortcut b { color: var(--text-muted); font-size: 24px; font-weight: 400; }

.record-list { display: grid; gap: 10px; }
.record-card { padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.record-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.record-card-title { margin: 2px 0 0; font-size: 14px; line-height: 1.45; }
.record-meta { display: grid; gap: 4px; color: var(--text-soft); font-size: 11px; }
.record-status { display: inline-flex; min-height: 24px; padding: 3px 8px; align-items: center; justify-content: center; border-radius: 999px; background: var(--surface-muted); color: var(--text-soft); font-size: 10px; font-weight: 800; }
.record-status.success { background: var(--success-soft); color: var(--success); }
.record-status.pending { background: var(--warning-soft); color: var(--warning); }
.record-status.failed { background: var(--danger-soft); color: var(--danger); }
.record-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); }
.record-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; padding: 4px; border-radius: 13px; background: var(--surface-muted); }
.record-tab { min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); font-size: 11px; font-weight: 800; }
.record-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.pending-swap-list { display: grid; gap: 10px; }
.pending-swap-card { padding: 15px; border-radius: var(--radius-md); }
.pending-swap-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pending-swap-heading h3 { margin: 3px 0 0; font-size: 14px; }
.pending-swap-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 9px; margin: 14px 0 8px; align-items: center; color: var(--text); font-size: 12px; text-align: center; }
.pending-swap-route span { color: var(--primary); font-size: 18px; }
.pending-swap-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; margin-top: 12px; }
.pending-swap-actions .primary-button { margin-top: 0; }
.pending-swap-actions > :only-child { grid-column: 1 / -1; }
.pending-adjustment-list, .adjustment-record-list { display: grid; gap: 10px; }
.pending-adjustment-card { padding: 15px; border-radius: var(--radius-md); }
.adjustment-date-route { display: flex; margin: 13px 0 8px; align-items: center; justify-content: space-between; gap: 10px; }
.adjustment-date-route strong { color: var(--primary); font-size: 13px; }
.adjustment-date-route span { color: var(--text-soft); font-size: 10px; }
.record-readonly-notice { margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(148,163,184,.35); border-radius: var(--radius-sm); background: #f8fafc; }
.record-readonly-notice strong { color: var(--text); font-size: 11px; }
.record-readonly-notice p { margin: 4px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.55; }
.notification-list { display: grid; gap: 10px; }
.notification-card { padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.notification-card.is-unread { border-color: rgba(217,35,50,.24); background: var(--primary-soft); }
.notification-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.notification-card h3 { margin: 3px 0 0; font-size: 14px; }
.notification-card p { margin: 10px 0 6px; font-size: 11px; line-height: 1.6; }
.notification-card small { display: block; margin-bottom: 10px; color: var(--text-soft); font-size: 9px; }
.team-schedule-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); -webkit-overflow-scrolling: touch; }
.team-schedule-table { border-collapse: separate; border-spacing: 0; min-width: max(100%,900px); font-size: 10px; text-align: center; }
.team-schedule-table th, .team-schedule-table td { min-width: 34px; padding: 8px 5px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.team-schedule-table thead th { position: sticky; top: 0; z-index: 2; background: var(--navy); color: #fff; }
.team-schedule-table th:first-child { position: sticky; left: 0; z-index: 3; min-width: 72px; background: var(--surface); color: var(--text); }
.team-schedule-table thead th:first-child { background: var(--navy); color: #fff; }
.team-schedule-table th small { display: block; margin-top: 2px; opacity: .72; }
.team-schedule-table td.duty-working { background: #eef4ff; }
.team-schedule-table td.duty-leave { background: #fff6e8; }
.team-schedule-table td.duty-off { background: #f0f2f5; }
.team-schedule-table td.duty-public { background: #ecfaf1; }
.team-schedule-table td.duty-swap { background: #f6f0ff; }
.export-summary-card { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--border); }
.export-summary-card > div { padding: 14px; background: var(--surface); }
.export-summary-card span { display: block; color: var(--text-soft); font-size: 9px; }
.export-summary-card strong { display: block; margin-top: 5px; font-size: 15px; }
.export-message-list { margin: 12px 0; padding: 12px 12px 12px 30px; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger); font-size: 10px; line-height: 1.6; }
.widget-action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.widget-action-grid .primary-button { grid-column: 1 / -1; margin-top: 0; }
.scriptable-identity { display: flex; align-items: center; justify-content: space-between; }
.scriptable-identity span { color: var(--text-soft); font-size: 10px; }
.scriptable-code-card { margin-top: 12px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.scriptable-code-card h3 { margin: 0 0 10px; font-size: 15px; }
.scriptable-code-card textarea { width: 100%; min-height: 280px; padding: 10px; border: 1px solid var(--border-strong); border-radius: 11px; background: #f8f9fb; font: 9px/1.45 ui-monospace,monospace; }
.schedule-share-button { margin-top: 16px; }
.leave-order-management-card { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.leave-order-management-card > label, .leave-order-management-grid label { display: grid; gap: 7px; color: var(--text-soft); font-size: 12px; font-weight: 800; }
.leave-order-management-card input, .leave-order-management-card select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 13px; background: #fff; color: var(--text); font: inherit; }
.leave-order-management-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.leave-order-management-warning { margin: 0; padding: 13px 15px; border-radius: 13px; color: #92400e; background: #fffbeb; line-height: 1.55; }
.leave-order-management-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width:560px) { .leave-order-management-grid,.leave-order-management-actions { grid-template-columns: 1fr; } }
.scriptable-step-list { display: grid; gap: 8px; }
.scriptable-step-list article { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.scriptable-step-list article > span { color: var(--primary); font-size: 9px; font-weight: 900; }
.scriptable-step-list strong { font-size: 12px; }
.scriptable-step-list p { margin: 3px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.5; }
.compact-empty { box-shadow: none; }

.danger-button, .text-action-button { display: inline-flex; min-height: 38px; padding: 8px 12px; align-items: center; justify-content: center; border-radius: 11px; font-size: 11px; font-weight: 800; }
.danger-button { border: 1px solid #f3c8cc; background: var(--danger-soft); color: var(--danger); }
.danger-button:disabled { opacity: .55; }
.mutation-action-button { display: flex; align-items: center; justify-content: center; gap: 9px; }
.mutation-action-button .mini-spinner { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.mutation-feedback { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.45; white-space: pre-line; }
.mutation-feedback.is-info { border-color: rgba(217,35,50,.24); background: rgba(217,35,50,.06); }
.mutation-feedback.is-success { border-color: rgba(25,135,84,.28); background: rgba(25,135,84,.08); color: #176b45; }
.mutation-feedback.is-error { border-color: rgba(177,35,47,.28); background: rgba(177,35,47,.08); color: #9f2431; }
.text-action-button { border: 1px solid var(--border); background: var(--surface); color: var(--primary); }

.modal-backdrop { position: fixed; inset: 0; z-index: 900; display: flex; padding: 16px; align-items: flex-end; justify-content: center; background: rgba(15,22,38,.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.action-modal { width: min(520px,100%); padding: 13px 17px 19px; border-radius: 23px; background: var(--surface); box-shadow: 0 24px 60px rgba(16,24,40,.26); }
.modal-handle { width: 40px; height: 5px; margin: 0 auto 17px; border-radius: 999px; background: #d7dbe2; }
.action-modal h3 { margin: 3px 0 6px; font-size: 21px; }
.modal-description { margin-bottom: 15px; color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.modal-actions .secondary-button, .modal-actions .danger-button { min-height: 46px; }

.more-menu { display: grid; gap: 9px; }
.push-setting-card { display: flex; min-height: 68px; padding: 12px 13px; align-items: center; gap: 11px; border-radius: var(--radius-md); }
.push-setting-card .primary-button { min-height: 38px; margin-top: 0; padding: 7px 12px; }
.push-setting-card .secondary-button { min-height: 38px; padding: 7px 12px; }
.more-menu-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 68px; padding: 12px 13px; border-radius: var(--radius-md); color: var(--text); text-align: left; cursor: pointer; }
.more-menu-item:active { background: var(--surface-soft); }
.more-menu-item[aria-disabled="true"] { cursor: default; }
.more-menu-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; background: var(--surface-soft); color: var(--primary); font-size: 19px; }
.more-menu-content { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.more-menu-content strong { font-size: 13px; }
.more-menu-content small { margin-top: 1px; color: var(--text-soft); font-size: 10px; }
.more-menu-arrow { color: var(--text-muted); font-size: 24px; line-height: 1; }
.more-system-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: var(--radius-md); }
.more-system-card div { display: grid; gap: 2px; }
.more-system-card small { color: var(--primary); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.more-system-card span { font-size: 12px; font-weight: 700; }
.more-system-card strong { color: var(--text-soft); font-size: 10px; }

.system-health-content, .system-health-performance { display: grid; gap: 12px; }
.system-health-overview, .system-health-section, .system-health-queue-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.system-health-overview { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-left: 5px solid #28a66a; }
.system-health-overview.is-updating { border-left-color: #3b82f6; background: #f3f8ff; }
.system-health-overview.is-warning { border-left-color: #d99b24; background: #fff9eb; }
.system-health-overview.is-error { border-left-color: var(--primary); background: #fff4f5; }
.system-health-overview small, .system-health-card-heading small { color: var(--primary); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.system-health-overview h3 { margin: 3px 0 0; font-size: 22px; }
.system-health-overview > span { color: var(--text-muted); font-size: 10px; }
.system-health-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.system-health-summary > div, .system-health-metric { padding: 12px; border-radius: 13px; background: var(--surface-soft); }
.system-health-summary span, .system-health-metric span, .system-health-metric small { display: block; color: var(--text-muted); font-size: 10px; }
.system-health-summary strong { display: block; margin-top: 4px; font-size: 20px; }
.system-health-section { padding: 14px; }
.system-health-section > h3 { margin: 0 0 11px; font-size: 15px; }
.system-health-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.system-health-card-heading strong { display: block; margin-top: 2px; }
.system-health-status { padding: 5px 8px; border-radius: 999px; background: #eaf2ff; color: #2f6fc2; font-size: 9px; font-weight: 900; }
.system-health-status.is-done { background: #e8f6ee; color: #218553; }
.system-health-status.is-failed, .system-health-status.is-stale-processing { background: #fdebed; color: #c51f31; }
.system-health-details { display: grid; gap: 6px; margin: 12px 0; }
.system-health-details > div { display: grid; grid-template-columns: minmax(105px, .8fr) 1.4fr; gap: 7px; }
.system-health-details dt { color: var(--text-muted); font-size: 10px; }
.system-health-details dd { margin: 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 800; }
.system-health-queue-card { margin-top: 8px; padding: 13px; }
.system-health-error { padding: 9px; border-radius: 9px; background: #fff0f1; color: #b51e2d; font-size: 10px; }
.system-health-pending { padding: 9px; border-radius: 9px; background: #fff7dc; color: #795800; font-size: 10px; }
.system-health-success { padding: 9px; border-radius: 9px; background: #e8f6ee; color: #218553; font-size: 10px; }
.system-health-metric strong { display: block; margin: 3px 0; font-size: 15px; }
.system-health-readonly { color: var(--text-muted); font-size: 10px; text-align: center; }

@media (max-width: 480px) {
  .system-health-summary { grid-template-columns: repeat(2, 1fr); }
  .system-health-details > div { grid-template-columns: 1fr; gap: 2px; }
}

.empty-card { display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: var(--radius-md); }
.empty-card-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; background: var(--surface-soft); color: var(--text-muted); font-size: 19px; }
.empty-card strong { font-size: 13px; }
.empty-card p { margin: 3px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.5; }
.inline-error { margin-top: 20px; }
.state-icon { display: grid; width: 54px; height: 54px; margin: 0 auto; place-items: center; border-radius: 17px; background: var(--surface-muted); color: var(--text-soft); font-size: 24px; font-weight: 900; }
.state-icon-danger { background: var(--danger-soft); color: var(--danger); }
.muted { color: var(--text-soft); font-size: 11px; }

.bottom-navigation { position: fixed; right: 0; bottom: 0; left: 0; z-index: 200; display: grid; grid-template-columns: repeat(5,1fr); min-height: var(--bottom-nav-height); padding: 6px 7px max(7px,env(safe-area-inset-bottom)); border-top: 1px solid rgba(228,232,239,.95); background: rgba(255,255,255,.95); box-shadow: var(--shadow-nav); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.nav-item { position: relative; display: flex; min-height: 54px; padding: 4px 2px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 13px; background: transparent; color: #8b95a5; cursor: pointer; }
.nav-item.active { background: rgba(217,35,50,.055); color: var(--primary); }
.nav-icon { display: grid; min-height: 23px; place-items: center; font-size: 21px; line-height: 1; }
.nav-label { font-size: 9px; font-weight: 700; }
.nav-primary-icon { width: 34px; height: 34px; margin-top: -12px; border-radius: 12px; background: var(--primary); color: #fff; box-shadow: 0 7px 17px rgba(217,35,50,.24); }
.nav-more-icon { letter-spacing: .08em; }

.web-toast { position: fixed; bottom: calc(var(--bottom-nav-height) + max(20px,env(safe-area-inset-bottom))); left: 50%; z-index: 1000; width: max-content; max-width: calc(100vw - 32px); padding: 11px 15px; border-radius: 13px; background: rgba(30,43,71,.96); color: #fff; box-shadow: 0 10px 28px rgba(16,24,40,.22); font-size: 12px; font-weight: 600; line-height: 1.5; text-align: center; white-space: pre-line; transform: translateX(-50%); }
.web-toast.is-warning { background: rgba(145,91,7,.96); }
.web-toast.is-error { background: rgba(177,35,47,.96); }

@media all and (display-mode: standalone) {
  .app-header { padding-top: env(safe-area-inset-top); }
  .app-main { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 28px); }
}
html.ios-standalone .app-header { padding-top: env(safe-area-inset-top); }
html.ios-standalone .app-main { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 28px); }
@media (max-width: 380px) {
  .app-content { padding-right: 12px; padding-left: 12px; }
  .app-header-content { padding-right: 12px; padding-left: 12px; }
  .app-brand-logo { width: 42px; height: 42px; flex-basis: 42px; }
  .app-brand-text h1 { font-size: 18px; }
  #headerMeta { max-width: 190px; }
  .duty-assignment-row { grid-template-columns: 58px minmax(0,1fr); }
  .calendar-day { min-height: 62px; }
  .calendar-duty { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner, .mini-spinner { animation: none; }
  .home-quick-button:active { transform: none; }
}

/* =========================================================
 * Legacy Apps Script UI parity
 * Original Index.html / Styles.html are the visual contract.
 * ========================================================= */

.header-action-button {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}
.header-action-symbol,
.refresh-symbol { font-size: 20px; line-height: 1; }
#headerMeta { max-width: 190px; color: var(--text-muted); }

.page-header { gap: 14px; margin: 2px 2px 18px; }
.page-header h2 { margin: 2px 0 4px; font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
.page-description { font-size: 13px; line-height: 1.5; }
.page-header-badge { margin-top: 4px; padding: 6px 10px; font-size: 11px; }

.home-greeting { margin-bottom: 1px; font-size: 13px; }
.home-user-line h2 { font-size: 27px; line-height: 1.2; letter-spacing: -.035em; }
.home-welcome > div:first-child > p:last-child { margin-top: 3px; font-size: 12px; }
.home-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.home-avatar img { width: 44px; height: 44px; border-radius: 12px; box-shadow: none; }
.role-badge { min-height: 25px; padding: 4px 9px; font-size: 11px; }
.home-supervisor-alert { margin-bottom: 16px; }
.alert-panel {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #d7e4fb;
  border-radius: var(--radius-sm);
  background: var(--info-soft);
  color: #1e5eae;
  font-size: 13px;
  line-height: 1.5;
}
.home-quick-actions { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 22px; }
.home-quick-button { min-height: 68px; padding: 12px; }
.home-quick-button:nth-child(3) { grid-column: 1 / -1; }
.home-quick-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 19px; }
.home-quick-content small { font-size: 11px; }
.home-quick-content strong { font-size: 14px; }

.section-heading { margin: 0 2px 11px; }
.section-meta { font-size: 10px; }
.content-section { margin: 23px 0; }
.home-primary-section { margin-top: 18px; }

.duty-card-top { padding: 17px; }
.duty-card-top h3 { margin: 2px 0 1px; font-size: 19px; }
.duty-metrics > div { padding: 12px 8px; }
.duty-metrics span { font-size: 10px; }
.duty-metrics strong { font-size: 24px; }
.duty-assignment-list { gap: 7px; padding: 14px 16px; }
.duty-assignment-row { min-height: 40px; padding: 7px 11px; }
.duty-assignment-row span { font-size: 11px; }
.duty-assignment-row strong { font-size: 14px; }
.duty-status-row { font-size: 11px; }

.leave-order-card { padding: 0; overflow: hidden; border-radius: var(--radius-lg); }
.leave-order-top { padding: 16px 16px 13px; }
.leave-order-top h3 { margin: 2px 0 0; font-size: 18px; }
.leave-order-progress { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; margin: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.leave-order-progress > div { padding: 12px 10px; border-right: 1px solid var(--border); border-radius: 0; background: #fff; }
.leave-order-progress > div:last-child { border-right: 0; }
.leave-order-progress span { font-size: 9px; }
.leave-order-progress strong { font-size: 12px; }
.leave-order-message { margin: 0; padding: 12px 15px; font-size: 12px; }

.form-card { padding: 18px; border-radius: var(--radius-lg); }
.form-card-heading { gap: 12px; margin-bottom: 17px; }
.form-card-heading h3 { margin: 2px 0 0; font-size: 19px; }
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; margin: 0 0 6px 2px; color: var(--text); font-size: 12px; font-weight: 700; }
.field select,
.field textarea,
.field input,
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
}
.field textarea,
.form-field textarea { min-height: 96px; resize: vertical; }
.field select:disabled,
.field textarea:disabled,
.field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled,
.form-field input:disabled { background: var(--surface-muted); color: var(--text-muted); }
.form-field { gap: 6px; margin-top: 16px; color: var(--text); font-size: 12px; }
.primary-button,
.secondary-button,
.danger-button { min-height: 43px; padding: 9px 15px; border-radius: 13px; font-size: 13px; }
.large-action-button { min-height: 51px; margin-top: 4px; border-radius: 15px; font-size: 15px; }

.page-info-card { padding: 14px; border-radius: var(--radius-md); }
.page-info-card small { font-size: 10px; }
.page-info-card strong { font-size: 13px; }
.page-info-card p { font-size: 11px; }

.chief-schedule-month-switch {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.chief-schedule-month-switch button {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}
.chief-schedule-month-switch button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.chief-schedule-source-note { margin: 0 0 10px; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.chief-schedule-toolbar { display: grid; gap: 9px; margin: 16px 0 12px; }
.chief-schedule-pager { display: grid; grid-template-columns: minmax(72px,1fr) minmax(74px,auto) minmax(72px,1fr); align-items: center; gap: 8px; }
.chief-schedule-pager button { min-height: 48px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 800; }
.chief-schedule-pager strong,
.chief-schedule-page-indicator { text-align: center; white-space: nowrap; }
.chief-schedule-page-indicator { color: var(--text-muted); font-size: 11px; font-weight: 800; }
.chief-schedule-table-wrap { width: 100%; max-height: calc(100vh - 300px); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); touch-action: pan-y; overscroll-behavior: contain; }
.chief-schedule-table { width: 100%; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.chief-schedule-table th,
.chief-schedule-table td { height: 58px; padding: 6px 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); text-align: center; vertical-align: middle; }
.chief-schedule-table thead th { position: sticky; top: 0; z-index: 4; background: var(--surface-soft); }
.chief-schedule-table .chief-schedule-name-cell,
.chief-schedule-table .chief-schedule-corner { position: sticky; left: 0; width: 94px; z-index: 5; background: var(--surface); font-size: 13px; white-space: nowrap; }
.chief-schedule-table .chief-schedule-corner { top: 0; z-index: 7; background: var(--surface-soft); }
.chief-schedule-date-cell span,
.chief-schedule-date-cell small { display: block; line-height: 1.2; }
.chief-schedule-date-cell span { font-size: 13px; font-weight: 900; }
.chief-schedule-date-cell small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.chief-schedule-date-cell.is-today { color: var(--primary); background: var(--primary-soft); }
.chief-schedule-table .duty-badge { display: inline-flex; width: 100%; min-height: 32px; padding: 5px 3px; align-items: center; justify-content: center; overflow-wrap: anywhere; border-radius: 9px; font-size: 11px; font-weight: 900; line-height: 1.15; }
.duty-badge.is-duty { color: #8b1d2a; background: rgba(217,35,50,.11); }
.duty-badge.is-off { color: #42516b; background: #eef0f4; }
.duty-badge.is-leave { color: #8c640b; background: #fff5dd; }
.duty-badge.is-swap { color: #6c438e; background: #f4edfb; }
.duty-badge.is-public { color: #237044; background: #e9f7ef; }

.push-setting-card,
.more-menu-item { min-height: 68px; padding: 12px 13px; }
.more-menu-content strong { font-size: 14px; }
.more-menu-content small { font-size: 11px; }

@media (max-width: 380px) {
  .home-user-line h2 { font-size: 24px; }
  .home-avatar { width: 48px; height: 48px; flex-basis: 48px; }
  .home-avatar img { width: 39px; height: 39px; }
  .home-quick-actions { grid-template-columns: 1fr; }
  .home-quick-button:nth-child(3) { grid-column: auto; }
  .leave-order-progress { grid-template-columns: 1fr; }
  .leave-order-progress > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-right: 0; border-bottom: 1px solid var(--border); text-align: left; }
}

/* Legacy remaining-page parity */
.notification-overview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.notification-overview-card small { display: block; color: var(--text-soft); font-size: 10px; }
.notification-overview-card strong { display: block; margin-top: 3px; color: var(--primary); font-size: 31px; line-height: 1; }
.notification-overview-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; background: var(--primary-soft); color: var(--primary); font-size: 22px; }
.notification-list { display: grid; gap: 9px; }
.notification-card { position: relative; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.notification-card.unread { border-color: rgba(217,35,50,.22); background: #fffafb; }
.notification-card.unread::before { position: absolute; top: 17px; left: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); content: ""; }
.notification-card-content { padding-left: 7px; }
.notification-card-title { margin: 0 0 4px; font-size: 14px; }
.notification-card-message { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.notification-card-meta { margin-top: 8px; color: var(--text-muted); font-size: 10px; }
.notification-card-content .text-action-button { margin-top: 8px; }
.notification-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 9px; font-weight: 900; line-height: 1; }
.header-action-button .notification-badge { position: absolute; top: -4px; right: -4px; }
.nav-notification-badge { position: absolute; top: 2px; right: 14px; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 8px; font-weight: 900; }
.more-menu-badge { margin-left: auto; }

.supervisor-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 18px; }
.supervisor-summary-card { min-height: 84px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.supervisor-summary-card span { display: block; color: var(--text-soft); font-size: 10px; }
.supervisor-summary-card strong { display: block; margin-top: 8px; font-size: 25px; line-height: 1; }
.supervisor-summary-card-accent { border-color: rgba(217,35,50,.2); background: var(--primary-soft); }
.supervisor-management-list { display: grid; gap: 11px; }
.supervisor-management-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.supervisor-management-title { margin: 2px 0 7px; font-size: 15px; }
.supervisor-management-meta { display: grid; gap: 3px; color: var(--text-soft); font-size: 11px; }
.supervisor-management-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); }

.danger-outline-button { width: 100%; min-height: 36px; margin-top: 11px; border: 1px solid rgba(217,35,50,.28); border-radius: 10px; color: var(--danger); background: transparent; font-size: 11px; font-weight: 900; }

.monthly-plan-export-card { display: grid; gap: 13px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.monthly-plan-export-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.monthly-plan-export-heading > div { display: grid; gap: 2px; }
.monthly-plan-export-heading small { color: var(--text-muted); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.monthly-plan-export-heading strong { color: var(--text); font-size: 15px; }
.monthly-plan-export-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.monthly-plan-export-grid > div { display: grid; gap: 3px; padding: 10px; border-radius: 11px; background: var(--surface-soft); }
.monthly-plan-export-grid span { color: var(--text-muted); font-size: 9px; }
.monthly-plan-export-grid strong { color: var(--text); font-size: 13px; }
.monthly-plan-export-manual-days { display: grid; gap: 9px; }
.monthly-plan-export-manual-days > p { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.monthly-plan-export-manual-day { display: grid; gap: 5px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 11px; }
.monthly-plan-export-manual-day > span { line-height: 1.5; overflow-wrap: anywhere; }
.monthly-plan-export-manual-day select { width: 100%; min-height: 38px; }
.monthly-plan-export-state,
.monthly-plan-export-warnings,
.monthly-plan-export-help { margin: 0; font-size: 11px; line-height: 1.55; }
.monthly-plan-export-state { padding: 9px 10px; border-radius: 10px; font-weight: 800; }
.monthly-plan-export-state.is-ready { color: var(--success); background: rgba(35,145,90,.1); }
.monthly-plan-export-state.is-blocked { color: var(--warning); background: rgba(191,117,15,.1); }
.monthly-plan-export-errors { display: grid; gap: 5px; margin: 0; padding: 0 0 0 18px; color: var(--danger); font-size: 10px; line-height: 1.5; }
.monthly-plan-export-warnings { color: var(--warning); }
.monthly-plan-export-help { color: var(--text-muted); text-align: center; }

.calendar-sync-content { display: grid; gap: 14px; }
.calendar-sync-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.calendar-sync-identity { display: grid; grid-template-columns: minmax(70px,auto) minmax(0,1fr); gap: 8px 14px; align-items: center; }
.calendar-sync-identity span { color: var(--text-soft); font-size: 11px; }
.calendar-sync-identity strong { text-align: right; }
.calendar-sync-notice { margin: 0; padding: 10px; border-radius: 10px; background: var(--surface-soft); color: var(--text-soft); font-size: 11px; }
.calendar-sync-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar-sync-heading h3, .calendar-sync-heading p, .calendar-sync-result h3, .calendar-sync-result p { margin: 0; }
.calendar-preview-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 14px 0; }
.calendar-preview-grid > div { display: grid; gap: 4px; padding: 11px 6px; border-radius: 11px; background: var(--surface-soft); text-align: center; }
.calendar-preview-grid span { color: var(--text-soft); font-size: 10px; }
.calendar-preview-grid strong { color: var(--text); font-size: 18px; }
.calendar-sync-select-label { display: grid; gap: 7px; margin-bottom: 12px; color: var(--text); font-size: 12px; font-weight: 800; }
.calendar-sync-select-label select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-soft); color: var(--text); font: inherit; }
.calendar-sync-result { border-color: rgba(35,145,90,.24); background: rgba(236,250,241,.72); }
.widget-access-card { display: grid; gap: 14px; }
.widget-access-description { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.65; }
.widget-access-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.widget-access-actions .full-button:only-child { grid-column: 1 / -1; }
.scriptable-installer-card { display: grid; gap: 16px; padding: 18px; border: 1px solid rgba(37,99,235,.2); border-radius: var(--radius-lg); background: rgba(239,246,255,.72); }
.leave-extra-authorization { display: grid; gap: 12px; margin-top: 16px; padding: 18px; border: 1px solid rgba(220,38,38,.16); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.leave-extra-authorization h3, .leave-extra-authorization p { margin: 0; }
.leave-extra-authorization > p:not(.card-label) { color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.leave-extra-mode-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.leave-extra-authorization-form { display: grid; gap: 11px; padding-top: 12px; border-top: 1px solid var(--border); }
.leave-extra-authorization-form label { display: grid; gap: 6px; color: var(--text); font-size: 12px; font-weight: 800; }
.leave-extra-authorization-form select, .leave-extra-authorization-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: #fff; color: var(--text); font: inherit; }
.leave-extra-authorization-form textarea { min-height: 84px; resize: vertical; }
.scriptable-installer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.scriptable-installer-heading h3,
.scriptable-installer-heading p,
.scriptable-code-panel p,
.scriptable-install-step p { margin: 0; }
.scriptable-token-status { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.scriptable-token-status.is-active { color: #166534; background: rgba(34,197,94,.14); }
.scriptable-token-status.is-inactive { color: #92400e; background: rgba(245,158,11,.16); }
.scriptable-code-panel { display: grid; gap: 10px; }
.scriptable-code-panel label { color: var(--text); font-weight: 800; }
.scriptable-code-panel textarea { width: 100%; min-height: 280px; padding: 12px; resize: vertical; border: 1px solid rgba(15,23,42,.16); border-radius: var(--radius-md); background: rgba(15,23,42,.94); color: #e2e8f0; font: 12px/1.5 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; }
.scriptable-code-panel p { color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.scriptable-install-steps { display: grid; gap: 10px; }
.scriptable-install-step { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 10px; align-items: flex-start; padding-top: 10px; border-top: 1px solid rgba(15,23,42,.08); }
.scriptable-install-step > span { color: var(--info); font-size: 11px; font-weight: 900; }
.scriptable-install-step strong { display: block; margin-bottom: 3px; }
.scriptable-install-step p { color: var(--text-soft); font-size: 12px; line-height: 1.5; }

/* RC-V2.7B reminders and new-month adapter UI */
.reminder-list { display: grid; gap: 12px; }
.reminder-card, .reminder-form-card, .new-month-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.reminder-card.is-completed { opacity: .78; }
.reminder-card p { margin: 10px 0; color: var(--text-soft); line-height: 1.55; }
.reminder-card-header > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reminder-status { flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.reminder-status.is-pending { color: #9a3412; background: #fff1e8; }
.reminder-status.is-completed { color: #166534; background: #eaf7ef; }
.reminder-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 13px 0; }
.reminder-meta div { padding: 9px 11px; border-radius: 11px; background: var(--surface-muted); }
.reminder-meta dt { color: var(--text-soft); font-size: 10px; }
.reminder-meta dd { margin: 3px 0 0; font-size: 12px; font-weight: 700; }
.reminder-form-card form { display: grid; gap: 14px; margin-top: 14px; }
.reminder-target-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.reminder-target-grid label { display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: 11px; background: var(--surface-muted); }
.reminder-history-heading { margin-top: 22px; }
.new-month-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.new-month-summary > div { padding: 14px; border-radius: 13px; background: var(--surface-muted); }
.new-month-summary small, .new-month-summary strong { display: block; }
.new-month-summary strong { margin-top: 5px; font-size: 20px; }
.new-month-checks { display: grid; gap: 8px; margin: 16px 0; }
.new-month-check { display: flex; gap: 10px; align-items: center; padding: 11px; border-radius: 11px; }
.new-month-check.is-pass { color: #166534; background: #eaf7ef; }
.new-month-check.is-fail { color: #991b1b; background: #fef2f2; }
.new-month-check div { display: grid; gap: 2px; }
.new-month-check small { opacity: .7; }
.new-month-notice { padding: 12px; border-radius: 12px; background: #fff8e1; line-height: 1.55; }

/* RC-V2.10A isolated special/support overlay UI. */
.support-duty-section { display: grid; gap: 8px; margin-top: 13px; padding: 12px; border: 1px solid rgba(220,38,38,.14); border-radius: 13px; background: #fff8f7; }
.support-duty-section h4 { margin: 0; color: #b91c1c; font-size: 12px; letter-spacing: .06em; }
.support-duty-row { display: grid; grid-template-columns: 50px minmax(0,1fr); gap: 8px; font-size: 12px; }
.support-duty-row span { color: var(--text-soft); font-weight: 800; }
.support-duty-row strong { min-width: 0; overflow-wrap: anywhere; }
.special-duty-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.special-duty-form-grid .form-card { display: grid; gap: 12px; }
.special-duty-preview { display: grid; gap: 13px; margin: 16px 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.special-duty-preview.is-pass { border-color: rgba(22,101,52,.28); background: #f2fbf5; }
.special-duty-preview.is-blocked { border-color: rgba(185,28,28,.28); background: #fff7f7; }
.special-duty-preview-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 9px; }
.special-duty-preview-grid > div { display: grid; gap: 4px; padding: 11px; border-radius: 11px; background: rgba(255,255,255,.78); }
.special-duty-preview-grid span { color: var(--text-soft); font-size: 11px; }
.support-duty-summary-list { display: grid; gap: 9px; margin-top: 14px; }
.support-duty-summary { display: grid; gap: 3px; padding: 10px 12px; border-radius: 11px; background: #fff8f7; font-size: 11px; }
.duty-badge.is-support, .schedule-cell.is-support { color: #9a3412; background: #fff1e8; }

@media (max-width: 420px) {
  .scriptable-installer-heading { align-items: stretch; flex-direction: column; }
  .scriptable-token-status { align-self: flex-start; }
  .scriptable-code-panel textarea { min-height: 240px; }
  .reminder-meta, .reminder-target-grid, .new-month-summary { grid-template-columns: 1fr; }
  .special-duty-form-grid { grid-template-columns: 1fr; }
}
.leave-order-waiver-action,
.leave-order-waiver-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(122, 135, 153, 0.2);
}

.leave-order-waiver-action p,
.leave-order-waiver-note {
  margin-bottom: 10px;
  color: var(--muted-text, #687386);
  line-height: 1.55;
}
