.ota-platform-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ota-platform-pill--android {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.ota-platform-pill--ios {
    border: 1px solid #e4e7ec;
    background: #f9fafb;
    color: #101828;
}

html.dark .ota-platform-pill--android {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

html.dark .ota-platform-pill--ios {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.ota-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #667085;
}

.ota-empty i {
    font-size: 2rem;
    color: #98a2b3;
}

.ota-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
}

/* KPI row */

.ota-kpis {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .ota-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .ota-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .ota-kpis {
        grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr));
    }
}

.ota-kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 8.25rem;
    border: 1px solid #eaecf0;
    border-radius: 1.25rem;
    padding: 1.1rem 1.25rem;
    background: #fff;
    overflow: hidden;
}

.ota-kpi--hero {
    border: 0;
    color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #5b21b6 100%);
    box-shadow: 0 12px 30px -14px rgba(124, 58, 237, 0.6);
}

.ota-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #667085;
}

.ota-kpi--hero .ota-kpi-label {
    color: rgba(255, 255, 255, 0.82);
}

.ota-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #101828;
    font-variant-numeric: tabular-nums;
}

.ota-kpi--hero .ota-kpi-value {
    color: #fff;
}

.ota-kpi-value--warn {
    color: #dc6803;
}

.ota-kpi-value--ok {
    color: #039855;
}

.ota-kpi-unit {
    margin-left: 0.1rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #98a2b3;
}

.ota-kpi-sub {
    margin-top: auto;
    font-size: 0.78rem;
    color: #667085;
}

.ota-kpi-bar {
    height: 0.4rem;
    border-radius: 999px;
    background: #f2f4f7;
    overflow: hidden;
}

.ota-kpi-bar span,
.ota-coverage span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.ota-kpi-split {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
}

.ota-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-variant-numeric: tabular-nums;
}

html.dark .ota-kpi:not(.ota-kpi--hero) {
    border-color: #1f2937;
    background: rgba(255, 255, 255, 0.03);
}

html.dark .ota-kpi-value {
    color: rgba(255, 255, 255, 0.94);
}

html.dark .ota-kpi-value--warn {
    color: #fdb022;
}

html.dark .ota-kpi-value--ok {
    color: #32d583;
}

html.dark .ota-kpi-label,
html.dark .ota-kpi-sub {
    color: #98a2b3;
}

html.dark .ota-kpi-bar {
    background: #1f2937;
}

/* Platform cards */

.ota-platforms {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .ota-platforms {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ota-platform {
    --ota-accent: #101828;
    --ota-accent-soft: #f2f4f7;
    --ota-accent-ring: #e4e7ec;
    display: flex;
    flex-direction: column;
    border: 1px solid #eaecf0;
    border-radius: 1.5rem;
    background: #fff;
    overflow: hidden;
}

.ota-platform--android {
    --ota-accent: #3ddc84;
    --ota-accent-soft: #ecfdf3;
    --ota-accent-ring: #abefc6;
}

.ota-platform-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 0;
}

.ota-platform-id {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.ota-platform-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.95rem;
    color: #fff;
    background: linear-gradient(160deg, #344054 0%, #0c111d 100%);
    box-shadow: 0 8px 18px -10px rgba(16, 24, 40, 0.6);
}

.ota-platform--android .ota-platform-logo {
    color: #fff;
    background: linear-gradient(160deg, #3ddc84 0%, #16a34a 100%);
    box-shadow: 0 8px 18px -10px rgba(22, 163, 74, 0.7);
}

.ota-platform-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #101828;
}

.ota-platform-caption {
    font-size: 0.8rem;
    color: #667085;
}

.ota-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.ota-badge i {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.2);
}

.ota-badge--live {
    background: #ecfdf3;
    color: #039855;
}

.ota-badge--idle {
    background: #f2f4f7;
    color: #667085;
}

.ota-release-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.1rem 1.5rem 0;
}

@media (max-width: 479px) {
    .ota-release-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ota-release {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 1.1rem;
    padding: 1rem 1.15rem;
    background: var(--ota-accent-soft);
    border: 1px solid var(--ota-accent-ring);
}

.ota-release--min {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.2);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ota-release--min:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.ota-release-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 1.1rem;
}

.ota-release-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #667085;
}

.ota-release-edit {
    font-size: 0.8rem;
    line-height: 1;
    color: #a78bfa;
}

.ota-release-version {
    margin-top: 0.15rem;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #5b21b6, #7c3aed 45%, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ota-version-field {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.ota-version-prefix {
    font-size: 1.5rem;
    font-weight: 800;
    color: #a78bfa;
}

.ota-version-input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    border-bottom: 2px dashed transparent;
    background: transparent;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #7c3aed;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: border-color 0.15s ease;
}

.ota-version-input::placeholder {
    color: #c4b5fd;
}

.ota-version-input:hover {
    border-bottom-color: rgba(124, 58, 237, 0.25);
}

.ota-version-input:focus {
    border-bottom-color: #7c3aed;
}

.ota-release-version--empty {
    background: none;
    color: #98a2b3;
}

