* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
}

body {
    margin: 0;
    background: #09090c;
    color: #eee9ea;
    font: 15px/1.6 system-ui, sans-serif;
}

a {
    color: #ffad7e;
}

a:focus-visible,
button:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #ffaf78;
    outline-offset: 3px;
}

.site-header {
    max-width: 1450px;
    margin: auto;
    padding: 22px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #34252a;
}

.logo {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-weight: 900;
    letter-spacing: .1em;
}

.logo small {
    display: block;
    color: #a899a0;
    font-size: 10px;
    letter-spacing: .14em;
}

.logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #a82024;
    font-size: 24px;
}

nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .06em;
}

main {
    max-width: 1400px;
    padding: 0 24px 80px;
    margin: auto;
}

.intro {
    padding: 65px 0 35px;
}

.eyebrow {
    color: #f47d49;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .17em;
}

h1 {
    margin: 8px 0 14px;
    font-size: clamp(38px, 5vw, 70px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

h1 span {
    color: #e3482c;
}

.intro > p:not(.eyebrow) {
    max-width: 790px;
    color: #c4b8bd;
    font-size: 18px;
}

.notice {
    max-width: 920px;
    border-left: 3px solid #f36b3b;
    background: #1c1216;
    padding: 16px 20px;
    color: #d0c0c4;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: start;
}

.editor-stack,
.preview-stack {
    min-width: 0;
    background: #151115;
    border: 1px solid #3a282e;
    border-radius: 16px;
    padding: 22px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

h2 {
    margin: 4px 0 0;
    font-size: 21px;
    line-height: 1.2;
    letter-spacing: .02em;
}

.editor-stack > label,
.controls label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    color: #e6a18c;
}

textarea {
    display: block;
    width: 100%;
    margin: 9px 0 22px;
    resize: vertical;
    background: #090a0d;
    color: #f3e9e7;
    border: 1px solid #50333a;
    border-radius: 9px;
    padding: 14px;
    font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
    tab-size: 4;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 6px 0 22px;
}

select {
    display: block;
    width: 100%;
    margin-top: 9px;
    border: 1px solid #50333a;
    border-radius: 9px;
    background: #0a0a0e;
    color: white;
    padding: 11px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

button {
    cursor: pointer;
    border: 1px solid #6c3535;
    border-radius: 9px;
    padding: 12px 15px;
    font-weight: 900;
    letter-spacing: .04em;
    font-size: 11px;
    color: white;
    background: #342023;
}

button:hover:not(:disabled) {
    filter: brightness(1.17);
}

button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

button.primary {
    background: linear-gradient(110deg, #a62227, #e15b28);
    border-color: #e26d46;
}

button.danger {
    background: #5b181e;
}

button.secondary {
    background: #241b20;
}

.preview-shell {
    width: 100%;
    height: 355px;
    border: 1px solid #59323b;
    border-radius: 12px;
    background: #090a0c;
    overflow: hidden;
    margin-inline: auto;
    transition: max-width .2s ease;
}

.preview-shell.mobile {
    max-width: 390px;
}

iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.status {
    border: 1px solid #663735;
    border-radius: 99px;
    color: #ffa079;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 900;
}

.hint,
.fineprint {
    color: #a89ca2;
    font-size: 12px;
}

.report {
    margin-top: 28px;
    border-top: 1px solid #39292d;
    padding-top: 22px;
}

.metrics,
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.metrics article,
.comparison-grid article {
    background: #21161b;
    border: 1px solid #513038;
    border-radius: 10px;
    padding: 13px;
}

.metrics span,
.comparison-grid span {
    display: block;
    color: #c8a3a0;
    font-size: 10px;
    font-weight: 800;
}

.metrics strong,
.comparison-grid strong {
    display: block;
    font-size: clamp(22px, 2.5vw, 31px);
    color: #ffa06c;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.metrics small,
.comparison-grid small {
    display: block;
    color: #a89ca2;
    font-size: 10px;
}

.progress {
    height: 6px;
    background: #342128;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 22px;
}

.progress > div {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #b21f29, #f4a33d);
    transition: width .2s linear;
}

#reportMessage {
    color: #e0c8c4;
}

.comparison {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #39292d;
}

.comparison h3 {
    margin: 0 0 14px;
    color: #f47d49;
    font-size: 12px;
    letter-spacing: .12em;
}

.rating-badge {
    padding: 6px 12px;
    border: 1px solid #654045;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    color: #c9a9a9;
}

.rating-badge[data-rating="pass"] {
    color: #8ae6b2;
    border-color: #3c9e72;
    background: #123226;
}

.rating-badge[data-rating="caution"] {
    color: #ffd08a;
    border-color: #ad7634;
    background: #382818;
}

.rating-badge[data-rating="fail"] {
    color: #ff9696;
    border-color: #a83d42;
    background: #3a191e;
}

.rating-badge[data-rating="inconclusive"] {
    color: #d6c7ee;
    border-color: #78638c;
    background: #282031;
}

.recommendation {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-left: 3px solid #e15b28;
    background: #21161b;
    color: #e0c8c4;
}

footer {
    text-align: center;
    border-top: 1px solid #34252a;
    padding: 25px;
    color: #9b8c92;
    font-size: 11px;
    letter-spacing: .1em;
}

footer span {
    color: #e45434;
}

@media (max-width: 1000px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .metrics,
    .comparison-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .editor-stack,
    .preview-stack {
        padding: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .preview-shell,
    .progress > div {
        transition: none;
    }
}
