:root {
  --bg: #f2f5f3;
  --surface: #ffffff;
  --surface-muted: #f7f9f8;
  --ink: #17241f;
  --muted: #68756f;
  --faint: #8d9994;
  --line: #dfe6e2;
  --primary: #176b55;
  --primary-dark: #10513f;
  --primary-soft: #e2f0eb;
  --navy: #31465b;
  --navy-soft: #e8eef3;
  --amber: #b96d13;
  --amber-soft: #fff1dc;
  --red: #b94d45;
  --red-soft: #fce9e7;
  --blue: #3974a8;
  --blue-soft: #e7f0f8;
  --shadow: 0 10px 30px rgba(20, 43, 34, .09);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: #e7ece9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, a { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(23, 107, 85, .35);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 36px rgba(21, 38, 31, .12);
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 480px);
  height: calc(64px + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  transform: translateX(-50%);
  border-bottom: 1px solid rgba(223, 230, 226, .85);
  background: rgba(247, 249, 248, .96);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--primary);
}
.brand-mark svg { width: 19px; height: 19px; stroke-width: 2; }
.brand-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.15; }
.brand-copy b { font-size: 15px; font-weight: 720; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.role-switch {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}
.role-switch svg:first-child { width: 14px; height: 14px; color: var(--primary); }
.role-switch svg:last-child { width: 12px; height: 12px; color: var(--muted); }
.icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.icon-button:active { background: var(--primary-soft); }
.icon-button svg { width: 20px; height: 20px; stroke-width: 1.9; }
.notification-dot {
  position: absolute;
  top: 8px;
  right: 7px;
  display: none;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface-muted);
  border-radius: 50%;
  background: var(--red);
}
.notification-dot.visible { display: block; }

.page {
  min-height: 100dvh;
  padding: calc(64px + var(--safe-top)) 0 calc(76px + var(--safe-bottom));
}
.page-inner { padding: 0 16px 24px; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px 16px 13px;
}
.page-heading h1 { margin: 0; font-size: 24px; line-height: 1.22; font-weight: 760; }
.page-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.page-heading .heading-action { margin-bottom: 1px; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 720;
}

.text-button, .outline-button, .solid-button, .soft-button, .danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 7px;
  font-weight: 680;
}
.text-button { min-height: 34px; padding: 0 7px; border: 0; color: var(--primary); background: transparent; }
.outline-button { border: 1px solid var(--line); background: var(--surface); }
.solid-button { border: 1px solid var(--primary); color: white; background: var(--primary); }
.soft-button { border: 1px solid transparent; color: var(--primary-dark); background: var(--primary-soft); }
.danger-button { border: 1px solid transparent; color: var(--red); background: var(--red-soft); }
.text-button svg, .outline-button svg, .solid-button svg, .soft-button svg, .danger-button svg { width: 17px; height: 17px; }
.button-block { width: 100%; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eeeb;
}
.segmented button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}
.segmented button.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px rgba(25, 42, 35, .08); }
.view-switch { margin: 4px 16px 12px; }

.summary-band {
  padding: 20px 16px 17px;
  border-bottom: 1px solid #1f3f35;
  color: white;
  background: #214d40;
}
.summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.summary-top h1 { margin: 0; font-size: 25px; line-height: 1.2; font-weight: 760; }
.summary-top p { margin: 5px 0 0; color: rgba(255,255,255,.72); font-size: 12px; }
.summary-sync {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: #cbe7dc;
  font-size: 11px;
  white-space: nowrap;
}
.summary-sync svg { width: 12px; height: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
.summary-stat { padding-right: 10px; border-right: 1px solid rgba(255,255,255,.15); }
.summary-stat + .summary-stat { padding-left: 13px; }
.summary-stat:last-child { border: 0; }
.summary-stat b { display: block; font-size: 19px; line-height: 1.15; }
.summary-stat span { display: block; margin-top: 4px; color: rgba(255,255,255,.68); font-size: 10px; }
.progress-row { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.progress-track { height: 5px; flex: 1; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.14); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: #71bba0; }
.progress-row small { color: rgba(255,255,255,.72); font-size: 10px; }

.date-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.date-button {
  display: flex;
  height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}
.date-button small { font-size: 10px; }
.date-button b { margin-top: 5px; font-size: 15px; }
.date-button.active { color: white; background: var(--primary); }
.date-button.today:not(.active) b { color: var(--primary); }

.change-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 13px 16px 4px;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  border-radius: 5px;
  color: #70440e;
  background: var(--amber-soft);
}
.change-banner > svg { width: 18px; height: 18px; flex: 0 0 auto; }
.change-banner div { min-width: 0; flex: 1; }
.change-banner b { display: block; font-size: 12px; }
.change-banner span { display: block; overflow: hidden; margin-top: 1px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.change-banner button { width: 30px; height: 30px; }

.toolbar-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.toolbar-row h2 { margin: 0; font-size: 15px; font-weight: 730; }
.toolbar-row small { color: var(--muted); }
.toolbar-actions { display: flex; align-items: center; gap: 4px; }
.compact-button { min-height: 34px; padding: 0 10px; font-size: 11px; }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  height: 31px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
}
.chip.active { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); font-weight: 680; }
.chip svg { width: 13px; height: 13px; }

