:root {
    --ink: #eeeee7;
    --muted: #979b91;
    --faint: #676b63;
    --night: #0d0e0c;
    --panel: #141612;
    --panel-soft: #191b16;
    --line: rgba(238, 238, 231, 0.11);
    --line-strong: rgba(238, 238, 231, 0.19);
    --accent: #c6f36b;
    --accent-deep: #9dcd3e;
    --danger: #ff8f83;
    --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
    --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 320px;
    background: var(--night);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 48% -12%, rgba(198, 243, 107, 0.035), transparent 32rem),
        var(--night);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.service-notice {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid rgba(198, 243, 107, 0.15);
    color: #b8bbb2;
    background: #151712;
}

.service-notice__inner {
    display: flex;
    width: min(1440px, 100%);
    min-height: 48px;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
    padding: 9px clamp(18px, 4vw, 58px);
}

.service-notice__dot {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-deep);
    box-shadow: 0 0 0 4px rgba(198, 243, 107, 0.07);
}

.service-notice p {
    flex: 1 1 auto;
    margin: 0;
    font-family: var(--serif);
    font-size: 11px;
    line-height: 1.5;
}

.service-notice button {
    display: grid;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 3px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.service-notice button:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.045);
}

.service-notice button svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.4;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

svg {
    display: block;
}

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

.brand {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
}

.brand__mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--accent);
}

.brand__mark svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.3;
}

.brand__word {
    font-size: 20px;
    font-weight: 640;
    letter-spacing: -0.04em;
}

.brand__dot {
    color: var(--accent);
}

.brand--compact .brand__mark {
    width: 30px;
    height: 30px;
}

.brand--compact .brand__word {
    font-size: 18px;
}

.button {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 17px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.button--primary {
    color: #10130d;
    background: var(--accent);
    box-shadow: 0 10px 30px rgba(198, 243, 107, 0.08);
}

.button--primary:hover {
    background: #d2fa82;
}

.button--secondary {
    color: var(--ink);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.035);
}

.button--secondary:hover {
    border-color: rgba(198, 243, 107, 0.45);
}

.kicker {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Access gate */
.gate {
    position: relative;
    display: grid;
    min-height: 100vh;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    padding: 36px clamp(24px, 5vw, 78px) 30px;
}

.gate::before {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
    content: "";
    opacity: 0.035;
    pointer-events: none;
}

.gate::after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0.05) 80%, transparent);
    content: "";
    opacity: 0.25;
}

.gate__header,
.gate__footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gate__actions {
    display: flex;
    align-items: center;
    gap: 22px;
}

.locale-picker {
    position: relative;
    display: flex;
    height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.018);
}

.locale-picker:hover,
.locale-picker:focus-within {
    border-color: rgba(198, 243, 107, 0.35);
}

.locale-picker svg {
    width: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.15;
}

.locale-picker select {
    max-width: 124px;
    height: 32px;
    padding: 0 18px 0 0;
    border: 0;
    outline: 0;
    appearance: none;
    color: var(--muted);
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m4 5 3 3 3-3' fill='none' stroke='%237b7f76' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: right center;
    background-repeat: no-repeat;
    font-size: 10px;
    font-weight: 680;
    cursor: pointer;
}

