:root {
  color-scheme: dark;
  --canvas: #101214;
  --panel: #1a1d20;
  --line: #363b40;
  --text: #f4f5f3;
  --muted: #b4b9b9;
  --accent: #c4f4a5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100svh; }
button, a { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:active { filter: brightness(.85); }
button:disabled { opacity: .56; cursor: wait; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.25rem, 5.4vw, 4.3rem); font-weight: 620; letter-spacing: -.065em; line-height: 1.05; }
h2 { font-size: clamp(1.35rem, 2vw, 1.75rem); font-weight: 610; letter-spacing: -.04em; }
h3 { font-size: 1.04rem; font-weight: 630; }
p { line-height: 1.55; }
.muted, .lede, .context, .content-panel > p, .account-qr p { color: var(--muted); }
.masthead { border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.masthead-inner, .shell {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(clamp(18px, 5vw, 64px), env(safe-area-inset-left));
  padding-right: max(clamp(18px, 5vw, 64px), env(safe-area-inset-right));
}
.masthead-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark, .actions, .input-row, .panel-heading, .page-heading { display: flex; align-items: center; gap: 12px; }
.wordmark { font-weight: 620; letter-spacing: -.035em; font-size: 1.08rem; }
.wordmark svg { color: var(--accent); }
.context { font-size: .88rem; }
.shell { padding-top: clamp(32px, 7vh, 72px); padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.pair-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, .72fr); gap: clamp(24px, 8vw, 90px); align-items: center; padding-block: clamp(8px, 4vh, 52px); }
.lede { font-size: clamp(1.06rem, 1.5vw, 1.22rem); max-width: 38ch; margin-top: 22px; }
#pair-details { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 24px; }
.field-label, label { font-weight: 580; font-size: .94rem; }
.display-code { display: block; margin: 8px 0 16px; font: 600 clamp(1.6rem, 4vw, 2.25rem)/1.2 ui-monospace, monospace; letter-spacing: .13em; overflow-wrap: anywhere; }
.qr-panel, .content-panel, .notice {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(20px, 3.5vw, 36px);
}
.qr-panel { display: grid; justify-items: center; align-content: center; gap: 16px; min-height: 280px; text-align: center; }
.qr-box { background: white; border: 8px solid white; border-radius: 8px; display: inline-flex; max-width: 100%; }
.qr-box img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.qr-panel p { font-size: .93rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.button, .text-button, .subtle-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .94rem; }
.button { padding: 9px 17px; border-radius: 10px; border: 1px solid transparent; user-select: none; }
.primary { background: var(--accent); color: #121b0d; }
.secondary { background: #272c2e; border-color: #454b50; }
.danger { background: #382425; color: #ffc3bd; border-color: #674346; }
.text-button, .subtle-link { color: var(--accent); background: none; border: 0; padding: 4px 1px; }
.subtle-link { text-decoration: underline; text-decoration-color: #65745e; text-underline-offset: 5px; }
.text-button { color: var(--muted); }
.page-heading, .panel-heading { justify-content: space-between; flex-wrap: wrap; }
.page-heading { align-items: baseline; margin-bottom: 25px; }
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.service { min-width: 0; display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 64px; border-radius: 12px; padding: 8px clamp(12px, 2.5vw, 24px); font-size: 1.06rem; font-weight: 620; border: 1px solid var(--line); background: #15181a; }
.service[aria-pressed="true"] { border-color: #a4bf91; background: #232c24; }
.provider-icon { width: 30px; height: 26px; display: inline-grid; flex: 0 0 auto; place-items: center; line-height: 1; }
.yt-icon { background: #f52233; color: white; border-radius: 7px; font-size: 12px; }
.tw-icon { background: #aa7dfa; color: #16101f; border-radius: 5px 5px 8px 2px; font-weight: 850; }
.content-panel + .content-panel, .owner > * + *, .notice + section { margin-top: 18px; }
.content-panel > .panel-heading:first-child { margin-top: -3px; }
.content-panel > p, .content-panel > form, #account-status { margin-top: 14px; }
.input-row { margin-top: 9px; }
.input-row input {
  flex: 1; min-width: 0; padding: 12px 14px; min-height: 49px; border-radius: 10px;
  border: 1px solid #596165; color: var(--text); font: inherit; font-size: 16px; background: #111416;
}
.input-row button { min-height: 49px; padding-inline: 24px; }
.input-row input::placeholder { color: #929a9d; }
.error-text, .content-panel > .error-text { color: #ffc3bd; }
#playback, .account-qr { margin-top: 20px; }
.player-slot { background: #000; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; border-radius: 10px; overflow: hidden; }
.player-slot iframe { height: 100%; width: 100%; border: 0; display: block; }
#playback .actions, .row, .feed-button { justify-content: space-between; }
.account-qr { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.account-qr > div:last-child { flex: 1 1 220px; }
.feed { list-style: none; padding: 0; margin: 8px 0 0; }
.feed-button, .row { display: flex; align-items: center; width: 100%; gap: 15px; border: 0; border-top: 1px solid var(--line); padding: 13px 0; background: none; text-align: left; }
.feed li:first-child .feed-button { border-top: 0; }
.feed-button > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.feed-button small, .row small { color: var(--muted); display: block; line-height: 1.5; }
.row { flex-wrap: wrap; margin-top: 12px; }
.row.selected { border-top-color: var(--accent); }
.owner { max-width: 720px; margin: auto; }
.owner > h1 { margin-bottom: 26px; }
.owner .button, .notice .button { margin-top: 10px; }
.owner .row .button { margin: 0; }
.actions { flex-wrap: wrap; }
@media (hover: hover) and (pointer: fine) {
  .button:hover, .service:hover, .text-button:hover { filter: brightness(1.14); }
  .feed-button:hover, .subtle-link:hover { color: var(--accent); }
}
@media (max-width: 660px) {
  .pair-layout { grid-template-columns: 1fr; gap: 20px; }
  .pair-layout > div:first-child { display: contents; }
  .pair-layout h1, .pair-layout .lede { grid-column: 1; }
  .pair-layout .lede { margin: -5px 0 0; max-width: none; }
  #pair-details { grid-row: 4; margin: 0; padding-top: 16px; }
  .qr-panel { min-height: 180px; }
  .masthead-inner { min-height: 60px; }
  .services { gap: 6px; }
  .service { justify-content: center; padding: 8px 4px; gap: 6px; font-size: .94rem; }
  .provider-icon { width: 24px; height: 22px; }
  .page-heading { gap: 7px; }
}
@media (max-width: 420px) {
  .service { flex-direction: column; }
  .account-qr { flex-direction: column; align-items: flex-start; }
  .account-qr > div:last-child { flex: auto; }
  .input-row button { padding-inline: 15px; }
}
.player-slot.twitch-player { min-height: 300px; }