.timeline { padding: 0 16px 16px; }
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 47px 14px minmax(0, 1fr);
  gap: 8px;
  min-height: 103px;
}
.timeline-time { padding-top: 15px; color: var(--ink); font-size: 13px; font-weight: 700; }
.timeline-time small { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; font-weight: 500; }
.timeline-axis { position: relative; }
.timeline-axis::before { content: ""; position: absolute; top: 25px; bottom: -15px; left: 6px; width: 1px; background: var(--line); }
.timeline-item:last-child .timeline-axis::before { display: none; }
.timeline-dot { position: absolute; z-index: 1; top: 20px; left: 2px; width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 1px var(--faint); }
.timeline-dot.in-progress { background: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px var(--primary-soft); }
.timeline-dot.done { background: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.task-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.task-type-icon, .doc-icon, .event-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--primary);
  background: var(--primary-soft);
}
.task-type-icon.meeting, .event-icon.meeting { color: var(--blue); background: var(--blue-soft); }
.task-type-icon.meal, .event-icon.meal { color: var(--amber); background: var(--amber-soft); }
.task-type-icon.transport, .event-icon.transport { color: var(--navy); background: var(--navy-soft); }
.task-type-icon.hotel, .event-icon.hotel { color: #8a526f; background: #f5e8ef; }
.task-type-icon svg, .doc-icon svg, .event-icon svg { width: 18px; height: 18px; stroke-width: 1.9; }
.task-copy { min-width: 0; flex: 1; }
.task-copy h3 { overflow: hidden; margin: 0; font-size: 14px; line-height: 1.35; font-weight: 710; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; min-width: 0; align-items: center; gap: 5px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.task-meta svg { width: 12px; height: 12px; flex: 0 0 auto; }
.task-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.group-label { color: var(--muted); font-size: 10px; }
.task-row > .chevron { width: 16px; height: 16px; margin-top: 11px; flex: 0 0 auto; color: var(--faint); }

.status {
  display: inline-flex;
  height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.status.pending { color: var(--amber); background: var(--amber-soft); }
.status.in-progress { color: var(--primary); background: var(--primary-soft); }
.status.done { color: var(--navy); background: var(--navy-soft); }
.status.archived { color: var(--muted); background: #ecefed; }

.avatar-stack { display: flex; align-items: center; margin-left: auto; }
.avatar-stack img, .mini-avatar {
  width: 25px;
  height: 25px;
  object-fit: cover;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--line);
}
.avatar-stack img + img { margin-left: -7px; }

.empty-state { padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-state .empty-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 12px; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); }
.empty-state h3 { margin: 0; color: var(--ink); font-size: 15px; }
.empty-state p { margin: 5px auto 0; max-width: 230px; font-size: 12px; }

.fab {
  position: fixed;
  z-index: 25;
  right: max(18px, calc((100vw - 480px) / 2 + 18px));
  bottom: calc(72px + var(--safe-bottom));
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--primary);
  box-shadow: 0 8px 22px rgba(16, 81, 63, .3);
}
.fab svg { width: 23px; height: 23px; }

.bottom-nav {
  position: fixed;
  z-index: 28;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, 480px);
  height: calc(62px + var(--safe-bottom));
  padding: 5px 8px var(--safe-bottom);
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(16px);
}
.bottom-nav.staff { grid-template-columns: repeat(4, 1fr); }
.bottom-nav.leader { grid-template-columns: repeat(4, 1fr); }
.nav-button {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: 0;
  color: var(--faint);
  background: transparent;
  font-size: 9px;
}
.nav-button svg { width: 20px; height: 20px; stroke-width: 1.8; }
.nav-button.active { color: var(--primary); font-weight: 700; }
.nav-button.active::before { content: ""; position: absolute; top: -5px; width: 22px; height: 2px; border-radius: 1px; background: var(--primary); }
.nav-badge { position: absolute; top: 1px; left: calc(50% + 8px); min-width: 14px; height: 14px; padding: 0 3px; border: 2px solid white; border-radius: 7px; color: white; background: var(--red); font-size: 8px; line-height: 10px; }