.locale-picker option {
    color: var(--ink);
    background: var(--panel);
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    font-weight: 620;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.text-button:hover {
    color: var(--ink);
}

.text-button svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.ambient {
    position: absolute;
    border: 1px solid rgba(198, 243, 107, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

.ambient::after {
    position: absolute;
    inset: 13%;
    border: inherit;
    border-radius: inherit;
    content: "";
}

.ambient--one {
    top: -29vw;
    left: -24vw;
    width: 66vw;
    height: 66vw;
    background: radial-gradient(circle, rgba(198, 243, 107, 0.035), transparent 59%);
}

.ambient--two {
    right: -33vw;
    bottom: -35vw;
    width: 72vw;
    height: 72vw;
}

.gate__content {
    position: relative;
    z-index: 2;
    width: min(720px, 100%);
    margin: auto;
    padding: 70px 0 54px;
    text-align: center;
}

.gate__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 710;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.gate__eyebrow span,
.search-hero .kicker span {
    display: inline-block;
    width: 22px;
    height: 1px;
    background: var(--accent);
}

.gate h1,
.search-hero h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(54px, 6.2vw, 83px);
    font-weight: 400;
    letter-spacing: -0.06em;
    line-height: 0.91;
}

.gate h1 em,
.search-hero h1 em {
    color: var(--accent);
    font-weight: 400;
}

.gate__intro {
    width: min(525px, 100%);
    margin: 28px auto 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.7;
}

.access-form {
    width: min(670px, 100%);
    margin: 43px auto 0;
    text-align: start;
}

.access-form > label {
    display: block;
    margin-bottom: 9px;
    color: #c6c9c0;
    font-size: 11px;
    font-weight: 720;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

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

.access-form__row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 11px;
}

.input-shell {
    display: grid;
    min-width: 0;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    background: rgba(20, 22, 18, 0.88);
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.2);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell:focus-within {
    border-color: rgba(198, 243, 107, 0.75);
    box-shadow: 0 0 0 3px rgba(198, 243, 107, 0.07);
}

.input-shell--error {
    border-color: rgba(255, 143, 131, 0.7);
}

.input-shell > svg {
    width: 20px;
    margin-left: 17px;
    fill: none;
    stroke: var(--faint);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.4;
}

.input-shell input {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 13px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.input-shell input::placeholder {
    color: #5f625b;
    opacity: 1;
}

.reveal {
    display: grid;
    width: 44px;
    height: 44px;
    margin-right: 4px;
    place-items: center;
    border: 0;
    color: var(--faint);
    background: transparent;
    cursor: pointer;
}

.reveal:hover {
    color: var(--ink);
}

.reveal svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.35;
}

.eye-off,
.reveal.is-visible .eye-on {
    display: none;
}

.reveal.is-visible .eye-off {
    display: block;
}

.form-hint,
.form-error {
    margin: 10px 0 0;
    font-size: 11px;
}

.form-hint {
    color: var(--faint);
}

.browser-save-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 6px 0 0;
    color: #7d8178;
    font-size: 10px;
}

.browser-save-hint svg {
    flex: 0 0 auto;
    width: 14px;
    fill: none;
    stroke: var(--accent-deep);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.2;
}

.form-error {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
}

.form-error span {
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
}

.trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 29px;
    margin-top: 43px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.trust-row span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.trust-row svg {
    width: 16px;
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.2;
}

.gate__footer {
    justify-content: center;
    gap: 13px;
    color: #555850;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.footer__line {
    width: 24px;
    height: 1px;
    background: #343630;
}

/* Dialog */
.privacy-dialog {
    width: min(470px, calc(100% - 32px));
    padding: 45px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    color: var(--ink);
    background: #171914;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
}

.privacy-dialog::backdrop {
    background: rgba(3, 4, 3, 0.78);
    backdrop-filter: blur(6px);
}

.privacy-dialog[open] {
    animation: dialog-in 180ms ease-out;
}

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
}

.dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.dialog-close svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.4;
}

.dialog-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 24px;
    place-items: center;
    border: 1px solid rgba(198, 243, 107, 0.25);
    border-radius: 50%;
    color: var(--accent);
    background: rgba(198, 243, 107, 0.04);
}

.dialog-icon svg {
    width: 26px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25;
}

.privacy-dialog h2 {
    margin: 6px 0 13px;
    font-family: var(--serif);
    font-size: 35px;
    font-weight: 400;
    letter-spacing: -0.04em;
}

