:root {
  --bg: #05030a;
  --panel: rgba(16, 10, 28, 0.84);
  --panel-strong: rgba(20, 12, 35, 0.96);
  --line: rgba(190, 132, 255, 0.32);
  --line-bright: rgba(205, 162, 255, 0.72);
  --violet: #9d64ff;
  --pink: #ff6bd6;
  --cyan: #58cfff;
  --mint: #58efb5;
  --text: #fbf9ff;
  --muted: #b8aec8;
  --danger: #ff7f9f;
  --radius: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48), 0 0 50px rgba(127, 66, 255, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 76% 18%, rgba(81, 118, 255, 0.16), transparent 32%),
    radial-gradient(circle at 18% 78%, rgba(172, 70, 255, 0.16), transparent 34%),
    linear-gradient(145deg, #030207, #0a0612 52%, #05030a);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell { position: relative; width: 100%; height: 100dvh; min-height: 100%; isolation: isolate; overflow: hidden; }
.app-shell::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: .38;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
}

.topbar {
  height: 68px; padding: 10px clamp(14px, 3vw, 40px); display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(5,3,10,.8); backdrop-filter: blur(18px); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand img { width: 46px; height: 46px; object-fit: cover; object-position: 50% 23%; border-radius: 12px; box-shadow: 0 0 22px rgba(122,91,255,.35); }
.brand img { flex-shrink: 0; }
.brand span { display: grid; letter-spacing: .15em; min-width: 0; }
.brand strong { font-size: clamp(.72rem, 1.6vw, .95rem); white-space: nowrap; }
.brand small { margin-top: 3px; color: var(--muted); font-size: .52rem; letter-spacing: .28em; }
.topbar-actions { display: flex; align-items: center; gap: clamp(8px, 1.7vw, 18px); font-size: .75rem; white-space: nowrap; }
.topbar-actions a, .text-button { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 6px 0; cursor: pointer; }
.topbar-actions a:hover, .text-button:hover { color: white; }
.credit-chip { padding: 8px 12px; border: 1px solid rgba(88,207,255,.3); border-radius: 999px; color: var(--cyan); background: rgba(88,207,255,.07); font-weight: 800; }

.screen { height: calc(100dvh - 68px); min-height: 0; }
.glass-panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(26,15,43,.91), rgba(10,7,18,.9)); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.eyebrow { margin: 0 0 7px; color: #c6a3ff; font-size: .65rem; font-weight: 900; letter-spacing: .22em; }

.auth-screen { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); align-items: center; gap: clamp(22px, 5vw, 76px); padding: clamp(20px, 4vw, 54px) clamp(20px, 6vw, 90px); }
.auth-console { width: min(100%, 700px); max-height: calc(100dvh - 110px); object-fit: contain; justify-self: end; filter: drop-shadow(0 0 48px rgba(126,80,255,.32)); }
.auth-card { width: min(100%, 470px); padding: clamp(24px, 4vw, 42px); }
.auth-card h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 4.2rem); line-height: .96; letter-spacing: -.05em; }
.auth-card h1 span { color: transparent; background: linear-gradient(90deg, #fff, #c9a5ff 46%, #62d6ff); background-clip: text; }
.auth-intro { max-width: 38ch; margin: 18px 0 22px; color: var(--muted); line-height: 1.5; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); padding: 4px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); }
.segment { border: 0; border-radius: 10px; padding: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; }
.segment.active { color: white; background: linear-gradient(135deg, rgba(155,89,255,.4), rgba(81,167,255,.26)); box-shadow: inset 0 0 0 1px rgba(211,173,255,.28); }
.auth-form { display: grid; gap: 12px; margin-top: 16px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 800; }
input { width: 100%; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; color: white; background: rgba(4,3,9,.72); outline: none; }
input:focus { border-color: var(--line-bright); box-shadow: 0 0 0 3px rgba(157,100,255,.12); }
.auth-form input { height: 47px; padding: 0 14px; }
.primary-button, .secondary-button { border-radius: 14px; border: 1px solid transparent; cursor: pointer; font-weight: 900; }
.primary-button { min-height: 46px; padding: 11px 18px; background: linear-gradient(120deg, #7a43e8, #a864ff 47%, #4c9eff); color: white; box-shadow: 0 10px 28px rgba(118,69,230,.28), inset 0 1px rgba(255,255,255,.22); }
.primary-button:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .48; }
.secondary-button { min-height: 44px; padding: 10px 16px; color: #e9dcff; border-color: var(--line); background: rgba(143,87,237,.1); }
.verification-panel { text-align: center; padding: 8px 0; }
.verification-icon, .download-check { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; color: #03140e; background: var(--mint); box-shadow: 0 0 36px rgba(88,239,181,.34); font-size: 1.6rem; font-weight: 900; }
.verification-panel h2 { margin: 0 0 8px; }
.verification-panel p { color: var(--muted); line-height: 1.5; }
.verification-panel .secondary-button { width: 100%; margin: 10px 0; }

.workspace-screen { position: relative; display: grid; grid-template-columns: minmax(250px, .64fr) minmax(520px, 1.55fr); gap: clamp(12px, 2vw, 24px); padding: clamp(12px, 2vw, 24px) clamp(12px, 3vw, 38px); }
.console-watermark { position: absolute; inset: 4% 12% 0 32%; z-index: -1; background: url('/assets/stemsplitacular-console.png') center / contain no-repeat; opacity: .06; filter: blur(1px); }
.entitlement-panel, .console-panel { min-height: 0; overflow: hidden; }
.entitlement-panel { padding: clamp(18px, 2.4vw, 28px); display: flex; flex-direction: column; justify-content: center; gap: clamp(15px, 2.4vh, 24px); }
.account-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.account-line strong { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.verified-badge { padding: 6px 8px; border-radius: 999px; color: var(--mint); border: 1px solid rgba(88,239,181,.35); background: rgba(88,239,181,.07); font-size: .55rem; font-weight: 900; letter-spacing: .1em; }
.balance-display { display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: rgba(2,2,7,.44); }
.balance-display > span { font-size: clamp(2.6rem, 5vw, 4.5rem); line-height: .8; font-weight: 950; color: transparent; background: linear-gradient(150deg, white, #c58cff); background-clip: text; }
.balance-display div { display: grid; gap: 4px; }
.balance-display strong { font-size: .95rem; }
.balance-display small { color: var(--muted); font-size: .66rem; line-height: 1.35; }
.purchase-button { display: flex; align-items: center; justify-content: space-between; }
.purchase-button strong { padding-left: 10px; font-size: 1.05rem; }
.price-note { margin: -17px 0 0; color: var(--muted); text-align: center; font-size: .66rem; }
.redeem-form { display: grid; gap: 7px; }
.redeem-form > label { color: #d5c4e9; font-size: .7rem; font-weight: 800; }
.redeem-form > div { display: grid; grid-template-columns: 1fr auto; }
.redeem-form input { min-width: 0; height: 43px; padding: 0 12px; border-radius: 12px 0 0 12px; }
.redeem-form button { border: 1px solid var(--line); border-left: 0; border-radius: 0 12px 12px 0; color: white; background: rgba(157,100,255,.24); padding: 0 14px; font-weight: 900; cursor: pointer; }
.redeem-form small { color: var(--muted); font-size: .63rem; }

.console-panel { position: relative; padding: clamp(16px, 2.4vw, 28px); }
.console-view { width: 100%; height: 100%; min-height: 0; }
.upload-view { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: clamp(12px, 2vh, 20px); }
.console-hero { position: relative; min-height: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 20px; background: radial-gradient(circle at 58% 65%, rgba(111,63,238,.22), transparent 42%), #05040a; }
.console-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,3,9,.86) 0 33%, transparent 68%), linear-gradient(0deg, rgba(4,3,9,.3), transparent); pointer-events: none; }
.console-hero img { width: 100%; height: 100%; object-fit: contain; object-position: 72% 50%; filter: saturate(1.08) contrast(1.04); }
.console-copy { position: absolute; z-index: 1; left: clamp(18px, 3vw, 36px); top: 50%; transform: translateY(-50%); max-width: 36%; }
.console-copy h2 { margin: 0; font-size: clamp(1.45rem, 3.2vw, 3rem); line-height: .98; letter-spacing: -.04em; }
.console-copy p:last-child { color: var(--muted); font-size: .72rem; }
.split-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .36fr); gap: 12px; }
.drop-zone { min-width: 0; min-height: 66px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; border: 1px dashed var(--line-bright); border-radius: 16px; background: rgba(132,72,235,.08); cursor: pointer; }
.drop-zone:hover, .drop-zone.dragover { background: rgba(132,72,235,.15); box-shadow: 0 0 30px rgba(129,70,236,.12); }
.upload-symbol { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, #703fe0, #4aa8ff); font-size: 1.3rem; }
.drop-zone > span:last-child { min-width: 0; display: grid; gap: 3px; }
.drop-zone strong, .drop-zone small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-zone small { color: var(--muted); font-size: .66rem; }
.split-button { display: grid; align-content: center; }
.split-button small { font-size: .62rem; opacity: .75; }

.processing-view { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.processing-machine { position: relative; width: min(55%, 430px); height: min(48vh, 390px); overflow: hidden; margin-bottom: -10px; }
.processing-machine img { width: 100%; height: 100%; object-fit: contain; filter: saturate(1.2) drop-shadow(0 0 26px rgba(118,83,255,.28)); }
.scan-line { position: absolute; left: 15%; right: 15%; height: 2px; top: 20%; background: linear-gradient(90deg, transparent, white, #8a69ff, transparent); box-shadow: 0 0 18px #8f78ff; animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 50% { top: 82%; } }
.processing-view h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.7rem); }
.processing-view > p:not(.eyebrow) { margin: 6px 0 16px; color: var(--muted); }
.channel-progress { width: min(100%, 690px); display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.channel-progress span { padding: 8px 4px; border: 1px solid rgba(146,101,255,.3); border-radius: 8px; color: #d7c4ef; background: rgba(142,84,245,.07); font-size: .54rem; font-weight: 900; letter-spacing: .08em; animation: channel 1.8s ease-in-out infinite; }
.channel-progress span:nth-child(2) { animation-delay: .15s; }.channel-progress span:nth-child(3) { animation-delay: .3s;}.channel-progress span:nth-child(4) { animation-delay: .45s;}.channel-progress span:nth-child(5) { animation-delay: .6s;}.channel-progress span:nth-child(6) { animation-delay: .75s;}
@keyframes channel { 50% { color: white; border-color: var(--cyan); box-shadow: 0 0 12px rgba(88,207,255,.24); } }
.progress-track { width: min(100%, 690px); height: 4px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.progress-track span { display: block; width: 35%; height: 100%; background: linear-gradient(90deg, var(--pink), var(--violet), var(--cyan)); animation: progress 1.7s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-110%); } to { transform: translateX(330%); } }

.results-view { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; }
.results-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.results-topline h2 { margin: 0; font-size: clamp(1.35rem, 2.5vw, 2.2rem); }
.results-topline p:last-child { margin: 3px 0 0; color: var(--muted); font-size: .72rem; }
.master-strip { display: grid; grid-template-columns: auto auto minmax(100px, 1fr) auto auto; gap: 8px; align-items: center; padding: 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 16px; background: rgba(3,3,8,.55); }
.round-control { width: 38px; height: 38px; border: 0; border-radius: 50%; color: white; background: linear-gradient(135deg, #8f4fff, #4b9dff); cursor: pointer; box-shadow: 0 0 18px rgba(123,84,255,.25); }
.round-control.secondary { color: var(--muted); border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); box-shadow: none; }
.master-status { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; }
.master-status strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .74rem; }
.master-status span { color: var(--cyan); font-variant-numeric: tabular-nums; font-size: .7rem; }
.format-control { display: flex; padding: 3px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; }
.format-button { border: 0; border-radius: 7px; padding: 6px 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: .57rem; font-weight: 900; }
.format-button.active { color: white; background: rgba(141,92,255,.38); }
.compact-button { min-height: 36px; padding: 7px 12px; font-size: .7rem; }
.stem-console { min-height: 0; display: grid; grid-template-rows: repeat(6, minmax(44px, 1fr)); gap: 7px; }
.stem-row { min-height: 0; display: grid; grid-template-columns: minmax(88px, .34fr) auto minmax(80px, 1fr) auto auto; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid rgba(162,107,255,.25); border-radius: 13px; background: linear-gradient(90deg, rgba(111,55,204,.12), rgba(25,19,42,.6)); }
.stem-row.playing { border-color: rgba(88,207,255,.65); box-shadow: inset 0 0 18px rgba(88,207,255,.08), 0 0 18px rgba(88,207,255,.08); }
.stem-identity { min-width: 0; display: flex; align-items: center; gap: 8px; }
.stem-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--cyan); background: rgba(88,207,255,.09); font-size: .8rem; }
.stem-identity strong { overflow: hidden; text-overflow: ellipsis; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.stem-action { width: 31px; height: 31px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; color: #e8dcf8; background: rgba(255,255,255,.04); cursor: pointer; }
.stem-timeline { min-width: 0; display: grid; grid-template-columns: minmax(40px, 1fr) auto; align-items: center; gap: 8px; }
.stem-progress { --stem-progress: 0%; width: 100%; height: 16px; margin: 0; appearance: none; cursor: pointer; background: transparent; }
.stem-progress::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--pink) 0%, var(--violet) var(--stem-progress), rgba(255,255,255,.1) var(--stem-progress), rgba(255,255,255,.1) 100%); }
.stem-progress::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4px; appearance: none; border: 2px solid #e9f8ff; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(88,207,255,.75); }
.stem-progress::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,.1); }
.stem-progress::-moz-range-progress { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--violet)); }
.stem-progress::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #e9f8ff; border-radius: 50%; background: var(--cyan); }
.stem-progress:disabled { cursor: wait; opacity: .45; }
.stem-time { min-width: 78px; color: var(--muted); font-size: .58rem; font-variant-numeric: tabular-nums; text-align: right; }
.stem-row.muted { opacity: .48; }
.stem-row.muted .stem-progress { opacity: .3; }
.mute-button.active { color: #08040e; background: var(--pink); border-color: transparent; }

.toast { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; max-width: min(92vw, 560px); padding: 12px 18px; border: 1px solid var(--line-bright); border-radius: 999px; color: white; background: rgba(18,11,30,.96); box-shadow: 0 14px 46px rgba(0,0,0,.48), 0 0 24px rgba(143,83,255,.22); text-align: center; font-size: .76rem; }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(2,1,6,.82); backdrop-filter: blur(12px); }
.download-modal { width: min(100%, 430px); padding: 32px; text-align: center; }
.download-modal h2 { margin: 0; }
.download-modal p { color: var(--muted); line-height: 1.5; }
.download-modal .primary-button { width: 100%; }