.ota-release-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: auto;
    padding-top: 0.6rem;
    font-size: 0.8rem;
    color: #475467;
}

.ota-release-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ota-release-meta i {
    font-size: 0.8rem;
    line-height: 1;
    color: #98a2b3;
}

.ota-platform-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1.1rem 1.5rem 0.6rem;
}

.ota-mini-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #101828;
    font-variant-numeric: tabular-nums;
}

.ota-mini-value--warn {
    color: #dc6803;
}

.ota-mini-label {
    font-size: 0.75rem;
    color: #667085;
}

.ota-coverage {
    height: 0.4rem;
    margin: 0 1.5rem;
    border-radius: 999px;
    background: #f2f4f7;
    overflow: hidden;
}

.ota-gate {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1.25rem;
    padding: 1.15rem 1.5rem 1.4rem;
    border-top: 1px dashed #e4e7ec;
    background: #fcfcfd;
    flex: 1;
}

.ota-gate-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #101828;
}

.ota-gate-title i {
    color: #7c3aed;
    line-height: 1;
}

.ota-release-meta .ota-gate-state {
    gap: 0.3rem;
}

.ota-gate-state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    background: #f2f4f7;
    color: #667085;
}

.ota-gate-state i {
    font-size: 0.7rem;
    color: inherit;
}

