/* Zip2APK — supplied brand kit, dark tech/minimalist application theme.
   Custom native HTML/CSS components. Semantic tokens preserve accessible contrast.
   Fonts and images are self-hosted; app pages require no third-party asset hosts. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/inter-latin-variable.woff2') format('woff2');
}
:root {
    color-scheme: dark;
    --brand: #4ADE80;
    --brand-fill: #22C55E;
    --brand-fill-hover: #20B856;
    --brand-fill-active: #1BAC50;
    --brand-text: #4ADE80;
    --brand-tint: #132F24;
    --brand-tint-line: #2B5841;
    --surface: #111D30;
    --surface-alt: #0B1220;
    --surface-sunken: #1B2B42;
    --console: #070E19;
    --console-alt: #0D1828;
    --text: #F1F5F9;
    --text-body: #D0DCEB;
    --text-muted: #B0BFD3;
    --text-subtle: #9FB0C8;
    --text-on-dark: #F8FAFC;
    --text-on-dark-muted: #AEBFD4;
    --text-inverse: #FFFFFF;
    --on-brand: #0F172A;
    --success: #86D8A8;
    --success-text: #B5F0CC;
    --success-tint: #123022;
    --success-line: #2D5D43;
    --on-success: #0E291B;
    --warning: #F2C476;
    --warning-text: #F4D199;
    --warning-tint: #34291C;
    --warning-line: #68512C;
    --danger: #FFA8A2;
    --danger-text: #FFB6AF;
    --danger-tint: #382224;
    --danger-line: #754344;
    --border: #293B54;
    --border-strong: #6E809A;
    --border-focus: #93C5FD;
    --border-dark: #30445E;
    --ink: #0F172A;
    --paper: #F8FAFC;
    --mint: #183B29;
    --on-mint: #B5F0CC;
    --mint-line: #366349;
    --logo-plate: transparent;
    --brand-green: #22C55E;
    --brand-blue: #3B82F6;
    --brand-slate: #64748B;
    --brand-light: #E2E8F0;
    --link-text: #93C5FD;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.12);
    --shadow-md: 0 12px 36px rgba(0,0,0,.18);
    --shadow-lg: 0 24px 64px rgba(0,0,0,.28);
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
    --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
    --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;
    --page-max: 800px; --page-max-wide: 1168px;
    --page-pad: var(--s5); --card-pad: var(--s6); --section-gap: var(--s12);
    --r-sm: 5px; --r-md: 10px; --r-lg: 16px; --r-xl: 20px; --r-full: 9999px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    --dur-fast: 140ms; --dur-base: 220ms; --ease: cubic-bezier(.2,0,0,1);
}
:root[data-theme='light'] {
    color-scheme: light;
    --brand: #16A34A;
    --brand-fill: #22C55E;
    --brand-fill-hover: #20B856;
    --brand-fill-active: #1BAC50;
    --brand-text: #15803D;
    --brand-tint: #ECFDF3;
    --brand-tint-line: #B8E7CA;
    --surface: #FFFFFF;
    --surface-alt: #F8FAFC;
    --surface-sunken: #E2E8F0;
    --console: #0B1628;
    --console-alt: #122039;
    --text: #0F172A;
    --text-body: #334155;
    --text-muted: #475569;
    --text-subtle: #64748B;
    --text-on-dark: #F8FAFC;
    --text-on-dark-muted: #AEBFD4;
    --text-inverse: #FFFFFF;
    --on-brand: #0F172A;
    --success: #19734C;
    --success-text: #14613F;
    --success-tint: #EDF9F2;
    --success-line: #B8DFC9;
    --on-success: #FFFFFF;
    --warning: #A14F0B;
    --warning-text: #8D4309;
    --warning-tint: #FFF6E7;
    --warning-line: #EDD0A4;
    --danger: #BE3434;
    --danger-text: #AD2929;
    --danger-tint: #FFF0EE;
    --danger-line: #F0C4BF;
    --border: #D8E1EC;
    --border-strong: #7D8B9E;
    --border-focus: #2563EB;
    --border-dark: #34465E;
    --ink: #0F172A;
    --paper: #F8FAFC;
    --mint: #DCFCE7;
    --on-mint: #14532D;
    --mint-line: #A7DDB9;
    --logo-plate: transparent;
    --brand-green: #22C55E;
    --brand-blue: #3B82F6;
    --brand-slate: #64748B;
    --brand-light: #E2E8F0;
    --link-text: #1D4ED8;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 12px 36px rgba(15,23,42,.07);
    --shadow-lg: 0 24px 64px rgba(15,23,42,.12);
}

/* --- reset ----------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--surface-alt);
    color: var(--text-body);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; color: var(--text); text-wrap: balance; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; }

/* One focus treatment, applied to everything focusable. Never `outline: none`
   without a replacement — keyboard users lose the page entirely. */
