:root {
  --navy: #294c54;
  --navy-2: #35636b;
  --blue: #478886;
  --blue-soft: #e8f3f1;
  --mint: #e2f2e8;
  --green: #2f735b;
  --coral: #e97858;
  --coral-soft: #fff0ec;
  --amber: #f2ad49;
  --ink: #263d41;
  --muted: #718184;
  --line: #dde5e2;
  --surface: #ffffff;
  --canvas: #f8f6f1;
  --danger: #c7463d;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(21, 58, 91, 0.09);
}

* { box-sizing: border-box; }

html { background: #e9e7e1; }

body {
  margin: 0;
  color: var(--ink);
  background: #e9e7e1;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  background: var(--canvas);
  box-shadow: 0 0 50px rgba(21, 58, 91, 0.12);
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 20px;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
  font-size: 13px;
}
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .04em; }
.brand-sub { margin-top: 1px; color: var(--muted); font-size: 10px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: var(--navy);
  background: #f0f3f1;
  cursor: pointer;
}
.icon-link { text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.save-status { padding: 5px 7px; border-radius: 8px; font-size: 9px; font-weight: 900; }
.save-status.saved { color: var(--green); background: var(--mint); }
.save-status.saving { color: #795119; background: #fff7e8; }
.save-status.error { color: var(--danger); background: var(--coral-soft); }

.content { padding: 20px 16px 28px; }
.content.with-workflow { padding-top: 14px; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 27px; line-height: 1.35; letter-spacing: -.02em; }
.home-copy { font-size: 18px; line-height: 1.5; }
h2 { margin-bottom: 12px; font-size: 18px; }
h3 { margin-bottom: 4px; font-size: 15px; }
.lead { margin-bottom: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.field-note { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 24px;
  color: var(--ink);
  background: linear-gradient(140deg, #dff0ea, #e8f2ed 65%, #f6eee1);
  box-shadow: var(--shadow);
}
.hero.complete { background: linear-gradient(140deg, #dff2e6, #edf7ef 70%, #f6f0e5); }
.hero.incomplete { background: linear-gradient(140deg, #fff0d7, #fff7e8 70%, #f8eee3); }
.hero::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -58px;
  width: 170px;
  height: 170px;
  border: 26px solid rgba(255,255,255,.38);
  border-radius: 50%;
}
.hero-date { color: var(--green); font-size: 13px; font-weight: 800; }
.hero-status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.event-status { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 6px 9px; border-radius: 10px; font-size: 10px; font-weight: 900; }
.event-status.complete { color: var(--green); background: #fff; }
.event-status.incomplete { color: #9a5d12; background: #fff; }
.event-status.draft { color: var(--blue); background: #fff; }
.event-status.compact { padding: 4px 7px; }
.event-title-line { display: flex; align-items: center; gap: 7px; }
.event-title-line h1 { min-width: 0; margin: 0; }
.hero h2 { margin: 8px 0 6px; font-size: 23px; }
.hero-place { margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-cell {
  padding: 10px 8px;
  border-radius: 13px;
  background: rgba(255,255,255,.68);
  text-align: center;
}
.status-cell strong { display: block; font-size: 20px; }
.status-cell span { color: var(--muted); font-size: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { color: #fff; background: var(--coral); box-shadow: 0 8px 18px rgba(239,118,93,.22); }
.btn-secondary { color: var(--navy); background: var(--blue-soft); }
.btn-outline { border: 1px solid var(--line); background: #fff; }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 12px; }
.hero .btn { position: relative; z-index: 1; margin-top: 18px; color: #fff; background: var(--navy); }
.hero-actions { position: relative; z-index: 1; }
.hero-edit-btn { display: block; width: 100%; margin-top: 8px; padding: 8px; border: 0; color: var(--navy); background: transparent; font-size: 12px; font-weight: 900; cursor: pointer; }
.issue-list { display: grid; gap: 6px; margin-top: 14px; padding: 11px; border-radius: 13px; background: rgba(255,255,255,.62); }
.issue-list div { display: flex; align-items: center; gap: 7px; color: #82561e; font-size: 11px; font-weight: 800; }
.issue-list span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: var(--amber); font-size: 10px; }

.start-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 9px 22px rgba(233,120,88,.22);
  text-align: left;
  cursor: pointer;
}
.start-card strong { display: block; font-size: 16px; }
.start-card small { display: block; margin-top: 3px; color: rgba(255,255,255,.78); font-size: 11px; }
.start-icon { display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; border-radius: 14px; color: var(--coral); background: #fff; font-size: 24px; font-weight: 400; }
.start-card > span:nth-child(2) { flex: 1; }
.start-arrow { font-size: 20px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 2px 10px;
}
.section-head h2 { margin: 0; }
.text-btn { padding: 6px; border: 0; color: var(--blue); background: none; font-weight: 800; cursor: pointer; }

.card {
  padding: 16px;
  border: 1px solid rgba(220,229,234,.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(21,58,91,.04);
}
.card + .card { margin-top: 10px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 15px; font-weight: 800; }
.card-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 10px; }
.quick-card { display: grid; grid-template-rows: auto auto 1fr; width: 100%; min-height: 132px; padding: 15px; border: 0; text-align: left; cursor: pointer; }
.quick-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 900;
}
.quick-card:nth-child(2) .quick-icon { color: var(--green); background: var(--mint); }

.saved-event-list { display: grid; gap: 9px; }
.saved-event-card { display: flex; align-items: center; gap: 11px; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: #fff; box-shadow: 0 4px 14px rgba(21,58,91,.04); text-align: left; cursor: pointer; }
.saved-event-date { display: grid; flex: 0 0 auto; place-items: center; width: 43px; height: 48px; border-radius: 12px; color: var(--navy); background: var(--blue-soft); }
.saved-event-date strong { font-size: 18px; line-height: 1; }
.saved-event-date span { font-size: 9px; font-weight: 800; }
.saved-event-main { min-width: 0; flex: 1; }
.saved-event-title { overflow: hidden; font-size: 13px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.saved-event-title small { display: inline-block; margin-left: 6px; padding: 3px 5px; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 8px; vertical-align: 2px; }
.saved-event-card.current { border-color: #afd0c9; box-shadow: 0 5px 16px rgba(71,136,134,.1); }
.saved-event-meta { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.saved-event-reasons { margin-top: 5px; color: #91601c; font-size: 9px; font-weight: 800; line-height: 1.4; }
.saved-event-arrow { color: #9aa8a7; font-size: 20px; }
.page-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-title-row .lead { margin-bottom: 0; }
.page-title-row .btn { flex: 0 0 auto; margin-top: 3px; }
.event-empty { margin-top: 18px; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 520px);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}
.nav-btn { padding: 5px; border: 0; color: #83929c; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.nav-icon { display: block; margin-bottom: 3px; font-size: 20px; line-height: 1; }
.nav-btn.active { color: var(--navy); }

.event-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px 12px;
}
.event-mini-main { min-width: 0; flex: 1; }
.event-edit { flex: 0 0 auto; padding: 7px 10px; border: 0; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; cursor: pointer; }
.date-tile { width: 52px; padding: 7px 4px; border-radius: 13px; color: var(--navy); background: #fff; text-align: center; }
.date-tile span { display: block; color: var(--coral); font-size: 10px; font-weight: 900; }
.date-tile strong { font-size: 22px; }
.event-mini h1 { margin: 0; font-size: 18px; }
.event-mini p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.workflow {
  position: sticky;
  z-index: 15;
  top: 68px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(242,246,248,.95);
  scrollbar-width: none;
}
.workflow::-webkit-scrollbar { display: none; }
.workflow-btn { flex: 1 0 auto; min-width: 72px; padding: 9px 10px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.workflow-btn.active { color: var(--navy); background: #fff; box-shadow: 0 3px 10px rgba(21,58,91,.08); }
.step-no { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 4px; border-radius: 50%; color: #fff; background: #a8b5bd; font-size: 10px; }
.workflow-btn.active .step-no, .workflow-btn.done .step-no { background: var(--blue); }

.progress-card { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #cfe3ef; border-radius: 14px; background: var(--blue-soft); }
.progress-card strong { color: var(--navy); font-size: 13px; }
.progress-track { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 20px; background: #cee0e9; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }

.person-list { display: grid; gap: 9px; }
.person-card { display: flex; align-items: center; gap: 11px; padding: 12px; }
.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--navy);
  background: #e8f1f5;
  font-size: 13px;
  font-weight: 900;
}
.avatar.guardian { color: var(--green); background: var(--mint); }
.person-main { min-width: 0; flex: 1; }
.person-name { font-weight: 800; }
.person-sub { margin-top: 2px; color: var(--muted); font-size: 11px; }

.segmented { display: flex; flex: 0 0 auto; gap: 3px; padding: 3px; border-radius: 11px; background: #edf1f3; }
.segmented button { min-width: 48px; padding: 7px 8px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.segmented button.active.yes { color: var(--green); background: #fff; box-shadow: 0 2px 6px rgba(21,58,91,.08); }
.segmented button.active.no { color: var(--danger); background: #fff; }
.role-segmented button { min-width: 43px; padding-inline: 6px; }
.segmented button.active.driver { color: var(--blue); background: #fff; }
.segmented button.active.guide { color: #8a5a14; background: #fff7e7; }
.segmented button:disabled { opacity: .35; cursor: not-allowed; }

.notice { display: flex; gap: 10px; margin-bottom: 14px; padding: 13px; border-radius: 14px; background: #fff7e8; color: #795119; font-size: 12px; line-height: 1.55; }
.notice.ok { color: var(--green); background: var(--mint); }
.notice.error { color: var(--danger); background: var(--coral-soft); }

.vehicle-card { padding: 0; overflow: hidden; }
.vehicle-top { display: flex; align-items: center; gap: 12px; padding: 15px; }
.vehicle-symbol { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 900; }
.vehicle-info { flex: 1; }
.vehicle-name { font-weight: 800; }
.vehicle-owner { margin-top: 3px; color: var(--muted); font-size: 11px; }
.coach-select-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; border-top: 1px solid var(--line); background: #f5f8fa; }
.coach-select-row strong { display: block; color: var(--navy); font-size: 12px; }
.coach-select-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.coach-select-btn { flex: 0 0 auto; padding: 8px 10px; border: 1px solid #b9cbd5; border-radius: 10px; color: var(--blue); background: #fff; font-size: 10px; font-weight: 900; cursor: pointer; }
.coach-select-btn.active { border-color: var(--navy); color: #fff; background: var(--navy); }
.vehicle-controls { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-top: 1px solid var(--line); background: #fbfcfd; }
.vehicle-controls.coach-excluded { background: #edf4f7; }
.counter { display: flex; align-items: center; gap: 12px; }
.counter button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 18px; cursor: pointer; }
.counter strong { min-width: 22px; text-align: center; }

.switch { position: relative; width: 46px; height: 28px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: #cbd5da; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.18); transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

.capacity-summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 15px 16px; border-radius: 16px; color: #fff; background: var(--navy); }
.capacity-summary span { color: #c5d8e3; font-size: 12px; }
.capacity-summary strong { display: block; margin-top: 3px; font-size: 23px; }
.capacity-pill { padding: 7px 10px; border-radius: 10px; color: var(--navy) !important; background: #fff; font-weight: 800; }

.allocation-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.coach-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #c9dde7; border-radius: 15px; background: #f1f7fa; }
.coach-summary-icon { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: var(--navy); font-size: 11px; font-weight: 900; }
.coach-summary > div { min-width: 0; flex: 1; }
.coach-summary strong { display: block; color: var(--navy); font-size: 12px; }
.coach-summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.car-board { display: grid; gap: 12px; }
.car-card { padding: 0; overflow: hidden; }
.car-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px 11px; border-bottom: 1px solid var(--line); }
.seat-count { padding: 5px 9px; border-radius: 9px; color: var(--green); background: var(--mint); font-size: 11px; font-weight: 900; }
.seat-count.full { color: #8a5a14; background: #fff1d6; }
.passengers { display: grid; gap: 7px; padding: 12px; }
.passenger { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; text-align: left; cursor: pointer; }
.passenger.driver-row { border-color: transparent; background: var(--blue-soft); cursor: default; }
.mini-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--navy); background: #e6eef2; font-size: 9px; font-weight: 900; }
.driver-row .mini-avatar { color: #fff; background: var(--blue); }
.passenger-label { flex: 1; font-size: 12px; font-weight: 800; }
.passenger-label small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 600; }
.move-hint { color: #9aa8b1; font-size: 13px; }
.empty-seat { padding: 10px; border: 1px dashed #cbd6dc; border-radius: 12px; color: #9aa8b1; text-align: center; font-size: 11px; }

.form-card { display: grid; gap: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.input-wrap { position: relative; }
.field input, .field select { width: 100%; height: 46px; padding: 0 42px 0 12px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink); background: #fff; font-weight: 700; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,121,168,.1); }
.unit { position: absolute; top: 50%; right: 13px; color: var(--muted); font-size: 12px; transform: translateY(-50%); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.cost-result { padding: 20px; border: 0; color: #fff; background: linear-gradient(140deg, var(--navy), #245f82); }
.cost-result .cost-label { color: #bed5e2; font-size: 12px; }
.cost-big { margin: 4px 0 16px; font-size: 37px; font-weight: 900; letter-spacing: -.03em; }
.cost-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cost-result-grid div { padding: 10px; border-radius: 11px; background: rgba(255,255,255,.1); }
.cost-result-grid span { display: block; color: #c6dce7; font-size: 10px; }
.cost-result-grid strong { display: block; margin-top: 4px; font-size: 16px; }

.formula { margin: 10px 0 0; padding: 13px; border-radius: 13px; color: var(--muted); background: #f7f9fa; font-size: 11px; line-height: 1.7; }
.completion-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 15px; border-radius: 17px; color: var(--green); background: var(--mint); }
.completion-banner > span { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--green); font-weight: 900; }
.completion-banner strong { display: block; font-size: 13px; }
.completion-banner small { display: block; margin-top: 3px; color: #56766a; font-size: 10px; line-height: 1.5; }
.incomplete-panel { display: grid; gap: 8px; margin-top: 16px; padding: 15px; border: 1px solid #f0d29d; border-radius: 17px; background: #fff7e8; }
.incomplete-panel > strong { color: #865718; font-size: 13px; }
.incomplete-panel > div { display: flex; align-items: center; gap: 7px; color: #865718; font-size: 11px; font-weight: 800; }
.incomplete-panel > div span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: var(--amber); font-size: 10px; }
.incomplete-panel .btn { margin-top: 4px; }
.completion-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.payer-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.payer-row:last-child { border-bottom: 0; }
.payer-name { font-size: 13px; font-weight: 800; }
.tag { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 9px; color: var(--green); background: var(--mint); font-size: 10px; font-weight: 900; }
.tag.pay { color: var(--navy); background: var(--blue-soft); }
.tag.role { color: #8a5a14; background: #fff2d8; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 13px; background: #e6ecef; }
.tab-btn { padding: 9px 4px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.tab-btn.active { color: var(--navy); background: #fff; box-shadow: 0 2px 8px rgba(21,58,91,.08); }
.list-action { width: 34px; height: 34px; border: 0; border-radius: 10px; color: var(--muted); background: #f0f4f6; cursor: pointer; }
.list-action.delete { color: var(--danger); }
.member-actions { display: flex; gap: 5px; }
.sort-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 12px 14px; border-radius: 15px; background: var(--blue-soft); }
.sort-toolbar strong { display: block; color: var(--navy); font-size: 12px; }
.sort-toolbar small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.person-card.sorting { border-color: #bfd8d3; box-shadow: none; }
.sort-actions { display: flex; gap: 5px; }
.sort-actions button { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 10px; color: var(--blue); background: #fff; font-size: 16px; font-weight: 900; cursor: pointer; }
.sort-actions button:disabled { color: #bac5c4; background: #f4f5f3; cursor: default; }

.guardian-choice-list { display: grid; gap: 7px; }
.guardian-choice { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.guardian-choice input { width: 18px; height: 18px; accent-color: var(--blue); }
.guardian-choice span { min-width: 0; }
.guardian-choice strong { display: block; font-size: 12px; }
.guardian-choice small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.empty-inline { padding: 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 11px; text-align: center; }
.link-count { flex: 0 0 auto; padding: 5px 7px; border-radius: 8px; color: var(--green); background: var(--mint); font-size: 9px; font-weight: 900; }

.fab {
  position: fixed;
  z-index: 25;
  right: max(18px, calc((100vw - 520px) / 2 + 18px));
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 9px 22px rgba(239,118,93,.35);
  font-size: 28px;
  cursor: pointer;
}

.sheet-backdrop { position: fixed; z-index: 80; top: var(--visual-viewport-offset, 0); right: 0; bottom: auto; left: 0; display: flex; align-items: flex-end; justify-content: center; height: var(--visual-viewport-height, 100dvh); background: rgba(11,31,46,.45); }
.sheet { width: min(100%, 520px); max-height: calc(var(--visual-viewport-height, 100dvh) - 8px); overflow-y: auto; scroll-padding: 24px 0 150px; overscroll-behavior: contain; padding: 20px 18px max(28px, calc(24px + env(safe-area-inset-bottom))); border-radius: 24px 24px 0 0; background: #fff; animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(20px); opacity: .3; } }
.sheet-handle { width: 42px; height: 4px; margin: -8px auto 18px; border-radius: 10px; background: #d7dfe3; }
.sheet h2 { margin-bottom: 6px; }
.sheet .lead { margin-bottom: 16px; }
.sheet-actions { display: grid; gap: 9px; margin-top: 18px; }
.choice-list { display: grid; gap: 8px; }
.choice-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-weight: 800; cursor: pointer; }
.choice-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.choice-btn:disabled { cursor: default; opacity: .62; }
.choice-btn small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 600; text-align: left; }
.swap-choice > span:last-child { color: var(--blue); font-size: 10px; }
.sheet-step { margin-bottom: 5px; color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.sheet-back { margin: 0 0 12px; padding: 0; border: 0; color: var(--blue); background: none; font-size: 12px; font-weight: 800; cursor: pointer; }

.sub-form { padding: 14px; border-radius: 15px; background: var(--blue-soft); }
.sub-form[hidden], [data-existing-guardian][hidden] { display: none; }
.sub-form-title { margin-bottom: 12px; color: var(--navy); font-size: 13px; font-weight: 900; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.inline-link { align-self: flex-start; padding: 4px 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.inline-link-card { width: 100%; padding: 11px 12px; border: 1px dashed #adcac4; border-radius: 12px; background: #f5faf8; text-align: left; }
.form-error { margin-top: 12px; padding: 11px 13px; border-radius: 12px; color: var(--danger); background: var(--coral-soft); font-size: 12px; font-weight: 800; }
.form-error[hidden] { display: none; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 102px; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px; color: #fff; background: #153a5b; box-shadow: var(--shadow); font-size: 12px; font-weight: 800; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty-state { padding: 32px 20px; border: 1px dashed #cbd6dc; border-radius: 17px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }

.auth-page { display: grid; min-height: 100dvh; place-items: center; padding: 18px; background: #edf3f5; }
.auth-shell { width: min(100%, 440px); padding: 26px 20px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 30px; }
.auth-form { margin-top: 18px; padding: 18px; }
.auth-link { display: block; color: var(--blue); font-size: 12px; font-weight: 800; text-align: center; text-decoration: none; }
.auth-link.secondary { color: var(--muted); font-size: 10px; }
.account-form { padding: 16px; }
.backup-link { margin: 16px 0; text-decoration: none; }
.activation-link { margin-bottom: 16px; padding: 14px; }
.activation-link strong { display: block; margin-bottom: 8px; font-size: 11px; }
.activation-link input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; }
.account-row { display: flex; align-items: center; gap: 10px; padding: 12px; }

.guardian-content { padding-bottom: 34px; }
.my-member-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 20px; }
.my-member-chips span { padding: 7px 9px; border-radius: 10px; color: var(--navy); background: var(--blue-soft); font-size: 11px; font-weight: 900; }
.my-member-chips small { color: var(--muted); font-size: 9px; }
.guardian-events { display: grid; gap: 12px; }
.guardian-event { padding: 0; overflow: hidden; }
.guardian-event > summary { display: flex; align-items: center; justify-content: space-between; padding: 16px; cursor: pointer; list-style: none; }
.guardian-event > summary::-webkit-details-marker { display: none; }
.guardian-event > summary h2 { margin: 8px 0 4px; font-size: 18px; }
.guardian-event > summary p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.guardian-event[open] > summary { border-bottom: 1px solid var(--line); }
.guardian-event[open] .saved-event-arrow { transform: rotate(180deg); }
.guardian-event-body { padding: 0 14px 16px; }
.guardian-event-body .section-head { margin-top: 17px; }
.guardian-event-body h3 { font-size: 14px; }
.inset-card { padding: 0 12px; box-shadow: none; }
.guardian-car-card { box-shadow: none; }
.guardian-passenger { cursor: default; }
.guardian-cost { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 13px; color: #fff; background: var(--navy); }
.guardian-cost div { padding: 10px; border-radius: 10px; background: rgba(255,255,255,.1); }
.guardian-cost span { display: block; color: #bed5e2; font-size: 9px; }
.guardian-cost strong { display: block; margin-top: 3px; font-size: 15px; }
.guardian-footer { margin-top: 24px; text-align: center; }
.guardian-footer a { color: var(--muted); font-size: 10px; }
.legal-page section { margin-bottom: 12px; padding: 16px; }
.legal-page section h2 { margin-bottom: 7px; font-size: 14px; }
.legal-page section p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }

@media (min-width: 521px) {
  body { padding: 18px 0; }
  .app-shell { min-height: calc(100dvh - 36px); border-radius: 26px; }
  .topbar { top: 18px; border-radius: 26px 26px 0 0; }
  .bottom-nav { bottom: 18px; border-radius: 0 0 26px 26px; }
  .workflow { top: 86px; }
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 24px; }
}
