:root {
    color-scheme: dark;
    --bg: #0b0d10;
    --panel: #151922;
    --panel-soft: #10141b;
    --text: #eef2f6;
    --muted: #aeb7c3;
    --subtle: #778291;
    --line: #28313d;
    --accent: #35d0ba;
    --accent-strong: #4ea1ff;
    --danger: #ff6f61;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 15% 0%, rgba(53, 208, 186, 0.12), transparent 26rem),
        linear-gradient(180deg, #0d1117 0%, var(--bg) 45%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

.site-shell,
.tool-shell {
    display: flex;
    flex-direction: column;
}

.site-header,
.site-main,
.site-footer,
.tool-header,
.tool-main,
.tool-footer {
    width: min(1120px, calc(100% - 32px));
    margin-right: auto;
    margin-left: auto;
}

.site-header {
    padding: 72px 0 34px;
}

.tool-header {
    padding: 34px 0 22px;
}

.site-main,
.tool-main {
    flex: 1;
}

.eyebrow,
.tool-category {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(2.35rem, 7vw, 5rem);
    line-height: 0.96;
    letter-spacing: 0;
}

h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: 0;
}

h3 {
    margin: 0 0 12px;
    font-size: 1.3rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.lead {
    max-width: 720px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(1.04rem, 2vw, 1.25rem);
}

.privacy-note {
    width: fit-content;
    max-width: 100%;
    margin: 24px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(53, 208, 186, 0.34);
    border-radius: 8px;
    background: rgba(53, 208, 186, 0.08);
    color: var(--text);
    font-weight: 700;
}

.section-heading {
    margin-bottom: 18px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 18px;
}

.tool-card {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(21, 25, 34, 0.96), rgba(16, 20, 27, 0.96));
    box-shadow: var(--shadow);
}

.tool-card p:not(.tool-category) {
    margin: 0;
    color: var(--muted);
}

.button-link,
button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #04110f;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
}

.button-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
}

.button-link:hover,
button:hover {
    background: #5fe3d1;
}

.tool-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.back-link {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    color: var(--text);
}

.seo-intro {
    max-width: 840px;
    margin: 20px 0 0;
    color: var(--muted);
}

.seo-intro strong {
    color: var(--text);
}

.seo-intro ul {
    display: grid;
    max-width: 780px;
    margin: 18px 0 0;
    padding-left: 1.2rem;
    gap: 8px;
}

.editor-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(21, 25, 34, 0.92);
    box-shadow: var(--shadow);
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.validator-grid {
    display: grid;
    gap: 24px;
}

.validator-panel {
    display: grid;
    gap: 16px;
}

.validator-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.compact-actions {
    justify-content: flex-end;
    margin-top: 0;
}

.column {
    display: flex;
    min-height: 480px;
    flex-direction: column;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    margin-bottom: 10px;
}

label {
    color: var(--muted);
    font-weight: 800;
}

textarea {
    width: 100%;
    flex: 1;
    min-height: 360px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #090c11;
    color: var(--text);
    font: inherit;
    line-height: 1.55;
    padding: 16px;
}

textarea:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18);
    outline: 0;
}

textarea[readonly] {
    background: var(--panel-soft);
    color: #d9e0e8;
}

.code-input {
    min-height: 190px;
    flex: initial;
    resize: vertical;
}

.results {
    min-height: 44px;
}

.empty-results {
    margin: 0;
    color: var(--subtle);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.results-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: #0a0e14;
    font-size: 0.94rem;
}

.results-table th,
.results-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.results-table th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.results-table tbody tr:last-child td {
    border-bottom: 0;
}

.results-table tr.valid td:nth-last-child(2),
.results-table tr.valid td:nth-last-child(1):empty,
.results-table tr.valid td:nth-child(4) {
    color: var(--accent);
    font-weight: 800;
}

.results-table tr.invalid td:nth-last-child(2),
.results-table tr.invalid td:last-child {
    color: var(--danger);
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #090c11;
    color: var(--text);
    font: inherit;
    padding: 0 12px;
}

input:focus,
select:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18);
    outline: 0;
}

.metadata-panel,
.results-layout {
    margin-bottom: 24px;
}

.metadata-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.metadata-form label {
    display: grid;
    gap: 8px;
}

.results-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.summary-card,
.result-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0a0e14;
}

.summary-card {
    padding: 14px;
}

.summary-card span {
    display: block;
    color: var(--subtle);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-card strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 1.6rem;
    line-height: 1.1;
}

