:root {
  --forest: #173d37;
  --forest-2: #28564d;
  --forest-3: #3c6b61;
  --paper: #f6f4ee;
  --surface: #fffefb;
  --ink: #18312d;
  --muted: #72827e;
  --line: #dde3dd;
  --coral: #ec745d;
  --coral-soft: #fde9e3;
  --mint: #dcece4;
  --amber: #e8b85e;
  --amber-soft: #fff2d7;
  --blue-soft: #e4edf5;
  --blue: #6686a0;
  --shadow: 0 18px 46px rgba(27, 55, 49, 0.1);
  --shadow-sm: 0 6px 24px rgba(27, 55, 49, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: #dfe5e0;
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.auth-gate {
  width: 100%; min-height: 100svh; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(232,184,94,.22), transparent 28%),
    radial-gradient(circle at 88% 86%, rgba(60,107,97,.22), transparent 34%),
    linear-gradient(145deg, #edf1eb, #dce5df);
}
.auth-card { width: min(100%, 440px); padding: 28px; border: 1px solid rgba(255,255,255,.8); border-radius: 30px; background: rgba(255,254,251,.96); box-shadow: 0 24px 80px rgba(12,43,36,.18); }
.auth-brand { margin-bottom: 30px; display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 48px; height: 48px; }
.auth-brand strong, .auth-brand small { display: block; }.auth-brand strong { font-size: 18px; letter-spacing: .08em; }.auth-brand small { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.auth-copy { margin-bottom: 22px; }.auth-copy h1, .auth-loading h1 { margin: 0 0 7px; font-size: 27px; }.auth-copy p, .auth-loading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.auth-loading { padding: 18px 0 8px; text-align: center; }.auth-spinner { width: 38px; height: 38px; margin: 0 auto 18px; display: block; border: 4px solid var(--mint); border-top-color: var(--forest); border-radius: 50%; animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-form { display: grid; gap: 14px; }.auth-form .field > span { color: var(--ink); font-size: 11px; }.auth-form .field input { min-height: 50px; font-size: 14px; }
.auth-submit { min-height: 51px; margin-top: 3px; border: 0; border-radius: 15px; background: var(--forest); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(23,61,55,.18); }.auth-submit:hover { background: var(--forest-2); }.auth-submit:disabled { cursor: wait; opacity: .62; }
.auth-message { min-height: 20px; margin: -4px 0 0; color: #ac4938; font-size: 11px; line-height: 1.55; }.auth-message:empty { display: none; }
.auth-security { margin: 20px 0 0; padding: 13px; display: flex; gap: 10px; border-radius: 15px; background: var(--mint); color: var(--forest-2); }.auth-security svg { width: 18px; flex: 0 0 auto; }.auth-security p { margin: 0; font-size: 10px; line-height: 1.65; }
.auth-file-warning { padding: 17px; display: grid; gap: 8px; border: 1px solid #edc8a1; border-radius: 18px; background: var(--amber-soft); }.auth-file-warning b { font-size: 13px; }.auth-file-warning p { margin: 0; color: #74551e; font-size: 11px; line-height: 1.7; }.auth-file-warning code { overflow-wrap: anywhere; font-size: 10px; }
.shared-setup-notice { margin: 0 0 14px; padding: 14px 16px; display: grid; gap: 4px; border: 1px solid #e7d9b9; border-radius: 16px; background: #fff8e8; color: #6d5625; }
.shared-setup-notice b { font-size: 12px; }.shared-setup-notice span { font-size: 10px; line-height: 1.6; }
.shared-setup-options { display: grid; gap: 10px; }
.shared-setup-choice { width: 100%; min-height: 82px; padding: 14px; display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 17px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.shared-setup-choice:hover { border-color: var(--forest); transform: translateY(-1px); box-shadow: 0 9px 22px rgba(23,61,55,.1); }.shared-setup-choice.recommended { border-color: #8ebcaf; background: #f5fbf8; }
.shared-setup-choice:disabled { cursor: wait; opacity: .58; transform: none; }.shared-setup-choice span:last-child { min-width: 0; display: grid; gap: 5px; }.shared-setup-choice b { font-size: 13px; }.shared-setup-choice small { color: var(--muted); font-size: 10px; line-height: 1.55; }
.shared-choice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--mint); color: var(--forest); }.shared-choice-icon svg { width: 20px; height: 20px; }.shared-setup-error { margin-top: 12px; }

.app-shell {
  position: relative;
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(16, 47, 40, 0.14);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 76px;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(246, 244, 238, 0.92);
  border-bottom: 1px solid rgba(217, 223, 216, 0.8);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 14px 14px 14px 5px;
  display: grid; place-items: center; background: var(--forest); color: #fff;
  box-shadow: 0 7px 16px rgba(23, 61, 55, 0.18);
}
.brand-mark span { font-family: "Noto Serif TC", serif; font-size: 18px; transform: translateY(-1px); }
.brand strong { display: block; font-size: 16px; letter-spacing: 0.08em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }

.icon-button {
  position: relative; width: 42px; height: 42px; padding: 0;
  display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); cursor: pointer;
}
.icon-button:hover { border-color: #c1cdc5; background: #fff; }
.icon-button.small { width: 36px; height: 36px; background: transparent; }
.icon-button.small svg { width: 18px; height: 18px; }
.icon-button.flip svg { transform: rotate(180deg); }
.notification-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border: 2px solid var(--surface); border-radius: 50%; background: var(--coral); }

main { min-height: calc(100vh - 76px); padding-bottom: calc(92px + var(--safe-bottom)); }
.view { display: none; animation: reveal 0.28s ease-out; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.home-hero { padding: 22px 20px 0; background: linear-gradient(180deg, #e5ece5 0%, var(--paper) 100%); overflow: hidden; }
.date-line { margin-bottom: 8px; color: var(--forest-3); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; }
.greeting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 14px; font-weight: 600; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: "Noto Serif TC", serif; font-size: clamp(30px, 7vw, 42px); line-height: 1.25; letter-spacing: 0.02em; }
h2 { margin-bottom: 0; font-size: 21px; line-height: 1.4; }
h3 { margin-bottom: 5px; font-size: 16px; line-height: 1.4; }
.weather-pill { flex: 0 0 auto; margin-top: 4px; padding: 7px 10px; display: flex; align-items: center; gap: 5px; border: 1px solid rgba(23,61,55,.09); border-radius: 999px; background: rgba(255,255,255,.55); font-size: 13px; }
.weather-pill span { color: #dc9e2a; }

.next-shift-card {
  position: relative; margin-top: 24px; min-height: 184px; padding: 21px;
  overflow: hidden; border-radius: var(--radius-xl); background: var(--forest); color: #fff;
  box-shadow: 0 18px 42px rgba(23, 61, 55, 0.25);
}
.next-shift-card::before, .next-shift-card::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.next-shift-card::before { width: 220px; height: 220px; right: -104px; top: -84px; border: 42px solid rgba(255,255,255,.035); }
.next-shift-card::after { width: 90px; height: 90px; right: 42px; bottom: -54px; background: rgba(238, 192, 104, 0.13); }
.shift-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.shift-card-label { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .13em; color: #b9d1c9; }
.live-chip { padding: 5px 9px; border-radius: 999px; background: rgba(237,116,93,.18); color: #ffb6a7; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.next-shift-card h2 { position: relative; z-index: 1; margin-top: 17px; font-size: 28px; letter-spacing: .04em; }
.shift-time { position: relative; z-index: 1; margin: 4px 0 18px; color: #edf4f0; font-size: 15px; }
.shift-meta-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.shift-meta-row span { display: inline-flex; align-items: center; gap: 6px; color: #bdd0ca; font-size: 12px; }
.shift-meta-row .follow-duty-chip { padding: 3px 8px; border-radius: 999px; background: rgba(246,201,117,.18); color: #f8d58f; font-weight: 800; }
.shift-meta-row svg { width: 16px; height: 16px; }
.shift-card-button { position: absolute; z-index: 2; right: 19px; bottom: 19px; width: 43px; height: 43px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f6c975; color: var(--forest); cursor: pointer; }
.shift-card-button svg { width: 18px; }

.content-stack { padding: 22px 20px; display: grid; gap: 30px; }
.home-content { margin-top: 0; }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-action { padding: 13px 6px 12px; display: grid; place-items: center; gap: 8px; border: 1px solid #e2e5df; border-radius: 20px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 5px 18px rgba(28, 52, 47, 0.04); }
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; }
.quick-icon svg { width: 20px; height: 20px; }
.quick-icon.coral { background: var(--coral-soft); color: var(--coral); }
.quick-icon.mint { background: var(--mint); color: var(--forest-2); }
.quick-icon.amber { background: var(--amber-soft); color: #b37d23; }

.section-heading { margin-bottom: 15px; display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.section-kicker { margin: 0 0 4px; color: var(--coral); font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.text-button { padding: 8px 0; display: inline-flex; align-items: center; border: 0; background: transparent; color: var(--forest-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.text-button svg { width: 15px; height: 15px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 0 17px; }
.week-day { min-height: 59px; padding: 8px 2px; display: grid; place-items: center; gap: 4px; border: 0; border-radius: 18px; background: transparent; color: var(--muted); cursor: pointer; }
.week-day small { font-size: 10px; }
.week-day strong { font-size: 14px; }
.week-day.active { background: var(--forest); color: #fff; box-shadow: 0 7px 18px rgba(23, 61, 55, .2); }
.week-day.has-shift:not(.active) strong::after { content: ""; display: block; width: 4px; height: 4px; margin: 3px auto -7px; border-radius: 50%; background: var(--coral); }

.shift-list { display: grid; gap: 10px; }
.shift-item { position: relative; padding: 15px; display: grid; grid-template-columns: 6px 1fr auto; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: 0 4px 16px rgba(25, 53, 47, 0.035); }
.shift-line { align-self: stretch; min-height: 54px; border-radius: 99px; background: var(--coral); }
.shift-line.evening { background: var(--amber); }
.shift-line.night { background: var(--blue); }
.shift-item-main { min-width: 0; }
.shift-item-main strong { display: block; margin-bottom: 4px; font-size: 15px; }
.shift-item-main p { margin: 0 0 3px; color: var(--muted); font-size: 12px; }
.shift-people { display: flex; align-items: center; margin-top: 7px; }
.mini-avatar { width: 25px; height: 25px; margin-right: -5px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 50%; color: #fff; font-size: 9px; font-weight: 700; }
.mini-avatar:nth-child(1) { background: #54766e; }.mini-avatar:nth-child(2) { background: #d47c67; }.mini-avatar:nth-child(3) { background: #7590a4; }
.shift-people span:last-child:not(.mini-avatar) { margin-left: 10px; color: var(--muted); font-size: 10px; }
.shift-follower { margin-top: 7px; display: flex; align-items: center; gap: 7px; color: var(--forest-2); font-size: 10px; }
.shift-follower b { padding: 2px 7px; border-radius: 999px; background: var(--amber-soft); color: #966818; font-size: 8px; letter-spacing: .08em; }
.shift-follower span { min-width: 0; overflow-wrap: anywhere; }
.shift-item-action { width: 35px; height: 35px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f0f3ef; color: var(--forest-2); cursor: pointer; }
.shift-item-action svg { width: 17px; height: 17px; }

.notice-card { padding: 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; border-radius: 22px; background: #eee9dc; }
.notice-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: var(--forest); font-family: serif; font-size: 19px; font-weight: 800; }
.notice-card h3 { margin-bottom: 4px; }
.notice-card p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.notice-card button { padding: 5px; border: 0; background: transparent; cursor: pointer; }
.notice-card button svg { width: 18px; }

.page-header { padding: 28px 20px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-header h1 { font-size: 34px; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.secondary-button, .primary-button { min-height: 42px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.secondary-button { border: 1px solid var(--line); background: var(--surface); }
.primary-button { border: 0; background: var(--forest); color: #fff; }
.primary-button:hover { background: var(--forest-2); }
.primary-button.compact { white-space: nowrap; }
.secondary-button svg, .primary-button svg { width: 17px; height: 17px; }
.round-add { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--coral); color: #fff; box-shadow: 0 8px 20px rgba(236,116,93,.24); cursor: pointer; }

.segmented { width: calc(100% - 40px); margin: 0 20px 17px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 15px; background: #e5e7e1; }
.segmented button { height: 36px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--forest); box-shadow: 0 4px 14px rgba(26,56,49,.08); }
.roster-rules { margin: 0 20px 17px; padding: 13px 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,254,251,.72); }
.roster-rules > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.roster-rules p { min-width: 0; margin: 0; }
.roster-rules b, .roster-rules small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-rules b { font-size: 10px; }.roster-rules small { margin-top: 1px; color: var(--muted); font-size: 8px; }
.rule-dot { width: 8px; height: 28px; flex: 0 0 auto; border-radius: 99px; }.rule-dot.coral { background: var(--coral); }.rule-dot.amber { background: var(--amber); }.rule-dot.blue { background: var(--blue); }
.schedule-layout { padding: 0 20px 28px; display: grid; gap: 25px; }
.calendar-card { padding: 15px 13px 13px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-sm); }
.calendar-toolbar { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.month-label { padding: 0 12px; display: grid; gap: 1px; border: 0; background: transparent; cursor: pointer; }
.month-label span { font-size: 17px; font-weight: 800; }
.month-label small { color: var(--muted); font-size: 9px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; }
.calendar-weekdays span { padding: 7px 0; }
.calendar-cell { position: relative; aspect-ratio: 1 / 1.07; min-height: 42px; padding: 5px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; }
.calendar-cell:hover { background: #f0f2ed; }
.calendar-cell.outside { color: #b7c0bc; }
.calendar-cell.today span { color: var(--coral); font-weight: 800; }
.calendar-cell.selected { background: var(--forest); color: #fff; box-shadow: 0 7px 18px rgba(23,61,55,.18); }
.calendar-cell.selected span { color: #fff; }
.calendar-cell span { font-size: 12px; line-height: 1; }
.calendar-cell.holiday { gap: 2px; }
.calendar-cell.holiday:not(.selected) .calendar-date-number { color: #b34f3f; font-weight: 800; }
.calendar-holiday { max-width: 100%; padding: 2px 4px; overflow: hidden; border-radius: 999px; background: var(--coral-soft); color: #a94332; font-size: 7px; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.calendar-cell.selected .calendar-holiday { background: rgba(255,255,255,.18); color: #fff; }
.calendar-cell.outside .calendar-holiday { opacity: .55; }
.calendar-dots { display: flex; gap: 2px; }
.calendar-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--coral); }
.calendar-dots i:nth-child(2) { background: var(--amber); }.calendar-dots i:nth-child(3) { background: var(--blue); }
.calendar-cell.selected .calendar-dots i { background: #a8cbc0; }
.selected-day-panel { min-width: 0; }

.capacity-ring { width: 55px; height: 55px; flex: 0 0 auto; display: flex; align-items: baseline; justify-content: center; padding-top: 13px; border: 5px solid var(--mint); border-right-color: var(--forest-2); border-radius: 50%; }.capacity-ring b { font-family: "Noto Serif TC", serif; font-size: 18px; }.capacity-ring small { color: var(--muted); font-size: 9px; }
.task-date-toolbar { margin: 0 20px 14px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.task-date-label { padding: 2px 18px; display: grid; place-items: center; gap: 1px; border: 0; background: transparent; cursor: pointer; }.task-date-label small { color: var(--coral); font-size: 8px; font-weight: 800; letter-spacing: .14em; }.task-date-label strong { font-size: 15px; }
.task-progress-card { margin: 0 20px 17px; padding: 16px; border-radius: 20px; background: var(--forest); color: #fff; box-shadow: 0 10px 24px rgba(23,61,55,.16); }.task-progress-card > div:first-child { display: flex; align-items: center; justify-content: space-between; font-size: 11px; }.task-progress-card strong { font-size: 13px; }.progress-track { height: 5px; margin: 10px 0; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.14); }.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--amber); transition: width .3s ease; }.task-progress-card p { margin: 0; color: #bfd0cb; font-size: 9px; line-height: 1.6; }
.task-board { padding: 0 20px 28px; display: grid; gap: 9px; }.task-slot { position: relative; min-height: 88px; padding: 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); cursor: pointer; text-align: left; }.task-slot:hover { border-color: #bdcbc4; box-shadow: var(--shadow-sm); }.task-number { width: 39px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: #edf0eb; color: var(--forest-3); font-family: "Noto Serif TC", serif; font-size: 14px; }.task-slot.filled .task-number { background: var(--coral-soft); color: #b14d3a; }.task-slot-main { min-width: 0; }.task-slot-main strong { display: block; margin-bottom: 3px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.task-slot-main p { margin: 0; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.task-slot-main small { display: block; margin-top: 5px; color: var(--forest-3); font-size: 9px; }.task-slot-assignee { display: grid; justify-items: center; gap: 3px; }.task-slot-assignee .avatar { width: 35px; height: 35px; border-radius: 12px; font-size: 10px; }.task-slot-assignee small { max-width: 53px; color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.task-slot-empty { color: #9ca7a3; font-size: 10px; }

.swap-summary { margin: 0 20px 20px; padding: 18px 6px; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 22px; background: var(--forest); color: #fff; box-shadow: 0 12px 28px rgba(23,61,55,.18); }
.swap-summary div { display: grid; place-items: center; border-right: 1px solid rgba(255,255,255,.13); }
.swap-summary div:last-child { border-right: 0; }
.swap-summary strong { font-family: "Noto Serif TC", serif; font-size: 24px; }
.swap-summary span { color: #bed0cb; font-size: 10px; }
.filter-pills, .department-filter { padding: 0 20px 14px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar, .department-filter::-webkit-scrollbar { display: none; }
.filter-pills button, .department-filter button { min-width: max-content; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.filter-pills button.active, .department-filter button.active { border-color: var(--forest); background: var(--forest); color: #fff; }
.swap-list { padding: 0 20px 26px; display: grid; gap: 12px; }
.swap-card { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 5px 18px rgba(28,55,49,.04); }
.swap-card-top { display: flex; align-items: center; gap: 11px; }
.avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; background: var(--mint); color: var(--forest); font-size: 13px; font-weight: 800; }
.avatar.coral { background: var(--coral-soft); color: #a84d3c; }.avatar.amber { background: var(--amber-soft); color: #95661a; }.avatar.blue { background: var(--blue-soft); color: #4b6d86; }
.swap-owner { min-width: 0; flex: 1; }
.swap-owner strong { font-size: 14px; }.swap-owner p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.status-chip { padding: 5px 9px; border-radius: 999px; background: var(--amber-soft); color: #95661a; font-size: 9px; font-weight: 800; }
.status-chip.done { background: var(--mint); color: var(--forest-2); }
.swap-detail { margin-top: 14px; padding: 13px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; border-radius: 16px; background: #f2f2ed; }
.swap-detail div { min-width: 0; }.swap-detail small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; }.swap-detail strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swap-arrow { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--coral); }
.swap-arrow svg { width: 15px; }
.swap-reason { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.swap-actions { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.swap-actions.three { grid-template-columns: .8fr .8fr 1.4fr; }.swap-actions.single { grid-template-columns: 1fr; }
.swap-actions button { min-height: 39px; border-radius: 13px; font-size: 11px; font-weight: 700; cursor: pointer; }
.swap-actions .accept { border: 0; background: var(--forest); color: #fff; }.swap-actions .contact { border: 1px solid var(--line); background: var(--surface); }

.search-box { position: relative; margin: 0 20px 14px; height: 49px; display: flex; align-items: center; gap: 10px; padding: 0 46px 0 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 4px 18px rgba(29,56,50,.04); }
.search-box > svg { flex: 0 0 auto; width: 19px; height: 19px; color: var(--muted); }
.search-box input { width: 100%; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-box input::placeholder { color: #9aa7a3; }
.clear-search { position: absolute; right: 8px; width: 33px; height: 33px; display: none; place-items: center; border: 0; border-radius: 50%; background: #f0f2ee; color: var(--muted); cursor: pointer; }
.clear-search.show { display: grid; }.clear-search svg { width: 15px; }
.contact-list { padding: 0 20px 28px; display: grid; gap: 9px; }
.department-label { margin: 10px 2px 2px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.contact-card { padding: 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.contact-main { min-width: 0; }
.contact-name-row { display: flex; align-items: center; gap: 7px; }
.contact-name-row { min-width: 0; flex-wrap: wrap; }
.contact-name-row strong { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }.online-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #5fa178; }
.contact-main p { margin: 2px 0 5px; color: var(--muted); font-size: 10px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.company-phone { max-width: 100%; overflow-wrap: anywhere; }
.company-phone { display: inline-flex; align-items: center; gap: 5px; color: var(--forest-2); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.company-phone svg { width: 13px; height: 13px; }
.contact-actions { display: flex; gap: 6px; }
.contact-actions button, .contact-actions a { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; text-decoration: none; cursor: pointer; }
.call-button { border: 0; background: var(--forest); color: #fff; }.edit-button { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.contact-actions svg { width: 16px; height: 16px; }

.bottom-nav { position: fixed; z-index: 35; left: 50%; bottom: 0; width: min(100%, 1180px); min-height: calc(72px + var(--safe-bottom)); padding: 6px 10px var(--safe-bottom); display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid rgba(211,219,212,.92); background: rgba(255,254,251,.94); backdrop-filter: blur(18px); transform: translateX(-50%); }
.bottom-nav button { position: relative; padding: 5px 0 3px; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: #8c9995; font-size: 9px; font-weight: 700; cursor: pointer; }
.bottom-nav button > svg { width: 21px; height: 21px; }
.bottom-nav button.active { color: var(--forest); }
.swap-nav-icon { width: 41px; height: 32px; display: grid; place-items: center; border-radius: 14px; }
.bottom-nav .swap-nav.active .swap-nav-icon { background: var(--forest); color: #fff; }
.swap-nav-icon svg { width: 21px; height: 21px; }
.bottom-nav i { position: absolute; top: 1px; left: calc(50% + 10px); min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 99px; background: var(--coral); color: #fff; font-size: 8px; font-style: normal; }
.bottom-nav i:empty, .bottom-nav i[data-count="0"] { display: none; }

.modal-layer { position: fixed; z-index: 100; inset: 0; display: none; align-items: flex-end; justify-content: center; }
.modal-layer.open { display: flex; }
.modal-scrim { position: absolute; inset: 0; background: rgba(9,31,27,.58); backdrop-filter: blur(4px); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.bottom-sheet { position: relative; z-index: 1; width: min(100%, 600px); max-height: min(88vh, 820px); padding: 8px 20px calc(24px + var(--safe-bottom)); overflow-y: auto; border-radius: 28px 28px 0 0; background: var(--paper); animation: slide-up .3s cubic-bezier(.2,.75,.25,1); }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
.sheet-handle { width: 40px; height: 4px; margin: 1px auto 17px; border-radius: 99px; background: #c7cfca; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.sheet-header h2 { font-size: 23px; }
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field, .form-row > * { min-width: 0; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 45px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: var(--surface); color: var(--ink); font-size: 12px; }
.field textarea { min-height: 82px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--forest-3); box-shadow: 0 0 0 3px rgba(60,107,97,.1); }
.form-hint { margin: -4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.form-actions { margin-top: 5px; display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.form-actions button { min-height: 46px; border-radius: 14px; font-size: 12px; font-weight: 800; cursor: pointer; }
.form-actions .cancel { border: 1px solid var(--line); background: var(--surface); }.form-actions .submit { border: 0; background: var(--forest); color: #fff; }
.form-actions .danger { border: 1px solid #edc5bc; background: var(--coral-soft); color: #a44736; }.form-actions.task-edit-actions { grid-template-columns: 1fr 2fr; }
.profile-preview { margin-bottom: 16px; padding: 15px; display: flex; align-items: center; gap: 12px; border-radius: 18px; background: var(--mint); }
.profile-preview .avatar { background: var(--forest); color: #fff; }.profile-preview p { margin: 2px 0 0; color: var(--forest-3); font-size: 11px; }
.primary-button.full-width { width: 100%; min-height: 48px; margin-top: 6px; }
.detail-hero small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.locked-shift-summary { padding: 14px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }.locked-shift-summary .shift-line { width: 7px; min-height: 59px; }.locked-shift-summary div { min-width: 0; }.locked-shift-summary small, .locked-shift-summary strong, .locked-shift-summary p { display: block; }.locked-shift-summary small { color: var(--muted); font-size: 9px; }.locked-shift-summary strong { margin-top: 3px; font-size: 13px; line-height: 1.5; }.locked-shift-summary p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.form-warning { padding: 12px 13px; display: grid; gap: 3px; border: 1px solid #edc8a1; border-radius: 14px; background: var(--amber-soft); color: #805a1c; }.form-warning b { font-size: 11px; }.form-warning span { font-size: 9px; line-height: 1.55; }
.selection-count { float: right; padding: 2px 7px; border-radius: 99px; background: var(--coral-soft); color: #a94d3b; font-size: 9px; }.selection-count.complete { background: var(--mint); color: var(--forest-2); }
.optional-follower-field { padding: 12px; border: 1px solid #ead6ad; border-radius: 15px; background: var(--amber-soft); }
.optional-follower-field[hidden] { display: none; }
.inline-search { height: 43px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }.inline-search svg { width: 17px; flex: 0 0 auto; color: var(--muted); }.inline-search input { width: 100%; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.assignee-picker { max-height: 310px; padding: 5px; display: grid; gap: 6px; overflow-y: auto; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,254,251,.58); }.assignee-option { position: relative; min-width: 0; padding: 9px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; background: var(--surface); cursor: pointer; }.assignee-option:has(input:checked) { border-color: var(--forest-3); background: var(--mint); }.assignee-option.filtered-out { display: none; }.assignee-option input { position: absolute; opacity: 0; pointer-events: none; }.assignee-option .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 9px; }.assignee-option > span:nth-of-type(2) { min-width: 0; display: grid; gap: 1px; }.assignee-option b { font-size: 11px; overflow-wrap: anywhere; }.assignee-option small { color: var(--muted); font-size: 8px; line-height: 1.4; overflow-wrap: anywhere; }.assignee-option i { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: transparent; }.assignee-option i svg { width: 14px; }.assignee-option:has(input:checked) i { border-color: var(--forest); background: var(--forest); color: #fff; }
.shift-change-summary { margin-top: 4px; padding: 12px; border-radius: 15px; background: var(--surface); }.shift-change-summary .department-label { margin-top: 0; }.shift-change-summary > div { padding: 7px 0; display: grid; gap: 2px; border-top: 1px solid var(--line); }.shift-change-summary strong { font-size: 10px; }.shift-change-summary small { color: var(--muted); font-size: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.role-button { height: 42px; padding: 4px 9px 4px 5px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; }
.role-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: #fff; font-size: 10px; font-weight: 800; }
.role-button span:last-child { display: grid; text-align: left; }.role-button small { color: var(--muted); font-size: 7px; }.role-button b { font-size: 10px; }
.account-summary { padding: 16px; display: flex; align-items: center; gap: 13px; border-radius: 18px; background: var(--mint); }.account-summary .avatar { background: var(--forest); color: #fff; }.account-summary div { min-width: 0; }.account-summary strong, .account-summary span, .account-summary small { display: block; overflow-wrap: anywhere; }.account-summary strong { font-size: 14px; }.account-summary span { margin-top: 2px; color: var(--forest-3); font-size: 10px; }.account-summary small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.account-actions { display: grid; gap: 8px; }.account-actions button { min-height: 47px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 12px; font-weight: 750; cursor: pointer; }.account-actions button svg { width: 17px; }.account-actions .logout-button { border-color: #edc5bc; color: #a44736; }
.user-admin-toolbar { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }.user-admin-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }.user-admin-list { display: grid; gap: 9px; }
.user-account-card { padding: 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }.user-account-card.inactive { opacity: .62; }.user-account-card > div { min-width: 0; }.user-account-card strong, .user-account-card span, .user-account-card small { display: block; overflow-wrap: anywhere; }.user-account-card strong { font-size: 12px; }.user-account-card span { margin-top: 2px; color: var(--muted); font-size: 9px; }.user-account-card small { margin-top: 4px; color: var(--forest-3); font-size: 8px; line-height: 1.5; }.user-account-card button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }.user-account-card button svg { width: 15px; }
.account-state { min-width: max-content; padding: 4px 7px; display: inline-block !important; border-radius: 99px; background: var(--mint); color: var(--forest-2) !important; font-size: 8px !important; font-weight: 800; }.account-state.off { background: #ecebea; color: #7c817f !important; }
.password-meter { margin-top: 1px; color: var(--muted); font-size: 9px; }.password-meter.valid { color: #347155; }
.form-actions.three-way { grid-template-columns: 1fr 1fr 1.4fr; }.form-actions .neutral { border: 1px solid var(--line); background: var(--surface); }
.danger-zone { padding-top: 13px; border-top: 1px solid var(--line); }.danger-zone button { width: 100%; min-height: 45px; border: 1px solid #edc5bc; border-radius: 14px; background: var(--coral-soft); color: #a44736; font-size: 11px; font-weight: 800; cursor: pointer; }
.approval-flow { margin: 15px 2px 0; display: flex; align-items: center; }
.approval-flow span { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: #9aa5a1; font-size: 8px; font-weight: 800; }
.approval-flow span.complete { border-color: var(--forest-2); background: var(--forest-2); color: #fff; }.approval-flow span.current { border-color: var(--coral); background: var(--coral-soft); color: #a94c3a; }
.approval-flow i { height: 1px; flex: 1; background: var(--line); }
.role-choices { display: grid; gap: 9px; }.role-choice { padding: 13px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); cursor: pointer; }.role-choice.selected { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(23,61,55,.08); }.role-choice input { accent-color: var(--forest); }.role-choice span { display: grid; gap: 2px; }.role-choice b { font-size: 13px; }.role-choice small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.detail-stack, .history-list, .notification-list { display: grid; gap: 10px; }.detail-hero { padding: 15px; display: flex; align-items: center; gap: 13px; border-radius: 17px; background: var(--surface); }.detail-hero .shift-line { width: 7px; min-height: 52px; }.detail-hero strong { font-size: 17px; }.detail-hero p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }.contact-card.compact { grid-template-columns: auto 1fr auto; }.contact-card.compact .call-button { width: 37px; height: 37px; }
.follower-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.follower-heading span { color: var(--muted); font-size: 8px; font-weight: 500; }.follow-duty-card { border-color: #ead6ad; background: var(--amber-soft); }.follow-duty-card .contact-main strong i { padding: 2px 6px; border-radius: 999px; background: #f4c86f; color: #704d10; font-size: 8px; font-style: normal; }.follower-empty { padding: 13px; border: 1px dashed #dbcaa9; border-radius: 15px; background: rgba(247,230,194,.34); color: var(--muted); font-size: 10px; text-align: center; }
.history-summary { padding: 15px; border-radius: 17px; background: var(--surface); }.history-summary p { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }.history-entry { position: relative; padding: 12px 0; display: flex; gap: 11px; }.history-entry > span { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: #fff; font-size: 9px; font-weight: 800; }.history-entry strong { font-size: 12px; }.history-entry p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.notification-list > button { width: 100%; padding: 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); text-align: left; cursor: pointer; }.notification-list .notice-icon { width: 35px; height: 35px; font-family: inherit; font-size: 12px; }.notification-list strong { font-size: 12px; }.notification-list p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }.notification-list svg { width: 17px; }
.schedule-layout.list-mode { display: block; }

.toast { position: fixed; z-index: 150; left: 50%; bottom: calc(88px + var(--safe-bottom)); max-width: calc(100% - 32px); min-height: 45px; padding: 10px 15px; display: flex; align-items: center; gap: 8px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 12px; box-shadow: 0 10px 28px rgba(15,35,30,.25); opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }.toast svg { width: 17px; height: 17px; color: #87c7a3; }
.empty-state { padding: 28px 20px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-illustration { width: 58px; height: 58px; margin-bottom: 10px; display: grid; place-items: center; border-radius: 20px; background: #e7ebe6; }.empty-illustration svg { color: var(--forest-3); }.empty-state h3 { margin-bottom: 5px; color: var(--ink); }.empty-state p { margin: 0; font-size: 11px; line-height: 1.6; }

@media (min-width: 740px) {
  .topbar { padding-left: 34px; padding-right: 34px; }
  .home-hero { padding: 34px 34px 0; }
  .home-content { padding: 27px 34px; }
  .next-shift-card { min-height: 205px; padding: 26px; }
  .quick-actions { gap: 16px; }
  .quick-action { grid-template-columns: auto 1fr; place-items: center start; padding: 16px 20px; font-size: 14px; }
  .page-header { padding: 34px 34px 20px; }
  .segmented { width: 310px; margin-left: 34px; }
  .roster-rules { margin-left: 34px; margin-right: 34px; }
  .schedule-layout { padding: 0 34px 30px; grid-template-columns: minmax(420px, .95fr) minmax(320px, 1.05fr); align-items: start; }
  .filter-pills, .department-filter { padding-left: 34px; padding-right: 34px; }
  .swap-summary { margin-left: 34px; margin-right: 34px; }
  .swap-list { padding-left: 34px; padding-right: 34px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-date-toolbar, .task-progress-card { margin-left: 34px; margin-right: 34px; }.task-board { padding-left: 34px; padding-right: 34px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-box { margin-left: 34px; margin-right: 34px; }
  .contact-list { padding-left: 34px; padding-right: 34px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .department-label { grid-column: 1 / -1; }
  .bottom-nav { max-width: 560px; bottom: 16px; min-height: 68px; padding: 6px 14px; border: 1px solid rgba(211,219,212,.9); border-radius: 23px; box-shadow: var(--shadow); }
  main { padding-bottom: 110px; }
  .modal-layer { align-items: center; padding: 24px; }
  .bottom-sheet { width: min(620px, calc(100vw - 48px)); max-height: min(86vh, 820px); padding: 24px 26px 26px; border-radius: 28px; animation: modal-pop .24s cubic-bezier(.2,.75,.25,1); box-shadow: 0 24px 80px rgba(8,31,26,.26); }
  .sheet-handle { display: none; }
  @keyframes modal-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
}

@media (min-width: 1040px) {
  .home-hero { padding-left: 72px; padding-right: 72px; }
  .home-content { padding-left: 72px; padding-right: 72px; grid-template-columns: 1.2fr .8fr; align-items: start; }
  .home-content .quick-actions { grid-column: 1 / -1; }
  .page-header { padding-left: 54px; padding-right: 54px; }
  .segmented { margin-left: 54px; }
  .roster-rules { margin-left: 54px; margin-right: 54px; }
  .schedule-layout, .swap-list, .contact-list { padding-left: 54px; padding-right: 54px; }
  .task-board { padding-left: 54px; padding-right: 54px; grid-template-columns: repeat(3, minmax(0, 1fr)); }.task-date-toolbar, .task-progress-card { margin-left: 54px; margin-right: 54px; }
  .filter-pills, .department-filter { padding-left: 54px; padding-right: 54px; }
  .swap-summary, .search-box { margin-left: 54px; margin-right: 54px; }
}

@media (max-width: 365px) {
  .topbar, .home-hero, .content-stack, .page-header, .schedule-layout, .swap-list, .contact-list { padding-left: 15px; padding-right: 15px; }
  .segmented { width: calc(100% - 30px); margin-left: 15px; margin-right: 15px; }
  .roster-rules { margin-left: 15px; margin-right: 15px; grid-template-columns: 1fr; }
  .swap-summary, .search-box { margin-left: 15px; margin-right: 15px; }
  .task-date-toolbar, .task-progress-card { margin-left: 15px; margin-right: 15px; }.task-board { padding-left: 15px; padding-right: 15px; }
  .filter-pills, .department-filter { padding-left: 15px; padding-right: 15px; }
  .quick-action { font-size: 10px; }.next-shift-card { padding: 18px; }.shift-card-button { right: 14px; bottom: 14px; }
  .calendar-card { padding-left: 8px; padding-right: 8px; }.calendar-cell { min-height: 39px; }
}

@media (max-width: 430px) {
  .person-form .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* v15 — mobile readability and touch-target pass */
:root {
  --muted: #596b66;
  --line: #d4ddd6;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .006em;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { letter-spacing: .008em; }
button:focus-visible, [role="button"]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(60,107,97,.28);
  outline-offset: 2px;
}

.field > span { font-size: 12px; line-height: 1.4; }
.field input, .field select, .field textarea { min-height: 50px; font-size: 16px; line-height: 1.45; }
.field textarea { min-height: 104px; }
.form-hint, .password-meter { font-size: 12px; }
.form-actions button { min-height: 50px; font-size: 14px; }
.form-warning b { font-size: 13px; }
.form-warning span { font-size: 11px; }
.selection-count { font-size: 11px; }
.inline-search { height: 49px; }
.inline-search input { font-size: 16px; }
.auth-copy p, .auth-loading p { font-size: 14px; }
.auth-form .field > span { font-size: 13px; }
.auth-message { font-size: 13px; }
.auth-security p { font-size: 12px; }
.auth-brand small, .auth-file-warning code { font-size: 12px; }
.shared-setup-notice b { font-size: 14px; }
.shared-setup-notice span, .shared-setup-choice small { font-size: 12px; }
.shared-setup-choice b { font-size: 15px; }

@media (max-width: 739px) {
  .topbar {
    min-height: 80px;
    height: auto;
    padding-left: 16px;
    padding-right: 16px;
  }
  .brand { gap: 10px; }
  .brand > div:last-child { min-width: max-content; }
  .brand strong, .brand small { white-space: nowrap; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-mark span { font-size: 20px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 11px; }
  .topbar-actions { gap: 7px; }
  .role-button { height: 46px; padding-right: 10px; }
  .role-avatar { width: 35px; height: 35px; font-size: 11px; }
  .role-button small { display: none; }
  .role-button b { font-size: 12px; line-height: 1.25; }
  .icon-button { width: 44px; height: 44px; }

  main { min-height: calc(100vh - 80px); padding-bottom: calc(103px + var(--safe-bottom)); }
  .home-hero { padding: 25px 18px 0; }
  .content-stack { padding: 24px 18px; gap: 32px; }
  .date-line { font-size: 13px; }
  .eyebrow { font-size: 15px; }
  h1 { font-size: clamp(34px, 9.6vw, 40px); }
  h2 { font-size: 23px; }
  h3 { font-size: 18px; }
  .weather-pill { font-size: 14px; }
  .next-shift-card { min-height: 195px; padding: 23px; }
  .shift-card-label { font-size: 12px; }
  .live-chip { font-size: 11px; }
  .next-shift-card h2 { font-size: 30px; }
  .shift-time { font-size: 16px; }
  .shift-meta-row span { font-size: 13px; }
  .shift-card-button { width: 46px; height: 46px; }

  .quick-actions { gap: 9px; }
  .quick-action { min-height: 98px; padding: 14px 5px; font-size: 14px; line-height: 1.35; }
  .quick-icon { width: 46px; height: 46px; }
  .section-kicker { font-size: 11px; }
  .text-button { min-height: 44px; font-size: 14px; }
  .week-day { min-height: 66px; }
  .week-day small { font-size: 12px; }
  .week-day strong { font-size: 16px; }

  .shift-list { gap: 12px; }
  .shift-item { min-height: 96px; padding: 17px 15px; gap: 12px; }
  .shift-item-main strong { font-size: 17px; line-height: 1.4; }
  .shift-item-main p { font-size: 13px; line-height: 1.5; }
  .mini-avatar { width: 29px; height: 29px; font-size: 11px; }
  .shift-people span:last-child:not(.mini-avatar) { font-size: 12px; line-height: 1.4; }
  .shift-follower { font-size: 12px; }
  .shift-follower b { font-size: 11px; }
  .shift-item-action { width: 44px; height: 44px; }
  .notice-card p:last-child { font-size: 13px; }

  .page-header { padding: 29px 18px 20px; }
  .page-header h1 { font-size: 37px; }
  .page-subtitle { font-size: 14px; line-height: 1.55; }
  .secondary-button, .primary-button { min-height: 46px; padding: 0 15px; font-size: 14px; }
  .round-add { width: 48px; height: 48px; }
  .segmented { width: calc(100% - 36px); margin: 0 18px 18px; }
  .segmented button { height: 42px; font-size: 14px; }

  .roster-rules {
    margin: 0 18px 19px;
    padding: 12px 14px;
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .roster-rules > div { min-height: 42px; }
  .roster-rules b, .roster-rules small { white-space: normal; overflow: visible; text-overflow: clip; }
  .roster-rules b { font-size: 13px; }
  .roster-rules small { font-size: 11px; line-height: 1.45; }
  .rule-dot { height: 34px; }

  .schedule-layout { padding: 0 18px 32px; gap: 28px; }
  .calendar-card { padding: 17px 12px 15px; }
  .calendar-toolbar { margin-bottom: 9px; }
  .calendar-toolbar .icon-button.small { width: 42px; height: 42px; }
  .month-label span { font-size: 20px; }
  .month-label small { font-size: 11px; }
  .calendar-weekdays { font-size: 12px; }
  .calendar-cell { min-height: 45px; gap: 5px; }
  .calendar-cell span { font-size: 14px; }
  .calendar-cell.holiday { min-height: 51px; gap: 3px; }
  .calendar-holiday { font-size: 9px; }
  .calendar-dots { gap: 3px; }
  .calendar-dots i { width: 5px; height: 5px; }
  .capacity-ring small { font-size: 11px; }

  .task-date-toolbar { margin: 0 18px 16px; padding: 10px 12px; }
  .task-date-toolbar .icon-button.small { width: 42px; height: 42px; }
  .task-date-label small { font-size: 11px; }
  .task-date-label strong { font-size: 17px; }
  .task-progress-card { margin: 0 18px 18px; padding: 18px; }
  .task-progress-card > div:first-child { font-size: 13px; }
  .task-progress-card strong { font-size: 15px; }
  .task-progress-card p { font-size: 11px; }
  .task-board { padding: 0 18px 32px; gap: 11px; }
  .task-slot { min-height: 104px; padding: 15px 13px; gap: 11px; }
  .task-number { width: 42px; height: 54px; font-size: 16px; }
  .task-slot-main strong {
    font-size: 15px;
    line-height: 1.45;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .task-slot-main p { font-size: 11px; line-height: 1.45; white-space: normal; }
  .task-slot-main small { font-size: 11px; line-height: 1.45; }
  .task-slot-assignee .avatar { width: 41px; height: 41px; font-size: 11px; }
  .task-slot-assignee small { max-width: 62px; font-size: 11px; }
  .task-slot-empty { font-size: 12px; }

  .swap-summary { margin: 0 18px 20px; padding: 20px 6px; }
  .swap-summary strong { font-size: 27px; }
  .swap-summary span { font-size: 12px; }
  .filter-pills, .department-filter { padding: 0 18px 16px; gap: 8px; }
  .filter-pills button, .department-filter button { min-height: 42px; padding: 9px 15px; font-size: 13px; }
  .swap-list { padding: 0 18px 30px; gap: 14px; }
  .swap-card { padding: 18px 16px; }
  .avatar { width: 46px; height: 46px; font-size: 14px; }
  .swap-owner strong { font-size: 16px; }
  .swap-owner p { font-size: 12px; }
  .status-chip { font-size: 11px; }
  .swap-detail small { font-size: 11px; }
  .swap-detail strong { font-size: 14px; }
  .swap-reason { font-size: 13px; }
  .swap-actions button { min-height: 46px; font-size: 13px; }

  .search-box { margin: 0 18px 16px; height: 54px; }
  .search-box input { font-size: 16px; }
  .contact-list { padding: 0 18px 32px; gap: 11px; }
  .department-label { font-size: 12px; }
  .contact-card { min-height: 82px; padding: 15px 13px; }
  .contact-name-row strong { font-size: 16px; }
  .contact-main p { font-size: 12px; }
  .company-phone { font-size: 14px; }
  .contact-actions button, .contact-actions a { width: 42px; height: 42px; }

  .bottom-nav { min-height: calc(80px + var(--safe-bottom)); padding: 7px 8px var(--safe-bottom); }
  .bottom-nav button { min-height: 58px; gap: 4px; font-size: 11px; }
  .bottom-nav button > svg, .swap-nav-icon svg { width: 23px; height: 23px; }
  .swap-nav-icon { width: 45px; height: 35px; }
  .bottom-nav i { min-width: 18px; height: 18px; font-size: 11px; }

  .bottom-sheet { padding-left: 18px; padding-right: 18px; }
  .sheet-header h2 { font-size: 25px; }
  .detail-hero strong { font-size: 19px; }
  .detail-hero p { font-size: 13px; }
  .detail-hero small { font-size: 11px; }
  .locked-shift-summary small { font-size: 11px; }
  .locked-shift-summary strong { font-size: 15px; }
  .locked-shift-summary p { font-size: 12px; }
  .profile-preview p { font-size: 13px; }
  .assignee-picker { max-height: 350px; }
  .assignee-option { min-height: 57px; padding: 10px; }
  .assignee-option .avatar { width: 40px; height: 40px; font-size: 11px; }
  .assignee-option b { font-size: 14px; }
  .assignee-option small { font-size: 11px; }
  .assignee-option i { width: 28px; height: 28px; }
  .shift-change-summary strong { font-size: 12px; }
  .shift-change-summary small { font-size: 11px; }

  .account-summary strong { font-size: 16px; }
  .account-summary span { font-size: 12px; }
  .account-summary small { font-size: 11px; }
  .account-actions button { min-height: 51px; font-size: 14px; }
  .user-admin-toolbar p { font-size: 12px; }
  .user-account-card { min-height: 74px; }
  .user-account-card strong { font-size: 14px; }
  .user-account-card span { font-size: 11px; }
  .user-account-card small { font-size: 11px; }
  .user-account-card button { width: 42px; height: 42px; }
  .account-state { font-size: 11px !important; }
  .danger-zone button { min-height: 50px; font-size: 13px; }
  .role-choice b { font-size: 15px; }
  .role-choice small { font-size: 11px; }
  .approval-flow span { width: 34px; height: 34px; font-size: 11px; }
  .follower-heading span { font-size: 11px; }
  .follow-duty-card .contact-main strong i { font-size: 11px; }
  .follower-empty { font-size: 12px; }
  .history-summary p { font-size: 12px; }
  .history-entry > span { width: 30px; height: 30px; font-size: 11px; }
  .history-entry strong { font-size: 14px; }
  .history-entry p { font-size: 11px; }
  .notification-list strong { font-size: 14px; }
  .notification-list p { font-size: 11px; }
  .toast { min-height: 50px; font-size: 14px; }
  .empty-state p { font-size: 13px; }
}

@media (max-width: 365px) {
  body { min-width: 0; }
  .brand small, .role-button small { display: none; }
  .role-button { padding-right: 9px; }
  .role-button b { font-size: 12px; }
  .quick-action { font-size: 13px; }
  .page-header h1 { font-size: 34px; }
  .task-slot { grid-template-columns: 40px minmax(0, 1fr) auto; padding-left: 10px; padding-right: 10px; }
}