@media (max-width: 820px) {
  .topbar { height: 56px; padding: 7px 12px; }
  .brand img { width: 40px; height: 40px; }
  .brand small { display: none; }
  .topbar-actions { gap: 9px; }
  .topbar-actions a { font-size: 0; }
  .topbar-actions a::after { font-size: .64rem; }
  .topbar-actions a:nth-of-type(1)::after { content: "Web"; }
  .topbar-actions a:nth-of-type(2)::after { content: "Privacy"; }
  .topbar-actions a:last-child::after { content: "Delete"; }
  .screen { height: calc(100dvh - 56px); }
  .auth-screen { grid-template-columns: 1fr; padding: 12px; }
  .auth-console { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; opacity: .18; object-fit: cover; }
  .auth-card { position: relative; justify-self: center; max-height: calc(100dvh - 80px); padding: 22px; }
  .auth-card h1 { font-size: clamp(2rem, 11vw, 3.3rem); }
  .workspace-screen { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 8px; }
  .entitlement-panel { padding: 9px 10px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; border-radius: 16px; }
  .account-line, .price-note, .redeem-form > label, .redeem-form > small, .balance-display div { display: none; }
  .balance-display { padding: 0 10px; border: 0; background: none; }
  .balance-display > span { font-size: 2rem; }
  .balance-display::after { content: "splits"; color: var(--muted); font-size: .62rem; }
  .purchase-button { min-height: 38px; padding: 7px 10px; font-size: .66rem; }
  .purchase-button strong { font-size: .74rem; }
  .redeem-form { display: block; }
  .redeem-form > div { min-width: 145px; }
  .redeem-form input { height: 38px; font-size: .68rem; }
  .redeem-form button { padding: 0 8px; font-size: .62rem; }
  .console-panel { padding: 10px; border-radius: 18px; }
  .console-copy { max-width: 46%; left: 16px; }
  .console-copy h2 { font-size: clamp(1.2rem, 5.8vw, 2rem); }
  .split-form { grid-template-columns: 1fr; gap: 7px; }
  .drop-zone { min-height: 54px; padding: 7px 10px; }
  .split-button { min-height: 43px; }
  .processing-machine { width: min(78%, 360px); height: min(39vh, 280px); }
  .results-view { gap: 7px; }
  .results-topline p:last-child { display: none; }
  .master-strip { grid-template-columns: auto auto 1fr auto; gap: 5px; padding: 6px; }
  .master-status span, .format-control { display: none; }
  .round-control { width: 34px; height: 34px; }
  .compact-button { min-height: 34px; padding: 6px 9px; }
  .stem-console { gap: 5px; }
  .stem-row { grid-template-columns: minmax(80px, .45fr) auto minmax(40px, 1fr) auto auto; padding: 5px 7px; gap: 6px; }
  .stem-timeline { grid-template-columns: minmax(36px, 1fr); gap: 1px; }
  .stem-time { min-width: 0; font-size: .5rem; text-align: left; }
  .stem-icon { width: 24px; height: 24px; }
  .stem-action { width: 29px; height: 29px; }
}

