* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(115deg, rgba(247, 243, 234, 0.82), rgba(238, 245, 241, 0.72)),
        repeating-linear-gradient(135deg, rgba(24, 33, 47, 0.045) 0 1px, transparent 1px 18px),
        radial-gradient(circle at 12% 16%, rgba(222, 91, 73, 0.2), transparent 24rem),
        radial-gradient(circle at 86% 8%, rgba(45, 129, 138, 0.24), transparent 28rem),
        linear-gradient(135deg, #f7f3ea 0%, #eef5f1 48%, #f7fafc 100%);
    color: #18212f;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 38%);
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 48px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.search-panel,
.name-bank {
    border: 1px solid rgba(24, 33, 47, 0.1);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 22px 70px rgba(24, 33, 47, 0.14);
    backdrop-filter: blur(18px);
}

.search-panel {
    overflow: hidden;
    position: relative;
    padding: 34px;
    border-radius: 8px;
}

.search-panel::after {
    content: "";
    position: absolute;
    right: -92px;
    bottom: -110px;
    width: 240px;
    height: 240px;
    border: 42px solid rgba(224, 89, 72, 0.13);
    border-radius: 50%;
    pointer-events: none;
}

.panel-hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 28px;
    align-items: center;
    margin-bottom: 30px;
}

.panel-header {
    margin-bottom: 0;
}

.eyebrow {
    margin: 0 0 8px;
    color: #27646d;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(2.3rem, 6vw, 4.8rem);
    line-height: 0.95;
    max-width: 520px;
}

h2 {
    margin-bottom: 0;
    font-size: 1.55rem;
}

.summary {
    max-width: 560px;
    margin-bottom: 0;
    color: #546171;
    font-size: 1.05rem;
}

.letter-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(24, 33, 47, 0.1);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 247, 246, 0.86)),
        #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 16px 36px rgba(24, 33, 47, 0.12);
    transform: rotate(2deg);
}

.letter-board span {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #18212f;
    color: #fff;
    font-size: 1.28rem;
    font-weight: 900;
    box-shadow: 0 4px 0 rgba(24, 33, 47, 0.22);
}

.letter-board span:nth-child(2n) {
    background: #27737b;
}

.letter-board span:nth-child(5),
.letter-board span:nth-child(8) {
    background: #d95543;
}

.search-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    margin-bottom: 26px;
    padding: 18px;
    border: 1px solid rgba(24, 33, 47, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

label {
    color: #2f3c4b;
    font-size: 0.9rem;
    font-weight: 800;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
}

input[type="text"] {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid #bbc7c8;
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: #18212f;
    font-size: 1rem;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"]:focus {
    border-color: #1f7a84;
    box-shadow: 0 0 0 4px rgba(31, 122, 132, 0.16);
}

.search-row button {
    min-height: 52px;
    border-radius: 8px;
    background: linear-gradient(135deg, #18212f, #2b5360);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    transition: transform 160ms ease, background 160ms ease;
}

.search-row button:hover {
    background: #26364a;
}

.search-row button:active,
.quick-picks button:active {
    transform: translateY(1px);
}

.quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-picks button {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid rgba(31, 122, 132, 0.2);
    border-radius: 999px;
    background: #f0f8f6;
    color: #23545c;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 800;
}

.results {
    position: relative;
    z-index: 1;
    min-height: 202px;
    padding: 18px;
    border: 1px solid rgba(24, 33, 47, 0.08);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 251, 252, 0.92)),
        #fbfcfd;
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6ebef;
}

.result-meta p {
    margin: 0;
    color: #465365;
}

.result-meta strong {
    color: #18212f;
}

.results ul,
.name-bank ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.results ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.results li {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #e4eaee;
    border-radius: 8px;
    background: #fff;
    color: #18212f;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(24, 33, 47, 0.06);
}

.results li::before {
    content: attr(data-initial);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #edf8f6;
    color: #27737b;
    font-size: 0.78rem;
    font-weight: 900;
}

.empty-state {
    min-height: 164px;
    display: grid;
    place-content: center;
    gap: 6px;
    text-align: center;
}

.empty-state p {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.empty-state span {
    color: #687587;
}

.no-results {
    color: #9a3412;
}

.name-bank {
    position: sticky;
    top: 24px;
    padding: 24px;
    border-radius: 8px;
}

.name-bank > div {
    margin-bottom: 18px;
}

.name-bank ul {
    display: grid;
    gap: 8px;
}

.name-bank li {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafb, #eef5f4);
    color: #3c4857;
    font-weight: 700;
}

.name-bank li::first-letter {
    color: #d95543;
    font-weight: 900;
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 24px 0;
    }

    .search-panel,
    .name-bank {
        padding: 22px;
    }

    .panel-hero {
        grid-template-columns: 1fr;
    }

    .letter-board {
        max-width: 260px;
    }

    .name-bank {
        position: static;
    }
}

@media (max-width: 520px) {
    .app-shell {
        width: min(100% - 20px, 1120px);
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .search-row button {
        width: 100%;
    }

    .results ul {
        grid-template-columns: 1fr;
    }
}
