﻿* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --color-ink: #241b14;
    --color-heading: #3f2717;
    --color-muted: #5f6b73;
    --color-page: #eef3f1;
    --color-surface: #fffdf7;
    --color-surface-strong: #ffffff;
    --color-paper: #fbf0cf;
    --color-paper-deep: #e3c276;
    --color-line: #dcc99b;
    --color-line-cool: #cfd8df;
    --color-teal: #0f766e;
    --color-teal-dark: #0a5f58;
    --color-teal-soft: #e0f2ef;
    --color-danger: #b42318;
    --shadow-soft: 0 12px 28px rgba(36, 27, 20, 0.1);
    --shadow-panel: 0 18px 38px rgba(66, 38, 12, 0.16);
}

body *:not(.site-header):not(.site-header *):not(.site-footer):not(.site-footer *) {
    text-align: center;
}

body {
    margin: 0;
    color: var(--color-ink);
    background:
        radial-gradient(circle 220px at var(--pointer-x, 20%) var(--pointer-y, 10%), rgba(15, 118, 110, 0.16), transparent 70%),
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 32rem),
        linear-gradient(180deg, #f7faf8 0%, var(--color-page) 100%);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-motion-item {
    animation: page-rise-in 900ms cubic-bezier(0.2, 0.85, 0.18, 1) both;
    animation-delay: var(--page-motion-delay, 0ms);
}

@keyframes page-rise-in {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(48px) scale(0.96);
    }

    60% {
        opacity: 1;
    }

    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

.tilt-ready {
    transform:
        perspective(1100px)
        rotateX(var(--tilt-x, 0deg))
        rotateY(var(--tilt-y, 0deg))
        translateY(var(--lift, 0));
    transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.tilt-ready:hover {
    filter: saturate(1.03);
    box-shadow: 0 26px 54px rgba(36, 27, 20, 0.2);
}

.js-ripple {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.ripple-dot {
    position: absolute;
    z-index: 0;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.18);
    pointer-events: none;
    transform: scale(0);
    animation: ripple-pop 640ms ease-out forwards;
}

@keyframes ripple-pop {
    to {
        opacity: 0;
        transform: scale(2.4);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    body,
    .page-motion-item {
        opacity: 1;
        filter: none;
        transform: none;
        animation: none;
    }
}

.site-header,
.site-footer {
    position: relative;
    overflow: visible;
    padding: 24px 32px;
    color: var(--color-heading);
    background: #BFA46E;
    border-color: rgba(130, 92, 38, 0.22);
    box-shadow: 0 8px 22px rgba(66, 38, 12, 0.1);
}

.site-header {
    display: grid;
    grid-template-columns: auto minmax(320px, 540px) 1fr;
    align-items: center;
    gap: 20px;
    z-index: 20;
    border-bottom: 1px solid rgba(130, 92, 38, 0.18);
    transition: box-shadow 240ms ease, transform 240ms ease;
}

.site-footer {
    border-top: 1px solid rgba(130, 92, 38, 0.18);
}

.site-header > *,
.site-footer > * {
    position: relative;
    z-index: 1;
}

.site-logo {
    color: var(--color-heading);
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
}

.site-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(120, 76, 40, 0.24);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.74);
    cursor: pointer;
}

.site-menu-toggle span {
    position: absolute;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-heading);
    transition: transform 180ms ease, opacity 180ms ease;
}

.site-menu-toggle span:nth-child(1) {
    transform: translateY(-7px);
}

.site-menu-toggle span:nth-child(3) {
    transform: translateY(7px);
}

.site-menu-toggle.is-open span:nth-child(1) {
    transform: rotate(45deg);
}

.site-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.site-menu-toggle.is-open span:nth-child(3) {
    transform: rotate(-45deg);
}

.site-menu-toggle:hover,
.site-menu-toggle:focus-visible {
    border-color: var(--color-teal);
    outline: none;
}

.site-nav {
    display: flex;
    gap: 14px;
}

