:root {
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --surface-muted: #f8fafc;
    --surface-accent: #eff6ff;
    --ink: #0f172a;
    --ink-soft: #475569;
    --ink-muted: #94a3b8;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --accent: #0284c7;
    --accent-soft: #e0f2fe;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --error: #dc2626;
    --error-soft: #fef2f2;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --info: #0284c7;
    --info-soft: #f0f9ff;
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --radius-xl: 12px;
    --radius-lg: 8px;
    --radius-md: 6px;
    --radius-sm: 4px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}

.app-shell {
    position: relative;
    max-width: 1480px;
    margin: 0 auto;
    padding: 20px 20px 40px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 22px 28px;
    border-radius: var(--radius-xl);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-accent);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(37, 99, 235, 0.16);
}

.hero__title {
    margin: 10px 0 6px;
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.hero__description {
    max-width: 760px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.6;
}

.hero__description--compact {
    max-width: none;
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap;
}

.category-bar {
    margin-top: 16px;
}

.category-bar__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-pill {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 15px;
    background: #ffffff;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-pill:hover {
    transform: translateY(-1px);
    background: #f8fafc;
    color: var(--ink);
    border-color: var(--line-strong);
}

.category-pill:focus-visible,
.service-card:focus-visible,
.tool-card:focus-visible,
.module-nav__home:focus-visible,
.back-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.primary-button:focus-visible,
.download-button:focus-visible,
.tab-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.category-pill.active {
    background: var(--ink);
    color: #ffffff;
    border-color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.app-main {
    margin-top: 20px;
}

.welcome-view,
.module-view {
    min-height: 420px;
}

.section-head,
.tool-detail__header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.section-head h2,
.module-shell__title,
.tool-detail__title {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.section-head p,
.module-shell__desc,
.tool-detail__subtitle {
    margin: 6px 0 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-accent);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.16);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.card-grid,
.summary-grid,
.stat-grid,
.field-grid,
.tool-grid,
.content-grid,
.result-columns {
    display: grid;
    gap: 16px;
}

.card-grid {
    margin-top: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.service-card,
.surface-card,
.module-shell,
.tool-detail,
.signature-card,
.summary-item,
.stat-card,
.signature-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.service-card {
    position: relative;
    width: 100%;
    padding: 18px 20px;
    appearance: none;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.service-card:hover,
.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #93c5fd;
}

.service-card__eyebrow,
.module-shell__eyebrow {
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.service-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.service-card__icon,
.tool-card__icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-accent);
    color: var(--primary);
    font-size: 18px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    flex-shrink: 0;
}

.service-card__title,
.tool-card__title {
    margin: 6px 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.service-card__summary,
.tool-card__summary {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.55;
    min-height: 52px;
    overflow-wrap: anywhere;
    flex-grow: 1;
}

.service-card__meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--ink-muted);
    font-size: 12px;
}

.service-card__meta > span:first-child {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-soft);
}

.service-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
    transition: transform 0.15s ease;
}

.service-card:hover .service-card__cta i {
    transform: translateX(3px);
}

.module-shell {
    padding: 24px;
}

.module-shell__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.demo-flow,
.agreement-panel,
.agreement-panel__meta,
.timeline-list,
.timeline-item,
.replay-stage,
.replay-stage__player,
.demo-preview-grid,
.demo-step-grid,
.demo-step-card,
.demo-fold,
.demo-fold > div,
.demo-flow__controls {
    min-width: 0;
}

.demo-flow {
    display: grid;
    gap: 20px;
}

.demo-flow__controls {
    margin-top: 18px;
}

.agreement-panel {
    display: grid;
    gap: 16px;
}