.result-cards {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.result-card {
    padding: 16px;
    border-left: 4px solid var(--accent);
}

.result-card.warning {
    border-left-color: #ffc857;
}

.result-card.error {
    border-left-color: var(--danger);
}

.result-card h3,
.result-card p {
    margin: 0;
}

.result-card h3 {
    font-size: 1rem;
}

.result-card p + p,
.result-card h3 + p {
    margin-top: 8px;
}

.result-severity {
    color: var(--subtle);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.metadata-preview {
    display: grid;
    grid-template-columns: minmax(150px, 0.72fr) 1fr;
    gap: 10px 14px;
    margin: 16px 0 0;
}

.metadata-preview dt {
    color: var(--subtle);
    font-weight: 800;
}

.metadata-preview dd {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.audio-panel {
    margin-bottom: 24px;
}

.drop-zone {
    display: grid;
    min-height: 260px;
    place-items: center;
    gap: 12px;
    padding: 32px;
    border: 2px dashed rgba(53, 208, 186, 0.42);
    border-radius: 8px;
    background: rgba(10, 14, 20, 0.72);
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone.drag-over,
.drop-zone:focus {
    border-color: var(--accent);
    background: rgba(53, 208, 186, 0.08);
    outline: 0;
}

.drop-zone p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
}

.drop-title {
    color: var(--text) !important;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 900;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.file-info {
    margin-top: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.info-grid div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0a0e14;
}

.info-grid span {
    display: block;
    color: var(--subtle);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.info-grid strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    overflow-wrap: anywhere;
}

.progress-wrap {
    height: 8px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: #090c11;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.2s ease;
}

.tool-message p {
    margin: 14px 0 0;
    color: var(--muted);
}

.tool-message .error {
    color: var(--danger);
    font-weight: 800;
}

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

.audio-summary .summary-card strong {
    font-size: 1.1rem;
}

.artwork-box {
    display: grid;
    gap: 16px;
}

.artwork-preview {
    width: min(100%, 320px);
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0a0e14;
}

.cover-preview {
    width: min(100%, 420px);
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0a0e14;
    box-shadow: var(--shadow);
}

.cover-maker-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(300px, 0.78fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.cover-maker-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #070a0f;
    box-shadow: var(--shadow);
    cursor: grab;
    touch-action: none;
}

.cover-maker-canvas:active {
    cursor: grabbing;
}

.cover-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.cover-control-grid label,
.preset-toolbar label {
    display: grid;
    gap: 8px;
}

.cover-control-grid input[type="range"] {
    padding: 0;
    accent-color: var(--accent);
}

.typography-panel {
    margin-bottom: 24px;
}

.preset-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}

.preset-toolbar label {
    min-width: min(100%, 300px);
    flex: 1;
}

.preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.compact-left {
    justify-content: flex-start;
}

.typography-studio {
    margin-bottom: 24px;
}

.typography-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(280px, 0.75fr);
    gap: 24px;
    align-items: start;
}

.typography-canvas-wrap {
    display: grid;
    gap: 10px;
}

.typography-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #070a0f;
    cursor: grab;
    box-shadow: var(--shadow);
    touch-action: none;
}

.typography-canvas:active {
    cursor: grabbing;
}

.typography-controls {
    display: grid;
    gap: 14px;
}

.typography-controls label {
    display: grid;
    gap: 8px;
}

.typography-controls input[type="range"] {
    padding: 0;
    accent-color: var(--accent);
}

.recommendation-list {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    padding-left: 1.2rem;
    color: var(--muted);
}

.visualizer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.analyzer-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 5;
    min-height: 180px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #090c11;
}

.visualizer-stage {
    margin-bottom: 24px;
}

.visualizer-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 260px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #070a0f;
    box-shadow: var(--shadow);
}

.visualizer-controls input[type="range"] {
    padding: 0;
    accent-color: var(--accent);
}

.inline-option {
    align-content: center;
    grid-template-columns: auto 1fr !important;
}

.inline-option input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--accent);
}

.audio-preview {
    width: 100%;
    margin-top: 16px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 18px 0 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(10, 14, 20, 0.72);
}

.options-grid legend {
    padding: 0 8px;
    color: var(--muted);
    font-weight: 800;
}

.options-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.options-grid input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--accent);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

button {
    padding: 0 18px;
}

button.secondary {
    background: #2d3542;
    color: var(--text);
}

button.secondary:hover {
    background: #394454;
}

button.tertiary {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
}

button.tertiary:hover {
    border-color: var(--accent);
    background: rgba(53, 208, 186, 0.08);
    color: var(--text);
}

.site-footer,
.tool-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 34px 0;
    border-top: 1px solid rgba(40, 49, 61, 0.72);
    color: var(--subtle);
    font-size: 0.92rem;
}

.site-footer p,
.tool-footer p {
    margin: 0;
}

.site-footer a,
.tool-footer a {
    color: var(--text);
    font-weight: 800;
    text-decoration-color: rgba(53, 208, 186, 0.55);
    text-underline-offset: 4px;
}

.site-footer a:hover,
.tool-footer a:hover {
    color: var(--accent);
}

@media (max-width: 760px) {
    .site-header {
        padding-top: 46px;
    }

    .tool-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .editor-panel {
        padding: 16px;
    }

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

    .validator-heading {
        flex-direction: column;
    }

    .metadata-form,
    .results-layout,
    .visualizer-grid,
    .cover-maker-layout,
    .cover-control-grid,
    .typography-layout,
    .options-grid,
    .summary-grid,
    .metadata-preview,
    .info-grid,
    .audio-summary {
        grid-template-columns: 1fr;
    }

    .compact-actions {
        justify-content: flex-start;
    }

    .site-footer,
    .tool-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .column {
        min-height: 340px;
    }

    textarea {
        min-height: 270px;
    }
}
