:root {
    --bg: #f5efe4;
    --bg-deep: #eadfcd;
    --surface: rgba(255, 250, 243, 0.88);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --line: rgba(64, 52, 45, 0.12);
    --line-soft: rgba(64, 52, 45, 0.08);
    --ink: #2c221d;
    --ink-strong: #1f1714;
    --muted: #76685d;
    --muted-strong: #65594f;
    --accent: #f37036;
    --accent-deep: #cf5420;
    --accent-soft: rgba(243, 112, 54, 0.12);
    --teal: #18847b;
    --teal-soft: rgba(24, 132, 123, 0.12);
    --shadow-soft: 0 24px 60px rgba(59, 43, 36, 0.12);
    --shadow-strong: 0 30px 90px rgba(59, 43, 36, 0.16);
    --radius-xl: 2rem;
    --radius-lg: 1.35rem;
    --radius-md: 1rem;
    --radius-sm: 0.8rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(243, 112, 54, 0.18) 0%, transparent 34%),
        radial-gradient(circle at bottom right, rgba(24, 132, 123, 0.16) 0%, transparent 28%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    color: var(--ink);
    font-family: "Inter", "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
}

#app {
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
.shell-title,
.brand-link strong,
.hero-card h1,
.detail-hero h1 {
    font-family: "Space Grotesk", "Inter", sans-serif;
}

h1:focus,
h2:focus,
h3:focus {
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.boot-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
}

.boot-shell h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 0.96;
}

.boot-copy,
.helper-copy,
.state-card p,
.hero-copy,
.surface-card p {
    color: var(--muted);
    line-height: 1.6;
}

.boot-mark {
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    border-radius: 1.4rem;
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: 0 20px 40px rgba(207, 84, 32, 0.3);
}

.boot-eyebrow,
.hero-kicker,
.state-kicker,
.panel-kicker,
.detail-eyebrow {
    margin: 0 0 0.6rem;
    color: var(--muted-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.surface-card,
.state-card,
.hero-card {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-xl);
    background: var(--surface);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
}

.surface-card {
    padding: 1.4rem;
}

.nested-card {
    padding: 1.25rem;
    background: var(--surface-strong);
}

.hero-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.4rem;
    padding: 1.6rem;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 252, 247, 0.94) 0%, rgba(252, 244, 234, 0.85) 100%),
        radial-gradient(circle at top right, rgba(243, 112, 54, 0.14), transparent 36%);
}

.hero-card h1,
.state-card h1 {
    margin: 0 0 0.8rem;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 0.96;
}

.hero-actions,
.state-actions,
.inline-controls,
.card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.95rem;
    padding: 0.8rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

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

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: 0 18px 28px rgba(207, 84, 32, 0.22);
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.section-header h2,
.surface-card h2,
.surface-card h3 {
    margin: 0;
}

.status-line {
    margin: 0 0 1rem;
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
}

.status-success {
    color: #12524c;
    background: rgba(24, 132, 123, 0.12);
}

.status-error {
    color: #8f2f18;
    background: rgba(243, 112, 54, 0.14);
}

.panel-grid,
.summary-grid,
.settings-grid {
    display: grid;
    gap: 1rem;
}

.panel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-grid strong,
.surface-card strong {
    color: var(--ink-strong);
}

.summary-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted-strong);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.accent-card {
    background:
        linear-gradient(135deg, rgba(243, 112, 54, 0.14), rgba(24, 132, 123, 0.12)),
        rgba(255, 250, 243, 0.92);
}

.state-shell {
    display: grid;
    place-items: center;
    min-height: 22rem;
}

.state-card {
    max-width: 42rem;
    padding: 2rem;
}

.compact-card {
    max-width: none;
    min-height: 16rem;
}

.search-form {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.85rem;
}

.form-grid-wide {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

.form-field span {
    color: var(--muted-strong);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-field-span-2 {
    grid-column: span 2;
}

.form-field-grow {
    flex: 1 1 20rem;
}

.text-input {
    width: 100%;
    min-height: 3rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
}

.text-input:focus {
    outline: none;
    border-color: rgba(243, 112, 54, 0.46);
    box-shadow: 0 0 0 4px rgba(243, 112, 54, 0.12);
}

.toggle-field {
    align-content: end;
}

.toggle-field input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--accent);
}

.results-meta {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    color: var(--muted-strong);
    font-size: 0.9rem;
}

.quick-panel,
.save-search-bar,
.page-footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.quick-panel {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line-soft);
}

.chip-row,
.saved-search-meta {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.quick-chip,
.query-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.4rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink-strong);
    font-weight: 700;
}