:where(a, button, input, [tabindex]):focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

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

/* --- type scale ------------------------------------------------------ */

.t-display {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.025em;
}
.t-h1 { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.t-h2 { font-size: 22px; font-weight: 650; line-height: 1.25; letter-spacing: -.015em; }
.t-h3 { font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }

.t-lead {
    font-size: 18px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 60ch;
    text-wrap: pretty;
}
.t-body  { font-size: 16px; line-height: 1.6; }
.t-small { font-size: 14px; line-height: 1.55; color: var(--text-muted); }
.t-note  { font-size: 13px; line-height: 1.55; color: var(--text-subtle); max-width: 68ch; text-wrap: pretty; }

.t-eyebrow {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.mono { font-family: var(--font-mono); font-size: .9em; }

a { color: var(--link-text); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 768px) {
    .t-display { font-size: 52px; }
    .t-h1 { font-size: 36px; }
    .t-h2 { font-size: 24px; }
}

/* --- layout ---------------------------------------------------------- */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.shell {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--page-pad);
}
.shell--wide { max-width: var(--page-max-wide); }

.stack       { display: flex; flex-direction: column; gap: var(--s4); }
.stack--tight{ gap: var(--s3); }
.stack--loose{ gap: var(--s6); }

main { flex: 1; padding-block: var(--s8) var(--s16); }

@media (min-width: 768px) {
    :root { --page-pad: var(--s6); }
    main { padding-block: var(--s12) var(--s20); }
}

/* --- app bar --------------------------------------------------------- */

.appbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.appbar__inner {
    display: flex;
    align-items: center;
    gap: var(--s3);
    min-height: 60px;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--page-pad);
}
.appbar--wide .appbar__inner { max-width: var(--page-max-wide); }

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    /* The wordmark is 28px of ink, but it is a link, so its TAP TARGET has to
       clear 44px. Padding rather than height, so the mark stays optically
       centred in the bar. */
    min-height: 44px;
    padding-right: var(--s2);
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -.01em;
    text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo__mark {
    width: 28px;
    height: 28px;
    border-radius: var(--r-md);
    background: var(--brand);
    display: grid;
    place-items: center;
    flex: none;
}
.logo__mark svg { width: 16px; height: 16px; display: block; }

.appbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }

/* --- badge ----------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.badge__dot {
    width: 6px;
    height: 6px;
    border-radius: var(--r-full);
    background: currentColor;
    flex: none;
}
.badge--brand   { background: var(--brand-tint);   border-color: var(--brand-tint-line); color: var(--brand-text); }
.badge--running { background: var(--warning-tint); border-color: var(--warning-line);    color: var(--warning-text); }
.badge--ok      { background: var(--success-tint); border-color: var(--success-line);    color: var(--success-text); }
.badge--error   { background: var(--danger-tint);  border-color: var(--danger-line);     color: var(--danger-text); }

.badge--running .badge__dot { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }

/* --- card ------------------------------------------------------------ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.card__body { padding: var(--card-pad); }
.card__head {
    padding: var(--s4) var(--card-pad);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--s3);
}
.card__foot {
    padding: var(--s4) var(--card-pad);
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.card--flush { box-shadow: none; }
.card--accent { border-top: 3px solid var(--brand); }
.card--danger { border-top: 3px solid var(--danger); }

/* --- buttons ---------------------------------------------------------
   One primary, one secondary, one ghost. Not five.
   Every variant is >=44px tall, which is the touch-target floor. */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    /* `flex: none` is load-bearing, not tidiness. In a flex COLUMN the main
       axis is vertical, so a button placed in one is shrinkable and
       `min-height` loses to the container — which quietly drops the tap target
       under the 44px floor on exactly the narrow screens where it matters. */
    flex: none;
    min-height: 44px;
    padding: 0 var(--s5);
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.005em;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary {
    background: var(--brand-fill);
    border-color: var(--brand-fill);
    color: var(--on-brand);
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover  { background: var(--brand-fill-hover); border-color: var(--brand-fill-hover); text-decoration: none; }
.btn--primary:active { background: var(--brand-fill-active); border-color: var(--brand-fill-active); }

.btn--secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}
.btn--secondary:hover { background: var(--surface-alt); border-color: var(--text-subtle); text-decoration: none; }

