html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Geist", sans-serif;
}

.font-geist {
    font-family: "Geist", sans-serif !important;
}

.font-jakarta {
    font-family: "Plus Jakarta Sans", sans-serif !important;
}

.skip {
    position: absolute;
    top: -80px;
    left: 12px;
    z-index: 100;
    border-radius: 0.75rem;
    border: 1px solid rgba(220, 252, 199, 0.3);
    background: #dcfcc7;
    color: #0b262a;
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.skip:focus {
    top: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.tool-page {
    color: rgb(226, 232, 240);
}

.tool-page h1,
.tool-page h2,
.tool-page h3 {
    font-family: "Plus Jakarta Sans", sans-serif;
}

.tool-section {
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem 1.5rem;
}

.tool-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.75rem;
    background: rgba(13, 46, 51, 0.7);
    backdrop-filter: blur(18px);
    padding: 1.5rem;
    box-shadow: 0 24px 70px rgba(1, 18, 21, 0.25);
}

.tool-mini-card {
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.035);
    padding: 0.85rem 1rem;
    color: rgb(203, 213, 225);
    font-size: 0.875rem;
}

.tool-mini-card svg {
    flex: 0 0 auto;
    color: #dcfcc7;
}

.section-head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.section-head h2,
.sources h2 {
    margin: 0;
    color: white;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    line-height: 1.15;
    font-weight: 400;
}

.section-head p,
.sources p,
.note {
    color: rgb(148, 163, 184);
    line-height: 1.75;
}

.number {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 0.875rem;
    border: 1px solid rgba(220, 252, 199, 0.25);
    background: rgba(220, 252, 199, 0.1);
    color: #dcfcc7;
    font-size: 0.75rem;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 0.6rem;
    color: #dcfcc7;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: end;
}

.tool-page label {
    display: block;
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
    color: rgb(148, 163, 184);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.tool-page input,
.tool-page textarea,
.tool-page select {
    width: 100%;
    min-height: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.035);
    color: white;
    padding: 0.75rem 1rem;
    font: inherit;
}

.fields input,
#palette {
    font-family: "Geist Mono", Consolas, monospace;
}

.tool-page textarea {
    resize: vertical;
}

.tool-page select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgb(148, 163, 184) 50%), linear-gradient(135deg, rgb(148, 163, 184) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.4rem;
}

.tool-page input::placeholder,
.tool-page textarea::placeholder {
    color: rgb(71, 85, 105);
}

.tool-page input:focus,
.tool-page textarea:focus,
.tool-page select:focus {
    outline: none;
    border-color: rgba(220, 252, 199, 0.5);
    box-shadow: 0 0 0 1px rgba(220, 252, 199, 0.45);
    background: rgba(255, 255, 255, 0.05);
}

.tool-page [aria-invalid="true"] {
    border-color: rgba(252, 165, 165, 0.8);
    box-shadow: 0 0 0 1px rgba(252, 165, 165, 0.55);
}

.tool-page button {
    min-height: 3rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    background: #dcfcc7;
    color: #0b262a;
    padding: 0.75rem 1.2rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.tool-page button:hover {
    background: white;
    box-shadow: 0 0 24px rgba(220, 252, 199, 0.22);
}

.tool-page button.secondary {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgb(226, 232, 240);
}

.tool-page button.secondary:hover {
    border-color: rgba(220, 252, 199, 0.35);
    color: white;
}

.tool-page button[hidden] {
    display: none;
}

:focus-visible {
    outline: 3px solid #dcfcc7;
    outline-offset: 4px;
}

.error {
    margin-top: 0.9rem;
    color: rgb(254, 202, 202);
    font-size: 0.875rem;
    font-weight: 650;
}

.error:empty {
    display: none;
}

.pair-output {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.95fr);
    gap: 1.25rem;
    margin-top: 1.6rem;
}

#preview {
    min-height: 22rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 2rem;
    overflow: hidden;
}

.preview-small {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
}

.preview-big {
    margin: 2rem 0;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: clamp(3rem, 7vw, 4.5rem);
    line-height: 1;
    font-weight: 400;
}

.score {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.035);
    padding: 1.5rem;
}

.ratio {
    margin: 0 0 1.25rem;
    color: white;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: clamp(3rem, 8vw, 4.75rem);
    line-height: 1;
    font-weight: 300;
}

.verdict {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.65rem 0;
    color: rgb(203, 213, 225);
    font-size: 0.925rem;
}

.verdict strong {
    color: #dcfcc7;
    white-space: nowrap;
}

#suggestion,
#palette-status,
#export-status {
    margin-top: 1rem;
    color: rgb(203, 213, 225);
    font-size: 0.925rem;
}

#palette-form button {
    margin-top: 1rem;
}

.table-wrap {
    margin-top: 1.4rem;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
}

table {
    width: 100%;
    min-width: 42rem;
    border-collapse: collapse;
    color: rgb(226, 232, 240);
    font-size: 0.875rem;
}

caption {
    padding: 0.9rem 1rem;
    text-align: left;
    color: rgb(148, 163, 184);
    font-weight: 600;
}

th,
td {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.9rem 1rem;
    text-align: left;
}

th:first-child,
td:first-child {
    border-left: 0;
}

th {
    background: rgba(255, 255, 255, 0.045);
    color: white;
}

td strong {
    display: block;
    margin-top: 0.25rem;
    color: #dcfcc7;
}

#checklist {
    margin: 1.25rem 0;
}

.check {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 14rem);
    gap: 1rem;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 0;
}

.check:first-child {
    border-top: 0;
}

.check p {
    margin: 0;
    color: rgb(148, 163, 184);
    font-size: 0.875rem;
    line-height: 1.6;
}

.check label {
    margin-bottom: 0.35rem;
    padding-left: 0;
    color: white;
    font-size: 0.925rem;
    letter-spacing: 0;
    text-transform: none;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.sources ul {
    margin: 1.25rem 0 0;
    padding-left: 1.2rem;
    color: rgb(203, 213, 225);
}

.sources li {
    margin-top: 0.65rem;
}

.sources a {
    color: #dcfcc7;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

@media (max-width: 900px) {
    .fields,
    .pair-output,
    .check {
        grid-template-columns: 1fr;
    }

    .fields button,
    .actions button {
        width: 100%;
    }

    .score {
        padding: 1.2rem;
    }
}

@media (max-width: 640px) {
    .tool-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tool-card {
        border-radius: 1.5rem;
        padding: 1.25rem;
    }

    #preview {
        min-height: 18rem;
        padding: 1.3rem;
    }
}

@media print {
    body > * {
        display: none !important;
    }

    #print-report {
        display: block !important;
        color: #000;
        font: 12pt/1.5 Georgia, serif;
        padding: 20px;
    }

    #print-report pre {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        font: inherit;
    }

    @page {
        margin: 18mm;
    }
}