.privacy-dialog p:not(.kicker) {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.privacy-dialog .button {
    width: 100%;
    margin-top: 17px;
}

.queue-challenge {
    width: min(430px, calc(100% - 32px));
    padding: 34px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    color: var(--ink);
    background: #171914;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
}

.queue-challenge::backdrop {
    background: rgba(3, 4, 3, 0.82);
    backdrop-filter: blur(6px);
}

.queue-challenge[open] {
    animation: dialog-in 180ms ease-out;
}

.queue-challenge h2 {
    margin: 6px 0 10px;
    font-family: var(--serif);
    font-size: 31px;
    font-weight: 400;
    letter-spacing: 0;
}

.queue-challenge form > p:not(.kicker) {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.queue-challenge label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    align-items: center;
    gap: 16px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: #c7cac1;
    background: rgba(255, 255, 255, 0.018);
    font-size: 13px;
}

.queue-challenge input {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    color: var(--ink);
    background: #0f100e;
    font: inherit;
    text-align: center;
}

.queue-challenge input:focus {
    border-color: var(--accent-deep);
    outline: 2px solid rgba(198, 243, 107, 0.12);
}

.queue-challenge__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 19px;
}

.queue-state__pulse {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(198, 243, 107, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: queue-spin 850ms linear infinite;
}

@keyframes queue-spin {
    to { transform: rotate(360deg); }
}

/* Library */
.app-shell {
    min-height: 100vh;
}

.app-header {
    position: relative;
    z-index: 5;
    display: flex;
    height: 76px;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(23px, 4.8vw, 72px);
    border-bottom: 1px solid var(--line);
    background: rgba(13, 14, 12, 0.88);
    backdrop-filter: blur(12px);
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header__actions .locale-picker {
    margin-inline-end: 8px;
}

.app-header__actions form {
    display: contents;
}

.private-state {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.private-state i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(198, 243, 107, 0.6);
}

.icon-button {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--faint);
    background: transparent;
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--line);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.03);
}

.icon-button svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.3;
}

.library {
    width: min(1120px, calc(100% - 46px));
    margin: 0 auto;
    padding: 70px 0 84px;
}

.search-hero {
    position: relative;
    display: grid;
    min-height: 260px;
    grid-template-columns: 1fr 290px;
    align-items: center;
    gap: 40px;
}

.search-hero .kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.search-hero h1 {
    font-size: clamp(52px, 6.4vw, 78px);
}

.search-hero > div:first-child > p:last-child {
    max-width: 520px;
    margin: 23px 0 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 17px;
}

.hero-art {
    position: relative;
    width: 260px;
    height: 230px;
    justify-self: end;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(198, 243, 107, 0.09);
    border-radius: 50%;
}

.orbit--one {
    inset: 14px 4px 2px 28px;
}

.orbit--two {
    inset: 43px 34px 30px 0;
}

.book {
    position: absolute;
    bottom: 42px;
    width: 44px;
    border: 1px solid rgba(238, 238, 231, 0.2);
    border-radius: 2px 5px 5px 2px;
    background: linear-gradient(90deg, rgba(255,255,255,.04) 12%, transparent 12%), #181a15;
    box-shadow: 10px 15px 35px rgba(0, 0, 0, 0.32);
    transform-origin: bottom center;
}

.book::before {
    position: absolute;
    top: 12px;
    right: 8px;
    left: 8px;
    height: 1px;
    background: currentColor;
    box-shadow: 0 5px currentColor;
    content: "";
    opacity: 0.25;
}

.book--one {
    left: 53px;
    height: 108px;
    color: var(--accent);
    transform: rotate(-9deg);
}

.book--two {
    left: 104px;
    height: 136px;
    border-color: rgba(198, 243, 107, 0.4);
    color: var(--accent);
    background: linear-gradient(90deg, rgba(0,0,0,.18) 12%, transparent 12%), #5f762f;
    transform: rotate(2deg);
}

.book--three {
    left: 158px;
    height: 92px;
    color: var(--ink);
    transform: rotate(11deg);
}

.search-panel {
    position: relative;
    margin-top: 37px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: rgba(20, 22, 18, 0.76);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.16);
}

.primary-search {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.primary-search > svg {
    width: 24px;
    margin-left: 12px;
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-width: 1.4;
}

.primary-search input {
    min-width: 0;
    height: 55px;
    padding: 0 19px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-family: var(--serif);
    font-size: 20px;
}

.primary-search input::placeholder {
    color: #6c7067;
}

.key-hint {
    margin-right: 15px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--faint);
    font-size: 10px;
}

