:root { color-scheme: dark; font-family: system-ui, sans-serif; --bg: #0a0a0a; --panel: #131313; --line: #333; --ink: #f5f5f5; --muted: #b7b7b7; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.bar {
  position: sticky; z-index: 3; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 66px; padding: 10px max(20px, calc((100% - 1220px) / 2));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none; font-weight: 850; letter-spacing: .12em; }
.brand::before { content: ""; width: 29px; height: 29px; background: url(/apex-mark.svg) center / contain no-repeat; }
.brand span { font-size: .7rem; letter-spacing: .14em; }
.solid, .outline {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 8px 15px; border: 1px solid #8a8a8a; border-radius: 3px;
  font-size: .88rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.solid { background: #fff; border-color: #fff; color: #111; }
.outline { background: transparent; color: var(--ink); }
main { max-width: 1260px; margin: auto; padding: 28px 20px 50px; }
.kicker { margin: 0; font-size: .75rem; font-weight: 750; letter-spacing: .16em; }
.intro h1 { margin: 7px 0 5px; font: 700 clamp(1.8rem, 4vw, 3rem)/1.08 Georgia, serif; }
.intro h1 br { display: none; }
.intro h1 br::after { content: ' '; }
.intro .artists, .intro .notice { margin: 4px 0; }
.intro .notice { color: #4b4b4b; font-size: .87rem; }
.agreement-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 338px); gap: 22px; align-items: start; }
.reader { min-width: 0; border: 1px solid var(--line); background: #1a1a1a; }
.reader-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px 7px 15px; background: #121212; border-bottom: 1px solid var(--line);
}
.reader-tools { display: flex; align-items: center; gap: 5px; }
.reader-toolbar a, .reader-toolbar button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 5px 9px; border: 1px solid transparent; border-radius: 3px; background: transparent;
  color: #fafafa; font-size: .85rem; white-space: nowrap;
}
.reader-toolbar a { text-decoration: none; border-color: #505050; }
.reader-toolbar button:hover:not(:disabled), .reader-toolbar a:hover { background: #292929; }
.page-indicator { min-width: 48px; text-align: center; font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reader-pages { max-height: calc(100dvh - 155px); overflow: auto; padding: 21px; }
.paper {
  min-height: min(1000px, 105vw); max-width: 760px; margin: 0 auto 18px;
  display: flex; flex-direction: column; padding: clamp(23px, 4vw, 50px);
  color-scheme: light; background: white; color: #151515;
  box-shadow: 0 3px 13px #0003; scroll-margin-top: 10px;
  font: 1.035rem/1.58 Georgia, serif;
}
.paper:last-child { margin-bottom: 0; }
.paper-meta, .paper-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 700 .7rem/1.3 system-ui, sans-serif; letter-spacing: .09em; color: #363636;
}
.paper-meta { border-bottom: 1px solid #bdbdbd; padding-bottom: 13px; margin-bottom: 21px; }
.paper-footer { margin-top: auto; padding-top: 17px; border-top: 1px solid #bdbdbd; }
.paper h2 { font: 750 1.02rem/1.3 system-ui, sans-serif; margin: 20px 0 8px; }
.paper p { margin: 0 0 12px; }
.paper p:last-child { margin-bottom: 18px; }
.paper .intro { margin-bottom: 18px; }
.paper .summary { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #bbb; margin: 12px 0; font: .84rem/1.4 system-ui, sans-serif; }
.paper .summary > div { padding: 9px 11px; }
.paper .summary > div + div { border-left: 1px solid #bbb; }
.paper .summary h2 { font-size: .77rem; margin: 0 0 3px; }
.paper .summary p { margin: 3px 0; }
.paper dl { font-size: .92rem; margin: 0 0 10px; }
.paper dl div { display: grid; grid-template-columns: 100px 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px solid #e2e2e2; }
dt { font-weight: bold; }
dd { margin: 0; }
.signature { scroll-margin-top: 86px; padding: 18px; border: 1px solid var(--line); background: var(--panel); }
.signature h2 { margin: 8px 0; font-size: 1.45rem; line-height: 1.15; }
.signature p { color: var(--muted); }
.signature form, #label-fields { display: grid; gap: 8px; }
.signature label { font-weight: 650; font-size: .9rem; }
.signature input:not([type=checkbox]) { width: 100%; padding: 9px 10px; color: #fff; background: #0a0a0a; border: 1px solid #727272; border-radius: 3px; }
.signature .check { display: flex; align-items: start; gap: 10px; margin-top: 8px; font-weight: 500; }
.check input { width: 19px; height: 19px; flex: none; margin: 2px 0 0; accent-color: #fff; }
.signature .privacy, .signature .status { font-size: .84rem; overflow-wrap: anywhere; }
#records { overflow-wrap: anywhere; }
footer { text-align: center; border-top: 1px solid var(--line); padding: 20px; font-size: .75rem; letter-spacing: .13em; }
footer span { margin-left: 12px; color: var(--muted); }
.lobby main { max-width: 480px; padding-top: clamp(45px, 10vh, 110px); }
.lobby .signature { background: white; color: #121212; margin-top: 22px; padding: 24px; color-scheme: light; }
.lobby .signature input { background: white; color: #121212; border-color: #6e6e6e; }
.lobby .signature .solid { background: #111; color: white; margin-top: 7px; }
@media (max-width: 840px) {
  .agreement-view { grid-template-columns: minmax(0, 1fr); }
  .reader-pages { max-height: none; overflow: visible; padding: 12px; }
  .reader-toolbar { position: sticky; top: 66px; z-index: 1; }
  .paper { min-height: 0; padding: clamp(16px, 5vw, 43px); scroll-margin-top: 128px; }
}
@media (max-width: 460px) {
  main { padding: 15px 10px 36px; }
  .bar { gap: 8px; padding-inline: 12px; }
  .brand { gap: 5px; }
  .brand span { font-size: .64rem; }
  .brand::before { width: 25px; height: 25px; }
  .bar .solid { padding-inline: 9px; }
  .reader-toolbar { gap: 4px; padding-inline: 7px; }
  .reader-toolbar a, .reader-toolbar button { padding-inline: 5px; }
  .paper dl div { grid-template-columns: 1fr; gap: 1px; }
  .paper { font-size: 1rem; }
}
@page { size: A4; margin: 13mm; }
@media print {
  body, .paper, .signature, .reader { color-scheme: light; background: white; color: black; }
  .bar, .reader-toolbar, footer, .signature form, .signature button, .signature .privacy, .signature .status { display: none !important; }
  main, .reader-pages, .paper { padding: 0; }
  .agreement-view { display: block; }
  .reader, .signature { border: 0; }
  .reader-pages { max-height: none; height: auto; overflow: visible; }
  .paper { min-height: 245mm; margin: 0; box-shadow: none; }
  .paper + .paper, .signature:has(#records:not([hidden])) { break-before: page; }
  .signature:not(:has(#records:not([hidden]))) { display: none; }
  .signature p { color: black; }
}
.ink-field { margin: 6px 0 0; padding: 0; border: 0; min-width: 0; }
.ink-field legend { padding: 0; margin-bottom: 7px; font-weight: 650; font-size: .9rem; }
.ink-start, .ink-canvas { display: block; width: 100%; border: 1px solid #777; border-radius: 3px; min-height: 100px; background: #fafafa; color: #111; }
.ink-canvas { touch-action: none; cursor: crosshair; aspect-ratio: 3.14; }
.ink-clear { min-height: 38px; margin: 3px 0 0; padding: 0 6px; background: transparent; border: 0; color: #eee; text-decoration: underline; }
.signature .ink-intent { margin: 3px 0; font-size: .8rem; }
.ink-send { justify-self: stretch; }
.ink-record { display: block; width: min(245px, 100%); height: auto; background: #fafafa; border: 1px solid #bbb; }
@media (max-width: 460px) {
  #review-action { max-width: 58%; white-space: normal; }
}
