:root {
  --bg: #f4f8f9;
  --surface: #ffffff;
  --surface-soft: #f6fbfc;
  --ink: #263238;
  --muted: #667782;
  --line: #dbe6ea;
  --sage: #4f8fa8;
  --sage-soft: #e6f3f7;
  --clay: #dd8b7c;
  --clay-soft: #fae7e2;
  --blue: #4f8fa8;
  --blue-soft: #e6f3f7;
  --gold: #e8b86d;
  --gold-soft: #f8ecd5;
  --primary: #4f8fa8;
  --primary-deep: #2f6f88;
  --sand: #e8b86d;
  --shadow: 0 18px 48px rgba(38, 50, 56, .10);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(79, 143, 168, .18), transparent 34rem),
    radial-gradient(circle at 82% 14%, rgba(232, 184, 109, .22), transparent 28rem),
    linear-gradient(135deg, #ffffff 0%, var(--bg) 48%, #eef5f7 100%);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell[data-mode="home"] {
  display: block;
}

.app-shell[data-mode="home"] .side-panel,
.app-shell[data-mode="home"] .trip-workspace {
  display: none;
}

.app-shell[data-mode="trip"] [data-view="trips"] {
  display: none;
}

.side-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(20px);
  overflow: auto;
}

.back-home-button {
  width: 100%;
  min-height: 38px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--sage);
  background: rgba(255, 255, 255, .74);
  font-weight: 800;
  text-align: left;
  padding: 8px 12px;
}

.brand,
.profile-button,
.member-pill,
.section-mini-head,
.panel-head,
.trip-actions,
.mobile-tabs,
.trip-meta-row,
.expense-meta,
.settlement-row,
.decision-card-head {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark,
.avatar,
.profile-button span {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(79, 143, 168, .24);
}

.brand strong {
  display: block;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.brand span:last-child,
.hint,
.trip-subtitle,
.panel-note,
.event-card p,
.expense-card p,
.photo-card p,
.decision-card p {
  color: var(--muted);
}

.profile-card,
.members-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .64);
}

.profile-card {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.profile-button {
  width: 100%;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.profile-button span {
  width: 34px;
  height: 34px;
}

.hint {
  margin: 10px 0 0;
  font-size: 12px;
}

.main-nav {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.nav-button,
.tab-button {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  text-align: left;
}

.nav-button:hover,
.nav-button.is-active,
.tab-button.is-active {
  border-color: rgba(114, 134, 108, .28);
  color: var(--ink);
  background: var(--sage-soft);
  font-weight: 800;
}

.section-mini-head {
  justify-content: space-between;
  gap: 12px;
}

.text-button,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--sage);
  font-weight: 800;
}

.member-list {
  display: grid;
  gap: 8px;
}

.member-pill {
  gap: 9px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(246, 251, 252, .86);
}

.member-pill.is-inactive {
  opacity: .72;
}

.avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.member-pill div {
  min-width: 0;
}

.member-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.member-actions button {
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid rgba(79, 143, 168, .18);
  border-radius: 999px;
  color: var(--sage);
  background: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 800;
}

.member-actions button[data-remove-member] {
  color: #b35d52;
  border-color: rgba(179, 93, 82, .22);
}

.member-pill strong,
.member-pill span {
  display: block;
}

.member-pill span {
  color: var(--muted);
  font-size: 12px;
}

.inactive-members {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(219, 230, 234, .95);
}

.inactive-members > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.content {
  min-width: 0;
  padding: 34px clamp(20px, 4vw, 56px) 80px;
}

.app-shell[data-mode="home"] .content {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 28px;
  align-items: end;
  padding: 34px 0 42px;
  border-bottom: 1px solid var(--line);
}

.landing-hero h1 {
  max-width: 780px;
}

.landing-lead {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.9;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.landing-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(230, 243, 247, .78)),
    var(--surface);
  box-shadow: var(--shadow);
}

.landing-card ul {
  margin: 0;
  padding-left: 1.25em;
  color: var(--muted);
}

.landing-card li + li {
  margin-top: 10px;
}

.trip-list-section {
  padding-top: 36px;
}

.trip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.trip-card {
  min-height: 250px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(246, 251, 252, .8)),
    var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.trip-card:hover,
.trip-card:focus-visible {
  border-color: rgba(79, 143, 168, .48);
  box-shadow: 0 20px 52px rgba(38, 50, 56, .14);
  transform: translateY(-2px);
  outline: none;
}

.trip-card-top,
.trip-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.trip-card-top {
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.trip-card h3 {
  margin-top: 22px;
  font-size: 30px;
  line-height: 1.2;
}

.trip-card p {
  min-height: 72px;
  color: var(--muted);
}

.trip-card .demo-password {
  min-height: 0;
  margin: 14px 0 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--sand-soft);
  color: #8d6d2e;
  font-size: 12px;
  font-weight: 800;
}