.agreement-panel__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.agreement-panel__meta > div {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.agreement-content {
    max-height: 460px;
    overflow: auto;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
    line-height: 1.8;
}

.agreement-content h3,
.agreement-content h4 {
    margin-top: 0;
}

.agreement-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.agreement-actions__checkbox {
    flex: 1 1 360px;
}

.status-grid--compact {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.status-pill--info {
    background: var(--info-soft);
    color: var(--info);
}

.status-pill--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-pill--success {
    background: var(--success-soft);
    color: var(--success);
}

.replay-stage {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: #edf1f5;
    padding: 12px;
}

.replay-stage--wide {
    padding: 16px;
}

.replay-stage__player {
    min-height: 420px;
    overflow: auto;
    border-radius: var(--radius-md);
    background: #ffffff;
}

.replay-stage__player--wide {
    min-height: 680px;
}

.timeline-list {
    display: grid;
    gap: 10px;
    overflow: auto;
}

.timeline-list--wide {
    max-height: none;
}

.timeline-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.timeline-item__time {
    font-family: var(--font-mono);
    color: var(--ink-muted);
}

.timeline-item__title {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.timeline-item__detail {
    margin-top: 4px;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.surface-card__title--small {
    font-size: 16px;
}

.demo-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.demo-step-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.demo-step-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
}

.demo-step-card__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-accent);
    color: var(--primary-strong);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.demo-fold {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    overflow: hidden;
}

.demo-fold summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 18px;
    font-weight: 700;
    color: var(--ink);
}

.demo-fold summary::-webkit-details-marker {
    display: none;
}

.demo-fold[open] summary {
    border-bottom: 1px solid var(--line);
}

.demo-fold > div {
    padding: 0 18px 18px;
}

@media (max-width: 1180px) {
    .demo-preview-grid,
    .demo-step-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .agreement-actions,
    .surface-card__toolbar {
        align-items: stretch;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .replay-stage__player,
    .agreement-content {
        max-height: none;
    }

    .replay-stage__player--wide {
        min-height: 440px;
    }
}

.module-nav__home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.module-nav__link {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--primary-strong);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.module-nav__link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.module-nav__trail {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--ink-muted);
    font-size: 14px;
    min-width: 0;
}

.module-nav__trail i {
    font-size: 11px;
    color: var(--ink-muted);
}

.module-nav__context {
    color: var(--ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.module-nav__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.module-shell__head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-top: 20px;
}

.module-shell__body {
    margin-top: 24px;
}

.module-shell__meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

.workspace-grid--wide {
    grid-template-columns: 1fr;
}

.workspace-grid--stacked {
    grid-template-columns: 1fr;
}

.workspace-grid__form,
.workspace-grid__result {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.result-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-columns--wide {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
}

.result-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-browser {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.tool-browser__selector,
.tool-browser__detail {
    min-width: 0;
}

.tool-browser__selector .surface-card {
    position: static;
}

.tool-grid {
    margin-top: 14px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

button.tool-card {
    appearance: none;
    text-align: left;
    font: inherit;
}

.tool-card .tool-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 20px;
}

.tool-card .tool-card__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    color: var(--ink);
    font-weight: 700;
}

.tool-card .tool-card__summary {
    line-height: 1.5;
    min-height: 0;
    color: var(--ink-soft);
}

.tool-card.active {
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
    background: #ffffff;
}

.tool-detail {
    margin-top: 0;
    padding: 24px;
    min-height: 420px;
}

.tool-detail--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-gap-top {
    margin-top: 18px;
}

.back-button,
.secondary-button,
.ghost-button,
.primary-button,
.download-button,
.tab-button {
    border: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.back-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
}

.back-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
    background: #f8fafc;
    border-color: #94a3b8;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.ghost-button:hover {
    background: var(--surface-muted);
    color: var(--ink);
    border-color: var(--line);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary-strong);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.primary-button:hover {
    background: var(--primary-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--accent);
    color: #ffffff;
    border: 1px solid #0369a1;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.download-button:hover {
    background: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
}

button:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.surface-card {
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.surface-card--muted {
    background: var(--surface-muted);
    border-color: var(--line);
}

.surface-card__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
}

.surface-card__subtitle {
    margin: 0 0 14px;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.55;
}

.surface-card__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field,
.field--span-2,
.file-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field--span-2,
.file-field {
    grid-column: 1 / -1;
}

.field label,
.field--span-2 label,
.file-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.field input,
.field textarea,
.field select,
.field--span-2 input,
.field--span-2 textarea,
.field--span-2 select,
.file-field input[type="file"] {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--ink);
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.45;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
    min-height: 100px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 13px;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.file-field input[type="file"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field input[type="checkbox"],
.field input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
    box-shadow: none;
}

.file-field {
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1.5px dashed var(--line-strong);
    background: var(--surface-muted);
    transition: all 0.15s ease;
}

input[type="file"] {
    color: var(--ink-soft);
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    margin-right: 12px;
    background: #ffffff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.15s ease;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

[hidden] {
    display: none !important;
}

.assist-text {
    margin: 0;
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.5;
}

.remember-row,
.inline-check,
.action-row,
.download-group,
.stack-actions,
.preset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.action-row {
    margin-top: 18px;
}

.output-panel {
    min-height: 220px;
    border-radius: var(--radius-lg);
    padding: 16px;
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid #1e293b;
    overflow: auto;
    max-width: 100%;
    overscroll-behavior: contain;
}

.output-panel pre,
.output-panel code {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.module-shell__body,
.surface-card,
.surface-card__toolbar,
.field-grid,
.download-group,
.action-row,
.preset-actions,
.remember-row,
.module-nav__trail,
.module-nav__actions,
.module-shell__nav,
.module-shell__head {
    min-width: 0;
}

.output-panel--light {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.strategy-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.apk-workbench {
    display: grid;
    gap: 20px;
}

.toolchain-status {
    display: grid;
    gap: 14px;
}

.toolchain-status__banner {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(245, 158, 11, 0.28);
    background: rgba(255, 251, 235, 0.92);
    color: #92400e;
}

.toolchain-status__banner.is-ready {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(240, 253, 244, 0.92);
    color: #166534;
}

.toolchain-status__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toolchain-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 700;
}

.toolchain-chip.is-ok {
    color: #166534;
    background: rgba(240, 253, 244, 0.92);
}

.toolchain-chip.is-missing {
    color: #991b1b;
    background: rgba(254, 242, 242, 0.92);
}

.apk-step-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.apk-step-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.apk-step-card {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    gap: 8px;
    min-width: 0;
}

.apk-step-card h4,
.apk-step-card p {
    margin: 0;
}

.apk-step-card__index {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.apk-step-card__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(123, 135, 148, 0.12);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.apk-step-card--completed .apk-step-card__status {
    background: var(--success-soft);
    color: var(--success);
}

.apk-step-card--running .apk-step-card__status,
.apk-step-card--queued .apk-step-card__status,
.apk-step-card--signing .apk-step-card__status {
    background: var(--info-soft);
    color: var(--info);
}

.apk-step-card--failed .apk-step-card__status {
    background: rgba(185, 28, 28, 0.12);
    color: #b91c1c;
}

.apk-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(123, 135, 148, 0.14);
    overflow: hidden;
}

.apk-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #0f766e);
    transition: width .2s ease;
}

.apk-stage-panels {
    display: grid;
    gap: 14px;
}

.evidence-list {
    display: grid;
    gap: 10px;
}

.evidence-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
}

.evidence-item p {
    margin: 4px 0 0;
    color: var(--ink-soft);
    line-height: 1.55;
}

.evidence-item.is-pass {
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(240, 253, 244, 0.96);
}

.evidence-item.is-pass i {
    color: #16a34a;
}

.evidence-item.is-fail {
    border-color: rgba(185, 28, 28, 0.25);
    background: rgba(254, 242, 242, 0.96);
}

.evidence-item.is-fail i {
    color: #b91c1c;
}

.strategy-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.98);
    min-width: 0;
}