@media (min-width: 821px) and (max-height: 800px) {
  .topbar { height: 60px; }
  .screen { height: calc(100dvh - 60px); }
  .auth-screen { padding-top: 12px; padding-bottom: 12px; }
  .auth-console { max-height: calc(100dvh - 92px); }
  .auth-card { padding: 16px 26px; }
  .auth-card h1 { font-size: clamp(2.1rem, 4vw, 3.25rem); }
  .auth-intro { margin: 8px 0 10px; line-height: 1.35; }
  .auth-form { gap: 8px; margin-top: 10px; }
  .auth-form input { height: 38px; }
}

@media (max-height: 680px) {
  .topbar { height: 52px; }
  .screen { height: calc(100dvh - 52px); }
  .auth-card { padding: 17px 22px; }
  .auth-intro { margin: 10px 0 12px; }
  .auth-form { gap: 8px; margin-top: 10px; }
  .auth-form input { height: 40px; }
  .console-panel { padding: 9px; }
  .results-topline h2 { font-size: 1.25rem; }
  .stem-row { padding-top: 3px; padding-bottom: 3px; }
  .processing-machine { height: 34vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Let the header take its actual height, including mobile rows and safe areas. */
.app-shell { display: flex; flex-direction: column; }
.topbar { flex: 0 0 auto; gap: 12px; }
.screen { flex: 1 1 0; height: auto; }
.auth-screen { overflow-y: auto; }
.verification-panel strong { overflow-wrap: anywhere; }
.verification-panel .primary-button { padding: 12px; margin: 8px 0; }

@media (max-width: 600px) {
  .topbar {
    height: auto; flex-direction: column; align-items: stretch; gap: 4px;
    padding: max(7px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left));
  }
  .brand { flex-shrink: 0; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
  .credit-chip { margin-right: auto; }
  .topbar-actions a { font-size: .7rem; }
  .topbar-actions a::after { content: none !important; }
  .auth-card { max-height: none; margin-block: auto; }
  .auth-form input { font-size: 16px; }
  .entitlement-panel { grid-template-columns: minmax(0, 1fr) auto; }
  .purchase-button { gap: 8px; white-space: nowrap; }
  .redeem-form { grid-column: 1 / -1; min-width: 0; }
  .redeem-form > div { min-width: 0; }
}

/* Compact phone credits layout; the live balance remains in creditReadout. */
@media (max-width: 600px) {
  .topbar { border-bottom: 0; }
  .topbar-actions .credit-chip { display: none; }
  .topbar-actions a, .topbar-actions .text-button {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .entitlement-panel {
    grid-template-columns: minmax(64px, .35fr) minmax(0, 1fr);
    gap: 10px 12px; min-width: 0; border: 0; box-shadow: none;
  }
  .balance-display { flex-direction: column; justify-content: center; gap: 5px; padding: 0; min-width: 0; }
  .balance-display > span { font-size: 1.7rem; }
  .purchase-button {
    width: 100%; min-width: 0; min-height: 48px; padding: 9px 12px;
    gap: 12px; border-radius: 12px; font-size: .82rem; line-height: 1.2;
  }
  .purchase-button > span { min-width: 0; text-align: left; }
  .purchase-method { display: block; margin-top: 3px; font-size: .68rem; font-weight: 600; }
  .purchase-button strong { flex: 0 0 auto; padding-left: 0; font-size: .95rem; }
  .redeem-form input { height: 44px; font-size: 16px; }
  .redeem-form button { min-height: 44px; padding-inline: 12px; font-size: .72rem; }
}