.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }

.btn--lg { min-height: 52px; padding: 0 var(--s6); font-size: 16px; }
.btn--block { width: 100%; }

.btn:disabled,
.btn[aria-disabled='true'] {
    background: var(--surface-sunken);
    border-color: var(--border);
    color: var(--text-subtle);
    box-shadow: none;
    cursor: not-allowed;
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* --- dropzone -------------------------------------------------------- */

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s3);
    padding: var(--s10) var(--s6);
    text-align: center;
    border: 2px dashed var(--border-strong);
    border-radius: var(--r-lg);
    background: var(--surface-alt);
    transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.dropzone.is-over {
    border-color: var(--brand);
    background: var(--brand-tint);
}
.dropzone__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--brand-text);
    box-shadow: var(--shadow-sm);
}
.dropzone__icon svg { width: 24px; height: 24px; }
.dropzone__title { font-size: 17px; font-weight: 600; color: var(--text); }

/* The chosen-file state replaces the prompt. Same box, different content, so
   the layout does not jump when a file is picked. */
.filecard {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
}
.filecard__icon {
    width: 40px; height: 40px;
    border-radius: var(--r-md);
    background: var(--brand-tint);
    color: var(--brand-text);
    display: grid; place-items: center;
    flex: none;
}
.filecard__icon svg { width: 20px; height: 20px; }
.filecard__meta { min-width: 0; }
.filecard__name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.filecard__size { font-size: 13px; color: var(--text-subtle); }
.filecard__end { margin-left: auto; flex: none; }

/* --- steps (how it works) -------------------------------------------- */

.steplist { display: grid; gap: var(--s5); counter-reset: step; }
@media (min-width: 768px) { .steplist { grid-template-columns: repeat(3, 1fr); gap: var(--s6); } }

.steplist__item { list-style: none; display: flex; gap: var(--s3); }
.steplist__num {
    width: 28px; height: 28px;
    border-radius: var(--r-full);
    background: var(--brand-tint);
    color: var(--brand-text);
    border: 1px solid var(--brand-tint-line);
    display: grid; place-items: center;
    font-size: 13px; font-weight: 700;
    flex: none;
}
.steplist__title { font-weight: 600; color: var(--text); margin-bottom: 2px; }

/* --- progress timeline -----------------------------------------------
   Replaces a progress bar on purpose. A Gradle build inside a sealed VM
   reports nothing until it is over, so there is no percentage to show that
   would not be invented. A phase list can say "running" honestly. */

.timeline { display: grid; gap: 0; }

.phase {
    position: relative;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) 0;
}
/* Each phase draws ONLY the connector below its own dot.
   Drawing a full-height line per row and then recolouring "the row after a
   done one" looks right until you try it: that rule paints the whole next
   row, so the green runs past the next dot and implies a phase has completed
   when it has not. One segment, one owner. */
.phase::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 50%;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.phase:last-child::after { display: none; }

.phase__dot {
    position: relative;
    z-index: 1;
    width: 24px; height: 24px;
    border-radius: var(--r-full);
    border: 2px solid var(--border-strong);
    background: var(--surface);
    display: grid; place-items: center;
    color: var(--text-inverse);
}
.phase__dot svg { width: 12px; height: 12px; }

.phase__name { font-size: 15px; font-weight: 500; color: var(--text-subtle); }
.phase__meta { font-size: 13px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }

.phase--done .phase__dot  { background: var(--success); border-color: var(--success); }
.phase--done .phase__name { color: var(--text); }
.phase--done::after       { background: var(--success); }

.phase--live .phase__dot {
    background: var(--surface);
    border-color: var(--warning);
    box-shadow: 0 0 0 4px var(--warning-tint);
}
.phase--live .phase__dot::after {
    content: '';
    width: 8px; height: 8px;
    border-radius: var(--r-full);
    background: var(--warning);
    animation: pulse 1.6s var(--ease) infinite;
}
.phase--live .phase__name { color: var(--text); font-weight: 600; }
.phase--live .phase__meta { color: var(--warning-text); font-weight: 500; }

.phase--failed .phase__dot { background: var(--danger); border-color: var(--danger); }
.phase--failed .phase__name { color: var(--danger-text); font-weight: 600; }

/* --- ad gate --------------------------------------------------------- */

.gate { display: grid; gap: var(--s3); }

.gate__item {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
}
.gate__icon {
    width: 32px; height: 32px;
    border-radius: var(--r-full);
    border: 2px solid var(--border-strong);
    display: grid; place-items: center;
    flex: none;
    font-size: 13px; font-weight: 700;
    color: var(--text-subtle);
}
.gate__icon svg { width: 14px; height: 14px; }
.gate__label { font-size: 15px; font-weight: 500; color: var(--text); }
.gate__sub { font-size: 13px; color: var(--text-subtle); }
.gate__end { margin-left: auto; flex: none; }

.gate__item--done {
    background: var(--success-tint);
    border-color: var(--success-line);
}
.gate__item--done .gate__icon { background: var(--success); border-color: var(--success); color: #FFF; }

.gate__item--live { border-color: var(--warning-line); background: var(--warning-tint); }
.gate__item--live .gate__icon { border-color: var(--warning); color: var(--warning-text); }

/* --- data rows ------------------------------------------------------- */

.rows { display: grid; }
.rows > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s4);
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.rows > div:last-child { border-bottom: 0; }
.rows .k { color: var(--text-subtle); flex: none; }
.rows .v {
    color: var(--text);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}
.rows .v.mono { font-family: var(--font-mono); font-size: 13px; }

/* --- console --------------------------------------------------------- */

.console {
    border-radius: var(--r-lg);
    background: var(--console);
    border: 1px solid var(--border-dark);
    overflow: hidden;
}
.console__head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--border-dark);
    background: var(--console-alt);
}
.console__title {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--text-on-dark-muted);
}
.console__actions { margin-left: auto; display: flex; gap: var(--s2); }
.console__btn {
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-on-dark-muted);
    background: transparent;
    border: 1px solid var(--border-dark);
    border-radius: var(--r-sm);
    padding: 6px 10px;
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.console__btn:hover { color: var(--text-on-dark); border-color: var(--text-on-dark-muted); }

.console__body {
    padding: var(--s3) 0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    max-height: 380px;
    overflow: auto;
    overscroll-behavior: contain;
}
.console__foot {
    padding: var(--s3) var(--s4);
    border-top: 1px solid var(--border-dark);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-on-dark-muted);
}

.cline {
    display: flex;
    gap: var(--s3);
    padding: 1px var(--s4);
    color: #CBD5E1;                 /* on --console = 11.6:1 */
    border-left: 2px solid transparent;
}
.cline__n {
    color: #64748B;                 /* on --console = 4.0:1, non-essential */
    width: 40px;
    flex: none;
    text-align: right;
    user-select: none;
}
.cline__t { white-space: pre-wrap; word-break: break-word; min-width: 0; }
.cline--warn  { color: #FCD34D; }   /* on --console = 11.4:1 */
.cline--error {
    color: #FCA5A5;                 /* on --console =  8.2:1 */
    background: rgba(220, 38, 38, .14);
    border-left-color: #DC2626;
}

.console__caret { padding: 1px var(--s4); color: var(--success); }
.console__caret span {
    display: inline-block;
    width: 7px; height: 13px;
    background: var(--success);
    margin-left: 6px;
    vertical-align: -2px;
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%, 55% { opacity: 1 } 56%, 100% { opacity: 0 } }

/* --- alerts ---------------------------------------------------------- */

.alert {
    display: flex;
    gap: var(--s3);
    padding: var(--s4);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-body);
}
.alert__icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.alert--info    { background: var(--brand-tint);   border-color: var(--brand-tint-line); color: var(--brand-text); }
.alert--error   { background: var(--danger-tint);  border-color: var(--danger-line);     color: var(--danger-text); }
.alert--success { background: var(--success-tint); border-color: var(--success-line);    color: var(--success-text); }