.trip-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.delete-trip-button {
  border: 0;
  color: #b35d52;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.delete-trip-button:hover,
.delete-trip-button:focus-visible {
  color: #8f4038;
  outline: none;
}

.trip-card-meta span {
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trip-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 22px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  font-weight: 750;
  letter-spacing: -.035em;
}

h1 {
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04;
  text-wrap: balance;
}

.trip-subtitle {
  max-width: 720px;
  margin: 16px 0 0;
  font-size: 18px;
}

.trip-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  padding: 8px 15px;
  border-radius: 13px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--sage);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 10px 22px rgba(79, 143, 168, .2);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, .76);
}

.danger-button {
  border: 1px solid rgba(179, 93, 82, .38);
  color: #fff;
  background: linear-gradient(135deg, #c66f63, #9f4b42);
  box-shadow: 0 10px 22px rgba(179, 93, 82, .18);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.mobile-tabs {
  display: none;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .75fr);
  gap: 16px;
}

.today-card,
.settlement-card,
.todo-card,
.event-card,
.day-column,
.expense-card,
.final-split,
.checklist-progress-card,
.checklist-group,
.doc-card,
.more-card,
.photo-card,
.decision-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .8);
  box-shadow: var(--shadow);
}

.today-card {
  grid-row: span 2;
  min-height: 520px;
  padding: 26px;
}

.today-card h2,
.panel-head h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.16;
}

.settlement-card,
.todo-card {
  padding: 22px;
}

.mini-timeline {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.timeline-time {
  color: var(--sage);
  font-weight: 800;
}

.timeline-item h3 {
  font-size: 22px;
}

.trip-meta-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
}

.money-summary {
  display: grid;
  gap: 4px;
  margin: 14px 0 16px;
}

.money-summary span {
  color: var(--muted);
}

.money-summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 500;
}

.settlement-list,
.decision-stack,
.decision-board,
.expense-list {
  display: grid;
  gap: 10px;
}

.settlement-row {
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.decision-mini,
.empty-state {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .56);
}

.panel-head {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.day-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.day-column {
  min-width: 260px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(246, 251, 252, .78)),
    var(--surface);
}

.day-column-head {
  margin-bottom: 14px;
}

.day-column-head span {
  color: var(--sage);
  font-weight: 800;
}

.day-column-head h3 {
  font-size: 28px;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-card {
  position: relative;
  padding: 14px;
  box-shadow: none;
}

.event-card.is-option {
  border-style: dashed;
}

.event-card h4,
.expense-card h3,
.photo-card h3,
.decision-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.event-card p,
.expense-card p,
.photo-card p,
.decision-card p {
  margin: 6px 0 0;
  font-size: 14px;
}

.event-place {
  display: inline-block;
  margin-top: 8px;
  color: var(--sage);
  font-size: 13px;
  font-weight: 800;
}

.linked-expenses {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(219, 230, 234, .9);
}

.linked-expenses-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.linked-expense-row,
.linked-expense-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
}

.linked-expense-row span,
.linked-expense-total span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.linked-expense-row strong,
.linked-expense-total strong {
  color: var(--ink);
  font-weight: 800;
}

.linked-expense-total {
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px dashed rgba(219, 230, 234, .95);
}

.expense-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.expense-card {
  position: relative;
  padding: 16px;
}

.checklist-progress-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px;
}

.checklist-progress-card h3 {
  font-size: 24px;
}

.checklist-progress-card > strong {
  color: var(--sage);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
}

.progress-track {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(219, 230, 234, .85);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  transition: width .25s ease;
}

.checklist-board {
  display: grid;
  gap: 14px;
}

.checklist-group {
  padding: 16px;
}

.checklist-group-head {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.checklist-items {
  display: grid;
  gap: 8px;
}

.checklist-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid rgba(219, 230, 234, .85);
  border-radius: 14px;
  background: rgba(246, 251, 252, .72);
  cursor: pointer;
}

.checklist-item:hover,
.checklist-item:focus-visible {
  border-color: rgba(79, 143, 168, .35);
  outline: none;
}

.checklist-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checklist-item.is-complete {
  color: var(--muted);
  background: rgba(255, 255, 255, .62);
}