.site-nav a {
    color: var(--color-heading);
    font-weight: 700;
    text-decoration: none;
    transition: color 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-logo:hover,
.site-logo:focus-visible {
    color: var(--color-teal);
    outline: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    transform: translateY(-2px);
}

.header-search {
    display: flex;
    gap: 0;
    justify-content: flex-start;
    min-width: 0;
}

.header-search .search-autocomplete {
    flex: 1;
    max-width: 440px;
    z-index: 30;
}

.header-search input,
.header-search button {
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    font: inherit;
}

.header-search input {
    width: 100%;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    color: var(--color-ink);
    background: rgba(255, 253, 247, 0.92);
}

.header-search button {
    border-radius: 0 8px 8px 0;
    border-color: var(--color-teal);
    color: #ffffff;
    background: var(--color-teal);
    font-weight: 700;
    cursor: pointer;
}

.site-footer {
    margin-top: 48px;
    display: grid;
    gap: 28px;
}

.site-footer p {
    margin: 0;
}

.page {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
    flex: 1;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) repeat(4, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.footer-block {
    display: grid;
    gap: 10px;
    align-content: start;
}

.footer-block h2 {
    margin: 0 0 4px;
    color: var(--color-heading);
    font-size: 16px;
}

.footer-block a,
.footer-user {
    color: var(--color-heading);
    text-decoration: none;
}

.footer-block a:hover,
.footer-block a:focus-visible {
    color: var(--color-teal);
    text-decoration: underline;
    outline: none;
}

.footer-brand p {
    max-width: 320px;
    color: var(--color-muted);
    line-height: 1.6;
}

.footer-donation {
    padding: 16px;
    border: 1px solid rgba(130, 92, 38, 0.18);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.42);
    box-shadow: 0 12px 24px rgba(66, 38, 12, 0.08);
}

.footer-donation p,
.footer-donation small {
    color: var(--color-muted);
    line-height: 1.55;
}

.footer-donation small {
    display: block;
    font-size: 12px;
}

.footer-donation-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 10px 14px;
    border: 1px solid var(--color-teal);
    border-radius: 8px;
    color: #ffffff !important;
    background: var(--color-teal);
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.16);
    font-weight: 800;
    text-decoration: none !important;
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.footer-donation-button:hover,
.footer-donation-button:focus-visible {
    background: var(--color-teal-dark);
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
    outline: none;
    transform: translateY(-2px);
}

.site-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(120, 76, 40, 0.18);
    color: var(--color-muted);
    font-size: 14px;
}

.footer-source {
    display: grid;
    gap: 4px;
    color: var(--color-heading);
    font-size: 12px;
    line-height: 1.45;
    opacity: 0.58;
    text-align: center;
}

.ad-slot {
    display: none;
    gap: 8px;
    width: min(100%, 970px);
    min-height: 132px;
    margin: 44px auto;
    padding: 0;
    color: var(--color-muted);
    text-align: center;
}

.ad-slot-label {
    margin: 0;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    opacity: 0.76;
    text-transform: uppercase;
}

.ad-slot-box {
    display: grid;
    min-height: 108px;
    place-items: center;
    border: 1px dashed rgba(95, 107, 115, 0.34);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.ad-slot-box span {
    max-width: 34rem;
    padding: 0 18px;
    color: var(--color-muted);
    font-size: 13px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.admin-stat-card {
    display: grid;
    gap: 8px;
    min-height: 160px;
    place-items: center;
}

.admin-stat-card span {
    color: var(--color-heading);
    font-size: 42px;
    font-weight: 900;
}

.admin-stat-card p {
    margin: 0;
    color: var(--color-muted);
    font-weight: 800;
}

.admin-actions-panel {
    display: grid;
    gap: 18px;
}

.admin-action-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.72);
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(130, 92, 38, 0.16);
    text-align: left;
}

.admin-table th {
    color: var(--color-heading);
    font-size: 13px;
    text-transform: uppercase;
}

.admin-role-badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--color-muted);
    background: rgba(255, 255, 255, 0.58);
    font-size: 13px;
    font-weight: 800;
}

.admin-role-badge.is-admin {
    color: #ffffff;
    background: var(--color-teal);
}

.admin-inline-form {
    display: inline-flex;
    margin: 0;
}

.admin-inline-form button {
    padding: 9px 12px;
    border: 1px solid var(--color-teal);
    border-radius: 8px;
    color: #ffffff;
    background: var(--color-teal);
    font-weight: 800;
    cursor: pointer;
}

.search-section {
    margin-bottom: 32px;
}

.home-hero {
    display: grid;
    justify-items: center;
    width: 100%;
    margin: 0 auto 40px;
    padding: 80px;
}

.home-hero,
.collection-tools,
.detail-summary,
.detail-panel,
.info-page-header {
    position: relative;
    overflow: hidden;
    min-height: fit-content;
    border: 0;
    color: var(--color-ink);
    background-color: #f6df9f;
    background-image:
        linear-gradient(rgba(246, 223, 159, 0.2), rgba(246, 223, 159, 0.2)),
        url("../img/parchment-texture.avif");
    background-position: center;
    background-size: auto, 100% 100%;
    background-repeat: no-repeat;
    box-shadow: var(--shadow-panel);
    border-radius: 8px;
    -webkit-mask: url("../img/parchment-torn-mask.svg") center / 100% 100% no-repeat;
    mask: url("../img/parchment-torn-mask.svg") center / 100% 100% no-repeat;
}

.home-hero h1 {
    max-width: 760px;
    margin: 0 auto 16px;
    font-size: 42px;
    line-height: 1.1;
    color: var(--color-heading);
}

.home-hero p {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    color: var(--color-ink);
}

.home-section {
    margin-top: 32px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0;
}

.section-heading a {
    color: var(--color-teal);
    font-weight: 800;
}