.ota-gate-state--on {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.ota-field-hint {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #667085;
}

.ota-field-error {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #d92d20;
}

.ota-gate-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.ota-link-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.ota-link-row .ta-input {
    flex: 1;
    min-width: 0;
}

.ota-link-chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.85rem;
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ota-link-chip i {
    font-size: 0.8rem;
    line-height: 1;
}

.ota-link-chip:hover {
    background: rgba(124, 58, 237, 0.16);
    border-color: rgba(124, 58, 237, 0.5);
}

.ota-link-builder {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    border: 1px dashed #d0d5dd;
    border-radius: 0.6rem;
    background: #fff;
    overflow: hidden;
}

.ota-link-prefix {
    flex-shrink: 0;
    padding: 0.45rem 0 0.45rem 0.7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    color: #667085;
}

.ota-link-id {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.7rem 0.45rem 0;
    border: 0;
    background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: #101828;
    outline: none;
}

.ota-link-builder:focus-within {
    border-color: #7c3aed;
}

html.dark .ota-link-chip {
    border-color: rgba(167, 139, 250, 0.35);
    background: rgba(124, 58, 237, 0.18);
    color: #c4b5fd;
}

html.dark .ota-link-chip:hover {
    background: rgba(124, 58, 237, 0.28);
}

html.dark .ota-link-builder {
    border-color: #344054;
    background: rgba(255, 255, 255, 0.03);
}

html.dark .ota-link-prefix {
    color: #98a2b3;
}

html.dark .ota-link-id {
    color: rgba(255, 255, 255, 0.92);
}

html.dark .ota-platform {
    border-color: #1f2937;
    background: rgba(255, 255, 255, 0.03);
    --ota-accent-soft: rgba(255, 255, 255, 0.04);
    --ota-accent-ring: rgba(255, 255, 255, 0.08);
}

html.dark .ota-platform--android {
    --ota-accent-soft: rgba(61, 220, 132, 0.07);
    --ota-accent-ring: rgba(61, 220, 132, 0.2);
}

html.dark .ota-platform--ios .ota-platform-logo {
    color: #0c111d;
    background: linear-gradient(160deg, #ffffff 0%, #d0d5dd 100%);
}

html.dark .ota-platform-name,
html.dark .ota-mini-value,
html.dark .ota-gate-title {
    color: rgba(255, 255, 255, 0.92);
}

html.dark .ota-mini-value--warn {
    color: #fdb022;
}

html.dark .ota-platform-caption,
html.dark .ota-mini-label,
html.dark .ota-release-label,
html.dark .ota-field-hint {
    color: #98a2b3;
}

html.dark .ota-release-meta {
    color: #d0d5dd;
}

html.dark .ota-badge--live {
    background: rgba(50, 213, 131, 0.12);
    color: #32d583;
}

html.dark .ota-badge--idle,
html.dark .ota-gate-state {
    background: rgba(255, 255, 255, 0.06);
    color: #98a2b3;
}

html.dark .ota-gate-state--on {
    background: rgba(124, 58, 237, 0.22);
    color: #c4b5fd;
}

html.dark .ota-release--min {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
}

html.dark .ota-version-input,
html.dark .ota-version-prefix {
    color: #a78bfa;
}

html.dark .ota-version-input::placeholder {
    color: #5b21b6;
}

html.dark .ota-release-version {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa 50%, #ddd6fe);
    -webkit-background-clip: text;
    background-clip: text;
}

html.dark .ota-release-version--empty {
    background: none;
    color: #667085;
}

html.dark .ota-gate-title i {
    color: #c084fc;
}

html.dark .ota-coverage {
    background: #1f2937;
}

html.dark .ota-gate {
    border-top-color: #1f2937;
    background: rgba(0, 0, 0, 0.12);
}

/* Version distribution */

.ota-dist {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .ota-dist {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ota-dist-col {
    border: 1px solid #eaecf0;
    border-radius: 1.25rem;
    padding: 1.1rem 1.25rem 0.75rem;
}

.ota-dist-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.ota-dist-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    color: #fff;
    background: #101828;
}

.ota-dist-col--android .ota-dist-logo {
    background: #22c55e;
}

.ota-dist-name {
    font-weight: 800;
    color: #101828;
}

.ota-dist-total {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 700;
    color: #667085;
    font-variant-numeric: tabular-nums;
}

.ota-dist-empty {
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: #98a2b3;
}

.ota-stack {
    display: flex;
    gap: 3px;
    height: 0.9rem;
    border-radius: 999px;
    overflow: hidden;
    background: #f2f4f7;
}

.ota-stack-seg {
    display: block;
    min-width: 3px;
    height: 100%;
}

.ota-stack-seg--current { background: linear-gradient(90deg, #6d28d9, #7c3aed); }
.ota-stack-seg--withdrawn {
    background: repeating-linear-gradient(135deg, #fdb022 0 4px, #fec84b 4px 8px);
}
.ota-stack-seg--old-0 { background: #98a2b3; }
.ota-stack-seg--old-1 { background: #b4bcc8; }
.ota-stack-seg--old-2 { background: #cdd3dc; }
.ota-stack-seg--old-3 { background: #dde1e7; }
.ota-stack-seg--old-4 { background: #e8ebef; }
.ota-stack-seg--rest { background: #f2f4f7; }

.ota-dist-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.ota-dist-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f2f4f7;
    font-size: 0.875rem;
}

.ota-dist-list li:last-child {
    border-bottom: 0;
}

.ota-dot {
    flex: none;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 0.2rem;
}

.ota-dist-version {
    font-weight: 700;
    color: #101828;
    font-variant-numeric: tabular-nums;
}

.ota-dist-rest .ota-dist-version {
    font-weight: 500;
    color: #667085;
}

.ota-tag {
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.ota-tag--ok {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.ota-tag--old {
    background: #f2f4f7;
    color: #98a2b3;
}

.ota-tag--warn {
    background: #fffaeb;
    color: #b54708;
}

.ota-dist-list li.is-current {
    margin: 0 -0.6rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    border-radius: 0.75rem;
    border-bottom-color: transparent;
    background: rgba(124, 58, 237, 0.06);
}

.ota-dist-list li.is-current .ota-dist-version,
.ota-dist-list li.is-current .ota-dist-share {
    color: #7c3aed;
}

.ota-dist-list li:not(.is-current):not(.ota-dist-rest) .ota-dist-version {
    color: #667085;
}

.ota-dist-count {
    margin-left: auto;
    color: #475467;
    font-variant-numeric: tabular-nums;
}

.ota-dist-share {
    min-width: 3.25rem;
    text-align: right;
    font-weight: 800;
    color: #101828;
    font-variant-numeric: tabular-nums;
}

html.dark .ota-dist-col {
    border-color: #1f2937;
    background: rgba(255, 255, 255, 0.02);
}

html.dark .ota-dist-logo {
    color: #0c111d;
    background: #f2f4f7;
}

html.dark .ota-dist-col--android .ota-dist-logo {
    color: #fff;
    background: #22c55e;
}

html.dark .ota-dist-name,
html.dark .ota-dist-version,
html.dark .ota-dist-share {
    color: rgba(255, 255, 255, 0.92);
}

html.dark .ota-dist-count,
html.dark .ota-dist-total,
html.dark .ota-dist-rest .ota-dist-version {
    color: #98a2b3;
}

html.dark .ota-stack {
    background: #1f2937;
}

html.dark .ota-stack-seg--current { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
html.dark .ota-stack-seg--old-0 { background: #667085; }
html.dark .ota-stack-seg--old-1 { background: #556072; }
html.dark .ota-stack-seg--old-2 { background: #475467; }
html.dark .ota-stack-seg--old-3 { background: #3b4554; }
html.dark .ota-stack-seg--old-4 { background: #344054; }
html.dark .ota-stack-seg--rest { background: #2a3341; }

html.dark .ota-dist-list li {
    border-bottom-color: #1f2937;
}

html.dark .ota-tag--ok {
    background: rgba(124, 58, 237, 0.22);
    color: #c4b5fd;
}

html.dark .ota-tag--old {
    background: rgba(255, 255, 255, 0.06);
    color: #667085;
}

html.dark .ota-tag--warn {
    background: rgba(253, 176, 34, 0.14);
    color: #fdb022;
}

html.dark .ota-dist-list li.is-current {
    background: rgba(124, 58, 237, 0.14);
}

html.dark .ota-dist-list li.is-current .ota-dist-version,
html.dark .ota-dist-list li.is-current .ota-dist-share {
    color: #c4b5fd;
}

html.dark .ota-dist-list li:not(.is-current):not(.ota-dist-rest) .ota-dist-version {
    color: #98a2b3;
}