.strategy-option input {
    margin-top: 3px;
}

.artifact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.content-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.strategy-result {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
}

.strategy-result--applied {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(240, 253, 244, 0.98);
}

.strategy-result--prepared {
    border-color: rgba(59, 130, 246, 0.25);
    background: rgba(239, 246, 255, 0.98);
}

.strategy-result--deferred {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(255, 251, 235, 0.98);
}

.strategy-result__title {
    font-weight: 700;
    color: var(--ink);
}

.strategy-result__status {
    margin-top: 4px;
    font-size: 13px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.strategy-result__desc {
    margin: 10px 0 0;
    color: var(--ink-soft);
    line-height: 1.6;
}

.details-summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--ink);
    list-style: none;
}

.details-summary::-webkit-details-marker {
    display: none;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    line-height: 1.6;
}

.notice--info {
    color: var(--info);
    background: var(--info-soft);
    border-color: rgba(21, 94, 239, 0.16);
}

.notice--success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(22, 101, 52, 0.16);
}

.notice--error {
    color: var(--error);
    background: var(--error-soft);
    border-color: rgba(180, 35, 24, 0.16);
}

.notice--warning {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(180, 83, 9, 0.16);
}

.tab-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding: 4px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    width: fit-content;
    max-width: 100%;
}

