:root {
  color-scheme: light;
  --page: #f3f6f7;
  --surface: #ffffff;
  --ink: #10253a;
  --muted: #617386;
  --line: #d4dfe5;
  --teal: #00717a;
  --teal-dark: #005860;
  --teal-soft: #e8f5f4;
  --green: #137a45;
  --green-soft: #edf8f2;
  --amber: #9a5b00;
  --amber-soft: #fff5e2;
  --red: #bc3030;
  --red-soft: #fff0f0;
  --surface-muted: #edf1f3;
  --field: #ffffff;
  --shadow: rgba(16, 37, 58, .12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f171f;
  --surface: #17232d;
  --ink: #edf4f7;
  --muted: #a8b7c2;
  --line: #334550;
  --teal: #55c7cc;
  --teal-dark: #7dd9dd;
  --teal-soft: #173b40;
  --green: #69d29a;
  --green-soft: #18372a;
  --amber: #f2bd63;
  --amber-soft: #3d2f18;
  --red: #ff8b8b;
  --red-soft: #422326;
  --surface-muted: #202e38;
  --field: #111c25;
  --shadow: rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
  transition: background-color .16s ease, color .16s ease;
}

button,
input { font: inherit; letter-spacing: 0; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

.preference-controls { display: inline-flex; align-items: center; gap: 7px; }
.preference-control {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 14px var(--shadow);
}
.preference-control.language { width: 52px; border-radius: 20px; }
.preference-control svg { width: 18px; height: 18px; stroke-width: 2; }
.preference-control span { font-size: 11px; font-weight: 900; line-height: 1; }
.preference-control:hover,
.preference-control:focus-visible { border-color: var(--teal); color: var(--teal-dark); outline: 3px solid rgba(0, 113, 122, .16); }
:root:not([data-theme="dark"]) .theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon { display: none; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header-inner,
main,
.site-footer {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.identity-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
}

.identity-mark img { display: block; width: 38px; height: 38px; }

.identity strong,
.identity small { display: block; }
.identity strong { font-size: 14px; }
.identity small { color: var(--muted); font-size: 11px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}

.site-switch {
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 6px 14px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.site-switch:hover,
.site-switch:focus-visible {
  color: var(--ink);
  outline: 2px solid rgba(0, 113, 122, .18);
  outline-offset: -2px;
}

.site-switch.is-active {
  background: var(--surface);
  color: var(--teal-dark);
  box-shadow: 0 1px 4px rgba(16, 37, 58, .12);
}

.header-link,
.site-footer a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.header-link:hover,
.header-link:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible { text-decoration: underline; outline: none; }

.invite-only,
.account-status {
  border: 1px solid #9fcfba;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

main { padding: 52px 0 64px; }

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 56px;
  align-items: start;
}

.entry-copy { padding-top: 12px; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.25;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

h3 {
  margin: 0;
  font-size: 16px;
}

.lead {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.lead.compact { max-width: 650px; font-size: 15px; }

.entry-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 34px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.entry-facts div { padding: 17px 16px 17px 0; }
.entry-facts div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.entry-facts dt { font-weight: 800; }
.entry-facts dd { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.access-tool {
  min-height: 300px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 37, 58, .07);
}

.access-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.access-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.access-index {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

#access-form { margin-top: 20px; }
#access-form label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }

#access-code {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #aebdc7;
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  text-transform: uppercase;
}

#access-code:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(0, 113, 122, .12);
}

.primary-command,
.outline-command,
.quiet-command {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 800;
}

.primary-command {
  padding: 8px 15px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-command:hover:not(:disabled),
.primary-command:focus-visible { background: var(--teal-dark); outline: none; }

#access-form .primary-command { width: 100%; margin-top: 12px; }

.outline-command {
  padding: 8px 14px;
  border: 1px solid var(--teal);
  background: var(--surface);
  color: var(--teal);
}

.outline-command:hover:not(:disabled),
.outline-command:focus-visible { background: var(--teal-soft); outline: none; }

.quiet-command {
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.quiet-command:hover,
.quiet-command:focus-visible { border-color: #91a4b1; outline: none; }

.access-message { margin-top: 20px; padding: 14px; background: var(--surface-muted); border-left: 3px solid var(--teal); }
.access-message p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.form-error { min-height: 24px; margin: 9px 0 0; color: var(--red); font-size: 13px; }

.flow-section,
.public-rules {
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.public-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.public-flow li { min-height: 118px; padding: 0 22px 0 0; }
.public-flow li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.public-flow span { color: var(--teal); font-size: 12px; font-weight: 800; }
.public-flow strong,
.public-flow small { display: block; }
.public-flow strong { margin-top: 8px; }
.public-flow small { margin-top: 3px; color: var(--muted); }

.public-rules {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 54px;
}

.public-rules ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  margin: 0;
  padding-left: 20px;
}

.portal-heading {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.portal-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.portal-tabs {
  display: flex;
  gap: 3px;
  margin: 20px 0 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #e9eef1;
  overflow-x: auto;
}

.portal-tabs button {
  min-width: 112px;
  min-height: 40px;
  flex: 1 0 auto;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.portal-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(16, 37, 58, .11);
}

.tab-panel { min-height: 430px; }

.dashboard-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 9px 14px;
  border: 1px solid #bddbd3;
  border-radius: 6px;
  background: var(--green-soft);
}

.dashboard-notice > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-notice p { margin: 0; color: #2d6247; font-size: 13px; }
.dashboard-notice a,
.section-text-link { color: var(--teal); font-size: 13px; font-weight: 800; text-decoration: none; }
.dashboard-notice a:hover,
.dashboard-notice a:focus-visible,
.section-text-link:hover,
.section-text-link:focus-visible { color: var(--teal-dark); text-decoration: underline; outline: none; }

.dashboard-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dashboard-summary-copy p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.dashboard-summary .primary-command { flex: 0 0 auto; }

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
}

.dashboard-stats > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 11px;
  min-height: 86px;
  align-content: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-mark {
  display: grid;
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
}

.calendar-mark { background: #edf3fb; color: #275c9a; }
.payment-mark { background: var(--amber-soft); color: var(--amber); font-size: 18px; }
.config-mark { background: var(--green-soft); color: var(--green); }
.dashboard-stats dt { color: var(--muted); font-size: 11px; }
.dashboard-stats dd { margin: 1px 0 0; font-size: 13px; font-weight: 800; }

.device-section,
.progress-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }

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

.device-grid > a {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.device-grid > a:hover,
.device-grid > a:focus-visible {
  border-color: #8db9bd;
  box-shadow: 0 8px 20px rgba(16, 37, 58, .08);
  outline: none;
  transform: translateY(-2px);
}

.device-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #edf3fb;
  color: #1769aa;
  font-size: 14px;
  font-weight: 900;
}

.android-mark { background: #edf8f2; color: var(--green); }
.ios-mark { background: #f1f2f4; color: #46515d; font-size: 11px; }
.device-grid strong,
.device-grid small { display: block; }
.device-grid small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.device-grid b { align-self: start; padding: 3px 7px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 10px; }

.section-heading { margin-bottom: 22px; }
.inline-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.progress-count { color: var(--teal); font-size: 18px; }

.account-flow {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.account-flow li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.account-flow li > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.account-flow strong,
.account-flow small { display: block; }
.account-flow small { margin-top: 2px; color: var(--muted); }
.account-flow b { color: var(--muted); font-size: 13px; }
.account-flow li.done > span { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.account-flow li.done b { color: var(--green); }
.account-flow li.current > span { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.account-flow li.current b { color: var(--teal); }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.rules-grid article {
  min-height: 174px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .48);
}

.rules-grid article > span { color: var(--teal); font-size: 11px; font-weight: 800; }
.rules-grid h3 { margin-top: 8px; }
.rules-grid p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.agreement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 18px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.agreement label { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; }
.agreement input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--teal); }
.accepted-notice { margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--green); background: var(--green-soft); color: var(--green); font-weight: 700; }

.locked-message {
  padding: 16px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
  color: #69420c;
}

.file-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.subscription-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--line);
}

.subscription-details { min-width: 0; }
.subscription-details strong,
.subscription-details small { display: block; }
.subscription-details small { margin-top: 2px; color: var(--muted); }
.subscription-details code {
  display: block;
  max-width: 100%;
  margin-top: 9px;
  overflow: hidden;
  color: var(--teal-dark);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.file-type {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.file-row strong,
.file-row small { display: block; }
.file-row small { margin-top: 2px; color: var(--muted); }

.config-notes { margin-top: 20px; }
.config-notes p { margin: 8px 0; color: var(--muted); }
.config-notes strong { color: var(--ink); }

.tutorial-jump {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  margin-top: 18px;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.tutorial-jump:hover,
.tutorial-jump:focus-visible { color: var(--teal-dark); outline: none; text-decoration: underline; }

.online-tutorial {
  margin-top: 38px;
  scroll-margin-top: 20px;
  border-top: 1px solid var(--line);
}

.tutorial-heading {
  padding: 28px 0 8px;
}

.tutorial-heading > p:last-child {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.tutorial-step {
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr);
  gap: 36px;
  align-items: center;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.tutorial-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.tutorial-copy h3 { margin-top: 12px; font-size: 19px; }
.tutorial-copy > p { margin: 8px 0 0; color: var(--muted); }
.tutorial-copy > p strong { color: var(--ink); }

.marker-legend {
  display: grid;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.marker-legend li { display: flex; align-items: center; gap: 8px; }
.marker-legend span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.marker-legend .warning span { background: var(--amber); }

.annotated-shot {
  position: relative;
  width: 100%;
  margin: 0;
  border: 1px solid #b8c8d1;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 37, 58, .08);
  overflow: hidden;
}

.annotated-shot img { display: block; width: 100%; height: auto; }

.shot-marker {
  position: absolute;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 37, 58, .34);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.marker-warning { background: var(--amber); }
.shot-import .marker-1 { left: 7%; top: 16%; }
.shot-import .marker-2 { left: 26%; top: 84%; }
.shot-import .marker-3 { left: 89%; top: 95%; }
.shot-network .marker-1 { left: 32%; top: 38%; }
.shot-network .marker-2 { left: 68%; top: 38%; }
.shot-network .marker-3 { left: 89%; top: 78%; }
.shot-rule .marker-1 { left: 34%; top: 46%; }
.shot-node .marker-1 { left: 49%; top: 51%; }
.shot-node .marker-2 { left: 49%; top: 68%; }
.shot-node .marker-warning { left: 73%; top: 11%; }
.shot-site .marker-1 { left: 38%; top: 52%; }

.tutorial-warning,
.recovery-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.recovery-note { border-left-color: var(--teal); background: var(--teal-soft); }
.tutorial-warning strong,
.recovery-note strong { font-size: 13px; }
.tutorial-warning p,
.recovery-note p { margin: 3px 0 0; color: #69420c; font-size: 13px; }
.recovery-note p { color: var(--teal-dark); }

.tutorial-boundary {
  margin-top: 12px;
  padding: 18px 20px;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
}

.tutorial-boundary p { margin: 4px 0 0; color: #2d6247; }

.payment-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 170px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.payment-state h3 { margin-top: 8px; font-size: 20px; }
.payment-state p { max-width: 680px; margin: 5px 0 0; color: var(--muted); }
.payment-label { color: var(--amber); font-size: 12px; font-weight: 800; }
.payment-label.paid { color: var(--green); }
.payment-footnote { color: var(--muted); font-size: 13px; }

.modal-open { overflow: hidden; }

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 37, 58, .58);
}

.payment-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  grid-template-rows: auto auto auto auto 1fr auto auto;
  column-gap: 28px;
  align-items: start;
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 37, 58, .3);
}

.payment-dialog > .eyebrow { grid-column: 1; grid-row: 1; }
.payment-dialog > h2 { grid-column: 1; grid-row: 2; }
.payment-dialog-copy { grid-column: 1; grid-row: 3; }
.payment-amount-row { grid-column: 1; grid-row: 4; }
.payment-reference { grid-column: 1; grid-row: 5; align-self: end; }
.payment-submit-button { grid-column: 1; grid-row: 6; width: 100%; margin-top: 14px; }
.payment-dialog-footnote { grid-column: 1; grid-row: 7; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover,
.modal-close:focus-visible { border-color: var(--teal); color: var(--teal); outline: none; }
.payment-dialog-copy { margin: 8px 38px 0 0; color: var(--muted); font-size: 14px; }

.payment-amount-row,
.payment-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.payment-amount-row span,
.payment-reference span { color: var(--muted); font-size: 13px; }
.payment-amount-row strong { color: var(--red); font-size: 22px; }

.payment-qr-frame {
  display: grid;
  grid-column: 2;
  grid-row: 1 / 8;
  width: 100%;
  min-height: 320px;
  place-items: center;
  align-self: center;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  overflow: hidden;
}

.payment-qr-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  background: #fff;
}
.payment-qr-placeholder { max-width: 220px; padding: 20px; color: var(--muted); text-align: center; }
.payment-reference { margin-top: 14px; }
.payment-reference strong { font-family: Consolas, "Courier New", monospace; }
.payment-dialog-footnote { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.payment-success-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 37, 58, .62);
}

.payment-success-dialog {
  width: min(440px, 100%);
  padding: 34px 30px 30px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 37, 58, .32);
  text-align: center;
}

.payment-success-dialog:focus { outline: none; }
.success-check {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin: 0 auto 18px;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 34px;
  font-weight: 800;
}

.payment-success-dialog .eyebrow { margin-bottom: 6px; }
.payment-success-dialog > p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); }
.success-countdown { display: block; margin-top: 20px; color: var(--green); font-size: 13px; }
.success-progress {
  display: block;
  height: 4px;
  margin-top: 13px;
  background: var(--line);
  overflow: hidden;
}

.success-progress::after {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--green);
  content: "";
  transform-origin: left;
  animation: payment-success-progress 8s linear forwards;
}

@keyframes payment-success-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 32px));
  padding: 12px 15px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 28px rgba(16, 37, 58, .2);
  font-size: 14px;
}

@media (max-width: 820px) {
  .entry-layout,
  .public-rules,
  .tutorial-step { grid-template-columns: 1fr; }
  .entry-layout { gap: 34px; }
  .entry-facts { grid-template-columns: 1fr; }
  .entry-facts div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .public-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .public-flow li:nth-child(3) { padding-left: 0; border-left: 0; }
  .public-rules { gap: 24px; }
  .rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-grid { grid-template-columns: 1fr; }
  .payment-dialog {
    display: block;
    width: min(430px, 100%);
  }
  .payment-qr-frame {
    width: min(320px, 100%);
    min-height: 0;
    margin: 18px auto 0;
  }
  .payment-qr-frame img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(52vh, 520px);
  }
}

@media (max-width: 640px) {
  .site-header-inner { min-height: 0; align-items: stretch; flex-direction: column; padding: 12px 0; }
  .header-actions { width: 100%; gap: 8px; }
  .site-switcher { min-width: 0; flex: 1 1 auto; }
  .site-switch { min-height: 36px; padding-inline: 5px; font-size: 12px; }
  .invite-only { flex: 0 0 auto; }
  .identity { align-self: flex-start; }
  .site-header-inner,
  main,
  .site-footer { width: min(100% - 24px, 1080px); }
  main { padding-top: 30px; }
  h1 { font-size: 29px; }
  .lead { font-size: 15px; }
  .entry-layout { display: flex; flex-direction: column; }
  .access-tool { width: 100%; min-height: 0; padding: 18px; }
  .public-flow,
  .public-rules ul,
  .rules-grid { grid-template-columns: 1fr; }
  .public-flow li,
  .public-flow li + li,
  .public-flow li:nth-child(3) { min-height: 92px; padding: 14px 0; border-top: 1px solid var(--line); border-left: 0; }
  .portal-heading,
  .payment-state,
  .agreement,
  .dashboard-summary { align-items: stretch; flex-direction: column; }
  .portal-actions { align-items: center; }
  .portal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 26px;
    overflow: visible;
  }
  .portal-tabs button { min-width: 0; }
  .account-flow li { grid-template-columns: 38px minmax(0, 1fr); padding: 12px 0; }
  .account-flow li b { grid-column: 2; }
  .dashboard-notice { grid-template-columns: auto minmax(0, 1fr); }
  .dashboard-notice a { grid-column: 2; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 48px minmax(0, 1fr); }
  .file-row .outline-command { grid-column: 2; justify-self: start; }
  .subscription-row { grid-template-columns: 48px minmax(0, 1fr); }
  .subscription-row .primary-command { grid-column: 2; justify-self: start; }
  .tutorial-step { gap: 22px; padding: 28px 0; }
  .tutorial-copy h3 { font-size: 18px; }
  .shot-marker { width: 27px; height: 27px; }
  .payment-dialog { padding: 22px 18px; }
  .payment-success-dialog { padding: 28px 20px 24px; }
  .site-footer { display: block; }
  .site-footer span { display: block; }
}

