:root {
  color-scheme: dark;
  font-family: "Montserrat", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  background: #011349;
  --muted: #aeb7dc;
  --gold: #cec190;
  --gold-gradient: linear-gradient(90deg, #d3d3d3, #cec190 70%);
  --panel: #163285;
  --active: #1e4599;
  --border: rgba(206, 193, 144, .5);
  --radius: 8px;
  --page-width: 768px;
  --gutter: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
[v-cloak] { display: none; }
body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.55;
  background:
    radial-gradient(120% 60% at 50% 100%, rgba(120, 170, 255, .22), transparent 60%),
    linear-gradient(170deg, #011349, #16357c 48%, #0a1f52);
  background-attachment: fixed;
}
h1, h2, h3, h4, p { margin: 0; }
button, input { font: inherit; }
button { border: 0; background: transparent; color: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.login, .portal { width: 100%; max-width: var(--page-width); margin: 0 auto; }
.login {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) var(--gutter) calc(20px + env(safe-area-inset-bottom));
}
.login-header, .portal-header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.summit-logo { width: min(185px, 49%); height: auto; flex: none; }
.header-button { color: var(--gold); border-radius: var(--radius); min-height: 36px; padding: 2px 7px; flex: none; }
.header-button:hover, .keyboard-toggle:hover { background: rgba(255, 255, 255, .08); }
.access { margin-top: 76px; }
.access h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  max-width: 22ch;
  color: var(--gold);
  background: var(--gold-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.access-intro { margin-top: 12px; font-size: 1.125rem; line-height: 1.3; }
.code-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  position: relative;
}
.code-grid input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  outline: none;
}
.code-grid input::selection { background: transparent; }
.code-grid input::-ms-reveal { display: none; }
.code-cell {
  display: grid;
  place-items: center;
  pointer-events: none;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .08);
  font-size: 1.25rem;
}
.code-cell.filled { border-color: var(--border); }
.code-cell.current, .code-grid:focus-within .code-cell:last-child.filled {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(206, 193, 144, .20);
}
.code-error .code-cell { border-color: #ff9d91; }
.access-feedback {
  min-height: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 3px;
}
.form-error { flex: 1; color: #ffada3; font-size: .875rem; padding-top: 7px; }
.keyboard-toggle {
  flex: none;
  color: var(--muted);
  min-height: 32px;
  padding: 3px 7px;
  border-radius: var(--radius);
  font-size: .8125rem;
}
.gold-button, .call-links a {
  color: #011349;
  background: var(--gold-gradient);
  border-radius: var(--radius);
  font-weight: 650;
}
.submit { width: 100%; min-height: 52px; padding: 10px 12px; }
.submit:disabled { color: #b2bddc; background: rgba(255, 255, 255, .09); cursor: default; }
.submit:disabled[aria-busy="true"] { cursor: wait; }
.gold-button:not(:disabled):hover, .call-links a:hover { filter: brightness(1.06); }

.portal {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.portal-header {
  flex: none;
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px;
  border-bottom: 1px solid rgba(206, 193, 144, .15);
}
.portal-actions { min-width: 0; display: flex; align-items: center; gap: 2px; }
.attendee { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sign-out { display: grid; place-items: center; width: 32px; }
.date-bar {
  display: flex;
  margin-top: 12px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.date-bar::-webkit-scrollbar { display: none; }
.date-button {
  flex: 0 0 56px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
}
.date-button strong { font-size: .9375rem; font-variant-numeric: tabular-nums; }
.date-button span { font-size: .75rem; }
.date-button[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(160deg, var(--active), var(--panel));
  color: #fff;
}
.date-button[aria-pressed="true"] strong { color: var(--gold); }
.date-button:focus-visible { outline-offset: -3px; }
.date-dot { width: 4px; height: 4px; border-radius: 50%; margin-top: 2px; }
.date-button[aria-current="date"] .date-dot { background: #ffe240; }

.portal-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 12px var(--gutter);
  scrollbar-width: none;
}
.portal-main::-webkit-scrollbar, .dialog-body::-webkit-scrollbar { display: none; }
.portal-main:focus { outline: none; }
.schedule-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 15px 0 14px;
}
.schedule-heading h1 { font-size: 1rem; }
.schedule-heading span { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.empty { padding: 16px 0; color: var(--muted); }
.timeline { position: relative; list-style: none; margin: 0 0 8px; padding: 0 0 0 20px; }
.timeline::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: linear-gradient(var(--gold), rgba(206, 193, 144, .22));
}
.timeline-entry { position: relative; margin-bottom: 14px; }
.timeline-entry::before {
  content: "";
  position: absolute;
  top: 10px;
  left: -19px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(206, 193, 144, .20);
}
.stop-time { font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.stop-content {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow-wrap: anywhere;
}
.stop-content h2 { font-size: 1rem; }
.stop-location { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); margin-top: 4px; }
.stop-location svg, .notice svg { margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  display: inline-block;
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 10px;
  color: #011349;
  background: var(--gold);
  font-size: .8125rem;
  font-weight: 650;
}
.stop-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .07);
  color: #e8d9a9;
  font-size: .875rem;
}
.stop-note, .stop-location, .notice, .assignment-detail, .route-detail p, .group-card p, .help-card p { white-space: pre-line; }

.assignment-card {
  padding: 14px 16px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--panel), var(--active));
  overflow-wrap: anywhere;
}
.assignment-card h2 { font-size: .8125rem; font-weight: 500; color: var(--gold); }
.assignment-identity { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.assignment-name { font-size: 1.125rem; font-weight: 650; }
.assignment-detail { font-size: .875rem; color: var(--muted); }
.assignment-card > .assignment-detail { margin-top: 8px; }
.group-badge {
  flex: none;
  min-width: 36px;
  padding: 6px;
  border-radius: 10px;
  color: #011349;
  background: var(--gold);
  font-weight: 650;
  text-align: center;
}
.group-badge[data-group="A1"], .group-badge[data-group="H4"] { background: #976fb9; color: #fff; }
.group-badge[data-group="A2"], .group-badge[data-group="H3"] { background: #c58d73; }
.group-badge[data-group="B1"], .group-badge[data-group="H6"] { background: #edbec7; }
.group-badge[data-group="B2"], .group-badge[data-group="H5"] { background: #a0c4eb; }
.group-badge[data-group="C1"], .group-badge[data-group="H1"] { background: #e34d5a; color: #011349; }
.group-badge[data-group="C2"], .group-badge[data-group="H2"] { background: #4f817e; color: #fff; }
.group-badge[data-group="C3"], .group-badge[data-group="H7"] { background: #f4d778; }
.group-action {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, .40);
  border-radius: var(--radius);
  font-size: .875rem;
}
.group-action:hover { background: rgba(255, 255, 255, .08); }
.group-contacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.contact { flex: 1 1 140px; min-width: 0; }
.contact > span:first-child { color: var(--muted); font-size: .75rem; }
.call-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .875rem; }
.call-links a {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 10px;
  text-decoration: none;
}
.call-links a::before {
  content: "";
  flex: 0 0 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("/assets/ic-phone.svg") center / contain no-repeat;
  mask: url("/assets/ic-phone.svg") center / contain no-repeat;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 196, 64, .14);
  color: #ffe9b8;
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.help-heading { font-size: 1.5rem; margin: 16px 0 14px; }
.help-list { display: grid; gap: 16px; }
.help-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--panel);
  overflow-wrap: anywhere;
}
.help-card h2 { font-size: 1.25rem; font-weight: 550; }
.help-card p { font-size: .9375rem; }
.help-images { display: grid; gap: 8px; }
.image-link { display: block; overflow: hidden; border-radius: 4px; cursor: zoom-in; }
.image-link img { width: 100%; height: auto; }

.bottom-nav {
  display: flex;
  flex: none;
  gap: 8px;
  padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav button {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--muted);
  border-radius: 999px;
}
.bottom-nav button[aria-pressed="true"] { background: var(--panel); color: var(--gold); }
.bottom-nav img { width: 16px; height: 16px; object-fit: contain; }

.groups-dialog {
  width: min(400px, calc(100% - 48px));
  max-height: 80vh;
  max-height: 80dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(160deg, var(--panel), #0a1f52);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}
.groups-dialog::backdrop, .image-dialog::backdrop { background: rgba(0, 0, 0, .70); backdrop-filter: blur(4px); }
.dialog-content { display: flex; flex-direction: column; max-height: inherit; }
.dialog-header {
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(206, 193, 144, .20);
}
.dialog-header h2 { color: var(--gold); font-size: 1rem; }
.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 50%;
  color: var(--muted);
}
.icon-button:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.dialog-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px 16px; scrollbar-width: none; }
.route-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.route-buttons button {
  flex: 1 1 80px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 24px;
  color: var(--muted);
  font-size: .875rem;
}
.route-buttons button[aria-pressed="true"] { color: #fff; border-color: var(--gold); background: var(--active); }
.route-detail, .group-card {
  border: 1px solid rgba(206, 193, 144, .30);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(22, 50, 133, .36);
  overflow-wrap: anywhere;
}
.route-detail h3, .group-card h3 { font-size: 1rem; }
.route-detail h3 { color: var(--gold); }
.route-detail p, .group-card p { margin-top: 5px; font-size: .875rem; color: var(--muted); }
.route-detail h4 { margin-top: 8px; font-size: .875rem; }
.segments { margin: 3px 0 0; padding-left: 22px; font-size: .875rem; }
.route-groups { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.route-detail + .route-groups { margin-top: 12px; }
.group-card.my-group { border-color: var(--gold); }
.group-card-heading { display: flex; align-items: center; gap: 10px; }
.route-images { margin-bottom: 10px; }

.image-dialog {
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  border: 0;
  padding: 44px 0 0;
  color: #fff;
  background: transparent;
}
.image-dialog .icon-button { position: absolute; top: 3px; right: 3px; }
.image-dialog img { max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); width: auto; margin: auto; object-fit: contain; }

@media (max-width: 360px) {
  .access h1 { font-size: 1.75rem; }
  .code-grid { gap: 6px; }
  .attendee { font-size: .875rem; }
}