.search-submit {
    min-width: 128px;
}

.search-submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

.search-submit.is-pending svg {
    animation: search-pulse 850ms ease-in-out infinite alternate;
}

@keyframes search-pulse {
    to {
        opacity: 0.25;
        transform: translateX(4px);
    }
}

.filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 19px 22px 13px;
}

.filter-toggle,
.clear-button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    color: #c8cbc2;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.filter-toggle svg {
    width: 17px;
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-width: 1.2;
}

.filter-toggle span {
    padding: 2px 7px;
    border-radius: 20px;
    color: var(--faint);
    background: rgba(255, 255, 255, 0.045);
    font-size: 9px;
    letter-spacing: 0.03em;
}

.clear-button {
    padding: 3px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 650;
}

.clear-button:hover {
    color: var(--accent);
}

.filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
    padding: 11px 22px 24px;
}

.filters > label,
.field-group {
    display: block;
}

.filters label > span,
.field-group > span {
    display: block;
    margin-bottom: 7px;
    color: var(--faint);
    font-size: 9px;
    font-weight: 720;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.filters input,
.filters select {
    width: 100%;
    height: 43px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 3px;
    outline: 0;
    color: #c9ccc4;
    background: #11130f;
    font-size: 12px;
    transition: border-color 140ms ease;
}

.filters input:focus,
.filters select:focus {
    border-color: rgba(198, 243, 107, 0.55);
}

.filters input::placeholder {
    color: #64675f;
}

.filters select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m5 6 3 3 3-3' fill='none' stroke='%236b6f66' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
}

.year-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 7px;
}

.year-range i {
    color: var(--faint);
    font-style: normal;
}

.filters.is-collapsed {
    display: none;
}

.quiet-note,
.results-state {
    display: flex;
    align-items: center;
    margin: 23px 0 0;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015);
}

.quiet-note {
    gap: 12px;
    padding: 16px 19px;
}

.quiet-note svg {
    flex: 0 0 auto;
    width: 18px;
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25;
}

.quiet-note p {
    margin: 0;
    color: var(--faint);
    font-size: 11px;
}

.quiet-note strong {
    color: #aeb1a8;
}

.results-state {
    gap: 25px;
    padding: 31px;
}

.results-state__icon {
    display: grid;
    flex: 0 0 auto;
    width: 68px;
    height: 68px;
    place-items: center;
    border: 1px solid rgba(198, 243, 107, 0.17);
    border-radius: 50%;
    color: var(--accent);
    background: rgba(198, 243, 107, 0.035);
}

.results-state__icon svg {
    width: 34px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.2;
}

.results-state h2 {
    margin: 5px 0 5px;
    font-family: var(--serif);
    font-size: 27px;
    font-weight: 400;
    letter-spacing: -0.035em;
}

.results-state p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.catalog-results {
    margin-top: 38px;
}

.results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.results-heading .kicker {
    margin-bottom: 7px;
}

.results-heading h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(29px, 4vw, 42px);
    font-weight: 400;
    letter-spacing: -0.045em;
}

.results-heading > span {
    flex: 0 0 auto;
    padding-bottom: 7px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.result-card {
    display: grid;
    min-width: 0;
    min-height: 230px;
    grid-template-columns: 132px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 48%),
        rgba(20, 22, 18, 0.78);
    color: inherit;
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease;
}

.result-card:hover,
.result-card:focus-visible {
    border-color: rgba(198, 243, 107, 0.22);
    transform: translateY(-2px);
}

.result-cover {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    border-inline-end: 1px solid var(--line);
    background:
        linear-gradient(155deg, rgba(198, 243, 107, 0.1), transparent 55%),
        #10120e;
}

.result-cover::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 45px;
    height: 62px;
    border: 1px solid rgba(198, 243, 107, 0.24);
    border-radius: 2px 5px 5px 2px;
    box-shadow: inset 7px 0 rgba(198, 243, 107, 0.035);
    content: "";
    transform: translate(-50%, -50%) rotate(-3deg);
}