/* Month view */
.month-panel { padding: 8px 16px 0; }
.month-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.month-head h2 { margin: 0; font-size: 15px; }
.month-head .month-actions { display: flex; }
.month-head .icon-button { width: 34px; height: 34px; }
.month-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-weekdays span { padding: 7px 0; color: var(--faint); font-size: 9px; text-align: center; }
.calendar-day {
  position: relative;
  display: flex;
  height: 47px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}
.calendar-day.outside { color: #bac2be; }
.calendar-day.selected { color: white; background: var(--primary); font-weight: 700; }
.calendar-day.today:not(.selected) { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.day-dots { position: absolute; bottom: 5px; display: flex; gap: 2px; }
.day-dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--amber); }
.calendar-day.selected .day-dots i { background: rgba(255,255,255,.75); }

/* Leader dashboard */
.leader-intro { padding: 20px 16px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.leader-intro-top { display: flex; align-items: flex-start; justify-content: space-between; }
.leader-intro h1 { margin: 0; font-size: 23px; line-height: 1.2; }
.leader-intro p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.month-selector { display: inline-flex; height: 32px; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); font-size: 11px; font-weight: 650; }
.month-selector svg { width: 13px; height: 13px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 17px; }
.metric-card { min-height: 86px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); }
.metric-card-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.metric-card-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.metric-card.pending .metric-card-head i { background: var(--amber); }
.metric-card.done .metric-card-head i { background: var(--navy); }
.metric-card.total .metric-card-head i { background: var(--blue); }
.metric-card b { display: block; margin-top: 8px; font-size: 24px; line-height: 1; }
.metric-card small { color: var(--faint); font-size: 9px; }
.dashboard-section { padding: 18px 16px 2px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-heading h2 { margin: 0; font-size: 15px; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.section-heading > span { color: var(--muted); font-size: 10px; }
.stack-bar { display: flex; height: 9px; overflow: hidden; border-radius: 5px; background: var(--line); }
.stack-bar span { display: block; height: 100%; }
.stack-bar .done { background: var(--navy); }
.stack-bar .progress { background: var(--primary); }
.stack-bar .pending { background: var(--amber); }
.legend { display: flex; gap: 14px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--navy); }
.legend .progress i { background: var(--primary); }
.legend .pending i { background: var(--amber); }
.trend-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; height: 116px; align-items: end; padding-top: 9px; border-bottom: 1px solid var(--line); }
.trend-col { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.trend-col b { font-size: 9px; }
.trend-col i { width: 18px; min-height: 4px; border-radius: 3px 3px 0 0; background: var(--primary); }
.trend-col span { margin-bottom: -20px; color: var(--muted); font-size: 9px; }

/* Search, documents, people */
.search-box { position: relative; margin: 4px 16px 12px; }
.search-box svg { position: absolute; top: 12px; left: 12px; width: 17px; height: 17px; color: var(--faint); }
.search-box input { width: 100%; height: 42px; padding: 0 38px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); }
.search-box input::placeholder { color: var(--faint); }
.search-clear { position: absolute; top: 5px; right: 5px; display: none; }
.search-clear.visible { display: grid; }
.content-list { margin: 0 16px; border-top: 1px solid var(--line); }
.list-row { display: flex; width: 100%; min-height: 70px; align-items: center; gap: 11px; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.list-row-copy { min-width: 0; flex: 1; }
.list-row-copy h3 { overflow: hidden; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.list-row-copy p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.list-row > svg { width: 16px; height: 16px; color: var(--faint); }
.doc-icon.pdf { color: var(--red); background: var(--red-soft); }
.doc-icon.doc { color: var(--blue); background: var(--blue-soft); }
.doc-icon.ppt { color: var(--amber); background: var(--amber-soft); }
.guest-avatar { width: 43px; height: 43px; flex: 0 0 auto; object-fit: cover; border-radius: 50%; background: var(--line); }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tiny-tag { display: inline-flex; height: 20px; align-items: center; padding: 0 6px; border-radius: 3px; color: var(--muted); background: #e9eeeb; font-size: 9px; }

/* Profile */
.profile-hero { display: flex; align-items: center; gap: 13px; padding: 24px 16px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.profile-avatar { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-size: 17px; font-weight: 720; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy h1 { margin: 0; font-size: 18px; }
.profile-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.profile-role { display: inline-flex; height: 23px; align-items: center; padding: 0 8px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 700; }
.settings-section { margin-top: 13px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settings-title { padding: 13px 16px 7px; color: var(--muted); font-size: 10px; font-weight: 650; }
.setting-row { display: flex; width: calc(100% - 32px); min-height: 52px; align-items: center; gap: 11px; margin: 0 16px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.setting-row:last-child { border-bottom: 0; }
.setting-row > svg:first-child { width: 18px; height: 18px; color: var(--primary); }
.setting-row span { min-width: 0; flex: 1; }
.setting-row small { color: var(--muted); }
.setting-row > svg:last-child { width: 16px; height: 16px; color: var(--faint); }
.toggle { position: relative; width: 42px; height: 24px; flex: 0 0 auto; border: 0; border-radius: 12px; background: #cbd3cf; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s ease; }
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(18px); }

/* Overlays and detail */
.overlay-root { position: relative; z-index: 100; }
.overlay-backdrop { position: fixed; z-index: 100; inset: 0; background: rgba(14, 28, 22, .42); animation: fade-in .18s ease; }
.sheet {
  position: fixed;
  z-index: 101;
  right: 50%;
  bottom: 0;
  width: min(100%, 480px);
  max-height: 88dvh;
  overflow: auto;
  transform: translateX(50%);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: sheet-up .22s ease;
  padding-bottom: var(--safe-bottom);
}
.sheet-handle { width: 36px; height: 4px; margin: 9px auto 3px; border-radius: 2px; background: #d6dcda; }
.sheet-header { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { margin: 0; font-size: 16px; }
.sheet-header p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.sheet-header .icon-button { flex: 0 0 auto; }
.sheet-body { padding: 14px 16px 18px; }
.fullscreen-panel {
  position: fixed;
  z-index: 101;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, 480px);
  overflow-y: auto;
  transform: translateX(-50%);
  background: var(--bg);
  animation: panel-in .22s ease;
}
.panel-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  min-height: calc(58px + var(--safe-top));
  align-items: center;
  padding: var(--safe-top) 8px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
}
.panel-header-title { min-width: 0; text-align: center; }
.panel-header-title h2 { overflow: hidden; margin: 0; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.panel-header-title p { margin: 1px 0 0; color: var(--muted); font-size: 9px; }
.panel-header .icon-button { width: 40px; height: 40px; }
.panel-content { padding-bottom: calc(82px + var(--safe-bottom)); }
.detail-hero { padding: 18px 16px 17px; border-bottom: 1px solid var(--line); background: var(--surface); }
.detail-hero .status { margin-bottom: 9px; }
.detail-hero h1 { margin: 0; font-size: 21px; line-height: 1.35; }
.detail-hero > p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.detail-fact { display: flex; min-width: 0; align-items: center; gap: 8px; }
.detail-fact > i { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 6px; color: var(--primary); background: var(--primary-soft); }
.detail-fact svg { width: 15px; height: 15px; }
.detail-fact span { min-width: 0; }
.detail-fact small { display: block; color: var(--muted); font-size: 9px; }
.detail-fact b { display: block; overflow: hidden; margin-top: 1px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.detail-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.detail-action { display: flex; height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 7px; color: var(--primary); background: var(--surface-muted); font-size: 9px; }
.detail-action svg { width: 18px; height: 18px; }
.detail-section { margin-top: 10px; padding: 15px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.detail-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.detail-section-title h3 { margin: 0; font-size: 14px; }
.detail-section-title span { color: var(--muted); font-size: 9px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; }
.info-item small { display: block; color: var(--muted); font-size: 9px; }
.info-item b { display: block; margin-top: 3px; font-size: 11px; font-weight: 620; }
.route-list { margin: 0; padding: 0; list-style: none; }
.route-item { position: relative; display: grid; grid-template-columns: 36px minmax(0,1fr) 34px; gap: 10px; min-height: 76px; }
.route-item::before { content: ""; position: absolute; top: 37px; bottom: -3px; left: 17px; width: 1px; background: var(--line); }
.route-item:last-child::before { display: none; }
.event-icon { position: relative; z-index: 1; }
.route-copy { min-width: 0; padding-bottom: 14px; }
.route-copy h4 { margin: 0; font-size: 12px; }
.route-copy p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.route-copy small { display: block; margin-top: 4px; color: var(--faint); font-size: 9px; }
.route-edit { width: 34px; height: 34px; }
.route-edit.done { color: white; background: var(--primary); }
.notice-box { display: flex; gap: 10px; padding: 11px; border-left: 3px solid var(--red); border-radius: 5px; color: #71332e; background: var(--red-soft); font-size: 10px; }
.notice-box svg { width: 17px; height: 17px; flex: 0 0 auto; }
.guest-strip { display: flex; gap: 9px; overflow-x: auto; scrollbar-width: none; }
.guest-chip { display: flex; min-width: 150px; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); }
.guest-chip img { width: 37px; height: 37px; object-fit: cover; border-radius: 50%; }
.guest-chip b { display: block; font-size: 11px; }
.guest-chip small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.log-list { margin: 0; padding: 0; list-style: none; }
.log-list li { position: relative; padding: 0 0 13px 18px; color: var(--muted); font-size: 10px; }
.log-list li::before { content: ""; position: absolute; top: 5px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.log-list li::after { content: ""; position: absolute; top: 14px; bottom: 2px; left: 4px; width: 1px; background: var(--line); }
.log-list li:last-child::after { display: none; }
.log-list b { color: var(--ink); font-weight: 650; }
.log-list time { display: block; margin-top: 2px; color: var(--faint); font-size: 8px; }
.bottom-action-bar { position: sticky; z-index: 4; bottom: 0; display: grid; grid-template-columns: 48px 1fr; gap: 9px; padding: 9px 16px calc(9px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); }

/* Forms */
.form-stepper { display: grid; grid-template-columns: repeat(3, 1fr); padding: 13px 16px 11px; border-bottom: 1px solid var(--line); background: var(--surface); }
.form-step { position: relative; color: var(--faint); font-size: 9px; text-align: center; }
.form-step::before { content: ""; position: absolute; top: 7px; right: 50%; left: -50%; height: 1px; background: var(--line); }
.form-step:first-child::before { display: none; }
.form-step i { position: relative; z-index: 1; display: grid; width: 16px; height: 16px; margin: 0 auto 4px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 8px; font-style: normal; }
.form-step.active { color: var(--primary); font-weight: 700; }
.form-step.active i { border-color: var(--primary); color: white; background: var(--primary); }
.form-step.complete::before, .form-step.active::before { background: var(--primary); }
.form-step.complete i { border-color: var(--primary); color: var(--primary); }
.form-panel { display: none; padding: 16px; }
.form-panel.active { display: block; }
.form-section-title { margin: 2px 0 13px; font-size: 13px; }
.field { display: block; margin-bottom: 13px; }
.field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 620; }
.field em { color: var(--red); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}
.field textarea { min-height: 78px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #a8b1ad; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.node-form-block { margin-bottom: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.node-form-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.node-form-head .event-icon { width: 30px; height: 30px; }
.node-form-head .event-icon svg { width: 15px; height: 15px; }
.node-form-head b { font-size: 11px; }
.form-footer { position: sticky; z-index: 4; bottom: 0; display: grid; grid-template-columns: 1fr 1.7fr; gap: 9px; padding: 10px 16px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); }
.destructive-row { display: flex; gap: 9px; margin: 8px 16px 18px; }
.destructive-row button { flex: 1; }

/* Notifications and role */
.role-option { display: flex; width: 100%; align-items: center; gap: 12px; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.role-option:last-child { border-bottom: 0; }
.role-option .role-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--primary); background: var(--primary-soft); }
.role-option.leader .role-icon { color: var(--navy); background: var(--navy-soft); }
.role-option .role-icon svg { width: 20px; height: 20px; }
.role-option > span:nth-child(2) { min-width: 0; flex: 1; }
.role-option b { display: block; font-size: 13px; }
.role-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.role-option > svg { width: 18px; height: 18px; color: var(--primary); opacity: 0; }
.role-option.selected > svg { opacity: 1; }
.demo-hint { margin-top: 12px; padding: 9px 10px; border-radius: 5px; color: var(--muted); background: var(--surface-muted); font-size: 9px; }
.notification-list { margin: 0; padding: 0; list-style: none; }
.notification-item { position: relative; display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notification-item.unread::before { content: ""; position: absolute; top: 19px; left: -8px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.notification-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); }
.notification-icon.change { color: var(--amber); background: var(--amber-soft); }
.notification-icon.reminder { color: var(--blue); background: var(--blue-soft); }
.notification-icon svg { width: 16px; height: 16px; }
.notification-copy { min-width: 0; flex: 1; }
.notification-copy b { font-size: 11px; }
.notification-copy p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.notification-copy time { display: block; margin-top: 4px; color: var(--faint); font-size: 8px; }

/* Guest and document preview */
.guest-profile-head { display: flex; gap: 13px; align-items: center; padding: 5px 0 15px; border-bottom: 1px solid var(--line); }
.guest-profile-head img { width: 62px; height: 62px; object-fit: cover; border-radius: 50%; }
.guest-profile-head h3 { margin: 0; font-size: 16px; }
.guest-profile-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.profile-block { padding: 13px 0; border-bottom: 1px solid var(--line); }
.profile-block:last-child { border-bottom: 0; }
.profile-block h4 { margin: 0 0 7px; font-size: 11px; }
.profile-block p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.file-preview { min-height: 260px; padding: 22px 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }
.file-preview h3 { margin: 0 0 13px; font-size: 16px; }
.file-preview p { margin: 0 0 10px; color: var(--muted); font-size: 10px; }
.file-preview ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 10px; }
.file-preview li { margin-bottom: 7px; }

.confirm-box { padding: 4px 0 7px; }
.confirm-box p { margin: 0 0 17px; color: var(--muted); font-size: 11px; }

/* Role entry */
.role-gate { background: #f2f5f3; }
.role-gate-inner {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  padding: calc(34px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}
.gate-brand { display: flex; align-items: center; gap: 10px; }
.gate-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.gate-brand b { font-size: 16px; }
.gate-brand small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.gate-heading { margin-top: clamp(68px, 13vh, 108px); }
.gate-mode { display: inline-flex; height: 23px; align-items: center; padding: 0 8px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 700; }
.gate-heading h1 { margin: 12px 0 0; font-size: 24px; line-height: 1.25; }
.gate-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.gate-options { display: grid; gap: 10px; margin-top: 26px; }
.gate-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 18px;
  min-height: 78px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid #cfdcd6;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(20, 43, 34, .05);
  text-align: left;
}
.gate-option:active { border-color: var(--primary); background: #f8fbfa; }
.gate-option-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 8px; color: white; background: var(--primary); }
.gate-option.leader .gate-option-icon { background: var(--navy); }
.gate-option-icon svg { width: 21px; height: 21px; }
.gate-option-copy { min-width: 0; }
.gate-option-copy b { display: block; font-size: 14px; }
.gate-option-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.gate-permission { display: inline-flex; height: 22px; align-items: center; padding: 0 7px; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-size: 8px; font-weight: 700; white-space: nowrap; }
.gate-option.leader .gate-permission { color: var(--navy); background: var(--navy-soft); }
.gate-option > svg { width: 17px; height: 17px; color: var(--faint); }
.gate-footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: auto; color: var(--faint); font-size: 9px; }
.gate-footer svg { width: 14px; height: 14px; }

.toast-region { position: fixed; z-index: 200; right: 50%; bottom: calc(78px + var(--safe-bottom)); display: flex; width: min(calc(100% - 32px), 448px); transform: translateX(50%); flex-direction: column; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 7px; max-width: 92%; padding: 9px 13px; border-radius: 6px; color: white; background: rgba(22, 36, 31, .94); box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease; }
.toast svg { width: 15px; height: 15px; color: #8ad1b6; }

@keyframes sheet-up { from { transform: translate(50%, 18px); opacity: 0; } }
@keyframes panel-in { from { transform: translate(-47%); opacity: .4; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 355px) {
  .summary-stat + .summary-stat { padding-left: 9px; }
  .summary-stat b { font-size: 17px; }
  .metric-grid { gap: 7px; }
  .task-type-icon { width: 32px; height: 32px; }
  .timeline { padding-right: 12px; padding-left: 12px; }
  .timeline-item { grid-template-columns: 43px 12px minmax(0, 1fr); gap: 6px; }
  .date-strip { padding-right: 4px; padding-left: 4px; }
  .role-switch span { display: none; }
}

@media (min-width: 700px) {
  body::before {
    content: "移动端预览";
    position: fixed;
    top: 20px;
    left: 20px;
    color: #6f7b76;
    font-size: 11px;
  }
}

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