/* v2 official site shell */
.site-header {
  border-bottom: 0;
  background: var(--page);
}

.site-header-inner,
main,
.site-footer { width: min(1120px, calc(100% - 40px)); }

.site-header-inner { min-height: 88px; }
.site-switcher {
  min-width: 238px;
  padding: 4px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(16, 37, 58, .08);
}
.site-switch { min-height: 40px; }
.site-switch.is-active { background: var(--teal-soft); box-shadow: none; }

.invitation-view {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr);
  gap: 56px;
  align-items: center;
  min-height: 570px;
  padding: 48px 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.invitation-copy h1 { font-size: 44px; }
.invitation-copy .lead { max-width: 650px; }
.invitation-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 38px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.invitation-facts div { padding: 17px 16px 17px 0; }
.invitation-facts div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.invitation-facts dt { font-size: 13px; font-weight: 800; }
.invitation-facts dd { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.invitation-view .access-tool { box-shadow: none; }

.dashboard-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.dashboard-welcome h1 { font-size: 25px; }
.dashboard-welcome p:last-child { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-notice { margin-top: 18px; }

.service-panel {
  margin-top: 18px;
  padding: 22px 24px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.service-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.service-heading h2 { font-size: 20px; }
.service-next { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.service-panel .portal-tabs { margin: 18px -24px 0; padding: 0 24px; border-width: 1px 0 0; border-radius: 0; background: var(--surface-muted); overflow-x: auto; }
.service-panel .portal-tabs button { min-height: 47px; border-radius: 0; box-shadow: none; }
.service-panel .portal-tabs button[aria-selected="true"] { color: var(--teal-dark); box-shadow: inset 0 -3px var(--teal); }

#tab-overview { min-height: 0; }
.dashboard-stats { margin-top: 14px; }
.dashboard-stats > div { min-height: 92px; }
.device-section { margin-top: 20px; padding: 22px 24px 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.device-section .section-heading { margin-bottom: 16px; }
.device-section h2 { font-size: 19px; }

.content-panel {
  min-height: 0;
  margin-top: 14px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.rules-grid article { background: var(--surface-muted); }
.tutorial-jump { display: inline-flex; margin-top: 20px; }

@media (max-width: 820px) {
  .invitation-view { grid-template-columns: 1fr; min-height: 0; padding: 36px; }
  .dashboard-welcome { align-items: flex-start; }
}

@media (max-width: 640px) {
  .site-header-inner,
  main,
  .site-footer { width: min(100% - 24px, 1120px); }
  .site-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 0;
  }
  .identity { align-self: center; }
  .invite-only { grid-column: 2; grid-row: 1; align-self: center; justify-self: end; }
  .site-switcher { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; }
  .invitation-view { gap: 30px; padding: 26px 18px; }
  .invitation-copy h1 { font-size: 34px; }
  .invitation-facts { grid-template-columns: 1fr; }
  .invitation-facts div { padding: 13px 0; }
  .invitation-facts div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .dashboard-welcome { align-items: stretch; flex-direction: column; padding: 18px; }
  .dashboard-welcome .portal-actions { justify-content: space-between; }
  .dashboard-notice { grid-template-columns: auto minmax(0, 1fr); }
  .dashboard-notice a { grid-column: 2; }
  .service-panel { padding: 18px 16px 0; }
  .service-heading { align-items: stretch; flex-direction: column; }
  .service-heading .primary-command { width: 100%; }
  .service-panel .portal-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px -16px 0; padding: 0 16px; }
  .service-panel .portal-tabs button { min-height: 44px; }
  .device-section { padding: 18px; }
  .content-panel { padding: 22px 18px; }
}