.home-subsection-heading {
    margin-top: 40px;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.home-top-list {
    display: grid;
    gap: 24px;
    width: 100%;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 32px;
}

.home-top-card {
    display: grid;
    gap: 12px;
}

.home-top-card h3 {
    margin: 0;
    color: var(--color-heading);
    font-size: 24px;
}

.home-top-card h3 a {
    color: inherit;
    text-decoration: none;
}

.home-top-card h3 a:hover,
.home-top-card h3 a:focus-visible {
    color: var(--color-teal);
    outline: none;
}

.home-top-card p {
    margin: 0;
}

.home-top-card-layout {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.home-top-card-image {
    display: block;
    width: 100%;
    max-width: 120px;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(36, 27, 20, 0.2);
}

.search-section h1 {
    margin: 0 0 16px;
    font-size: 34px;
}

.route-cards #collection-options,
.route-cards .search-section .search-form {
    display: none !important;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.search-form input,
.search-form select {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--color-line-cool);
    border-radius: 8px;
    font-size: 16px;
}

.search-form input {
    width: 100%;
}

.search-form select {
    flex: 0 1 180px;
    background: var(--color-surface-strong);
}

.search-autocomplete {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.suggestions {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    border: 1px solid var(--color-line-cool);
    border-radius: 8px;
    background: var(--color-surface-strong);
    box-shadow: var(--shadow-soft);
    transform-origin: top center;
    animation: suggestions-in 180ms ease both;
}

@keyframes suggestions-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.suggestions-list {
    max-height: 320px;
    overflow-y: auto;
}

.suggestions button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid #e7ecef;
    background: var(--color-surface-strong);
    color: var(--color-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.suggestions button:last-child {
    border-bottom: 0;
}

.suggestions button:hover {
    background: var(--color-teal-soft);
}

.suggestions-footer {
    padding: 10px 14px;
    border-top: 1px solid #e7ecef;
    background: #f7fbfa;
}

.suggestions-view-all {
    color: var(--color-teal);
    font-weight: 700;
    text-decoration: none;
}

.suggestions-view-all:hover,
.suggestions-view-all:focus-visible {
    text-decoration: underline;
    outline: none;
}

.search-form button {
    padding: 12px 18px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: var(--color-teal);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.message {
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--color-line-cool);
    border-radius: 8px;
    background: var(--color-surface-strong);
}

.message-success {
    border-color: #86efac;
    background: #f0fdf4;
}

.message-error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.message-warning {
    border-color: #fcd34d;
    background: #fffbeb;
}

.collection-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 80px;
}

.collection-tools p {
    margin: 0;
    color: var(--color-heading);
    font-weight: 700;
}

.home-hero::before,
.home-hero::after,
.collection-tools::before,
.collection-tools::after,
.detail-summary::before,
.detail-summary::after,
.detail-panel::before,
.detail-panel::after,
.info-page-header::before,
.info-page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-hero::before,
.collection-tools::before,
.detail-summary::before,
.detail-panel::before,
.info-page-header::before {
    inset: 0;
    background:
        linear-gradient(90deg, rgba(120, 76, 40, 0.16), transparent 8%, transparent 92%, rgba(120, 76, 40, 0.16)),
        linear-gradient(180deg, rgba(120, 76, 40, 0.14), transparent 10%, transparent 90%, rgba(120, 76, 40, 0.14));
    opacity: 0.42;
}

.home-hero::after,
.collection-tools::after,
.detail-summary::after,
.detail-panel::after,
.info-page-header::after {
    inset: 0;
    display: none;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: center;
    gap: 12px;
}

.filter-form label {
    display: grid;
    gap: 6px;
    color: var(--color-muted);
    font-size: 14px;
}

.filter-form select,
.filter-form button {
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    background: var(--color-surface-strong);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.filter-form button {
    color: #ffffff;
    background: var(--color-heading);
    cursor: pointer;
}

button:hover,
button:focus-visible,
select:hover,
select:focus-visible,
input:hover,
input:focus-visible,
textarea:hover,
textarea:focus-visible {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
    outline: none;
}

button:active,
.card-detail-link:active,
.back-link:active {
    transform: translateY(1px) scale(0.99);
}

.card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.card-carousel {
    --carousel-gap: 24px;
    --carousel-card-width: 190px;
    --carousel-visible: 5;
    width: 80vw;
    max-width: 80vw;
    margin: 0 auto;
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

.card-carousel:active {
    cursor: grabbing;
}

.card-carousel-viewport {
    position: relative;
    overflow: hidden;
    padding: 20px 48px;
    margin: -20px -48px;
    perspective: 900px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
}

.card-carousel-viewport::before,
.card-carousel-viewport::after {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 18px;
    z-index: 2;
    width: 64px;
    pointer-events: none;
}

.card-carousel-viewport::before {
    left: 0;
    background: linear-gradient(90deg, rgba(238, 243, 241, 0.86), transparent);
}

.card-carousel-viewport::after {
    right: 0;
    background: linear-gradient(270deg, rgba(238, 243, 241, 0.86), transparent);
}

.card-carousel-track {
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--carousel-gap);
    transform: translate3d(var(--carousel-offset, 0), 0, 0);
    transition: none;
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.card-item {
    flex: 0 1 calc(25% - 18px);
    overflow: hidden;
    border: 1px solid rgba(130, 92, 38, 0.18);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    transition: border-color 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.card-item:hover,
.card-item:focus-within {
    border-color: rgba(15, 118, 110, 0.36);
    box-shadow: 0 18px 38px rgba(36, 27, 20, 0.16);
}

.card-carousel .card-carousel-slide {
    flex: 0 0 var(--carousel-card-width);
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transform: translateZ(-18px) scale(0.94);
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.card-carousel-valuable .card-carousel-track,
.card-carousel-recent .card-carousel-track {
    transform-style: flat;
}

.card-carousel-valuable .card-carousel-slide,
.card-carousel-recent .card-carousel-slide {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
    will-change: auto;
}

.card-carousel-link {
    position: relative;
    display: block;
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(36, 27, 20, 0.22);
    text-decoration: none;
    transform: translateZ(0);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.card-carousel-link:hover,
.card-carousel-link:focus-visible {
    box-shadow: 0 18px 34px rgba(36, 27, 20, 0.28);
    filter: saturate(1.06);
    outline: none;
    transform: translateY(-4px) translateZ(36px) scale(1.03);
}

.card-carousel .card-image {
    border-radius: 8px;
}

.card-carousel-price {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 7px 10px;
    border-radius: 8px;
    color: #ffffff;
    background: rgba(63, 39, 23, 0.94);
    box-shadow: 0 8px 18px rgba(36, 27, 20, 0.24);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    font-variant-numeric: tabular-nums;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    contain: paint;
    pointer-events: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.card-image {
    display: block;
    width: 100%;
    aspect-ratio: 5 / 7;
    object-fit: cover;
    background: #e8edea;
}

.card-image-link {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
}

.card-content {
    padding: 16px;
}

.card-content h2 {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.3;
}

.card-content h2 a {
    color: var(--color-heading);
    text-decoration: none;
}

.card-content h2 a:hover,
.card-detail-link:hover,
.back-link:hover {
    text-decoration: underline;
}

.card-content p {
    margin: 8px 0 0;
    color: var(--color-muted);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.card-tags span {
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--color-heading);
    background: #f1e4bd;
    font-size: 13px;
    font-weight: 700;
}

.card-item.is-hidden {
    display: none;
}

.card-detail-link,
.back-link,
.external-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--color-teal);
    font-weight: 700;
    text-decoration: none;
}

.card-detail-link:hover,
.card-detail-link:focus-visible,
.back-link:hover,
.back-link:focus-visible,
.external-links a:hover,
.external-links a:focus-visible,
.header-search button:hover,
.header-search button:focus-visible,
.search-form button:hover,
.search-form button:focus-visible,
.comment-form button:hover,
.comment-form button:focus-visible {
    background: var(--color-teal-dark);
    outline: none;
    text-decoration: none;
}

.back-link {
    margin: 0 0 24px;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    margin-bottom: 32px;
}

.detail-image {
    display: block;
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-panel);
}

.detail-summary,
.detail-panel {
    padding: 80px;
}

.home-hero h1,
.detail-summary h1,
.detail-panel h2 {
    margin: 0 0 16px;
    color: var(--color-heading);
}

.home-hero > *,
.detail-summary > *,
.detail-panel > *,
.collection-tools > *,
.info-page-header > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--color-teal);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
}

.muted {
    color: var(--color-muted);
}

.detail-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
}

.detail-list dt {
    color: var(--color-muted);
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.nested-list {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.7);
}

.external-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.external-links a {
    margin-top: 0;
    background: var(--color-heading);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
    margin-left: auto;
    margin-right: auto;
}

.comments-panel {
    margin-top: 24px;
}

.route-card-show .comments-panel {
    overflow: visible;
    border: 1px solid var(--color-line-cool);
    border-radius: 0;
    background-color: var(--color-surface-strong);
    background-image: none;
    box-shadow: var(--shadow-soft);
    -webkit-mask: none;
    mask: none;
}

.route-card-show .comments-panel::before,
.route-card-show .comments-panel::after {
    display: none;
}

.discussion-shell {
    display: grid;
    gap: 16px;
}

.discussion-toolbar {
    display: grid;
    gap: 16px;
}

.discussion-select {
    display: grid;
    gap: 8px;
    color: var(--color-muted);
    font-weight: 700;
}

.discussion-select select {
    width: fit-content;
    min-width: 160px;
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    background: var(--color-surface-strong);
    font: inherit;
}

.discussion-languages {
    display: grid;
    gap: 8px;
}

.discussion-languages p {
    margin: 0;
    color: var(--color-muted);
    font-weight: 700;
}

.language-button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.language-button {
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    background: var(--color-surface-strong);
    color: var(--color-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.language-button.is-active {
    border-color: var(--color-teal);
    color: #ffffff;
    background: var(--color-teal);
}

.card-price-language-select {
    width: min(100%, 320px);
    margin: 0 auto;
    padding: 12px 14px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    color: var(--color-ink);
    background: var(--color-surface-strong);
    font: inherit;
    font-weight: 800;
}

.price-history-panel {
    margin-top: 24px;
}

.price-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.price-history-header h2 {
    margin: 0;
}

.price-history-ranges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(130, 92, 38, 0.16);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.58);
}

.price-history-ranges button {
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--color-heading);
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.price-history-ranges button:hover,
.price-history-ranges button:focus-visible,
.price-history-ranges button.is-active {
    border-color: var(--color-teal);
    color: #ffffff;
    background: var(--color-teal);
    outline: none;
}

.price-history-chart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 22px;
    border: 1px solid rgba(130, 92, 38, 0.12);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 14px 26px rgba(66, 38, 12, 0.08);
    transition: opacity 180ms ease, filter 180ms ease;
}

.price-history-chart.is-loading {
    opacity: 0.62;
    filter: blur(1px);
    pointer-events: none;
}

.price-history-chart svg {
    width: 100%;
    max-width: 1040px;
    height: auto;
    overflow: visible;
}

.price-chart-grid line {
    stroke: rgba(89, 103, 124, 0.2);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.price-chart-axis {
    fill: none;
    stroke: rgba(58, 73, 92, 0.48);
    stroke-width: 2;
    shape-rendering: crispEdges;
}

.price-chart-current-line {
    stroke: rgba(58, 73, 92, 0.66);
    stroke-width: 1.4;
    shape-rendering: crispEdges;
}

.price-chart-line {
    fill: none;
    stroke: #4f95d8;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3.4;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: chart-draw 900ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.price-chart-dot {
    fill: #4f95d8;
    stroke: #ffffff;
    stroke-width: 2;
    opacity: 0.72;
    transform-origin: center;
    animation: chart-dot-in 420ms ease forwards;
    animation-delay: 520ms;
}

.price-chart-current-badge rect {
    fill: #50617d;
}

.price-chart-current-badge text {
    fill: #ffffff;
    font-size: 18px;
    font-weight: 800;
}

.price-chart-side-label,
.price-chart-date {
    fill: #42454d;
    font-size: 18px;
    font-weight: 800;
}

.price-chart-side-label {
    font-size: 18px;
    font-weight: 600;
}

.price-chart-date {
    font-size: 15px;
}

@keyframes chart-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes chart-dot-in {
    from {
        opacity: 0;
        transform: scale(0.65);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.comment-form {
    display: grid;
    gap: 12px;
    width: 80%;
    margin: 16px auto 20px;
}

.comment-form label {
    display: grid;
    gap: 8px;
    color: var(--color-muted);
    font-weight: 700;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    color: var(--color-ink);
    background: rgba(255, 253, 247, 0.94);
    font: inherit;
}

.header-search input:focus,
.search-form input:focus,
.search-form select:focus,
.filter-form select:focus,
.discussion-select select:focus,
.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
    outline: none;
}

.comment-form textarea {
    resize: vertical;
}

.comment-form button {
    justify-self: start;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: var(--color-teal);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.forum-layout,
.forum-section,
.forum-thread-list {
    display: grid;
    gap: 20px;
}

.route-blog .home-hero,
.route-blog-topic .home-hero,
.route-blog-thread .home-hero,
.route-blog .detail-panel,
.route-blog-topic .detail-panel,
.route-blog-thread .detail-panel,
.route-blog .detail-summary,
.route-blog-topic .detail-summary,
.route-blog-thread .detail-summary,
.route-blog .info-page-header,
.route-blog-topic .info-page-header,
.route-blog-thread .info-page-header {
    overflow: visible;
    border: 1px solid var(--color-line-cool);
    border-radius: 0;
    background-color: var(--color-surface-strong);
    background-image: none;
    box-shadow: var(--shadow-soft);
    -webkit-mask: none;
    mask: none;
}

.route-blog .home-hero::before,
.route-blog .home-hero::after,
.route-blog-topic .home-hero::before,
.route-blog-topic .home-hero::after,
.route-blog-thread .home-hero::before,
.route-blog-thread .home-hero::after,
.route-blog .detail-panel::before,
.route-blog .detail-panel::after,
.route-blog-topic .detail-panel::before,
.route-blog-topic .detail-panel::after,
.route-blog-thread .detail-panel::before,
.route-blog-thread .detail-panel::after,
.route-blog .detail-summary::before,
.route-blog .detail-summary::after,
.route-blog-topic .detail-summary::before,
.route-blog-topic .detail-summary::after,
.route-blog-thread .detail-summary::before,
.route-blog-thread .detail-summary::after,
.route-blog .info-page-header::before,
.route-blog .info-page-header::after,
.route-blog-topic .info-page-header::before,
.route-blog-topic .info-page-header::after,
.route-blog-thread .info-page-header::before,
.route-blog-thread .info-page-header::after {
    display: none;
}

.forum-thread-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.78);
    box-shadow: inset 0 0 0 1px rgba(120, 53, 15, 0.14);
}

.forum-thread-card h3,
.forum-thread-card p {
    margin: 0;
}

.forum-thread-card-full p {
    line-height: 1.7;
}

.forum-thread-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    color: var(--color-muted);
}

.comment-list {
    display: grid;
    gap: 12px;
    width: min(100%, 720px);
    margin-left: auto;
    margin-right: auto;
    justify-items: center;
}

.comment-list-nested {
    width: 100%;
    margin: 16px auto 0;
    padding-top: 14px;
    border-top: 1px solid rgba(130, 92, 38, 0.12);
}

.comment-item {
    display: grid;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.86);
    border: 1px solid rgba(130, 92, 38, 0.12);
}

.comment-item p {
    max-width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.65;
}

.comment-item small {
    display: block;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.comment-item .comment-item {
    width: min(100%, 580px);
    margin-left: auto;
    margin-right: auto;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: none;
}

.comment-reply-box {
    margin-top: 12px;
}

.comment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.comment-actions form {
    margin: 0;
}

.comment-edit-box summary,
.comment-reply-box summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(224, 242, 239, 0.72);
    cursor: pointer;
    color: var(--color-teal);
    font-weight: 700;
    list-style: none;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.comment-edit-box summary::-webkit-details-marker,
.comment-reply-box summary::-webkit-details-marker {
    display: none;
}

.comment-edit-box summary:hover,
.comment-edit-box summary:focus-visible,
.comment-reply-box summary:hover,
.comment-reply-box summary:focus-visible {
    background: var(--color-teal);
    color: #ffffff;
    outline: none;
    transform: translateY(-1px);
}

.comment-edit-box summary {
    min-width: 42px;
    min-height: 42px;
    color: #ffffff;
    background: var(--color-teal);
}

.comment-form-inline {
    margin: 12px auto 0;
}

.comment-danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: var(--color-danger);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.comment-danger-button:hover,
.comment-danger-button:focus-visible {
    background: #8f1d14;
    text-decoration: none;
    outline: none;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    padding: 10px 14px;
    border: 1px solid var(--color-line-cool);
    border-radius: 8px;
    background: var(--color-surface-strong);
    color: var(--color-ink);
    text-decoration: none;
}

.pagination a {
    font-weight: 700;
}

.pagination span {
    color: var(--color-muted);
}

.is-loaded .card-item {
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.is-loaded .card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 28px rgba(36, 27, 20, 0.14);
}

@media (max-width: 980px) {
    .card-item {
        flex-basis: calc(33.333% - 16px);
    }

    .card-carousel {
        --carousel-card-width: 160px;
        --carousel-visible: 2;
    }
}

@media (max-width: 720px) {
    .card-item {
        flex-basis: calc(50% - 12px);
    }

    .card-carousel {
        --carousel-card-width: 148px;
        --carousel-visible: 2;
    }

    .admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-hero,
    .detail-grid,
    .home-top-card-layout,
    .topic-grid {
        grid-template-columns: 1fr;
    }

    .price-history-header {
        align-items: stretch;
        flex-direction: column;
    }

    .price-history-ranges {
        justify-content: center;
        width: 100%;
    }

    .price-history-chart {
        padding: 14px 8px;
    }

    .forum-thread-meta {
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 520px) {
    .page {
        width: min(100% - 24px, 1200px);
        padding: 28px 0;
    }

    .site-header,
    .site-footer {
        padding: 18px 20px;
    }

    .search-form {
        flex-direction: column;
        width: 100%;
    }

    .home-hero {
        padding: 56px 36px;
    }

    .collection-tools,
    .detail-summary,
    .detail-panel,
    .info-page-header {
        padding: 56px 36px;
    }

    .home-hero h1 {
        font-size: 32px;
    }

    .collection-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .card-item {
        flex-basis: 100%;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .card-carousel {
        --carousel-card-width: 162px;
        --carousel-visible: 1;
        width: 80vw;
        max-width: 80vw;
    }

    .card-carousel-viewport {
        margin: 0;
        padding: 18px 16px;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .card-carousel-viewport::before,
    .card-carousel-viewport::after {
        content: none;
    }

    .ad-slot {
        min-height: 118px;
        margin: 34px auto;
    }

    .ad-slot-box {
        min-height: 92px;
    }

    .comment-form {
        width: 100%;
    }

    .detail-list div {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .home-hero,
    .collection-tools,
    .detail-summary,
    .detail-panel,
    .info-page-header {
        padding: 60px 28px;
    }

    .site-header > .header-search {
        flex-basis: 90%;
        width: 90%;
    }
}

.site-meta {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.site-meta .site-nav {
    margin-right: auto;
    margin-left: auto;
}

.site-auth {
    align-items: center;
    display: flex;
    gap: 12px;
}

.notification-link {
    position: relative;
    min-width: 42px;
    padding: 0 10px !important;
}

.notification-link span {
    line-height: 1;
}

.notification-link strong {
    position: absolute;
    top: -8px;
    right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--color-danger);
    font-size: 12px;
    line-height: 1;
}

.site-locale {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.site-locale a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid rgba(120, 76, 40, 0.24);
    border-radius: 8px;
    color: var(--color-heading);
    background: rgba(255, 253, 247, 0.62);
    font-weight: 700;
    text-decoration: none;
}

.site-locale a:hover,
.site-locale a:focus-visible,
.site-locale a.is-active {
    border-color: var(--color-teal);
    color: var(--color-teal);
    outline: none;
}

.site-locale a.is-active {
    background: var(--color-teal-soft);
}

.site-auth a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(120, 76, 40, 0.2);
    border-radius: 8px;
    color: var(--color-heading);
    background: var(--color-surface-strong);
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.site-auth a:hover,
.site-auth a:focus-visible {
    border-color: var(--color-teal);
    color: var(--color-teal);
    outline: none;
}

.site-user {
    color: var(--color-muted);
    font-size: 14px;
}

.site-auth-strong {
    border-color: var(--color-teal) !important;
    color: #ffffff !important;
    background: var(--color-teal) !important;
}

.site-auth-strong:hover,
.site-auth-strong:focus-visible {
    border-color: var(--color-teal-dark) !important;
    background: var(--color-teal-dark) !important;
    color: #ffffff !important;
}

.auth-shell {
    display: flex;
    justify-content: center;
}

.auth-panel {
    max-width: 520px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form > div,
.auth-form label {
    display: grid;
    gap: 8px;
}

.auth-form ul {
    color: var(--color-danger);
    font-size: 14px;
    margin: 4px 0 0;
    padding-left: 18px;
}

.oauth-block {
    border-top: 1px solid rgba(130, 92, 38, 0.16);
    margin-top: 24px;
    padding-top: 24px;
}

.oauth-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.oauth-button {
    align-items: center;
    border: 1px solid var(--color-line-cool);
    border-radius: 8px;
    color: inherit;
    display: inline-flex;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    text-decoration: none;
}

.auth-switch {
    margin: 20px 0 0;
}

.info-page {
    display: grid;
    gap: 24px;
}

.info-page-header {
    display: grid;
    gap: 12px;
    padding: 44px 48px;
}

.info-page-header h1 {
    margin: 0;
    color: var(--color-heading);
}

.info-page-intro {
    max-width: 780px;
    margin: 0 auto;
    color: var(--color-ink);
    line-height: 1.7;
}

.info-page-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.info-section {
    display: grid;
    gap: 12px;
}

.info-section h2 {
    margin-bottom: 0;
}

.info-section p {
    margin: 0;
    color: var(--color-muted);
    line-height: 1.7;
}

.notification-panel h1 {
    margin: 0 0 20px;
}

.notification-list {
    display: grid;
    gap: 12px;
}

.notification-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(130, 92, 38, 0.14);
    border-radius: 8px;
    color: var(--color-ink);
    background: rgba(255, 253, 247, 0.8);
    text-decoration: none;
}

.notification-item:hover,
.notification-item:focus-visible {
    border-color: var(--color-teal);
    outline: none;
}

.notification-item small {
    color: var(--color-muted);
}

.notification-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: transparent;
}

.notification-item.is-unread .notification-dot {
    background: var(--color-teal);
}

.deck-hero .card-detail-link {
    margin-top: 10px;
}

.deck-section,
.deck-form-panel,
.deck-show {
    display: grid;
    gap: 22px;
    margin-bottom: 32px;
}

.route-deck-show .deck-section {
    overflow: visible;
    border: 1px solid var(--color-line-cool);
    border-radius: 0;
    background-color: var(--color-surface-strong);
    background-image: none;
    box-shadow: var(--shadow-soft);
    -webkit-mask: none;
    mask: none;
}

.route-deck-show .deck-section::before,
.route-deck-show .deck-section::after {
    display: none;
}

.deck-form-panel {
    overflow: visible;
    border: 1px solid var(--color-line);
    border-radius: 0;
    background: #BFA46E;
    box-shadow: var(--shadow-soft);
    -webkit-mask: none;
    mask: none;
}

.deck-form-panel::before,
.deck-form-panel::after {
    display: none;
}

.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    width: 100%;
}

.deck-card {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 20px;
    border: 1px solid rgba(130, 92, 38, 0.2);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.76);
    box-shadow: var(--shadow-soft);
}

.deck-card h3,
.deck-entry h4 {
    margin: 0;
    color: var(--color-heading);
}

.deck-card h3 a,
.deck-entry h4 a {
    color: inherit;
    text-decoration: none;
}

.deck-card h3 a:hover,
.deck-card h3 a:focus-visible,
.deck-entry h4 a:hover,
.deck-entry h4 a:focus-visible {
    color: var(--color-teal);
    outline: none;
}

.deck-card p,
.deck-description {
    margin: 0;
}

.deck-meta {
    color: var(--color-muted);
    font-size: 14px;
}

.deck-form {
    display: grid;
    gap: 16px;
    width: min(80%, 860px);
    margin: 0 auto;
}

.deck-form label {
    display: grid;
    gap: 8px;
    color: var(--color-heading);
    font-weight: 800;
}

.deck-form input,
.deck-form select,
.deck-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.92);
    color: var(--color-ink);
    font: inherit;
}

.deck-form textarea {
    resize: vertical;
}

.deck-form button {
    justify-self: center;
    padding: 12px 18px;
    border: 1px solid var(--color-teal);
    border-radius: 8px;
    color: #ffffff;
    background: var(--color-teal);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.deck-builder {
    display: grid;
    gap: 18px;
}

.deck-builder-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px) 120px;
    gap: 14px;
    align-items: end;
}