.result-cover::after {
    position: absolute;
    top: calc(50% - 13px);
    left: 50%;
    width: 20px;
    height: 1px;
    background: rgba(198, 243, 107, 0.25);
    box-shadow: 0 7px rgba(198, 243, 107, 0.16);
    content: "";
    transform: translateX(-40%);
}

.result-cover img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-card__body {
    min-width: 0;
    padding: 21px 21px 19px;
}

.result-card__source {
    margin: 0 0 8px;
    color: var(--accent-deep);
    font-size: 8px;
    font-weight: 780;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.result-card h3 {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.result-card__author {
    margin: 8px 0 0;
    overflow: hidden;
    color: #b6b9b0;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-card__meta {
    margin: 12px 0 0;
    color: var(--faint);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.result-card__description {
    display: -webkit-box;
    margin: 12px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.result-card__open {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 15px;
    color: var(--accent-deep);
    font-size: 9px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.result-card__open svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25;
    transition: transform 150ms ease;
}

.result-card:hover .result-card__open svg {
    transform: translateX(3px);
}

/* Book detail */
.book-page {
    width: min(1060px, calc(100% - 46px));
    min-height: calc(100vh - 148px);
    margin: 0 auto;
    padding: 48px 0 82px;
}

.book-back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 30px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 720;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.book-back:hover {
    color: var(--accent);
}

.book-back svg {
    width: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25;
}

.book-detail {
    display: grid;
    min-height: 560px;
    grid-template-columns: minmax(230px, 310px) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background:
        radial-gradient(circle at 13% 12%, rgba(198, 243, 107, 0.055), transparent 30rem),
        rgba(20, 22, 18, 0.8);
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.2);
}

.book-detail__cover {
    position: relative;
    width: 100%;
    height: 560px;
    align-self: start;
    overflow: hidden;
    border-inline-end: 1px solid var(--line);
    background:
        linear-gradient(155deg, rgba(198, 243, 107, 0.11), transparent 52%),
        #10120e;
}

.book-detail__cover::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 108px;
    height: 158px;
    border: 1px solid rgba(198, 243, 107, 0.2);
    border-radius: 3px 9px 9px 3px;
    box-shadow: inset 17px 0 rgba(198, 243, 107, 0.025), 20px 26px 70px rgba(0, 0, 0, 0.25);
    content: "";
    transform: translate(-50%, -50%) rotate(-3deg);
}

.book-detail__cover::after {
    position: absolute;
    top: calc(50% - 30px);
    left: 50%;
    width: 47px;
    height: 1px;
    background: rgba(198, 243, 107, 0.24);
    box-shadow: 0 13px rgba(198, 243, 107, 0.14);
    content: "";
    transform: translateX(-38%);
}

.book-detail__cover img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.book-detail__content {
    display: flex;
    min-width: 0;
    padding: clamp(35px, 6vw, 72px);
    align-items: center;
}

.book-detail__content > div {
    width: 100%;
}

.book-detail h1 {
    max-width: 650px;
    margin: 11px 0 0;
    font-family: var(--serif);
    font-size: clamp(38px, 5vw, 60px);
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 1.04;
}

.book-detail__author {
    margin: 18px 0 0;
    color: #bdc0b7;
    font-family: var(--serif);
    font-size: 18px;
}

.book-detail__status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.book-detail__status-row .kicker {
    margin: 0;
}

.book-detail__refreshing {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--faint);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.book-detail__refreshing i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    animation: detail-pulse 900ms ease-in-out infinite alternate;
}

.book-detail__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.book-detail__facts > span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.018);
    font-size: 9px;
    letter-spacing: 0.035em;
}

.book-detail__facts strong {
    margin-inline-end: 4px;
    color: #b8bbb2;
    font-weight: 720;
}

.book-request {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 15px;
    margin-top: 30px;
}

.book-request__button {
    min-width: 150px;
}

.book-request__button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.book-request__button.is-pending svg {
    animation: request-pulse 850ms ease-in-out infinite alternate;
}