.quick-chip:hover {
    border-color: rgba(243, 112, 54, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.save-search-bar {
    align-items: end;
}

.page-footer {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
}

.saved-search-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.saved-search-card {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.saved-query {
    margin: 0;
    color: var(--ink-strong);
    font-size: 1.05rem;
    font-weight: 700;
}

.saved-search-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.empty-grid {
    display: grid;
    min-height: 18rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.product-card {
    display: grid;
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 1.6rem;
    background: var(--surface-strong);
    overflow: hidden;
    box-shadow: 0 18px 34px rgba(59, 43, 36, 0.08);
}

.product-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: linear-gradient(180deg, rgba(243, 112, 54, 0.08), rgba(24, 132, 123, 0.04));
}

.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.price-badge {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(31, 23, 20, 0.82);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
}

.product-card-body {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
}

.product-card h3 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.25;
}

.product-kicker {
    margin: 0;
    color: var(--muted-strong);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.price-current {
    color: var(--ink-strong);
    font-size: 1.35rem;
    font-weight: 800;
}

.price-original {
    color: var(--muted);
    font-size: 0.95rem;
    text-decoration: line-through;
}

.metric-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.metric-row span,
.tracking-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(64, 52, 45, 0.06);
    color: var(--muted-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.tracking-pill-on {
    background: rgba(24, 132, 123, 0.16);
    color: #12524c;
}

.tracking-pill-off {
    background: rgba(243, 112, 54, 0.12);
    color: #8f2f18;
}

.product-note {
    margin: 0;
}

.detail-stack {
    display: grid;
    gap: 1rem;
}

.detail-hero {
    align-items: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.detail-card {
    display: grid;
    gap: 1rem;
}

.detail-card-wide {
    grid-column: 1 / -1;
}

.detail-media {
    overflow: hidden;
    border-radius: 1.4rem;
    aspect-ratio: 1 / 1;
    background: linear-gradient(180deg, rgba(243, 112, 54, 0.08), rgba(24, 132, 123, 0.04));
}

.detail-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-facts,
.fact-grid {
    display: grid;
    gap: 0.8rem;
}

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

.fact-item {
    display: grid;
    gap: 0.35rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line-soft);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.74);
}

.fact-item span {
    color: var(--muted-strong);
    font-size: 0.79rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.history-empty {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(64, 52, 45, 0.04);
    color: var(--muted);
}

.sparkline-shell {
    display: grid;
    gap: 0.7rem;
}

.sparkline-chart {
    width: 100%;
    height: 11rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(243, 112, 54, 0.08), rgba(24, 132, 123, 0.06));
}

.sparkline-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.sparkline-labels {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted-strong);
    font-size: 0.9rem;
    font-weight: 700;
}

.settings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.code-block,
.mono-title {
    font-family: Consolas, "SFMono-Regular", monospace;
    word-break: break-word;
}

.mono-title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.code-block {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(31, 23, 20, 0.92);
    color: #f8efe0;
}

.loading-card,
.skeleton-card {
    overflow: hidden;
    position: relative;
}

.loading-card {
    min-height: 10rem;
    display: grid;
    place-items: center;
    color: var(--muted-strong);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.18)),
        var(--surface);
    background-size: 240% 100%;
    animation: shimmer 1.8s linear infinite;
}

.skeleton-box,
.skeleton-line,
.skeleton-button {
    border-radius: 0.9rem;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.15)),
        rgba(64, 52, 45, 0.06);
    background-size: 220% 100%;
    animation: shimmer 1.8s linear infinite;
}

.skeleton-box {
    min-height: 16rem;
}

.skeleton-line {
    height: 0.95rem;
}

.skeleton-line-short {
    width: 45%;
}

.skeleton-actions {
    display: flex;
    gap: 0.7rem;
}

.skeleton-button {
    flex: 1;
    height: 2.9rem;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    padding: 1rem 4rem 1rem 1.15rem;
    border-radius: 1.15rem;
    background: rgba(143, 47, 24, 0.95);
    color: white;
    box-shadow: var(--shadow-strong);
}

#blazor-error-ui .reload {
    margin-left: 0.6rem;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    cursor: pointer;
    opacity: 0.75;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -20% 0;
    }
}

@media (max-width: 1100px) {
    .card-grid,
    .detail-grid,
    .saved-search-grid,
    .settings-grid,
    .panel-grid,
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid,
    .form-grid-wide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-field-span-2 {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .surface-card,
    .state-card,
    .hero-card {
        border-radius: 1.4rem;
    }

    .surface-card,
    .state-card,
    .hero-card,
    .nested-card {
        padding: 1rem;
    }

    .hero-card,
    .section-header {
        flex-direction: column;
    }

    .card-grid,
    .detail-grid,
    .saved-search-grid,
    .settings-grid,
    .panel-grid,
    .summary-grid,
    .form-grid,
    .form-grid-wide,
    .fact-grid {
        grid-template-columns: 1fr;
    }

    .form-field-span-2,
    .detail-card-wide {
        grid-column: auto;
    }

    .quick-panel,
    .save-search-bar,
    .page-footer {
        align-items: flex-start;
    }

    .boot-shell h1,
    .hero-card h1,
    .state-card h1 {
        font-size: 2rem;
    }

    .results-meta {
        font-size: 0.85rem;
    }
}
