:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-input: #232733;
    --border: #2e3344;
    --text: #e8eaef;
    --text-muted: #9aa3b5;
    --accent: #5b8def;
    --accent-hover: #7aa3f5;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --radius: 12px;
    --radius-sm: 8px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91, 141, 239, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(91, 141, 239, 0.06), transparent);
}

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

.app {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header__title {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header__subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.main {
    flex: 1;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box__input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box__input::placeholder {
    color: var(--text-muted);
}

.search-box__input:hover {
    border-color: #3d4458;
}

.search-box__input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.25);
}

.search-box__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.status {
    min-height: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status--error {
    color: #f07178;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.result-card__main {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.swatch {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.result-card__info {
    flex: 1;
    min-width: 0;
}

.result-card__name {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.result-card__link {
    color: inherit;
    text-decoration: none;
}

.result-card__link:hover,
.result-card__link:focus-visible {
    text-decoration: underline;
}

.result-card__meta {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.result-card__code {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    font-family: ui-monospace, monospace;
    background: var(--bg-input);
    border-radius: 4px;
    color: var(--accent);
}

.copy-link-btn {
    display: inline-block;
    margin-top: 0.65rem;
    padding: 0.35rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    margin-left: 10px;
}

.copy-link-btn:hover,
.copy-link-btn:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    outline: none;
}

.copy-link-btn--copied {
    color: #7dd3a0;
    border-color: #7dd3a0;
}

.equivalents {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.equivalents__title {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.equivalents__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.equivalent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.equivalent-item .swatch {
    width: 32px;
    height: 32px;
}

.equivalent-item__text {
    flex: 1;
    min-width: 0;
}

.equivalent-item__name {
    font-weight: 500;
}

.equivalent-item__meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer p {
    margin: 0;
}

@media (max-width: 480px) {
    .app {
        padding: 1.25rem 1rem 2rem;
    }

    .header__title {
        font-size: 1.4rem;
    }

    .result-card__main {
        flex-direction: column;
    }

    .swatch {
        width: 48px;
        height: 48px;
    }
}

.app-link,
.app-link:link,
.app-link:visited {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.app-link:hover,
.app-link:focus-visible {
    color: var(--accent);
    outline: none;
}
.back-link {
    margin-top: 1.25rem;
}

.search-promo {
    margin: -0.5rem 0 1.25rem;
    text-align: center;
}
.search-promo[hidden] {
    display: none;
}
.search-promo__link,
.search-promo__link:link,
.search-promo__link:visited {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.search-promo__link:hover,
.search-promo__link:focus-visible {
    color: var(--text);
    background: var(--bg-card);
    border-color: rgba(91, 141, 239, 0.45);
}