.book-request__status {
    max-width: 420px;
    margin: 0;
    color: var(--faint);
    font-size: 11px;
    line-height: 1.55;
}

.book-request__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-deep);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.book-request__link:hover {
    color: var(--accent);
}

.book-description {
    margin-top: 35px;
    padding-top: 27px;
    border-top: 1px solid var(--line);
}

.book-description h2 {
    margin: 0 0 11px;
    color: #c9ccc3;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.book-description__text {
    max-width: 690px;
    margin: 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-line;
}

.book-description__text.is-clamped:not(.is-expanded) {
    max-height: 8.75em;
    overflow: hidden;
}

.book-description__text.is-collapsible:not(.is-expanded) {
    -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
}

.book-description__toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 13px;
    padding: 4px 0;
    border: 0;
    color: var(--accent-deep);
    background: transparent;
    font-size: 9px;
    font-weight: 760;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-transform: uppercase;
}

.book-description__toggle:hover,
.book-description__toggle:focus-visible {
    color: var(--accent);
}

.book-description__toggle svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.35;
    transition: transform 160ms ease;
}

.book-description__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.book-loading h1,
.book-error h1 {
    font-size: clamp(38px, 5vw, 58px);
}

.book-loading__line {
    width: min(430px, 90%);
    height: 10px;
    margin-top: 34px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,.035), rgba(198,243,107,.11), rgba(255,255,255,.035));
    background-size: 220% 100%;
    animation: detail-shimmer 1.4s ease-in-out infinite;
}

.book-loading__line--short {
    width: min(290px, 64%);
    margin-top: 12px;
}

.book-error > p:not(.kicker) {
    max-width: 520px;
    margin: 18px 0 27px;
    color: var(--muted);
}

.book-inline-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 27px;
    padding: 13px 15px;
    border: 1px solid rgba(198, 243, 107, 0.12);
    border-radius: 3px;
    background: rgba(198, 243, 107, 0.025);
}

.book-inline-status p {
    margin: 0;
    color: var(--faint);
    font-size: 10px;
}

.book-inline-status button {
    flex: 0 0 auto;
    padding: 3px;
    border: 0;
    color: var(--accent-deep);
    background: transparent;
    font-size: 9px;
    font-weight: 720;
    cursor: pointer;
    text-transform: uppercase;
}

.book-inline-status button:disabled {
    cursor: wait;
    opacity: 0.45;
}

@keyframes detail-shimmer {
    to {
        background-position: -220% 0;
    }
}

@keyframes detail-pulse {
    to {
        opacity: 0.25;
        transform: scale(0.72);
    }
}

@keyframes request-pulse {
    to {
        opacity: 0.35;
        transform: translateY(3px);
    }
}

.app-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px clamp(23px, 4.8vw, 72px);
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-size: 10px;
}

.app-footer > span {
    color: #a8aba2;
    font-size: 14px;
    font-weight: 700;
}

.app-footer > span span {
    color: var(--accent);
}

.app-footer p {
    margin: 0;
}

.app-footer button {
    margin-inline-start: auto;
    border: 0;
    color: var(--faint);
    background: transparent;
    font-size: 10px;
    cursor: pointer;
}

html[dir="rtl"] .brand,
html[dir="rtl"] .gate__actions,
html[dir="rtl"] .app-header__actions {
    direction: rtl;
}

html[dir="rtl"] .text-button svg,
html[dir="rtl"] .button svg {
    transform: scaleX(-1);
}

html[dir="rtl"] .locale-picker select {
    padding: 0 0 0 18px;
    background-position: left center;
}

html[dir="rtl"] .input-shell > svg {
    margin-right: 17px;
    margin-left: 0;
}

html[dir="rtl"] .reveal {
    margin-right: 0;
    margin-left: 4px;
}

html[dir="rtl"] .primary-search > svg {
    margin-right: 12px;
    margin-left: 0;
}

.app-footer button:hover {
    color: var(--ink);
}