.deck-builder-results,
.deck-builder-list {
    display: grid;
    gap: 12px;
}

.deck-builder-results {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.deck-builder-result-card,
.deck-builder-selected-card {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(130, 92, 38, 0.16);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.76);
}

.deck-builder-result-card {
    grid-template-columns: 64px minmax(0, 1fr) auto;
}

.deck-builder-selected-card {
    grid-template-columns: 58px minmax(0, 1fr) 88px auto;
}

.deck-builder-result-card img,
.deck-builder-selected-card img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 8px 14px rgba(36, 27, 20, 0.18);
}

.deck-builder-result-card h3,
.deck-builder-selected-card h3 {
    margin: 0;
    color: var(--color-heading);
    font-size: 16px;
}

.deck-builder-result-card p,
.deck-builder-selected-card p {
    margin: 4px 0 0;
}

.deck-builder-result-card button,
.deck-builder-selected-card button {
    justify-self: end;
}

.deck-builder-selected-card input[type="number"] {
    min-width: 0;
    text-align: center;
}

.deck-builder-list-shell h2 {
    margin-bottom: 12px;
}

.deck-list-section {
    display: grid;
    gap: 12px;
}

.deck-list-section h3 {
    margin: 14px 0 0;
    color: var(--color-heading);
}

.deck-entry-list {
    display: grid;
    gap: 12px;
}

