:root {
    color-scheme: dark;
    --bg: #0b0f14;
    --bg-accent: #121a24;
    --panel: #121821;
    --panel-soft: #171f2b;
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #eef3f8;
    --muted: #96a5b8;
    --accent: #7cc7ff;
    --accent-strong: #42b1ff;
    --accent-soft: rgba(124, 199, 255, 0.14);
    --danger: #ff8e8e;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top, rgba(66, 177, 255, 0.1), transparent 34%),
        linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 28%, #090d12 100%);
    color: var(--text);
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
    min-height: 100vh;
    padding: 28px 18px 40px;
}

.search-shell {
    width: min(100%, 860px);
    margin: 0 auto;
}

.hero {
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.title {
    margin: 0;
    font-size: clamp(2.15rem, 5vw, 3.3rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.subtitle {
    margin: 10px 0 0;
    color: var(--muted);
    max-width: 38rem;
}

.search-form {
    margin-bottom: 14px;
}

.search-input-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    width: 100%;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(15, 22, 31, 0.92);
    color: var(--text);
    font: inherit;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.search-input::placeholder {
    color: #748395;
}

.search-input:focus {
    border-color: rgba(124, 199, 255, 0.45);
    box-shadow: 0 0 0 4px var(--accent-soft);
    background: rgba(15, 22, 31, 1);
}

.clear-button,
.result-action {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 10px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.clear-button {
    padding: 12px 14px;
    white-space: nowrap;
}

.clear-button:hover,
.result-action:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
}

.clear-button:active,
.result-action:active {
    transform: translateY(1px);
}

.status-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 16px;
}

.count,
.status {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

kbd {
    display: inline-block;
    min-width: 1.5em;
    padding: 0.1em 0.42em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    text-align: center;
}

.results {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.result-item {
    background: linear-gradient(180deg, rgba(20, 28, 38, 0.96), rgba(15, 21, 29, 0.96));
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.result-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
}

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

.result-title {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.result-url {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    word-break: break-all;
}

.result-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.result-action {
    padding: 10px 12px;
}

.result-action-primary {
    border-color: rgba(124, 199, 255, 0.25);
    background: rgba(124, 199, 255, 0.1);
}

.result-action-primary:hover {
    background: rgba(124, 199, 255, 0.16);
    border-color: rgba(124, 199, 255, 0.32);
}

.highlight {
    background: rgba(124, 199, 255, 0.22);
    color: #ffffff;
    border-radius: 4px;
    padding: 0 1px;
}

.empty-state,
.error-state {
    padding: 26px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.empty-state {
    color: var(--muted);
    text-align: center;
}

.error-state {
    margin-bottom: 16px;
    border-color: rgba(255, 142, 142, 0.2);
    background: rgba(255, 142, 142, 0.06);
}

.error-title {
    margin: 0 0 6px;
    color: #ffdede;
    font-weight: 600;
}

.error-text {
    margin: 0;
    color: #f0c7c7;
}

.copied {
    border-color: rgba(111, 224, 171, 0.26);
    background: rgba(111, 224, 171, 0.12);
}

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

@media (max-width: 720px) {
    .app {
        padding: 18px 14px 28px;
    }

    .search-input-wrap,
    .status-row,
    .result-card {
        flex-direction: column;
        align-items: stretch;
    }

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