:root {
    --ink: #20333b;
    --muted: #68787d;
    --paper: #fffdf8;
    --canvas: #f4f0e7;
    --line: #d9ddd8;
    --brand: #0f665f;
    --brand-dark: #084c47;
    --accent: #d07a3a;
    --accent-soft: #fae9d7;
    --green-soft: #dfeee8;
    --child-soft: #eee6f6;
    --danger: #aa3d35;
    --shadow: 0 14px 38px rgba(40, 55, 50, .08);
    --radius: 18px;
  }
  * { box-sizing: border-box; }
  html { color: var(--ink); background: var(--canvas); font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; scroll-padding-bottom: 150px; }
  body { margin: 0; min-height: 100vh; background:
      radial-gradient(circle at 10% -10%, rgba(208,122,58,.13), transparent 28rem),
      linear-gradient(180deg, #f8f5ed 0, var(--canvas) 26rem); }
  button, input, select, textarea { font: inherit; }
  button, a { -webkit-tap-highlight-color: transparent; }
  h1, h2, h3, p { margin-top: 0; }
  [hidden] { display: none !important; }

  .site-header {
    min-height: 156px; padding: 20px max(24px, calc((100vw - 1040px)/2)) 22px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
    color: white; background:
      linear-gradient(120deg, rgba(4,55,52,.97), rgba(15,102,95,.9)),
      repeating-linear-gradient(135deg, transparent 0 22px, rgba(255,255,255,.04) 22px 24px);
  }
  .site-header h1 { margin: 6px 0 8px; font-size: clamp(2rem, 5vw, 3.45rem); letter-spacing: .06em; line-height: 1.15; }
  .eyebrow { color: #f3c99f; font-size: .78rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
  .header-meta { margin: 0; color: rgba(255,255,255,.78); }
  .report-link { color: white; text-decoration: none; border: 1px solid rgba(255,255,255,.46); padding: 10px 16px; border-radius: 999px; white-space: nowrap; font-weight: 700; }
  .report-link:hover { background: rgba(255,255,255,.12); }

  .page-shell, .report-shell { width: min(1040px, calc(100% - 32px)); margin: 14px auto 0; padding-bottom: 190px; position: relative; }
  .report-shell { width: min(1440px, calc(100% - 32px)); }
  .card { background: rgba(255,253,248,.98); border: 1px solid rgba(217,221,216,.9); border-radius: var(--radius); padding: clamp(20px, 4vw, 34px); margin-bottom: 20px; box-shadow: var(--shadow); }
  .intro-card { border-left: 5px solid var(--accent); padding: 18px 28px; }
  .intro-card h2 { font-size: 1rem; margin-bottom: 6px; color: var(--accent); }
  .intro-card p { margin: 0; color: var(--muted); }
  .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
  .section-heading > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .section-heading h2 { margin: 0; font-size: 1.28rem; }
  .step { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--brand); background: var(--green-soft); font-size: .78rem; font-weight: 900; }

  .choice-grid { display: grid; gap: 12px; }
  .choice-grid--two { grid-template-columns: repeat(2, 1fr); }
  .choice-grid--three { grid-template-columns: repeat(3, 1fr); }
  .choice-grid--four { grid-template-columns: repeat(4, 1fr); }
  .choice-stack { display: grid; gap: 10px; }
  .choice { display: block; position: relative; cursor: pointer; }
  .choice input { position: absolute; opacity: 0; pointer-events: none; }
  .choice > span { min-height: 80px; display: flex; flex-direction: column; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; transition: .18s ease; background: white; }
  .choice > span::before { content: ""; width: 18px; height: 18px; border: 2px solid #a8b4b3; border-radius: 50%; position: absolute; top: 14px; right: 14px; }
  .choice input:checked + span { border-color: var(--brand); background: #f1f8f5; box-shadow: inset 0 0 0 1px var(--brand); }
  .choice input:checked + span::before { border: 5px solid var(--brand); background: white; }
  .choice.choice--disabled { cursor: not-allowed; }
  .choice.choice--disabled > span { color: #8d9695; background: #f2f3f2; border-color: #d9dddc; opacity: .72; }
  .choice.choice--disabled > span::before { border-color: #c7cecd; background: #e7eae9; }
  .choice strong { padding-right: 22px; }
  .choice small { color: var(--muted); line-height: 1.45; }
  .choice small.registration-note--danger { color: var(--danger); font-weight: 800; }
  .choice.compact > span { min-height: 70px; }

  .button { border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer; font-weight: 800; transition: .18s ease; }
  .button:hover { transform: translateY(-1px); }
  .button:disabled { opacity: .55; cursor: wait; transform: none; }
  .button--primary { color: white; background: var(--brand); box-shadow: 0 8px 18px rgba(15,102,95,.22); }
  .button--primary:hover { background: var(--brand-dark); }
  .button--secondary { color: var(--brand); background: var(--green-soft); }
  .button--text { color: var(--brand); background: transparent; padding: 8px; }

  .member-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 16px; background: white; }
  .member-card__header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: linear-gradient(90deg, #dcece7, #eef6f3); color: var(--brand-dark); }
  .member-card__header--child { background: linear-gradient(90deg, var(--child-soft), #f7f2fb); color: #684b7d; }
  .member-card__header h3 { margin: 0; font-size: 1rem; }
  .remove-member { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-weight: 800; padding: 6px 8px; border-radius: 8px; }
  .remove-member:hover { background: rgba(170,61,53,.09); }
  .member-card__body { padding: 20px; }
  .form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
  .contact-email-field { margin-top: 16px; }
  .field > span, .field-group legend { font-size: .84rem; color: #42565c; font-weight: 800; }
  .room-type-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
  .field-inline-note { color: var(--danger); font-size: .8rem; font-style: normal; font-weight: 800; line-height: 1.45; }
  .field-label-line { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: 9px; min-width: 0; }
  .early-bird-status { display: inline-flex; align-items: center; justify-self: start; min-width: 0; padding: 3px 8px; border-radius: 10px; font-size: .76rem; line-height: 1.35; font-weight: 800; }
  .early-bird-status--paid { color: #805300; background: #fff1c7; }
  .early-bird-status--unpaid { color: #a32f28; background: #fde8e6; }
  .early-bird-status[hidden] { display: none; }
  .field input, .field select, .field textarea {
    width: 100%; border: 1px solid #cbd3d1; border-radius: 11px; padding: 11px 12px; color: var(--ink); background: white; outline: none;
  }
  .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,102,95,.12); }
  select option.route-unavailable { color: var(--danger); }
  .toggle-field { display: flex; gap: 9px; align-items: center; min-height: 44px; align-self: end; padding: 10px 12px; background: #f7f8f5; border-radius: 11px; font-weight: 700; }
  .toggle-field input { width: 18px; height: 18px; accent-color: var(--brand); }
  .kaohsiung-only[hidden], .adult-only[hidden], .room-type-field[hidden],
  .insurance-block[hidden], .insurance-details[hidden], .guardian-fields[hidden], .accommodation-section[hidden],
  .insurance-survey[hidden] { display: none; }
  .dependent-actions { padding: 0 18px 15px; }
  .child-card { margin: 0 18px 16px; border-color: #ded3e7; }
  .field-help { color: var(--muted); font-size: .8rem; margin: 0 20px 16px; }
  .warning-text { color: #925727; margin: 12px 0 0; }
  .muted { color: var(--muted); }

  .hotel-banner { display: flex; gap: 14px; align-items: center; border-radius: 14px; padding: 16px; background: #fbf3e9; margin-bottom: 20px; }
  .hotel-banner p { margin: 3px 0 0; color: var(--muted); font-size: .88rem; }
    #hotelPricingDescription {  white-space: pre-line;}
  .primary-hotel-info { margin: 0 20px 20px; }
  .hotel-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: white; font-weight: 900; }
  .meeting-only-choice { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 16px; border: 2px solid #e3b589; border-radius: 14px; background: #fff8ec; cursor: pointer; }
  .meeting-only-choice input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
  .meeting-only-choice span { display: grid; gap: 4px; }
  .meeting-only-choice small { color: var(--muted); line-height: 1.5; }
  .accommodation-section { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line); }
  .accommodation-section .hotel-banner { margin: 16px 0 0; }
  .confirmation-panel { display: grid; gap: 10px; margin-top: 16px; }
  .confirmation-choice { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid #dfc39f; border-radius: 12px; background: #fff9ef; cursor: pointer; line-height: 1.55; }
  .confirmation-choice input { width: 19px; height: 19px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); }
  .survey-card-hidden { display: none; }
  .insurance-survey { margin-top: 20px; padding: 18px; border: 2px solid #b7d6cc; border-radius: 16px; background: #f3f8f6; }
  .insurance-survey__heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
  .insurance-survey__heading h3 { margin: 0; color: var(--brand-dark); font-size: 1.08rem; }
  .insurance-survey__heading p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
  .insurance-price { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; color: #7b451e; background: var(--accent-soft); font-size: .8rem; font-weight: 900; }
  .insurance-participants { display: grid; gap: 12px; }
  .insurance-member { padding: 15px; border: 1px solid #d9e5e1; border-radius: 14px; background: white; }
  .insurance-member h4 { margin: 0 0 12px; color: var(--brand-dark); }
  .insurance-name-note { color: var(--danger); font-size: .82rem; font-weight: 800; }
  .insurance-details { margin-top: 14px; }
  .guardian-fields { grid-column: 1 / -1; padding-top: 14px; border-top: 1px dashed #b8d0c8; }
  .capacity-note { display: block; margin-top: 6px; color: #9a531f; font-weight: 900; }
  .field-group { border: 0; padding: 0; margin: 0; }
  .field-group legend { margin-bottom: 10px; }
  .route-section { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 20px; }
  .route-info, .route-count { margin: 12px 0; padding: 14px 16px; border-radius: 12px; background: var(--green-soft); line-height: 1.55; }
  .route-notes { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(15,102,95,.28); }
  .route-notes ul { margin: 7px 0 0; padding-left: 22px; }
  .route-notes li { margin: 4px 0; }
  .route-itinerary { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(15,102,95,.28); }
  .route-itinerary-scroll { margin-top: 8px; overflow-x: auto; border: 1px solid rgba(15,102,95,.18); border-radius: 10px; background: #fff; }
  .route-itinerary table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: .92rem; line-height: 1.45; }
  .route-itinerary th, .route-itinerary td { padding: 9px 10px; border-bottom: 1px solid #e4ece9; text-align: left; vertical-align: top; }
  .route-itinerary th { background: #edf7f3; color: var(--brand-dark); white-space: nowrap; }
  .route-itinerary td:first-child { width: 74px; white-space: nowrap; font-weight: 700; color: #44514d; }
  .route-itinerary td:nth-child(2) { width: 118px; white-space: nowrap; }
  .route-itinerary td:nth-child(3) { width: auto; }
  .route-itinerary tr:last-child td { border-bottom: 0; }
  .route-count { background: var(--accent-soft); color: #70411d; font-weight: 700; }
  .route-count ul { margin: 9px 0 5px; padding-left: 22px; }
  .route-count li { margin: 4px 0; }
  .route-count small { display: block; margin-top: 8px; font-weight: 700; line-height: 1.55; }
  .route-options { display: grid; gap: 14px; margin: 16px 0; }
  .route-option-notice { padding: 13px 15px; border-radius: 12px; color: var(--brand-dark); background: var(--green-soft); }
  .activity-count { max-width: 520px; padding: 14px; border-radius: 12px; background: #f7f8f5; }
  .mini-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .9rem; }
  .mini-table caption { text-align: left; font-weight: 900; margin-bottom: 8px; color: var(--brand-dark); }
  .mini-table th, .mini-table td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; }
  .mini-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
  .route-detail-table { margin: 14px 0 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .route-detail-table th { position: static; background: #eef6f3; }
  .route-detail-table th:last-child, .route-detail-table td:last-child { text-align: left; }
  .member-card, .route-section, .field { scroll-margin-bottom: 150px; }

  .fee-dock { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: rgba(255,253,248,.97); border-top: 1px solid var(--line); box-shadow: 0 -12px 35px rgba(35,50,45,.12); backdrop-filter: blur(14px); }
  .fee-dock__inner { width: min(1040px, calc(100% - 24px)); margin: 0 auto; min-height: 92px; display: grid; grid-template-columns: 240px 1fr; align-items: center; gap: 20px; position: relative; }
  .fee-total { border: 0; background: transparent; text-align: left; cursor: pointer; padding: 12px 0; display: grid; gap: 2px; color: var(--ink); }
  .fee-total span { font-size: .78rem; color: var(--muted); font-weight: 800; }
  .fee-total strong { color: var(--brand-dark); font-size: 1.65rem; font-variant-numeric: tabular-nums; }
  .fee-total small { color: var(--accent); font-weight: 800; }
  .fee-dock__actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
  .onsite-reminder { color: var(--danger); font-size: .82rem; font-weight: 900; max-width: 470px; }
  .fee-dock__details { position: absolute; bottom: 92px; left: 0; width: 390px; max-height: 55vh; overflow: auto; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 16px; box-shadow: var(--shadow); }
  .detail-row { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; border-bottom: 1px solid #edf0ed; }
  .member-fee { padding: 4px 0 10px; }
  .member-fee + .member-fee { border-top: 2px solid var(--green-soft); padding-top: 14px; }
  .member-fee h4 { margin: 0 0 5px; color: var(--brand-dark); font-size: .92rem; }
  .detail-row.subtotal { border-bottom: 0; color: var(--brand-dark); font-weight: 800; }
  .detail-row.total { font-weight: 900; color: var(--brand-dark); border: 0; padding-top: 12px; }
  .mobile-bottom-spacer { height: 150px; }

  .message { border-radius: 12px; padding: 13px 15px; margin: 12px 0; background: var(--green-soft); color: var(--brand-dark); }
  .message--error { background: #fae5e2; color: #7b2d28; }
  .result-dialog { border: 0; border-radius: 20px; padding: 32px; text-align: center; color: var(--ink); box-shadow: 0 20px 70px rgba(20,35,30,.3); width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
  .result-dialog::backdrop { background: rgba(20,33,31,.62); backdrop-filter: blur(4px); }
  .success-mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; background: var(--green-soft); color: var(--brand); font-size: 2rem; font-weight: 900; }
  .result-info-card { margin: 18px 0; padding: 16px; border-radius: 14px; background: var(--green-soft); text-align: left; }
  .result-info-card h3 { margin: 0 0 8px; color: var(--brand-dark); }
  .result-info-card p { margin: 5px 0; white-space: pre-line; line-height: 1.6; }
  .result-route-group { text-align: center; background: #fff7d9; }
  .result-route-group img { display: block; width: min(240px, 100%); aspect-ratio: 1; object-fit: contain; margin: 12px auto; border: 8px solid white; border-radius: 12px; background: white; }
  .result-route-group .button { display: inline-flex; text-decoration: none; }

  .report-header {
    min-height: 160px;
    padding-left: max(24px, calc((100vw - 1440px) / 2));
    padding-right: max(24px, calc((100vw - 1440px) / 2));
    text-align: left;
  }
  .report-header > div, .report-header h1 { text-align: left; }
  .login-card { width: min(460px, 100%); margin: 0 auto; }
  .report-control-card { padding-bottom: 24px; }
  .report-view-grid { display: grid; grid-template-columns: minmax(280px, 560px); }
  .report-loading { display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; color: var(--brand-dark); font-weight: 800; }
  .report-loading__spinner { width: 18px; height: 18px; border: 2px solid #b9d2cb; border-top-color: var(--brand); border-radius: 50%; animation: report-spin .7s linear infinite; }
  @keyframes report-spin { to { transform: rotate(360deg); } }
  .report-title-block { display: grid; gap: 5px; text-align: left; }
  .report-title-block h2, .report-title-block p { margin: 0; }
  .login-card form { display: grid; gap: 14px; }
  .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
  .stats-grid--overview { grid-template-columns: repeat(3, 1fr); }
  .stat-card { border-radius: 16px; padding: 20px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
  .stat-card .stat-card__label { display: block; color: var(--muted); font-size: .82rem; font-weight: 800; }
  .stat-card .stat-card__value { display: block; font-size: 1.85rem; margin-top: 5px; color: var(--brand-dark); }
  .stat-card__details { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
  .stat-card__detail { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 3px 10px; }
  .stat-card__detail span { color: var(--muted); font-size: .78rem; font-weight: 800; }
  .stat-card__detail strong { justify-self: end; color: var(--ink); font-size: .98rem; font-weight: 900; }
  .stat-card__detail small { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; line-height: 1.45; }
  .stat-card--money { background: var(--brand); color: white; }
  .stat-card--money .stat-card__label, .stat-card--money .stat-card__value,
  .stat-card--money .stat-card__detail span, .stat-card--money .stat-card__detail strong,
  .stat-card--money .stat-card__detail small { color: white; }
  .filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .filter-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 18px; }
  .field--wide { grid-column: span 2; }
  .report-actions { align-items: flex-start; }
  .download-menu { position: relative; }
  .download-options { position: absolute; right: 0; top: calc(100% + 8px); width: 220px; z-index: 10; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); padding: 6px; }
  .download-options button { width: 100%; border: 0; background: transparent; padding: 11px 12px; text-align: left; border-radius: 8px; cursor: pointer; }
  .download-options button:hover { background: var(--green-soft); }
  .route-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .route-pill { padding: 7px 10px; border-radius: 999px; background: var(--accent-soft); color: #70411d; font-size: .78rem; font-weight: 800; }
  .table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
  table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: .82rem; }
  th { position: sticky; top: 0; background: #e8eef1; color: #34474d; text-align: left; z-index: 1; }
  th, td { padding: 10px 12px; border-bottom: 1px solid #e5e8e5; }
  tbody tr:hover { background: #f8faf8; }
  tbody tr.report-row--care-total { background: #edf7f3; font-weight: 800; }
  tbody tr.report-row--care-total:hover { background: #e4f1ec; }
  tbody tr.report-row--grand-total { background: var(--green-soft); font-weight: 900; border-top: 2px solid var(--brand); }
  tbody tr.report-row--grand-total:hover { background: #d5e8e0; }
  td.money { text-align: right; font-variant-numeric: tabular-nums; }
  .report-table--centered th, .report-table--centered td { text-align: center; }

  @media (max-width: 800px) {
    .site-header { min-height: 142px; padding: 18px; }
    .site-header h1 { font-size: 2rem; }
    html { scroll-padding-bottom: 130px; }
    .page-shell, .report-shell { width: min(100% - 20px, 1040px); margin-top: 10px; padding-bottom: 230px; }
    .card { padding: 20px 16px; border-radius: 15px; }
    .intro-card { padding: 15px 16px; }
    .choice-grid--two, .choice-grid--three, .choice-grid--four, .form-grid, .stats-grid, .filter-grid { grid-template-columns: 1fr; }
    .field--wide { grid-column: auto; }
    .section-heading { align-items: flex-start; }
    .member-card__body { padding: 16px; }
    .primary-hotel-info { margin: 0 16px 16px; }
    .insurance-details, .guardian-fields { grid-template-columns: 1fr; }
    .insurance-survey { padding: 14px; }
    .insurance-survey__heading { display: grid; gap: 8px; }
    .child-card { margin: 0 10px 12px; }
    .fee-dock__inner { min-height: 0; grid-template-columns: 1fr auto; gap: 10px; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
    .fee-total strong { font-size: 1.35rem; }
    .fee-dock__actions { display: contents; }
    .onsite-reminder { grid-column: 1 / -1; grid-row: 2; max-width: none; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .fee-dock__details { bottom: 110px; width: 100%; max-height: 42vh; }
    .mobile-bottom-spacer { height: 190px; }
    .report-link { padding: 8px 12px; font-size: .84rem; }
    .stats-grid, .stats-grid--overview { grid-template-columns: repeat(2, 1fr); }
    .filter-actions { align-items: stretch; flex-direction: column; }
    .filter-actions .button { width: 100%; }
    .stat-card { padding: 15px; }
    .stat-card .stat-card__value { font-size: 1.35rem; }
  }