/* --- failure block --------------------------------------------------- */

.failure__title { color: var(--danger-text); }
.checklist { display: grid; gap: var(--s2); }
.checklist li {
    list-style: none;
    display: flex;
    gap: var(--s2);
    font-size: 14px;
    color: var(--text-body);
}
.checklist li::before {
    content: '→';
    color: var(--danger);
    flex: none;
    font-weight: 700;
}

/* --- ad slots ---------------------------------------------------------
   Placement is a POLICY CONTROL, not decoration. From the plan:
     - nothing within ~150px of a primary action (accidental-click proximity
       is the fastest route to an account strike, and the ad account funds
       the entire service)
     - never inside an error log
     - at most 3 units per view
     - nothing on a thin page (uploading/validating render no slot at all)
   `--ad-standoff` is that 150px, written once so it cannot drift. */

.ad-slot {
    --ad-standoff: 160px;
    margin-top: var(--section-gap);
    display: grid;
    place-items: center;
    gap: var(--s2);
    min-height: 120px;
    padding: var(--s4);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
    background: var(--surface-alt);
}
.ad-slot--standoff { margin-top: var(--ad-standoff); }
.ad-slot__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

/* The isolation frame every ad renders inside. The BORDER, the LABEL and the
   reserved height all stay out here in the parent: an ad that fails to fill
   must not collapse the page around it, and the "Advertisement" label must not
   be something an ad network's own document can remove. */
.ad-frame {
    display: block;
    width: 100%;
    min-height: 90px;
    border: 0;
    background: transparent;
    color-scheme: light dark;
}

/* --- rewarded overlay -------------------------------------------------
   Created on click and removed when the ad ends; see job.js. It covers the
   page rather than sitting in the flow because a rewarded ad IS the
   interaction at that moment, and because a full-viewport frame is what the
   creative expects. */
.ad-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: var(--s4);
    background: rgba(15, 23, 42, .72);
}
.ad-overlay__panel {
    position: relative;
    display: grid;
    gap: var(--s3);
    width: min(680px, 100%);
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--s4);
}
.ad-frame--offerwall {
    min-height: min(70vh, 420px);
}
.ad-overlay__close {
    justify-self: end;
    appearance: none;
    /* 44px on both axes. `flex: none` is irrelevant in a grid, but the floor is
       written explicitly for the same reason it is everywhere else here: a tap
       target that shrinks is a defect that only shows up when measured. */
    min-height: 44px;
    min-width: 44px;
    padding: 0 var(--s4);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md, 10px);
    background: var(--surface);
    color: var(--text-body);
    font: 600 14px/1 var(--font, system-ui), sans-serif;
    cursor: pointer;
}
.ad-overlay__close:hover { background: var(--surface-alt); }
.ad-overlay__close:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* --- footer ---------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding-block: var(--s6);
}
.footer__inner {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--page-pad);
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3) var(--s6);
    align-items: center;
    font-size: 13px;
    color: var(--text-subtle);
}

/* --- utilities ------------------------------------------------------- */

.hidden, [hidden] { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--s4);
    top: -100px;
    z-index: 50;
    padding: var(--s3) var(--s4);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    transition: top var(--dur-base) var(--ease);
}
.skip-link:focus { top: var(--s4); }

.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

.tnum { font-variant-numeric: tabular-nums; }

