:root {
  color-scheme: light;
  --paper: #f6f7f2;
  --surface: #fff;
  --ink: #17231b;
  --muted: #565f56;
  --line: #dce1d7;
  --shade: #edf0e8;
  --accent: #d8f454;
  --accent-hover: #c7e73e;
  --green: #2b4a35;
  --line-green: #087b3d;
  --radius: 16px;
  --shadow: 0 5px 18px rgb(18 36 23 / 5%);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-synthesis: none;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-size: 1rem; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.26; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 3px solid #518062; outline-offset: 3px; }
main:focus { outline: none; }
[hidden] { display: none !important; }

.shell { width: min(100% - 80px, 1280px); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 8; padding: 10px; background: var(--accent); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.small-icon { width: 16px; height: 16px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  font-size: .9375rem;
  line-height: 1.35;
  text-align: center;
  transition: background-color .17s, border-color .17s;
}
.button-primary { background: var(--accent); color: #17241a; }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-secondary { background: var(--shade); color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: #dfe6d8; }
.button-quiet { color: var(--muted); background: transparent; }
.button-quiet:hover:not(:disabled), .button-profile:hover { background: var(--shade); color: var(--ink); }
.button-line { color: #fff; background: var(--line-green); }
.button-line .icon { filter: invert(1); }
.button-line:hover:not(:disabled) { background: #056833; }
.button-danger { background: #faeae6; color: #8a3327; }
.button-danger:hover:not(:disabled) { background: #f3d5cd; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { min-height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-size: 1.15rem; letter-spacing: .025em; line-height: 1.12; font-weight: 850; }
.brand-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); }
.brand-icon .icon { width: 24px; height: 24px; transform: rotate(-10deg); }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: .65rem; letter-spacing: .18em; font-weight: 800; }
.site-nav, .header-actions { display: flex; align-items: center; }
.site-nav { gap: 32px; min-height: 74px; }
.site-nav a { color: var(--muted); display: flex; align-items: center; position: relative; min-height: inherit; font-size: .9375rem; white-space: nowrap; font-weight: 700; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #4d754d; border-radius: 4px 4px 0 0; }
.header-actions { gap: 6px; justify-content: end; }
.header-actions .button { white-space: nowrap; }
.demo-button { padding-inline: 10px; }
.demo-button .icon { width: 16px; height: 16px; opacity: .75; }
.button-profile { background: transparent; padding-inline: 8px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--ink); }
.profile-name { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; }

main { min-height: 56vh; }
.hero {
  display: flex;
  align-items: center;
  isolation: isolate;
  min-height: 364px;
  margin-top: 28px;
  overflow: hidden;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(90deg, rgb(12 24 16 / 78%), rgb(15 27 15 / 36%) 47%, transparent 76%),
    #15261a url("/images/hero.webp") center 49% / cover no-repeat;
}
.hero-content { max-width: 600px; padding: 38px clamp(27px, 4.6vw, 70px); }
.hero h1 { font-size: clamp(3rem, 5vw, 4.65rem); margin-block: 10px 13px; font-weight: 900; letter-spacing: -.055em; line-height: 1.11; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: #f0f2e9; font-size: 1.01rem; font-weight: 500; }
.hero-button { margin-top: 23px; min-height: 48px; padding-inline: 19px; }
.events-section { margin-top: 38px; scroll-margin-top: 22px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(1.65rem, 2.8vw, 2.15rem); font-weight: 850; letter-spacing: -.035em; }
.section-head p, .subtle { color: var(--muted); }
.section-head p { margin-top: 6px; }
.search { display: flex; align-items: center; gap: 10px; width: min(100%, 308px); min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.search .icon { opacity: .65; }
.search input { width: 100%; min-width: 0; padding: 9px 0; border: 0; background: transparent; }
.search input:focus { outline: 0; }
.search:focus-within { outline: 2px solid #518062; outline-offset: 2px; }
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { display: inline-flex; align-items: center; gap: 6px; min-height: 39px; padding: 5px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: .875rem; font-weight: 700; white-space: nowrap; }
.filter:hover { border-color: #98a890; }
.filter[aria-pressed="true"] { color: #fff; border-color: var(--green); background: var(--green); }
.filter[aria-pressed="true"] .icon { filter: invert(1); }
.result-count { color: var(--muted); font-size: .875rem; white-space: nowrap; }

.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.event-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.event-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.route-photo { position: relative; padding: 13px; aspect-ratio: 2.5; background: #314438 url("/images/routes.webp") no-repeat top center / 100% auto; }
.route-mountain { background-position: center; }
.route-city { background-position: bottom center; }
.date-tile { position: absolute; top: 13px; left: 13px; display: grid; place-items: center; width: 50px; min-height: 54px; padding: 5px; line-height: 1; border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.date-tile small { font-size: .75rem; font-weight: 750; }
.date-tile strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; width: fit-content; padding: 4px 9px; border-radius: 6px; font-weight: 750; font-size: .8125rem; line-height: 1.4; }
.photo-badge { position: absolute; right: 13px; top: 13px; box-shadow: var(--shadow); }
.badge-open { background: #e6f5ce; color: #274522; }
.badge-review, .status-pending { background: #fff1cd; color: #674019; }
.badge-neutral, .status-unreviewed { background: var(--shade); color: #425344; }
.status-approved, .status-attended { background: #e1f2db; color: #21522d; }
.status-canceled, .status-rejected, .status-no_show { background: #f9e6e0; color: #873627; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 17px 17px 16px; }
.card-context { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: .875rem; font-weight: 650; }
.card-context > span:first-child, .card-schedule, .run-metrics > span, .card-capacity > span, .stat > span { display: flex; align-items: center; gap: 6px; }
.card-context .icon, .card-schedule .icon, .card-capacity .icon, .stat .icon { opacity: .65; }
.category { padding: 2px 7px; border-radius: 5px; background: var(--shade); color: #3b5140; font-size: .8125rem; }
.event-card h3 { margin: 9px 0 7px; font-size: clamp(1.225rem, 2vw, 1.4rem); font-weight: 850; }
.event-card h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.card-schedule { color: var(--muted); font-size: .875rem; }
.run-metrics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 14px; font-size: .875rem; font-weight: 700; }
.run-metrics > span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }
.card-capacity { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.card-capacity b { color: var(--ink); }
.card-capacity b span { color: var(--muted); font-weight: 600; }
progress { display: block; width: 100%; height: 7px; overflow: hidden; appearance: none; border: 0; border-radius: 8px; background: #e9eee6; accent-color: #86a84e; }
progress::-webkit-progress-bar { background: #e9eee6; border-radius: 8px; }
progress::-webkit-progress-value { background: #86a84e; border-radius: 8px; }
progress::-moz-progress-bar { background: #86a84e; border-radius: 8px; }
.card-capacity > progress { grid-column: 1 / -1; }
.card-link { width: 100%; margin-top: 14px; }

.footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 20px 0 30px; margin-top: 48px; color: var(--muted); font-size: .875rem; }
.footer b { padding-left: 5px; font-size: .7rem; letter-spacing: .12em; }
.footer a:hover, .back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.page-heading, .inner-page { margin-top: 35px; }
.page-heading h1, .detail-body h1 { font-size: clamp(1.95rem, 4vw, 2.8rem); overflow-wrap: anywhere; letter-spacing: -.04em; }
.panel p, .list-title, .roster-row { overflow-wrap: anywhere; }
.empty { margin-top: 20px; padding: 44px 20px; text-align: center; }
.empty h2 { margin-top: 13px; font-size: 1.3rem; }
.empty p { color: var(--muted); margin-top: 6px; }
.empty .button { margin-top: 16px; }
.empty-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: #e8efd9; flex: 0 0 auto; }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.back-link { display: inline-block; color: var(--green); font-size: .9375rem; font-weight: 750; margin-bottom: 17px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; }
.stat > span { color: var(--muted); font-size: .875rem; }
.stat strong { display: block; margin-top: 4px; font-size: 1.9rem; }
.stats-note { font-size: .875rem; margin-top: 10px; }
.list-heading { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 10px; }
.list-heading span { color: var(--muted); }
.list-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 18px; }
.list-row + .list-row, .roster-row + .roster-row { border-top: 1px solid var(--line); }
.list-title { flex: 1; min-width: 190px; }
.list-title span { display: block; color: var(--muted); font-size: .875rem; }
.role-form { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.role-form .form-error { max-width: 18rem; }

.event-detail-grid { display: grid; grid-template-columns: minmax(0, 2.35fr) minmax(230px, 1fr); gap: 20px; align-items: start; }
.detail-panel { overflow: hidden; }
.detail-body { padding: 20px 24px 26px; }
.detail-body h1 { margin: 8px 0 18px; }
.detail-body h2 { font-size: 1.25rem; margin: 19px 0 6px; }
.detail-body p + p { margin-top: 8px; }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fact-grid > div { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: var(--shade); overflow-wrap: anywhere; }
.fact-grid small { display: block; font-size: .875rem; color: var(--muted); }
.pre-line { white-space: pre-line; }
.booking { padding: 18px; display: grid; gap: 13px; }
.booking > div:not(.booking-action) { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; }
.booking-count progress { grid-column: 1 / -1; margin: 5px 0; }
.booking-action { display: grid; gap: 9px; padding-top: 11px; border-top: 1px solid var(--line); }
.booking-action p, .check-in-action p { color: var(--muted); font-size: .9375rem; }
.manage-section { margin-top: 33px; }
.roster-row { padding: 16px 18px; display: grid; gap: 12px; }
.roster-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.roster-top h3 { font-size: 1.15rem; margin-bottom: 3px; }
.roster-row h4 { margin-bottom: 4px; }
.roster-stats { display: flex; flex-wrap: wrap; gap: 7px; }
.roster-stats span { padding: 4px 8px; border-radius: 7px; background: var(--shade); font-size: .875rem; }
.roster-stats b { margin-left: 3px; }
details { margin-top: 10px; }
summary { width: fit-content; color: var(--green); font-weight: 750; }
.history-list { list-style: none; padding: 0; margin: 8px 0 0; }
.history-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; }
.history-list li + li { border-top: 1px solid var(--line); }
.history-list small { display: block; color: var(--muted); }
.check-in-page { max-width: 520px; margin: 35px auto 0; }
.check-in-card { padding: 30px 20px; text-align: center; }
.check-in-card h1 { margin-top: 12px; }
.check-in-card h2 { margin: 9px 0 3px; font-size: 1.25rem; }
.check-in-action { margin-top: 16px; }
.check-in-action p { margin-top: 7px; }

dialog { width: min(100vw - 24px, 570px); max-height: 90dvh; padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 70px rgb(10 24 14 / 22%); }
dialog::backdrop { background: rgb(10 20 12 / 55%); }
.dialog-heading { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 1.3rem; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: var(--shade); }
.dialog-body { padding: 18px; }
.dialog-note { margin-bottom: 12px; }
.stack-form, .form-grid { display: grid; gap: 11px; }
.form-grid { grid-template-columns: 1fr 1fr; }
.stack-form label { display: grid; gap: 5px; align-content: start; font-size: .9375rem; font-weight: 750; min-width: 0; }
.stack-form label.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--green); }
.stack-form input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 42px; padding: 6px 9px; border: 1px solid #bac5b8; border-radius: 8px; background-color: var(--surface); color: var(--ink); }
select { appearance: none; padding-right: 31px; background: var(--surface) url("/icons/chevron-down.svg") right 8px center / 16px no-repeat; }
textarea { resize: vertical; }
.stack-form > .button { justify-self: start; }
.form-error { color: #983b2a; font-size: .875rem; }
.form-error:empty { display: none; }
.role-choices { display: grid; gap: 9px; }
.role-choice { width: 100%; display: flex; gap: 11px; align-items: center; text-align: left; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.role-choice:hover { background: var(--shade); }
.role-choice small { display: block; color: var(--muted); font-size: .875rem; }
.role-choices + .form-error { margin-top: 9px; }
.account-profile { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.qr-panel { display: grid; justify-items: center; gap: 8px; text-align: center; }
.qr-image { object-fit: contain; border: 1px solid var(--line); border-radius: 12px; }
.qr-expiry { font-weight: 750; }
.toast { position: fixed; z-index: 5; right: 18px; bottom: 18px; max-width: min(90vw, 23rem); padding: 10px 15px; color: #fff; border-radius: 8px; background: var(--green); font-weight: 750; box-shadow: var(--shadow); }

@media (max-width: 1050px) {
  .shell { width: min(100% - 48px, 1280px); }
  .site-nav { gap: 20px; }
  .header-inner { gap: 13px; }
  .event-grid { gap: 13px; }
  .card-body { padding-inline: 13px; }
}

@media (max-width: 800px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 0 12px; padding-top: 9px; }
  .header-actions { grid-row: 1; grid-column: 2; }
  .site-nav { grid-column: 1 / -1; min-height: 44px; overflow-x: auto; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { margin-top: 18px; min-height: 335px; background-position: 58% center; }
  .event-detail-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 550px) {
  .shell { width: calc(100% - 28px); }
  .brand { font-size: 1rem; gap: 6px; }
  .brand-icon { width: 34px; height: 34px; border-radius: 8px; }
  .brand-icon .icon { width: 20px; height: 20px; }
  .header-actions { gap: 2px; }
  .header-actions .button { min-height: 39px; padding-inline: 9px; font-size: .8125rem; }
  .header-actions .button .icon { width: 16px; height: 16px; }
  .profile-name { display: none; }
  .site-nav { gap: 17px; }
  .site-nav a { font-size: .875rem; }
  .hero { min-height: 340px; border-radius: 15px; background-position: 59% center; background-image: linear-gradient(90deg, rgb(8 19 12 / 82%), rgb(10 21 13 / 57%) 52%, rgb(11 22 13 / 10%)), url("/images/hero.webp"); }
  .hero-content { padding: 24px 18px; }
  .hero h1 { font-size: clamp(2.6rem, 11vw, 3.7rem); }
  .hero p { max-width: 16rem; }
  .hero-button { margin-top: 17px; }
  .events-section { margin-top: 25px; }
  .section-head { display: grid; align-items: start; justify-content: stretch; gap: 10px; }
  .section-head > .button { justify-self: start; }
  .search { width: 100%; }
  .filter-row { flex-wrap: wrap; gap: 6px; }
  .filter { padding-inline: 8px; }
  .result-count { flex: 1; text-align: right; }
  .event-grid { grid-template-columns: minmax(0, 1fr); }
  .event-card h3 { font-size: 1.32rem; }
  .footer { margin-top: 31px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .list-row { padding: 12px; gap: 8px; }
  .list-title { flex-basis: 100%; }
  .detail-body { padding: 14px; }
  .fact-grid > div { align-items: start; }
  .fact-grid > div:first-child, .fact-grid > div:nth-child(2) { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