.deck-entry {
    display: grid;
    grid-template-columns: 48px 52px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(130, 92, 38, 0.16);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.72);
}

.deck-entry-quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--color-teal);
}

.deck-entry img {
    width: 52px;
    border-radius: 6px;
    box-shadow: 0 8px 14px rgba(36, 27, 20, 0.18);
}

.deck-entry p {
    margin: 4px 0 0;
}

@media (max-width: 900px) {
    .site-header {
        align-items: center;
        gap: 16px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .site-logo {
        order: 1;
    }

    .site-menu-toggle {
        display: inline-flex;
        position: relative;
        order: 2;
    }

    .site-header > .header-search {
        order: 3;
        flex: 0 0 80%;
        width: 80%;
        margin: 0 auto;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .site-meta {
        align-items: stretch;
        display: none;
        order: 4;
        flex-basis: 100%;
        flex-direction: column;
        gap: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(120, 76, 40, 0.18);
    }

    .site-header.is-menu-open .site-meta {
        display: flex;
    }

    .site-nav,
    .site-locale,
    .site-auth {
        width: 100%;
    }

    .site-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .site-nav a,
    .site-auth a {
        width: auto;
    }

    .header-search {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .header-search .search-autocomplete {
        max-width: none;
        width: 100%;
    }

    .header-search input {
        width: 100%;
    }

    .header-search button {
        width: fit-content;
        border-radius: 8px;
    }

    .header-search input {
        border-right: 1px solid var(--color-line);
        border-radius: 8px;
    }

    .site-auth,
    .site-locale {
        justify-content: center;
    }

    .page section,
    .page form,
    .page .home-section,
    .page .forum-layout,
    .page .forum-section,
    .page .deck-section,
    .page .deck-show,
    .page .info-page,
    .page .notification-panel,
    .page .admin-actions-panel {
        justify-items: center;
    }

    .page button,
    .page .card-detail-link,
    .page .back-link,
    .page .footer-donation-button,
    .page .oauth-button,
    .page .language-button,
    .page .comment-danger-button {
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }

    .section-heading,
    .collection-tools,
    .filter-form,
    .search-form,
    .comment-actions,
    .oauth-buttons,
    .price-history-header,
    .price-history-ranges,
    .admin-action-list,
    .card-tags,
    .external-links,
    .pagination {
        align-items: center;
        justify-content: center;
    }

    .comment-form button,
    .admin-inline-form,
    .deck-builder-result-card button,
    .deck-builder-selected-card button {
        justify-self: center;
    }

    .site-footer-grid,
    .info-page-grid {
        grid-template-columns: 1fr;
    }

    .site-footer-grid,
    .footer-block,
    .footer-brand p,
    .site-footer-bottom {
        text-align: center;
    }

    .footer-brand p {
        margin-left: auto;
        margin-right: auto;
    }

    .site-footer-bottom {
        justify-content: center;
    }

    .deck-form {
        width: 100%;
    }

    .deck-builder-controls,
    .deck-builder-result-card,
    .deck-builder-selected-card {
        grid-template-columns: 1fr;
    }

    .deck-builder-result-card img,
    .deck-builder-selected-card img {
        width: 92px;
        margin: 0 auto;
    }

    .deck-entry {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .deck-entry img {
        display: none;
    }
}