.tab-button {
    padding: 7px 16px;
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-button:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.7);
}

.tab-button.active {
    background: #ffffff;
    color: var(--ink);
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

.tab-panel {
    margin-top: 0;
}

.summary-grid,
.stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-item,
.stat-card {
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.summary-item strong,
.stat-card strong,
.kpi {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.summary-item span,
.stat-card span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--ink-soft);
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: #ffffff;
}

.metrics-table th,
.metrics-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.metrics-table th {
    background: var(--surface-muted);
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.metrics-table tr:hover td {
    background: #f8fafc;
}

.metrics-table td:last-child,
.metrics-table th:last-child {
    text-align: right;
}

.tree-view,
.details-tree {
    min-height: 320px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    padding: 16px 18px;
    overflow: auto;
    min-width: 0;
}

.tree-view--tall {
    min-height: 520px;
}

.tree-view--xlarge {
    min-height: 720px;
}

.tree-view ul,
.details-tree ul {
    list-style: none;
    margin: 8px 0 0 16px;
    padding-left: 16px;
    border-left: 1px solid rgba(31, 41, 51, 0.12);
}

.tree-view li,
.details-tree li {
    margin: 8px 0;
}

.toggler,
.tree-toggle {
    display: inline-flex;
    width: 20px;
    justify-content: center;
    margin-right: 6px;
    color: var(--ink-muted);
    cursor: pointer;
    user-select: none;
}

.nested,
.signature-body {
    display: none;
}

.nested.active,
.signature-body.active {
    display: block;
}

.node-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.node-text {
    min-width: 0;
    flex: 1 1 auto;
}

.node-name {
    font-weight: 700;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.node-type {
    color: var(--primary);
    font-style: italic;
    overflow-wrap: anywhere;
}

.node-value {
    margin-top: 4px;
    color: var(--ink-soft);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.node-description {
    margin: 6px 0 0;
    color: var(--ink-muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.signature-panel {
    overflow: hidden;
}

.signature-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    background: rgba(15, 118, 110, 0.08);
    cursor: pointer;
}

.signature-body {
    padding: 18px 20px 22px;
}

.compact-list,
.stack-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.issue-list,
.bullet-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.issue-item,
.bullet-list > li {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.issue-item--high {
    border-left: 4px solid var(--error);
}

.issue-item--medium {
    border-left: 4px solid var(--warning);
}

.issue-item--low {
    border-left: 4px solid var(--info);
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.kv-card {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    min-width: 0;
    overflow-wrap: anywhere;
}

.kv-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--ink);
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.score-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.score-card__value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
}

.score-card__label {
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.metrics-table td,
.metrics-table th,
.summary-item span,
.summary-item strong,
.kv-card div,
.kv-card strong,
.issue-item div,
.issue-item strong {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.status-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-inline--success {
    background: var(--success-soft);
    color: var(--success);
}

.status-inline--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-inline--error {
    background: var(--error-soft);
    color: var(--error);
}

.status-inline--info {
    background: var(--info-soft);
    color: var(--info);
}

.panel-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.bullet-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.compact-list > div,
.stack-list > div {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    border: 1px solid var(--line);
}

.app-footer {
    margin-top: 32px;
    padding: 16px 20px;
    border-radius: var(--radius-xl);
    background: #ffffff;
    color: var(--ink-soft);
    font-size: 13px;
    text-align: center;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
}

.app-footer p {
    margin: 0;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
}

.loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    min-width: 220px;
    border-radius: var(--radius-xl);
    background: #ffffff;
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
}

.loading-panel__icon {
    font-size: 26px;
    color: var(--primary);
}

.loading-panel__text {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
}

.status-ok {
    color: var(--success);
}

.status-fail {
    color: var(--error);
}

.status-info {
    color: var(--info);
}

.consent-layout {
    display: grid;
    gap: 18px;
}

.consent-page {
    display: grid;
    gap: 20px;
}

.consent-hero {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.consent-hero--compact {
    gap: 0;
    padding: 14px 18px;
}

.consent-hero__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.consent-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.consent-stage-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.consent-hero--compact .consent-stage-bar {
    display: none !important;
}

.consent-stage-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.consent-stage-pill--pending {
    background: rgba(123, 135, 148, 0.12);
    color: var(--ink-soft);
    border-color: rgba(123, 135, 148, 0.12);
}

.consent-stage-pill--current {
    background: var(--info-soft);
    color: var(--info);
    border-color: rgba(21, 94, 239, 0.16);
}

.consent-stage-pill--done {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(22, 101, 52, 0.16);
}

.consent-frame-shell {
    min-height: 720px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.consent-frame {
    width: 100%;
    min-height: 720px;
    border: 0;
    display: block;
    background: transparent;
}

.consent-player-panel {
    display: grid;
    gap: 18px;
}

.consent-player {
    display: grid;
    gap: 14px;
}

.consent-player__toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.consent-replay-stage {
    min-height: 720px;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    overflow: hidden;
    display: grid;
    align-items: start;
}

.consent-replay-root,
.consent-replay-root > div,
.consent-replay-root iframe {
    width: 100%;
}

.consent-replay-root {
    min-height: 680px;
}

.consent-replay-root iframe {
    min-height: 680px;
    border: 0;
    border-radius: 20px;
    background: #ffffff;
}

.consent-info-grid,
.consent-fold-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.consent-modal {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: min(460px, calc(100vw - 32px));
    width: min(460px, calc(100vw - 32px));
}

.consent-modal::backdrop {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
}

.consent-modal__card {
    display: grid;
    gap: 16px;
    padding: 26px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 32px);
    overflow: auto;
}

.consent-modal__card h3,
.consent-modal__card p {
    margin: 0;
}

.consent-modal__icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--success-soft);
    color: var(--success);
    font-size: 24px;
}

.consent-modal__icon--error {
    background: rgba(185, 28, 28, 0.12);
    color: #b91c1c;
}

.consent-workbench__header {
    align-items: flex-start;
}

.consent-toolbar {
    flex-wrap: wrap;
}

.consent-capture-scope {
    position: relative;
}

.consent-player {
    display: grid;
    gap: 14px;
}

.replay-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.replay-progress {
    flex: 1 1 260px;
    min-width: 180px;
}

.replay-time {
    min-width: 120px;
    font-family: Consolas, monospace;
    color: var(--ink-soft);
    text-align: right;
}

.replay-stage__player--wide {
    min-height: 720px;
    padding: 12px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    overflow: auto;
}

.consent-replay-root,
.consent-replay-root > div,
.consent-replay-root iframe {
    width: 100%;
}

.consent-replay-root iframe {
    min-height: 660px;
}

.demo-preview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 16px;
    margin-top: 16px;
}

.demo-fold {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.demo-fold summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    font-weight: 700;
}

.demo-fold summary::-webkit-details-marker {
    display: none;
}

.demo-fold > :not(summary) {
    padding: 0 16px 16px;
}

.timeline-list--wide {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(243, 239, 231, 0.88);
    min-width: 0;
}

.timeline-item__time {
    font-family: Consolas, monospace;
    color: var(--ink-soft);
}

.timeline-item__title {
    font-weight: 700;
    color: var(--ink);
}

.timeline-item__detail {
    color: var(--ink-soft);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.compact-list {
    display: grid;
    gap: 12px;
}

.compact-list > div,
.kv-card {
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.consent-recording-active .consent-recording-blocked {
    display: none !important;
}

body.consent-recording-active .consent-capture-scope,
body.consent-recording-active .consent-workbench {
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
}

@media (max-width: 1180px) {
    .workspace-grid,
    .tool-browser {
        grid-template-columns: 1fr;
    }

    .tool-browser__selector .surface-card {
        position: static;
    }
}

@media (max-width: 1024px) {
    .module-shell,
    .tool-detail,
    .hero {
        padding: 24px;
    }

    .section-head,
    .module-shell__nav,
    .tool-detail__header,
    .module-shell__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .module-nav__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .result-columns,
    .result-columns--wide,
    .panel-split,
    .workspace-grid--wide,
    .demo-preview-grid,
    .consent-info-grid,
    .consent-fold-grid {
        grid-template-columns: 1fr;
    }

    .consent-hero__main {
        flex-direction: column;
    }

    .consent-stage-bar {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .app-shell {
        padding: 16px 14px 32px;
    }

    .hero {
        padding: 22px 20px;
        border-radius: 24px;
    }

    .hero__description--compact {
        white-space: normal;
    }

    .field-grid,
    .card-grid,
    .content-grid,
    .summary-grid,
    .stat-grid,
    .strategy-picker {
        grid-template-columns: 1fr;
    }

    .module-shell,
    .tool-detail,
    .surface-card,
    .service-card {
        border-radius: 22px;
    }

    .service-card__summary,
    .tool-card__summary {
        min-height: 0;
    }

    .action-row,
    .download-group,
    .preset-actions,
    .remember-row,
    .surface-card__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-row .primary-button,
    .action-row .secondary-button,
    .action-row .ghost-button,
    .download-group .download-button {
        width: 100%;
        justify-content: center;
    }

    .replay-toolbar {
        align-items: stretch;
    }

    .replay-time {
        width: 100%;
        text-align: left;
    }

    .replay-stage__player--wide {
        min-height: 420px;
    }

    .consent-replay-root iframe {
        min-height: 400px;
    }

    .output-panel {
        min-height: 180px;
        padding: 14px;
    }

    .module-shell__nav,
    .module-shell__head,
    .module-nav__trail,
    .module-nav__actions {
        gap: 12px;
        flex-wrap: wrap;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .consent-top-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .consent-top-actions .primary-button,
    .consent-top-actions .secondary-button,
    .consent-top-actions .ghost-button {
        width: 100%;
        justify-content: center;
    }

    .consent-frame-shell,
    .consent-frame {
        min-height: 480px;
    }

    .consent-replay-stage {
        min-height: 380px;
        padding: 12px;
    }

    .consent-replay-root,
    .consent-replay-root > div,
    .consent-replay-root iframe {
        min-height: 320px;
    }

    .tab-strip {
        width: 100%;
    }

    .tab-button {
        flex: 1 1 calc(50% - 10px);
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero__title,
    .section-head h2,
    .module-shell__title,
    .tool-detail__title {
        font-size: 28px;
    }

    .hero,
    .service-card,
    .surface-card,
    .module-shell,
    .tool-detail {
        padding: 18px;
    }

    .hero__description--compact {
        font-size: 14px;
    }

    .summary-item strong,
    .stat-card strong,
    .kpi {
        font-size: 24px;
    }

    .module-nav__trail {
        font-size: 13px;
    }

    .output-panel {
        min-height: 150px;
        padding: 12px;
    }

    .consent-frame-shell,
    .consent-frame {
        min-height: 420px;
    }

    .consent-replay-stage {
        min-height: 380px;
    }
}

/* Consent timestamp demo overrides */
.consent-page--timestamp {
    display: grid;
    gap: 20px;
}

.consent-page--timestamp .consent-hero {
    padding: 24px;
}

.consent-page--timestamp .consent-hero--compact {
    padding: 14px 18px;
}

.consent-page--timestamp .consent-workbench__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.consent-page--timestamp .consent-stage-bar,
.consent-page--timestamp .consent-hero--compact .consent-stage-bar {
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
}

.consent-page--timestamp .consent-stage-pill {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
}

.consent-phone-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
    width: 100%;
}

.consent-phone-frame {
    width: 405px;
    max-width: 100%;
    margin: 0 auto;
    padding: 14px 14px 18px;
    border-radius: 46px;
    background: #0f172a;
    border: 3.5px solid #334155;
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.25s ease;
}

.consent-phone-frame__notch {
    width: 110px;
    height: 18px;
    background: #020617;
    border-radius: 0 0 14px 14px;
    margin: -2px auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.consent-phone-frame__speaker {
    width: 42px;
    height: 4px;
    background: #334155;
    border-radius: 999px;
}

.consent-phone-frame__camera {
    width: 7px;
    height: 7px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 50%;
}

.consent-phone-frame__screen {
    width: 375px;
    height: 667px;
    max-width: 100%;
    border-radius: 26px;
    overflow: hidden;
    background: #ffffff;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.consent-phone-frame .consent-frame {
    width: 375px;
    height: 667px;
    border: 0;
    display: block;
    background: #ffffff;
    margin: 0;
}

.consent-phone-frame__home-bar {
    width: 120px;
    height: 4px;
    background: #475569;
    border-radius: 999px;
    margin: 12px auto 0;
}

/* 手机扫码与模拟器协同布局 */
.consent-operation-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 28px;
    align-items: start;
    margin-top: 18px;
}

@media (max-width: 960px) {
    .consent-operation-grid {
        grid-template-columns: 1fr;
    }
}

.consent-qr-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.consent-qr-panel__head {
    margin-bottom: 16px;
}

.consent-qr-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #0f766e;
    background: #ccfbf1;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.consent-qr-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.consent-qr-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.consent-qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 20px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.consent-qr-box {
    width: 190px;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 6px;
    border-radius: 8px;
    overflow: hidden;
}

.consent-qr-box img {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.consent-qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
}

.consent-qr-status {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.consent-qr-status--waiting {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.consent-qr-status--connected {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.consent-qr-status--submitted {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(71, 85, 105, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(71, 85, 105, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(71, 85, 105, 0); }
}

.consent-qr-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.copy-input-group {
    display: flex;
    gap: 6px;
    width: 100%;
}

.copy-input-group input {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
}

.consent-qr-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.consent-phone-stage-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.stage-info-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 10px;
}

.consent-page--timestamp .consent-player {
    gap: 16px;
}

.consent-page--timestamp .consent-player__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.consent-page--timestamp .consent-replay-stage {
    min-height: 760px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    padding: 16px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.consent-replay-shell {
    position: relative;
    width: 100%;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.consent-replay-scene {
    position: relative;
    width: 375px;
    height: 667px;
    overflow: hidden;
}

.consent-replay-root {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #ffffff;
}

.consent-replay-root,
.consent-replay-root > div,
.consent-replay-root iframe {
    width: 100%;
    height: 100%;
}

.consent-replay-root iframe {
    border: 0;
    background: #ffffff;
    display: block;
}

.consent-replay-root .replayer-wrapper,
.consent-replay-root .rr-player {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.consent-replay-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.consent-replay-tail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.consent-replay-cursor {
    position: absolute;
    width: 22px;
    height: 30px;
    transform: translate(-3px, -4px);
    filter: drop-shadow(0 8px 20px rgba(15, 118, 110, 0.22));
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='30' viewBox='0 0 22 30'%3E%3Cpath d='M4 2L17 14H11.2L15 27L11 28.5L7.2 15.8L3 20V2Z' fill='%23ffffff' stroke='%230f766e' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.consent-replay-click {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 2px solid rgba(15, 118, 110, 0.95);
    background: rgba(15, 118, 110, 0.24);
    transform: translate(-50%, -50%);
    animation: consent-replay-ripple 520ms ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

.consent-console-entry {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.consent-console-entry:last-child {
    border-bottom: 0;
}

.consent-console-entry__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    flex-wrap: wrap;
}

.consent-console-entry--error strong {
    color: #b91c1c;
}

.consent-console-entry--warning strong {
    color: #b45309;
}

.consent-console-entry--success strong {
    color: #166534;
}

@keyframes consent-replay-ripple {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.4);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(3.5);
    }
}

.consent-page--timestamp .consent-info-grid,
.consent-page--timestamp .consent-fold-grid {
    margin-top: 14px;
}

.consent-page--timestamp .compact-list {
    display: grid;
    gap: 12px;
}

.consent-page--timestamp .demo-fold {
    background: rgba(244, 239, 231, 0.56);
}

.consent-page--timestamp .demo-fold summary {
    font-size: 14px;
}

.consent-page--timestamp .tool-detail__header {
    margin-bottom: 8px;
}

@media (max-width: 1180px) {
    .consent-page--timestamp .consent-hero__main {
        flex-direction: column;
    }

    .consent-page--timestamp .consent-stage-bar {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .apk-step-actions,
    .apk-step-grid,
    .strategy-picker {
        grid-template-columns: 1fr;
    }

    .consent-page--timestamp .consent-top-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .consent-page--timestamp .consent-top-actions .primary-button,
    .consent-page--timestamp .consent-top-actions .secondary-button,
    .consent-page--timestamp .consent-top-actions .ghost-button {
        width: 100%;
        justify-content: center;
    }

    .consent-page--timestamp .consent-player__toolbar {
        gap: 8px;
    }

    .consent-page--timestamp .consent-player__toolbar .primary-button,
    .consent-page--timestamp .consent-player__toolbar .secondary-button,
    .consent-page--timestamp .consent-player__toolbar .ghost-button {
        flex: 1 1 80px;
        justify-content: center;
        padding: 8px 12px;
        font-size: 13px;
    }

    .consent-page--timestamp .consent-player__toolbar .replay-progress {
        width: 100%;
        order: 10;
    }

    .consent-page--timestamp .consent-player__toolbar .replay-time {
        order: 11;
        width: 100%;
        text-align: right;
        font-size: 12px;
    }

    .consent-phone-frame {
        width: 100% !important;
        max-width: 385px !important;
        padding: 10px 8px 14px !important;
        border-radius: 36px !important;
        border-width: 2.5px !important;
    }

    .consent-phone-frame__screen {
        width: 100% !important;
        height: 620px !important;
        border-radius: 22px !important;
    }

    .consent-phone-frame .consent-frame {
        width: 100% !important;
        height: 620px !important;
    }

    .consent-page--timestamp .consent-replay-stage {
        min-height: 700px;
        padding: 8px;
    }

    .consent-replay-shell {
        min-height: 660px;
    }
}