/* Errors */
.error-page {
    display: flex;
    width: min(600px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
}

.error-page .brand {
    margin-bottom: 80px;
}

.error-page h1 {
    margin: 9px 0;
    font-family: var(--serif);
    font-size: clamp(46px, 8vw, 74px);
    font-weight: 400;
    letter-spacing: -0.06em;
}

.error-page > p:not(.kicker) {
    margin: 0 0 30px;
    color: var(--muted);
}

@media (max-width: 800px) {
    .service-notice__inner {
        min-height: 0;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 13px 11px;
    }

    .service-notice__dot {
        margin-top: 6px;
    }

    .service-notice p {
        font-size: 10px;
        line-height: 1.45;
    }

    .service-notice button {
        width: 28px;
        height: 28px;
        margin-top: -2px;
    }

    .gate {
        padding: 25px 22px 23px;
    }

    .gate::after {
        display: none;
    }

    .gate__content {
        padding: 80px 0 50px;
    }

    .access-form__row {
        grid-template-columns: 1fr;
    }

    .access-form .button {
        width: 100%;
    }

    .trust-row {
        gap: 14px;
    }

    .search-hero {
        grid-template-columns: 1fr 190px;
    }

    .hero-art {
        width: 190px;
        transform: scale(0.82);
        transform-origin: right center;
    }

    .filters {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-list {
        grid-template-columns: 1fr;
    }

    .book-detail {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 590px) {
    .gate__header .text-button {
        font-size: 0;
    }

    .gate__header .text-button svg {
        width: 20px;
    }

    .gate__content {
        padding-top: 60px;
    }

    .gate h1 {
        font-size: clamp(47px, 15vw, 66px);
    }

    .gate__intro {
        font-size: 16px;
    }

    .trust-row {
        flex-wrap: wrap;
        margin-top: 31px;
    }

    .privacy-dialog {
        padding: 38px 25px 27px;
    }

    .app-header {
        height: 66px;
    }

    .gate__actions {
        gap: 10px;
    }

    .locale-picker select {
        max-width: 72px;
    }

    .app-header__actions .locale-picker {
        margin-inline-end: 1px;
    }

    .app-header__actions .locale-picker svg,
    .app-header__actions > .icon-button {
        display: none;
    }

    .app-header__actions .locale-picker {
        padding-inline: 5px;
    }

    .private-state {
        display: none;
    }

    .library {
        width: min(100% - 30px, 1120px);
        padding-top: 48px;
    }

    .search-hero {
        display: block;
        min-height: 0;
    }

    .search-hero h1 {
        font-size: clamp(49px, 15vw, 67px);
    }

    .hero-art {
        display: none;
    }

    .search-panel {
        margin-top: 40px;
    }

    .primary-search {
        grid-template-columns: auto 1fr;
        gap: 0;
    }

    .primary-search input {
        height: 51px;
        padding-right: 9px;
        font-size: 17px;
    }

    .key-hint {
        display: none;
    }

    .search-submit {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 7px;
    }

    .filter-heading {
        padding-top: 17px;
    }

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

    .results-state {
        align-items: flex-start;
        flex-direction: column;
    }

    .results-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .results-heading > span {
        padding: 0;
    }

    .result-card {
        min-height: 205px;
        grid-template-columns: 104px minmax(0, 1fr);
    }

    .result-card__body {
        padding: 17px 16px;
    }

    .result-card h3 {
        font-size: 19px;
    }

    .book-page {
        width: min(100% - 30px, 1060px);
        padding-top: 32px;
    }

    .book-detail {
        display: block;
    }

    .book-detail__cover {
        height: 360px;
        border-inline-end: 0;
        border-bottom: 1px solid var(--line);
    }

    .book-detail__content {
        min-height: 390px;
        padding: 34px 24px 42px;
    }

    .book-detail__status-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .book-inline-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .book-request {
        align-items: stretch;
        flex-direction: column;
    }

    .book-request__button,
    .book-request__link {
        width: 100%;
    }

    .book-description__text {
        font-size: 14px;
    }

    .app-footer {
        flex-wrap: wrap;
        gap: 8px 15px;
    }

    .app-footer button {
        width: 100%;
        margin: 5px 0 0;
        padding: 0;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
