:root {
    --bg: #0f172a;
    --panel: #111827;
    --card: #1e293b;
    --border: #334155;
    --fg: #e2e8f0;
    --muted: #94a3b8;
    --cyan: #22d3ee;
    --green: #22c55e;
    --red: #ef4444;
}

body.light-mode {
    --bg: #e2e8f0;
    --panel: #f8fafc;
    --card: #ffffff;
    --border: #cbd5e1;
    --fg: #0f172a;
    --muted: #475569;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #111111;
    color: var(--fg);
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    justify-content: center;
}

.phone-shell {
    width: min(100%, 430px);
    min-height: 100vh;
    background: var(--bg);
    border-left: 1px solid #1f2937;
    border-right: 1px solid #1f2937;
    padding-bottom: 76px;
}

.phone-shell.no-bottom-bar {
    padding-bottom: 0;
}

.mobile-header {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px;
    background: rgba(15, 23, 42, 0.96);
    border-bottom: 1px solid var(--border);
}

body.light-mode .mobile-header,
body.light-mode .bottom-bar {
    background: rgba(248, 250, 252, 0.96);
}

.header-row,
.status-strip,
.toolbar,
.output-header,
.bottom-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-row,
.output-header {
    justify-content: space-between;
}

.home-link,
.icon-button,
.tool-button,
.tab-button,
.quick-actions button,
.package-action {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0b1120;
    color: var(--cyan);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.home-link,
.icon-button {
    padding: 8px 10px;
    font-size: 0.86rem;
}

body.light-mode .home-link,
body.light-mode .icon-button,
body.light-mode .tool-button,
body.light-mode .tab-button,
body.light-mode .quick-actions button {
    background: #ffffff;
    color: #0891b2;
}

.brand strong {
    display: block;
    color: #ffffff;
    font-size: 1rem;
}

body.light-mode .brand strong,
body.light-mode .output-header strong,
body.light-mode .affiliate-card h2,
body.light-mode .package-top strong,
body.light-mode .example-card strong {
    color: #0f172a;
}

.brand span,
#status,
.usage-text {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.status-strip {
    display: grid;
    grid-template-columns: 1fr auto;
    margin-top: 10px;
}

.usage-bar {
    height: 8px;
    border-radius: 999px;
    background: #0b1120;
    border: 1px solid var(--border);
    overflow: hidden;
}

body.light-mode .usage-bar {
    background: #ffffff;
}

.usage-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    transition: width 0.2s ease;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.quick-actions button,
.package-action {
    padding: 10px;
    font-weight: 800;
}

.quick-actions .primary,
.package-action {
    background: var(--cyan);
    color: #06121f;
    border-color: var(--cyan);
}

main.mobile-content,
.mobile-content {
    padding: 12px;
}

.card,
.language-card,
.affiliate-card,
.resource-list,
.package-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.language-card {
    display: grid;
    gap: 10px;
}

.field-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.select-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(45deg, transparent 50%, var(--cyan) 50%) calc(100% - 20px) 50% / 7px 7px no-repeat,
        linear-gradient(135deg, var(--cyan) 50%, transparent 50%) calc(100% - 14px) 50% / 7px 7px no-repeat,
        #0b1120;
    color: #ffffff;
    appearance: none;
    padding: 14px 42px 14px 14px;
    font-size: 1rem;
    font-weight: 900;
}

body.light-mode .select-control {
    background:
        linear-gradient(45deg, transparent 50%, var(--cyan) 50%) calc(100% - 20px) 50% / 7px 7px no-repeat,
        linear-gradient(135deg, var(--cyan) 50%, transparent 50%) calc(100% - 14px) 50% / 7px 7px no-repeat,
        #ffffff;
    color: #0f172a;
}

.affiliate-card header {
    position: static;
    padding: 0;
    margin: 0 0 10px;
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.affiliate-card h2,
.package-top strong {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
}

.ad-label,
.package-badge {
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 999px;
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 900;
    padding: 4px 9px;
    text-transform: uppercase;
}

.affiliate-links,
.resource-list div {
    display: grid;
    gap: 8px;
}

.affiliate-links a,
.resource-list a {
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #0b1120;
    color: var(--fg);
    padding: 10px;
    text-decoration: none;
    font-weight: 700;
}

body.light-mode .affiliate-links a,
body.light-mode .resource-list a {
    background: #f8fafc;
    color: #0f172a;
}

.affiliate-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.82rem;
}

.affiliate-footer button {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--cyan);
    font-weight: 800;
    padding: 9px 11px;
}

.package-strip {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.package-card {
    position: relative;
    margin-bottom: 0;
}

.package-card.featured {
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.12);
}

.package-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.price {
    color: var(--cyan);
    font-weight: 900;
}

.package-card p {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
    margin: 8px 0 10px;
}

.features {
    display: grid;
    gap: 7px;
    color: var(--fg);
    font-size: 0.82rem;
    margin-bottom: 12px;
}

.feature {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.feature b {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    color: var(--cyan);
    font-size: 0.72rem;
}

.feature.muted {
    color: var(--muted);
}

.package-action {
    width: 100%;
}

.package-action:disabled {
    opacity: 0.65;
    cursor: default;
    background: #0b1120;
    color: var(--muted);
    border-color: var(--border);
}

.bottom-bar {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(100%, 430px);
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.96);
    border-top: 1px solid var(--border);
}

.bottom-run,
#runButton {
    width: 100%;
    border: 0;
    border-radius: 13px;
    background: var(--green);
    color: #052e16;
    padding: 14px;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
}
