:root {
  color-scheme: light;
  --ink: #123f49;
  --muted: #47626a;
  --line: #cadcde;
  --surface: #f5f8f8;
  --teal: #07576a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/1.65 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button { font: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(27px, 4vw, 42px); line-height: 1.25; }
h2 { font-size: 22px; line-height: 1.35; }
a { color: var(--teal); text-underline-offset: .22em; }
:focus-visible { outline: 3px solid #a95300; outline-offset: 3px; }
.wrap { width: min(1100px, calc(100% - 2 * clamp(16px, 4vw, 40px))); margin-inline: auto; }
@supports (padding: max(0px)) {
  body { padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px); }
}
.site-header { background: white; border-bottom: 1px solid var(--line); }
.header-row, .app-brand, .app-nav, .ledger-links { display: flex; align-items: center; }
.header-row { justify-content: space-between; flex-wrap: wrap; gap: 0 16px; min-height: 62px; padding-block: 6px; }
.app-brand { gap: 9px; font-weight: 750; }
.app-brand img { border-radius: 8px; }
.app-nav { flex-wrap: wrap; gap: 0 16px; font-size: 14px; }
.app-nav a, .ledger-links a { display: inline-flex; align-items: center; min-height: 44px; }
.install-main { padding-block: clamp(20px, 4vw, 42px) max(26px, env(safe-area-inset-bottom, 0px)); }
.install-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(245px, 300px);
  grid-template-areas: "intro scan" "platforms scan" "links links";
  gap: 16px;
}
.browser-notice {
  margin-bottom: 16px;
  padding: 13px 17px;
  border: 1px solid #e1b94c;
  border-radius: 12px;
  background: #fff3cf;
  color: #654200;
  font-size: 15px;
}
.intro {
  grid-area: intro;
  padding: clamp(21px, 4vw, 36px);
  border-radius: 18px;
  color: white;
  background: linear-gradient(120deg, #123f49, #175967);
}
.intro p { margin-top: 8px; color: #ebf9f9; }
.intro .device-hint, .intro .installed { color: #a9f4ee; font-size: 14px; font-weight: 650; }
.platforms { grid-area: platforms; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { padding: clamp(16px, 2vw, 24px); border: 1px solid var(--line); border-radius: 16px; background: white; }
.small { color: var(--muted); font-size: 14px; }
.platform { min-width: 0; }
.platform h2 { margin-bottom: 12px; }
.button {
  display: flex;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  column-gap: .45em;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--ink); color: white; }
.button-primary span { font-size: .88em; color: #adf3ee; }
.button-muted { background: #ecf6f5; color: var(--teal); border-color: #bcd7d8; }
.button[aria-disabled="true"], .button:disabled { color: var(--muted); background: #f2f5f5; border-color: var(--line); cursor: default; }
@media (hover: hover) {
  .button:not([aria-disabled="true"], :disabled):hover { text-decoration: underline; }
}
details { margin-top: 7px; }
summary { min-height: 44px; padding: 10px 0; color: var(--teal); font-size: 14px; cursor: pointer; }
.steps { display: grid; gap: 8px; margin: 4px 0 12px; padding-inline-start: 1.4em; font-size: 14px; }
.steps span { display: block; color: var(--muted); }
.apple-steps { list-style: none; padding: 0; gap: 10px; }
.apple-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; }
.apple-steps svg { width: 30px; height: 30px; padding: 4px; border-radius: 7px; color: var(--teal); background: #ecf6f5; }
.apk-option { padding-top: 12px; border-top: 1px solid var(--line); }
.apk-option .small { margin-top: 5px; }
#copy-url { margin-top: 12px; }
.copy-status:not(:empty) { margin-top: 6px; }
.scan-card { grid-area: scan; align-self: start; text-align: center; }
.scan-card .small { margin-top: 3px; }
.qr-code { width: min(100%, 224px); margin: 12px auto 4px; }
.qr-code svg { display: block; width: 100%; height: auto; }
.install-url { display: inline-block; font-size: 14px; overflow-wrap: anywhere; }
#print-qr { margin-top: 12px; }
.ledger-links { grid-area: links; flex-wrap: wrap; gap: 0 20px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 650; }
.ledger-links a { gap: 6px; }
.print-only { display: none; }

@media (max-width: 850px) {
  .install-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "platforms" "scan" "links"; }
}
@media (max-width: 600px) {
  .install-layout, .platforms { gap: 12px; }
  .platforms { grid-template-columns: minmax(0, 1fr); }
}
@page { size: A4 portrait; margin: 18mm; }
@media print {
  body { padding: 0; color: black; background: white; }
  .site-header, .browser-notice, .intro, .platforms, .ledger-links, .screen-only { display: none !important; }
  .print-only { display: block; }
  .install-main { width: 100%; padding: 0; }
  .install-layout { display: block; }
  .scan-card { width: min(100%, 156mm); margin: 0 auto; padding: 12mm; border: 1px solid #222; border-radius: 4mm; break-inside: avoid; }
  .poster-name { font-size: 23pt; font-weight: 750; margin-bottom: 3mm; }
  .scan-card h2 { font-size: 15pt; }
  .qr-code { width: min(100%, 68mm); margin-block: 4mm 2mm; }
  .install-url { color: black; font-size: 13pt; text-decoration: none; }
  .poster-instruction { margin-top: 2mm; font-size: 11pt; }
}
