* {
    box-sizing: border-box;
}
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: #fff;
    color: #172033;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}
header {
    display: flex;
    justify-content: flex-end;
    padding: 26px 32px;
}
.submit-link {
    color: #f97316;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}
.submit-link:hover {
    text-decoration: underline;
}
main {
    width: min(600px, calc(100% - 32px));
    margin: auto;
    text-align: center;
    padding: 24px 0 80px;
}
h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 64px);
    letter-spacing: -0.065em;
    line-height: 1.1;
}
.brand {
    color: inherit;
    text-decoration: none;
}
.brand span {
    color: #f97316;
}
.subtitle {
    margin: 14px 0 28px;
    color: #64748b;
    font-size: 16px;
}
.search {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #dce2ea;
    border-radius: 28px;
    padding: 7px 8px 7px 18px;
    text-align: left;
}
.search:focus-within {
    border-color: #f97316;
}
.search-icon {
    width: 21px;
    height: 21px;
    flex: none;
    color: #64748b;
}
textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    line-height: 24px;
    padding: 7px 0;
    max-height: 160px;
    color: inherit;
}
textarea::placeholder {
    color: #8490a2;
}
button {
    border: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex: none;
    background: #f97316;
    color: white;
    font-size: 24px;
    cursor: pointer;
}
button:hover {
    background: #ea580c;
}
button:focus-visible,
a:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 4px;
}
.stats,
.notice,
footer {
    color: #64748b;
    font-size: 13px;
}
.stats {
    margin: 20px 0 0;
}
footer {
    text-align: center;
    padding: 22px 16px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
@media (max-width: 480px) {
    header {
        padding: 20px 16px;
    }
    main {
        padding-bottom: 48px;
    }
    .subtitle {
        font-size: 14px;
    }
}

.search button svg {
    transform: translateY(2px);
}

/* Public navigation */
header .public-nav { display:flex; align-items:center; justify-content:flex-end; gap:16px; flex-wrap:wrap; margin-left:auto; }
.public-nav .public-nav-group { display:flex; align-items:center; gap:8px; white-space:nowrap; }
header .public-nav .public-nav-link { color:#172033; font-size:14px; font-weight:600; text-decoration:none; }
header .public-nav .public-nav-add { color:#f97316; background:#fff7ed; border-radius:7px; padding:6px 10px; font-size:13px; font-weight:500; text-decoration:none; }
header .public-nav .public-nav-add:hover { background:#ffedd5; }
header .public-nav .public-nav-link:hover { color:#f97316; }
.public-nav-scale { color:#94a3b8; flex:none; }
.results-header:has(.public-nav) { flex-wrap:wrap; }
.results-header > .search + .public-nav { flex-basis:100%; }
.submit-page header { align-items:center; flex-wrap:wrap; gap:16px; }
@media(max-width:480px) { header .public-nav { gap:9px; } .public-nav .public-nav-group { gap:5px; } header .public-nav .public-nav-add { padding:5px 7px; } .public-nav-scale { width:20px; height:20px; } }

/* Navigation balance icon */
.public-nav .public-nav-scale {
    width: 28px;
    height: 28px;
    color: #94a3b8;
    flex-shrink: 0;
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .public-nav .public-nav-scale {
        width: 24px;
        height: 24px;
    }
}

/* Mobile header alignment */
@media (max-width: 600px) {
    body header:has(.public-nav) {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
    }

    body header .public-nav {
        width: 100%;
        justify-content: center;
        align-items: center;
    }

    body header .brand {
        margin: 0;
        text-align: center;
    }
}

/* Consistent header logo */
header a.brand {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -1px;
    line-height: 1.2;
    color: #172033;
    text-decoration: none;
    white-space: nowrap;
}

header a.brand span {
    color: #f97316;
}

header a.brand:hover {
    text-decoration: none;
}

/* Consistent inner page header */
header:has(> a.brand) {
    width: min(850px, calc(100% - 32px));
    box-sizing: border-box;
    margin: 0 auto;
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    header:has(> a.brand) {
        justify-content: center;
        gap: 16px;
    }

    header:has(> a.brand) .public-nav {
        width: 100%;
        justify-content: center;
    }
}

.search.is-loading button::after {
    display: none;
}

.search.is-loading button svg {
    opacity: 1;
    transform-origin: center;
    animation: bulb-rotate 1.2s linear infinite;
}

@keyframes bulb-rotate {
    from {
        transform: translateY(2px) rotate(0deg);
    }
    to {
        transform: translateY(2px) rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .search.is-loading button svg {
        animation: none;
    }
}

.search.is-loading button::after {
    display: none;
}

.search.is-loading button svg {
    opacity: 1;
    transform-origin: center;
    animation: bulb-rotate 1.2s linear infinite;
}

@keyframes bulb-rotate {
    from {
        transform: translateY(2px) rotate(0deg);
    }
    to {
        transform: translateY(2px) rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .search.is-loading button svg {
        animation: none;
    }
}

.search.is-loading button::after {
    display: none !important;
}

.search.is-loading button svg {
    opacity: 1 !important;
    transform-origin: 50% 50% !important;
    animation: problemhub-spin 0.8s linear infinite !important;
}

@keyframes problemhub-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.search.is-loading {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    cursor: wait;
}

.search.is-loading textarea {
    color: #94a3b8;
    background: transparent;
    opacity: 1;
    cursor: wait;
}

.search.is-loading .search-icon {
    opacity: 0.4;
}


/* Orange brand */
.public-nav-add {
    color: #c2410c;
    background: #fff7ed;
}

.results-main a,
footer a {
    color: #c2410c;
}