/* --- branded layout and component refinements ------------------------ */
html { scroll-padding-top: var(--s24); }
:where(button, summary, select):focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
main { padding-block: var(--s12) var(--s20); }
.appbar { background: var(--surface-alt); }
.appbar__inner { min-height: var(--s20); }
.logo { gap: var(--s2); }
.logo__symbol { display: block; width: 52px; height: 52px; flex: none; border-radius: var(--r-md); background: var(--logo-plate); }
.logo__word { font-size: 25px; font-weight: 800; letter-spacing: -.055em; }
.logo__word > span { color: var(--brand-green); }
.app-nav { display: flex; align-items: center; gap: var(--s8); margin-left: var(--s12); font-size: 13px; }
.app-nav a { color: var(--text-muted); font-weight: 650; padding-block: var(--s3); }
.appbar__cta { min-height: 44px; font-size: 13px; }
.theme-toggle { display: inline-flex; align-items: center; gap: var(--s2); min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-full); padding: 0 var(--s3); background: transparent; color: var(--text-muted); font: 600 12px var(--font); cursor: pointer; }
.theme-toggle:hover { background: var(--surface); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; flex: none; }
.btn { min-height: 48px; font-size: 14px; border-radius: var(--r-full); font-weight: 700; }
.btn--lg { min-height: 56px; font-size: 15px; }
.btn--primary { box-shadow: none; }
.badge { font-size: 11px; font-weight: 700; padding: 6px 10px; }
.badge--mint { background: var(--mint); border-color: var(--mint-line); color: var(--on-mint); }
.landing { display: flex; flex-direction: column; gap: var(--s20); }
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: var(--s16); align-items: start; }
.hero__copy { padding-block: var(--s8); min-width: 0; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: var(--s2); font-size: 11px; font-weight: 700; letter-spacing: .015em; color: var(--text-muted); }
.hero__eyebrow > span { width: 7px; height: 7px; background: var(--success); border-radius: var(--r-full); }
.hero__title { font-size: clamp(40px, 4.1vw, 58px); font-weight: 800; line-height: 1.08; letter-spacing: -.06em; margin-top: var(--s6); text-wrap: initial; }
.hero__title > span { color: var(--brand-text); }
.hero__lead { max-width: 46ch; margin-top: var(--s6); color: var(--text-muted); font-size: 16px; line-height: 1.8; }
.hero__facts { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); list-style: none; margin-top: var(--s6); font-size: 12px; font-weight: 600; color: var(--text-muted); }
.hero__facts li { display: inline-flex; gap: var(--s2); align-items: center; }
.hero__facts li > span { color: var(--success-text); font-weight: 800; }
.hero__footnote { margin-top: var(--s6); font-size: 11px; color: var(--text-subtle); }
.source-flow { display: flex; align-items: center; margin-top: var(--s12); max-width: 390px; }
.source-flow__file { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); width: 90px; height: 112px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); flex: none; }
.source-flow__file::before { content: ''; position: absolute; top: var(--s3); left: var(--s3); height: 3px; width: 14px; border-radius: var(--r-full); background: var(--border-strong); }
.source-flow__extension { font: 600 20px var(--font-mono); color: var(--text); }
.source-flow__caption { font-size: 9px; color: var(--text-muted); }
.source-flow__file--apk { background: var(--mint); border-color: var(--mint-line); }
.source-flow__file--apk .source-flow__extension, .source-flow__file--apk .source-flow__caption { color: var(--on-mint); }
.source-flow__file--apk::before { background: var(--on-mint); opacity: .5; }
.source-flow__line { height: 1px; min-width: 14px; flex: 1; background: var(--border-strong); }
.source-flow__line::after { content: ''; display: block; width: 5px; height: 5px; border-top: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); transform: translateY(-2px) rotate(45deg); margin-left: auto; }
.source-flow__engine { width: 72px; height: 72px; display: grid; place-items: center; flex: none; border-radius: var(--r-lg); background: var(--logo-plate); margin-inline: var(--s2); }
.source-flow__engine img { width: 72px; height: 72px; display: block; }
.upload-panel { box-shadow: var(--shadow-md); scroll-margin-top: var(--s6); min-width: 0; }
.upload-panel .card__body { padding: var(--s8); gap: var(--s5); }
.section-label { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.t-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; }
.upload-panel .t-h2 { font-size: 26px; font-weight: 750; letter-spacing: -.04em; }
.dropzone { padding: var(--s6) var(--s4); gap: var(--s3); background: var(--surface-alt); border-width: 1px; border-radius: var(--r-md); }
.dropzone__icon { width: 52px; height: 52px; border: 0; background: var(--brand-tint); box-shadow: none; border-radius: var(--r-md); }
.dropzone__title { font-size: 14px; font-weight: 700; }
.dropzone .t-small { font: 10px/1.6 var(--font-mono); }
.dropzone .btn { font-size: 13px; min-height: 48px; padding-inline: var(--s5); }
.dropzone .btn--secondary { min-height: 44px; font-size: 12px; }
.upload-panel .t-note { font-size: 12px; line-height: 1.8; }
.upload-panel .card__foot { padding: var(--s5) var(--s8); }
.upload-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.upload-specs > div { display: flex; flex-direction: column; gap: var(--s1); font-size: 10px; }
.upload-specs span { color: var(--text-subtle); }
.upload-specs strong { color: var(--text-body); font-size: 10px; font-weight: 650; }
.filecard { padding: var(--s3); gap: var(--s2); border-radius: var(--r-md); }
.filecard__name { font-size: 12px; }
.filecard__meta { flex: 1; }
.filecard__end .btn { padding-inline: var(--s3); font-size: 12px; }
.benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s8); padding: var(--s8) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.benefits > div { display: flex; align-items: flex-start; gap: var(--s3); }
.benefits__icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--brand-text); font-size: 18px; }
.benefits strong { font-size: 14px; color: var(--text); font-weight: 750; }
.benefits p { font-size: 13px; color: var(--text-muted); margin-top: var(--s1); }
.workflow { scroll-margin-top: var(--s6); }
.section-heading { display: grid; gap: var(--s3); margin-bottom: var(--s8); }
.t-section { font-size: 36px; line-height: 1.2; font-weight: 750; letter-spacing: -.045em; }
.steplist { gap: var(--s4); }
.steplist__item { flex-direction: column; padding: var(--s6); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); gap: var(--s8); }
.steplist__num { border-radius: var(--r-md); border: 0; background: var(--brand-tint); font: 500 12px var(--font-mono); width: 40px; height: 40px; }
.steplist__item:last-child .steplist__num { background: var(--mint); color: var(--on-mint); }
.steplist__title { font-size: 15px; font-weight: 750; margin-bottom: var(--s3); }
.steplist__item .t-small { font-size: 14px; line-height: 1.8; }
.project-guide { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: var(--s20); padding: var(--s10); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); scroll-margin-top: var(--s6); }
.project-guide__intro { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); }
.project-guide__intro a { margin-top: var(--s3); font-size: 12px; }
.project-guide__intro .t-small { max-width: 28ch; font-size: 14px; }
.faq { min-width: 0; }
.faq details { border-bottom: 1px solid var(--border); padding-block: var(--s4); }
.faq details:first-child { padding-top: 0; }
.faq details:last-child { border-bottom: 0; padding-bottom: 0; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.7; min-height: 44px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 20px; font-weight: 400; color: var(--text-subtle); }
.faq details[open] summary::after { content: '−'; }
.faq p { font-size: 13px; line-height: 1.9; color: var(--text-muted); margin-top: var(--s3); }
.landing > .ad-slot { margin-top: 0; }
.footer { background: var(--surface-alt); padding-block: var(--s8); }
.footer--wide .footer__inner { max-width: var(--page-max-wide); }
.footer__inner { gap: var(--s3) var(--s6); font-size: 11px; }
.footer__brand { font-weight: 800; color: var(--text); margin-right: auto; }
.footer__brand > span { font-weight: 400; margin-left: var(--s2); color: var(--text-muted); }
.build-shell > .stack:first-child { padding-block: var(--s3) var(--s2); }
.build-shell .t-h1 { letter-spacing: -.045em; font-weight: 750; }
.build-shell .t-lead { font-size: 15px; line-height: 1.8; }
.build-shell .card__body { padding: var(--s8); }
.build-shell .card__head { padding: var(--s5) var(--s8); }
.build-shell .t-h3 { font-size: 18px; font-weight: 750; }
.build-shell .rows { font-family: var(--font-mono); }
.build-shell .rows > div { font-size: 12px; padding-block: var(--s4); }
.build-shell .rows .v { font-family: var(--font); font-size: 13px; }
.build-shell #result-card { border-color: var(--success-line); }
.phase--done .phase__dot, .gate__item--done .gate__icon { color: var(--on-success); }
.console__btn { min-height: 44px; min-width: 44px; }
@media (min-width: 1100px) { .upload-panel .card__body { padding: var(--s8); } }
@media (max-width: 1000px) {
    .hero { gap: var(--s8); }
    .app-nav { gap: var(--s5); margin-left: var(--s6); }
    .hero__title { font-size: 44px; }
    .hero__lead { font-size: 14px; }
    .project-guide { gap: var(--s10); }
}
@media (max-width: 767px) {
    main { padding-block: var(--s8) var(--s12); }
    .appbar__inner { min-height: 72px; gap: var(--s2); }
    .logo__symbol { width: 44px; height: 44px; }
    .logo__word { font-size: 21px; }
    .app-nav { display: none; }
    .appbar__end { gap: var(--s2); }
    .appbar__cta { font-size: 11px; padding-inline: var(--s3); min-height: 44px; }
    .hero { grid-template-columns: 1fr; gap: var(--s8); }
    .hero__copy { padding-block: var(--s2) 0; }
    .hero__title { font-size: clamp(32px, 7.8vw, 42px); margin-top: var(--s5); }
    .hero__lead { font-size: 14px; max-width: 48ch; line-height: 1.8; margin-top: var(--s5); }
    .hero__eyebrow { font-size: 10px; }
    .hero__facts { font-size: 11px; gap: var(--s3); margin-top: var(--s4); }
    .source-flow { margin-top: var(--s8); max-width: 340px; }
    .source-flow__file { width: 80px; height: 96px; }
    .source-flow__engine, .source-flow__engine img { width: 64px; height: 64px; }
    .hero__footnote { font-size: 10px; }
    .landing { gap: var(--s12); }
    .benefits { grid-template-columns: 1fr; gap: var(--s5); padding-block: var(--s6); }
    .benefits strong { font-size: 13px; }
    .benefits p { font-size: 12px; }
    .steplist { grid-template-columns: 1fr; }
    .steplist__item { flex-direction: row; gap: var(--s4); }
    .steplist__item .t-small { max-width: 40ch; }
    .t-section { font-size: 28px; }
    .project-guide { grid-template-columns: 1fr; gap: var(--s6); padding: var(--s6); }
    .project-guide__intro .t-small { max-width: 44ch; }
    .footer__inner { align-items: flex-start; flex-direction: column; gap: var(--s2); }
    .footer__brand { margin-bottom: var(--s2); }
    .build-shell .card__body { padding: var(--s6); }
    .build-shell .card__head { padding: var(--s4) var(--s6); }
}
@media (max-width: 600px) {
    #theme-name { display: none; }
    .theme-toggle { padding: 0; justify-content: center; }
}
@media (max-width: 380px) {
    .appbar__cta { display: none; }
    .upload-panel .card__body { padding: var(--s5); }
    .upload-panel .card__foot { padding-inline: var(--s5); }
    .badge { font-size: 10px; }
}

.link-arrow { display: inline-block; width: 1em; height: 1em; flex: none; vertical-align: -.1em; }

/* Supplied logo is the single hero illustration; all other surfaces stay quiet. */
.source-flow--brand { margin-top: var(--s6); gap: var(--s6); max-width: 440px; }
.hero__mascot { display: block; width: 200px; height: 200px; object-fit: contain; flex: none; }
.hero__artifact-label { display: grid; gap: var(--s3); color: var(--text-muted); font: 11px/1.6 var(--font-mono); }
.hero__artifact-label strong { color: var(--brand-text); font-size: 18px; font-weight: 600; }
.robot-credit { margin-top: var(--s3); font-size: 10px; color: var(--text-subtle); }
@media (max-width: 767px) {
    .hero__mascot { width: 160px; height: 160px; }
    .source-flow--brand { gap: var(--s5); }
}
@media (max-width: 380px) {
    .hero__mascot { width: 136px; height: 136px; }
    .hero__artifact-label { font-size: 10px; }
}