.checklist-item.is-complete strong {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.check-mark {
  color: var(--sage);
  font-size: 18px;
  font-weight: 900;
}

.docs-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.doc-card {
  position: relative;
  min-width: 0;
  padding: 16px;
}

.doc-card h3 {
  margin-top: 10px;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.doc-details {
  margin-top: 12px;
}

.doc-details summary {
  color: var(--sage);
  font-weight: 900;
  cursor: pointer;
}

.doc-details p {
  margin: 10px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.image-placeholder-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(79, 143, 168, .28);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(230, 243, 247, .45);
  font-size: 13px;
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.more-card {
  display: grid;
  gap: 4px;
  min-height: 124px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
}

.more-card span {
  font-size: 24px;
}

.more-card strong,
.more-card em {
  display: block;
}

.more-card em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid rgba(79, 143, 168, .2);
  border-radius: 999px;
  color: var(--sage);
  background: rgba(230, 243, 247, .72);
  font-size: 12px;
  font-weight: 800;
}

.decision-card {
  position: relative;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 8px;
}

.item-actions button {
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid rgba(79, 143, 168, .22);
  border-radius: 999px;
  color: var(--sage);
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
}

.item-actions button[data-delete-item] {
  border-color: rgba(179, 93, 82, .24);
  color: #b35d52;
}

.item-actions button:hover,
.item-actions button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.expense-meta {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.expense-amount {
  margin-left: auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.final-split {
  position: sticky;
  top: 22px;
  padding: 20px;
}

.final-split h3 {
  font-size: 30px;
}

.category-breakdown {
  display: grid;
  gap: 8px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  gap: 8px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(219, 230, 234, .7);
  color: var(--muted);
  font-size: 13px;
}

.category-row span {
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
}

.category-row strong {
  color: var(--ink);
  font-weight: 800;
}

.category-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.split-divider {
  margin: 18px 0;
  border-top: 1px dashed rgba(219, 230, 234, .95);
}

.upload-button {
  position: relative;
  overflow: hidden;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.panel-note {
  margin: -8px 0 18px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.photo-card {
  overflow: hidden;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(79, 143, 168, .16), rgba(232, 184, 109, .2)),
    var(--surface-soft);
  color: var(--sage);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  font-size: 28px;
  font-weight: 800;
}

.photo-card div {
  padding: 13px;
}

.decision-card {
  padding: 16px;
}

.decision-card-head {
  justify-content: space-between;
  gap: 12px;
}

.status {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status.pending {
  color: var(--gold);
  background: var(--gold-soft);
}

.status.done {
  color: var(--sage);
  background: var(--sage-soft);
}

.status.option {
  color: var(--blue);
  background: var(--blue-soft);
}

.modal {
  width: min(620px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
}

.modal::backdrop {
  background: rgba(48, 53, 47, .3);
  backdrop-filter: blur(5px);
}

.modal-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(48, 53, 47, .22);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head h2 {
  font-size: 34px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 26px;
}

.modal-fields {
  display: grid;
  gap: 13px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  inline-size: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: block;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
}

.field input[type="date"],
.field input[type="time"] {
  min-width: 0;
  max-width: 100%;
}

.field input[type="date"]::-webkit-date-and-time-value,
.field input[type="time"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.form-hint,
.access-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.access-note {
  margin: -4px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid rgba(219, 230, 234, .9);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(246, 251, 252, .72);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.checkbox-grid label:has(input:checked) {
  border-color: rgba(79, 143, 168, .42);
  background: rgba(230, 243, 247, .92);
  box-shadow: inset 0 0 0 1px rgba(79, 143, 168, .08);
}

.checkbox-grid input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--sage);
}

.checkbox-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checkbox-field {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.single-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.single-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--sage);
}

.disabled-upload {
  justify-content: center;
  opacity: .72;
  cursor: not-allowed;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translate(-50%, 16px);
  max-width: min(420px, calc(100% - 28px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .side-panel {
    display: none;
  }

  .app-shell[data-mode="trip"] .side-panel {
    display: none;
  }

  .content {
    padding: 22px 16px 90px;
  }

  .app-shell[data-mode="home"] .content {
    width: auto;
    margin: 0;
  }

  .landing-hero,
  .trip-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    padding-top: 22px;
  }

  .trip-header {
    grid-template-columns: 1fr;
  }

  .trip-actions {
    justify-content: flex-start;
  }

  .mobile-tabs {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    margin: 0;
    padding: 8px;
    overflow: visible;
    border: 1px solid rgba(222, 216, 202, .9);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 40px rgba(38, 50, 56, .14);
    backdrop-filter: saturate(180%) blur(16px);
  }

  .app-shell[data-mode="home"] .mobile-tabs {
    display: none;
  }

  .tab-button {
    min-width: 0;
    min-height: 42px;
    padding: 7px 4px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
  }

  .overview-grid,
  .expense-layout {
    grid-template-columns: 1fr;
  }

  .today-card {
    grid-row: auto;
    min-height: auto;
    padding: 20px;
  }

  .timeline-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .day-columns {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .day-column {
    min-width: 0;
  }

  .final-split {
    position: static;
  }

  .photo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .docs-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 42px;
  }

  .trip-subtitle {
    font-size: 16px;
  }

  .trip-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .more-grid {
    grid-template-columns: 1fr;
  }

  .checklist-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .checklist-item .item-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin: 4px 0 0;
  }

  .modal-card {
    padding: 18px;
  }

  .member-pill {
    align-items: flex-start;
  }

  .member-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .checkbox-grid {
    padding: 8px;
  }

  .checkbox-grid label {
    min-height: 48px;
    padding: 9px 8px;
    font-size: 14px;
  }

  .category-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .category-row em {
    grid-column: 1 / -1;
    text-align: left;
  }
}

