@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Crimson+Text:wght@400;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --bg: #ede4cf;
    --bg-alt: #d8c7a3;
    --surface: #fffaf0;
    --surface-strong: #f6ead2;
    --ink: #22180f;
    --ink-soft: #5f4e3a;
    --ink-strong: #2a1d12;
    --ink-muted: #7a6953;
    --accent: #1e6b59;
    --accent-strong: #0f4e41;
    --accent-alt: #9f4d25;
    --danger: #8f1d22;
    --ring: #b98530;
    --shadow: 0 16px 38px rgba(47, 30, 8, 0.16);
    --shadow-soft: 0 8px 22px rgba(47, 30, 8, 0.11);
    --line: rgba(62, 42, 17, 0.18);
    --radius: 16px;
}

body[data-ui-theme="archive"] {
    --bg: #e4e8e0;
    --bg-alt: #c5cec1;
    --surface: #f7faf4;
    --surface-strong: #ebf1e8;
    --ink: #1d2520;
    --ink-soft: #445148;
    --ink-strong: #172019;
    --ink-muted: #5f6c63;
    --accent: #325f54;
    --accent-strong: #1d473d;
    --accent-alt: #6f5533;
    --danger: #7e2d2f;
    --ring: #74885d;
    --line: rgba(30, 47, 38, 0.2);
}

body[data-ui-theme="vault"] {
    --bg: #ddd3b5;
    --bg-alt: #c5b38b;
    --surface: #fff8e6;
    --surface-strong: #f2e4c2;
    --ink: #211606;
    --ink-soft: #5c4521;
    --ink-strong: #2d1e09;
    --ink-muted: #7a623a;
    --accent: #8a5f15;
    --accent-strong: #68460f;
    --accent-alt: #45644e;
    --danger: #8a291e;
    --ring: #b48c34;
    --line: rgba(74, 52, 18, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Crimson Text', serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 14% 16%, rgba(190, 134, 48, 0.28), transparent 36%),
        radial-gradient(circle at 84% 5%, rgba(30, 107, 89, 0.2), transparent 34%),
        repeating-linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08) 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px),
        linear-gradient(135deg, var(--bg), var(--bg-alt));
    min-height: 100vh;
    letter-spacing: 0.01em;
}

body[data-ui-theme="archive"] {
    background:
        radial-gradient(circle at 15% 17%, rgba(91, 124, 104, 0.25), transparent 34%),
        radial-gradient(circle at 86% 6%, rgba(111, 85, 51, 0.2), transparent 32%),
        repeating-linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.09) 2px, rgba(8, 22, 12, 0.025) 2px, rgba(8, 22, 12, 0.025) 5px),
        linear-gradient(135deg, var(--bg), var(--bg-alt));
}

body[data-ui-theme="vault"] {
    background:
        radial-gradient(circle at 12% 14%, rgba(180, 140, 52, 0.28), transparent 34%),
        radial-gradient(circle at 84% 8%, rgba(69, 100, 78, 0.22), transparent 35%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07) 1px, rgba(26, 17, 5, 0.03) 1px, rgba(26, 17, 5, 0.03) 4px),
        linear-gradient(140deg, var(--bg), var(--bg-alt));
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.13), transparent 30%),
        radial-gradient(circle at 90% 90%, rgba(0, 0, 0, 0.06), transparent 42%);
}

body::after {
    background: linear-gradient(180deg, rgba(26, 17, 7, 0.08), transparent 16%, transparent 86%, rgba(26, 17, 7, 0.09));
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    z-index: 1000;
}

.skip-link:focus {
    left: 0.75rem;
    top: 0.75rem;
}

.page-shell {
    width: min(1120px, 92vw);
    margin: 2rem auto 4rem;
    display: grid;
    gap: 1.2rem;
    position: relative;
    z-index: 1;
}

.page-content-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.page-content-column {
    display: grid;
    gap: 1.2rem;
}

.workflow-step-overview {
    background: linear-gradient(145deg, rgba(255, 253, 247, 0.96), rgba(241, 248, 243, 0.9));
    border: 1px solid rgba(14, 122, 85, 0.18);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.05rem;
    display: grid;
    gap: 0.85rem;
}

.workflow-step-overview-header {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: end;
    flex-wrap: wrap;
}

.workflow-step-overview-header h2 {
    margin: 0.18rem 0 0;
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.workflow-step-summary {
    margin: 0;
    max-width: 48ch;
    color: var(--ink-soft);
}

.workflow-step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.workflow-step-card {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 14px;
    padding: 0.9rem 0.95rem;
    background: rgba(255, 255, 255, 0.84);
    display: grid;
    gap: 0.38rem;
    align-content: start;
}

.workflow-step-card h3 {
    margin: 0;
    font-size: 1rem;
}

.workflow-step-card[data-step-state="active"] {
    border-color: rgba(14, 122, 85, 0.42);
    box-shadow: inset 0 0 0 1px rgba(14, 122, 85, 0.14);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(236, 249, 243, 0.9));
}

.workflow-step-card[data-step-state="done"] {
    border-color: rgba(14, 122, 85, 0.24);
}

.workflow-step-card[data-step-state="waiting"] {
    opacity: 0.9;
}

.workflow-step-label,
.workflow-step-kicker {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-strong);
    font-family: 'IBM Plex Mono', monospace;
}

.workflow-step-copy,
.workflow-step-hint {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.45;
}

.workflow-step-status {
    margin: 0.16rem 0 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 1.7rem;
    padding: 0.18rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(31, 26, 18, 0.14);
    background: rgba(246, 238, 219, 0.55);
    color: var(--ink-soft);
    font-size: 0.74rem;
    font-family: 'IBM Plex Mono', monospace;
}

.workflow-step-card[data-step-state="active"] .workflow-step-status {
    border-color: rgba(14, 122, 85, 0.4);
    background: rgba(14, 122, 85, 0.14);
    color: var(--accent-strong);
}

.workflow-step-card[data-step-state="done"] .workflow-step-status {
    border-color: rgba(14, 122, 85, 0.34);
    background: rgba(14, 122, 85, 0.08);
    color: var(--accent-strong);
}

.workflow-step-action {
    margin-top: 0.2rem;
    width: fit-content;
    text-decoration: none;
}

.hero {
    background:
        radial-gradient(circle at 78% 0%, rgba(190, 134, 48, 0.18), transparent 36%),
        linear-gradient(140deg, rgba(255, 252, 244, 0.97), rgba(246, 231, 198, 0.9));
    border: 1px solid rgba(55, 39, 18, 0.16);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.6rem 1.4rem;
    animation: rise-in 400ms ease-out;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0.75rem;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(16, 79, 66, 0), rgba(16, 79, 66, 0.75) 18%, rgba(181, 121, 43, 0.82) 52%, rgba(16, 79, 66, 0.75) 82%, rgba(16, 79, 66, 0));
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(31, 26, 18, 0.08);
    flex-wrap: wrap;
}

.site-brand {
    text-decoration: none;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    font-family: 'Cinzel', serif;
}

.site-nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.inline-form {
    margin: 0;
}

button.site-nav-link {
    cursor: pointer;
    font-family: inherit;
}

.site-nav-quicklinks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
}

.site-nav-link,
.site-nav-future {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.26rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 238, 219, 0.72));
    color: var(--ink-soft);
    font-size: 0.76rem;
    text-decoration: none;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.site-nav-theme-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2rem;
    padding: 0.2rem 0.45rem 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(246, 238, 219, 0.7));
}

.site-nav-theme-label {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.site-nav-theme-select {
    border: 1px solid rgba(31, 26, 18, 0.22);
    border-radius: 999px;
    min-height: 1.6rem;
    padding: 0.1rem 0.55rem;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink-strong);
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
}

.site-nav-theme-select:focus-visible {
    outline: 2px solid rgba(14, 122, 85, 0.35);
    outline-offset: 1px;
}

.site-nav-theme-random {
    border: 1px solid rgba(31, 26, 18, 0.24);
    border-radius: 999px;
    min-height: 1.6rem;
    padding: 0.08rem 0.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 238, 219, 0.76));
    color: var(--ink-soft);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
    cursor: pointer;
}

.site-nav-theme-random:hover {
    color: var(--accent-strong);
    border-color: var(--accent);
    box-shadow: var(--shadow-soft);
}

.site-nav-link:hover {
    color: var(--accent-strong);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.site-nav-link.is-active {
    color: var(--accent-strong);
    border-color: var(--accent);
    background: rgba(14, 122, 85, 0.12);
}

.site-nav-future {
    border-style: dashed;
    color: var(--ink-soft);
}

.site-nav-quicklink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.24rem 0.68rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(246, 238, 219, 0.52));
    color: var(--ink-soft);
    font-size: 0.75rem;
    text-decoration: none;
}

.site-nav-quicklink:hover {
    color: var(--accent-strong);
    border-color: var(--accent);
    box-shadow: var(--shadow-soft);
}

.eyebrow {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.hero h1 {
    margin: 0.35rem 0 0.4rem;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-family: 'Cinzel', serif;
    letter-spacing: 0.03em;
    text-wrap: balance;
}

.hero h1,
.workflow-step-overview-header h2,
.generator-section-header h2,
.inventory-header h2,
.pinboard-header h2,
.shop-detail-summary-header h2,
.diag-grid + .request-summary p strong {
    position: relative;
}

.workflow-step-overview-header h2,
.generator-section-header h2,
.inventory-header h2,
.pinboard-header h2,
.shop-detail-summary-header h2 {
    padding-left: 1.45rem;
}

.workflow-step-overview-header h2::before,
.generator-section-header h2::before,
.inventory-header h2::before,
.pinboard-header h2::before,
.shop-detail-summary-header h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35em;
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(47, 30, 8, 0.34);
    background:
        radial-gradient(circle at center, rgba(181, 121, 43, 0.72) 0 25%, transparent 25% 100%),
        linear-gradient(135deg, rgba(15, 78, 65, 0.26), rgba(181, 121, 43, 0.18));
    box-shadow: 0 0 0 2px rgba(255, 250, 240, 0.72);
}

#comparePanel .inventory-header h2::before,
#dashboardCompareTitle::before,
#dashboardHistoryTitle::before {
    border-radius: 2px;
    transform: rotate(45deg);
}

#pinnedManagerPanel .inventory-header h2::before,
#dashboardPinnedTitle::before {
    border-radius: 3px;
    background:
        linear-gradient(90deg, transparent 0 36%, rgba(15, 78, 65, 0.82) 36% 64%, transparent 64% 100%),
        linear-gradient(180deg, transparent 0 36%, rgba(181, 121, 43, 0.82) 36% 64%, transparent 64% 100%),
        linear-gradient(135deg, rgba(15, 78, 65, 0.22), rgba(181, 121, 43, 0.14));
}

.hero-subtitle {
    margin: 0;
    color: var(--ink-soft);
    max-width: 72ch;
    font-size: 1.02rem;
    line-height: 1.45;
}

.ui-mode-toggle {
    margin-top: 0.85rem;
    border: 1px dashed rgba(31, 26, 18, 0.22);
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.72);
    display: grid;
    gap: 0.35rem;
}

.ui-mode-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.ui-mode-buttons {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.ui-mode-buttons .ghost-button {
    margin-top: 0;
}

.ui-mode-buttons .ghost-button.is-active {
    border-color: rgba(14, 122, 85, 0.45);
    background: rgba(14, 122, 85, 0.12);
    color: var(--accent-strong);
}

.ui-mode-hint {
    margin: 0;
    font-size: 0.74rem;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.table-mode-toggle .ghost-button {
    justify-self: start;
    margin-top: 0;
}

body.table-mode .table-mode-toggle {
    border-style: solid;
    border-color: rgba(14, 122, 85, 0.35);
    background: linear-gradient(175deg, rgba(234, 250, 243, 0.78), rgba(255, 255, 255, 0.88));
}

body.table-mode .table-mode-hidden {
    display: none !important;
}

.table-mode-status {
    margin: 0.6rem 0 0;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(14, 122, 85, 0.3);
    border-radius: 10px;
    background: linear-gradient(170deg, rgba(234, 250, 243, 0.9), rgba(255, 255, 255, 0.96));
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-family: 'IBM Plex Mono', monospace;
}

.dashboard-context-strip {
    margin-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dashboard-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid rgba(31, 26, 18, 0.16);
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink-soft);
    font-size: 0.7rem;
    font-family: 'IBM Plex Mono', monospace;
}

.dashboard-context-chip strong {
    color: var(--ink);
    font-weight: 700;
}

body.table-mode .page-shell {
    width: min(1420px, 96vw);
}

body.table-mode .page-content-shell {
    grid-template-columns: 240px minmax(0, 1fr);
}

body.table-mode .section-nav-rail {
    display: block;
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 1.5rem);
    overflow: auto;
}

body.table-mode .section-nav-mobile {
    display: none;
}

body.table-mode .saved-snapshot-list.table-board-layout,
body.table-mode .pinned-manager-list.table-board-layout,
body.table-mode .compare-diff-list.table-board-layout {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.7rem;
}

body.table-mode .history-list.table-board-layout {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    align-items: start;
}

body.table-mode .history-list.table-board-layout .history-day-divider {
    grid-column: 1 / -1;
}

body.table-mode .history-list.table-board-layout .history-item-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.35rem;
}

body.table-mode .snapshot-card {
    min-height: 100%;
}

.workflow-nudge {
    margin-top: 0.75rem;
    border: 1px solid rgba(14, 122, 85, 0.28);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(234, 250, 243, 0.9), rgba(247, 255, 251, 0.95));
    padding: 0.55rem 0.7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.workflow-nudge-message {
    margin: 0;
    color: var(--ink);
    font-size: 0.83rem;
    line-height: 1.35;
}

.workflow-nudge .ghost-button {
    margin-top: 0;
    border-color: rgba(14, 122, 85, 0.35);
}

body[data-ui-depth="basic"] .advanced-mode-only {
    display: none !important;
}

.breadcrumb-trail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.7rem;
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.breadcrumb-trail a {
    color: var(--accent-strong);
    text-decoration: none;
}

.breadcrumb-trail a:hover {
    text-decoration: underline;
}

.section-nav-rail {
    position: sticky;
    top: 1rem;
    align-self: start;
    background: linear-gradient(160deg, rgba(255, 253, 247, 0.97), rgba(245, 235, 212, 0.92));
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 0.75rem;
}

.section-nav-title {
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.section-nav-list,
.section-nav-mobile-list {
    display: grid;
    gap: 0.38rem;
}

.section-nav-group + .section-nav-group {
    margin-top: 0.62rem;
    padding-top: 0.56rem;
    border-top: 1px dashed rgba(31, 26, 18, 0.18);
}

.section-nav-group-title {
    margin: 0 0 0.34rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.section-nav-utility,
.section-nav-mobile-utility {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(31, 26, 18, 0.18);
    display: grid;
    gap: 0.38rem;
}

.section-nav-utility-link {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(246, 238, 219, 0.7));
}

.section-nav-link,
.section-nav-mobile-link {
    display: block;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(31, 26, 18, 0.14);
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.72);
}

.section-nav-link:hover,
.section-nav-mobile-link:hover {
    color: var(--accent-strong);
    border-color: var(--accent);
}

.section-nav-link.is-active,
.section-nav-mobile-link.is-active {
    color: var(--accent-strong);
    border-color: var(--accent);
    background: rgba(14, 122, 85, 0.13);
    font-weight: 700;
}

.section-nav-mobile {
    display: none;
}

.section-nav-mobile summary {
    list-style: none;
    cursor: pointer;
    border: 1px solid rgba(31, 26, 18, 0.2);
    border-radius: 999px;
    background: linear-gradient(130deg, var(--accent), var(--accent-strong));
    color: #fff;
    padding: 0.45rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(31, 26, 18, 0.22);
}

.section-nav-mobile summary::-webkit-details-marker {
    display: none;
}

.section-nav-mobile[open] {
    border-radius: 12px;
    border: 1px solid rgba(31, 26, 18, 0.12);
    background: linear-gradient(160deg, rgba(255, 253, 247, 0.99), rgba(245, 235, 212, 0.98));
    box-shadow: 0 16px 32px rgba(31, 26, 18, 0.26);
    padding: 0.55rem;
}

.section-nav-mobile[open] summary {
    margin-bottom: 0.45rem;
}

.item-link {
    color: var(--accent-strong);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.item-link:hover {
    color: var(--accent);
}

.section-intro {
    margin: 0 0 0.9rem;
    color: var(--ink-soft);
    font-size: 0.92rem;
    max-width: 74ch;
}

.control-panel,
.diagnostics,
.inventory-section,
.pinboard,
.session-snapshot {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.55) 8px, rgba(246, 232, 204, 0.72) 100%),
        var(--surface);
    border: 1px solid rgba(52, 36, 14, 0.14);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    animation: rise-in 420ms ease-out;
    position: relative;
    overflow: hidden;
}

.control-panel::before,
.diagnostics::before,
.inventory-section::before,
.pinboard::before,
.session-snapshot::before {
    content: "";
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    top: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(16, 79, 66, 0), rgba(16, 79, 66, 0.65) 22%, rgba(181, 121, 43, 0.78) 50%, rgba(16, 79, 66, 0.65) 78%, rgba(16, 79, 66, 0));
}

.workflow-section-highlight {
    outline: 2px solid rgba(14, 122, 85, 0.55);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(14, 122, 85, 0.08), var(--shadow);
    animation: workflow-pulse 900ms ease-out 2;
}

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

.insights-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.insights-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.65rem;
    margin-top: 0.45rem;
}

.insights-kpi-card {
    border: 1px solid rgba(31, 26, 18, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    padding: 0.62rem 0.72rem;
    display: grid;
    gap: 0.22rem;
}

.insights-kpi-label {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
}

.insights-kpi-value {
    margin: 0;
    color: var(--ink-strong);
    font-size: 1.25rem;
    font-weight: 700;
}

.insights-series-grid,
.insights-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.7rem;
    margin-top: 0.75rem;
}

.insights-series-panel {
    border: 1px solid rgba(31, 26, 18, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
    padding: 0.72rem 0.82rem;
    display: grid;
    gap: 0.5rem;
}

.insights-series-panel h3 {
    margin: 0;
    font-size: 0.96rem;
}

.insights-key-value-list {
    display: grid;
    gap: 0.34rem;
}

.insights-mini-chart {
    display: grid;
    gap: 0.32rem;
    padding: 0.38rem;
    border: 1px solid rgba(31, 26, 18, 0.1);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 236, 217, 0.64));
}

.insights-chart-row {
    display: grid;
    grid-template-columns: minmax(85px, 1fr) minmax(120px, 2fr) auto;
    align-items: center;
    gap: 0.35rem;
}

.insights-chart-label {
    font-size: 0.75rem;
    color: var(--ink-soft);
    text-transform: capitalize;
}

.insights-chart-track {
    border: 1px solid rgba(31, 26, 18, 0.16);
    border-radius: 999px;
    height: 0.6rem;
    background: rgba(255, 255, 255, 0.76);
    overflow: hidden;
}

.insights-chart-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-alt));
}

.insights-chart-value {
    font-size: 0.74rem;
    color: var(--accent-strong);
    font-family: 'IBM Plex Mono', monospace;
}

.insights-mini-chart-delta {
    grid-auto-flow: column;
    grid-auto-columns: minmax(42px, 1fr);
    align-items: end;
    min-height: 120px;
    overflow-x: auto;
}

.insights-delta-col {
    display: grid;
    gap: 0.2rem;
    justify-items: center;
    align-content: end;
    min-height: 104px;
}

.insights-delta-bar {
    width: 70%;
    min-height: 4px;
    border-radius: 8px 8px 2px 2px;
    background: linear-gradient(180deg, #4ca37f, #1d614f);
}

.insights-delta-bar.is-negative {
    background: linear-gradient(180deg, #c37153, #8a291e);
}

.insights-delta-label {
    width: 100%;
    text-align: center;
    font-size: 0.67rem;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.insights-kv-row {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    padding: 0.38rem 0.48rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.insights-kv-row strong {
    color: var(--ink);
}

.insights-kv-row-stack {
    display: grid;
    justify-content: stretch;
}

.insights-table-list {
    display: grid;
    gap: 0.42rem;
}

.insights-table-row {
    border: 1px solid rgba(31, 26, 18, 0.13);
    border-radius: 11px;
    padding: 0.48rem 0.58rem;
    background: rgba(255, 255, 255, 0.9);
    display: grid;
    gap: 0.24rem;
}

.insights-table-rank,
.insights-table-title,
.insights-table-meta {
    margin: 0;
}

.insights-table-rank {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--accent-strong);
    font-size: 0.73rem;
}

.insights-table-title {
    color: var(--ink-strong);
    font-weight: 700;
}

.insights-table-meta {
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.advanced-controls {
    margin-top: 1.25rem;
    border: 1px solid rgba(110, 79, 53, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 250, 243, 0.94), rgba(248, 240, 229, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    overflow: hidden;
}
.advanced-controls summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-strong);
    list-style: none;
}
.advanced-controls summary::-webkit-details-marker {
    display: none;
}
.advanced-controls summary::after {
    content: "+";
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(110, 79, 53, 0.12);
    color: var(--accent-strong);
    font-size: 1.05rem;
    line-height: 1;
}
.advanced-controls[open] summary::after {
    content: "-";
}
.advanced-controls[open] summary {
    border-bottom: 1px solid rgba(110, 79, 53, 0.14);
}
.advanced-controls-intro {
    margin: 0;
    padding: 1rem 1.2rem 0;
    color: var(--ink-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.advanced-field-grid,
.advanced-toggles {
    padding: 1rem 1.2rem 1.2rem;
}
.advanced-field-grid {
    padding-bottom: 0;
}

.utility-details {
    margin-top: 0.75rem;
}

.utility-details .advanced-field-grid {
    padding-top: 0.75rem;
}

.field {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(110, 79, 53, 0.24);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 254, 250, 0.99), rgba(252, 246, 236, 0.96));
    box-shadow: 0 12px 28px rgba(66, 41, 15, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
    color: var(--ink-soft);
}

.field:focus-within,
.toggle:focus-within {
    border-color: rgba(176, 118, 46, 0.45);
    box-shadow: 0 14px 30px rgba(66, 41, 15, 0.1), 0 0 0 3px rgba(176, 118, 46, 0.12);
}

.field-help,
.toggle-help {
    color: var(--ink-soft);
    font-size: 0.76rem;
    line-height: 1.35;
}

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

a {
    color: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.58rem 0.7rem;
    border: 1px solid rgba(31, 26, 18, 0.18);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
}

textarea {
    min-height: 5.5rem;
    resize: vertical;
    line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}

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

.field-wide {
    grid-column: 1 / -1;
}

.field-inline-button {
    justify-self: start;
}

.toggles {
    margin-top: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.toggle {
    display: inline-grid;
    align-items: center;
    gap: 0.35rem;
    min-width: 170px;
    padding: 0.9rem 0.95rem;
    border: 1px solid rgba(110, 79, 53, 0.22);
    border-radius: 16px;
    background: rgba(255, 254, 250, 0.97);
    box-shadow: 0 8px 20px rgba(66, 41, 15, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.72);
    font-size: 0.87rem;
}

.toggle input[type="checkbox"] {
    justify-self: start;
}

.toggle select {
    min-width: 170px;
    padding: 0.45rem 0.55rem;
}

.toggle span {
    color: var(--ink-soft);
}

.toggle:first-child {
    min-width: 170px;
}

.actions {
    margin-top: 1rem;
}

#generateButton {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(110deg, var(--accent), var(--accent-strong));
    color: #fff;
    padding: 0.68rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease, filter 140ms ease;
}

#generateButton:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.diag-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.9rem;
}

.diag-grid p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.diag-grid strong,
.diag-grid span {
    color: var(--ink);
}

.request-summary {
    margin-top: 0.7rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(31, 26, 18, 0.2);
    max-height: 19rem;
    overflow: auto;
    resize: vertical;
}

.admin-response-shell {
    border: 1px solid rgba(31, 26, 18, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.45);
    padding: 0.35rem 0.5rem 0.5rem;
}

.admin-response-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.3rem;
}

.admin-response-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    color: var(--ink-soft);
}

.admin-response-tools {
    position: sticky;
    top: 0.35rem;
    z-index: 2;
    padding: 0.45rem;
    border: 1px solid rgba(31, 26, 18, 0.14);
    border-radius: 10px;
    background: rgba(249, 246, 236, 0.92);
    backdrop-filter: blur(3px);
}

.inline-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.sql-query-input {
    min-height: 8.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    resize: vertical;
}

.request-summary p {
    margin: 0.2rem 0;
    font-size: 0.83rem;
    color: var(--ink-soft);
}

.admin-profile-details {
    margin-top: 0.35rem;
}

.admin-profile-details > summary {
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.compact-profile-form {
    margin-top: 0.45rem;
}

.compact-user-actions {
    margin-top: 0.5rem;
    gap: 0.45rem;
}

.compact-user-actions-status {
    margin-top: 0.35rem;
    font-size: 0.78rem;
}

#reqSummaryUrl {
    font-family: 'IBM Plex Mono', monospace;
    word-break: break-all;
    color: var(--ink);
}

.inventory-header,
.pinboard-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.inventory-header h2,
.pinboard-header h2 {
    margin: 0;
}

.inventory-summary {
    margin: 0;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
}

.pricing-legend {
    margin: 0.35rem 0 0;
    color: var(--ink-soft);
    font-size: 0.75rem;
    line-height: 1.4;
    font-style: italic;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.7rem;
    margin-top: 0.75rem;
}

.filter-field {
    align-content: start;
}

.filter-field span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 0.15rem;
}

.filter-search-field input,
.filter-field select,
.pinned-filter-field input,
.pinned-filter-field select {
    width: 100%;
    border: 1px solid rgba(31, 26, 18, 0.2);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 0.35rem 0.45rem;
    font-size: 0.78rem;
    font-family: 'IBM Plex Mono', monospace;
}

.history-filter-summary {
    margin: 0.4rem 0 0;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
}

.history-filter-empty {
    margin-top: 0.35rem;
}

.history-view-controls {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.3rem;
}

.history-density-field {
    max-width: 220px;
    padding: 0.45rem 0.55rem;
}

.history-density-field span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 0.15rem;
}

.history-density-field select {
    width: 100%;
    border: 1px solid rgba(31, 26, 18, 0.2);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 0.35rem 0.45rem;
    font-size: 0.78rem;
    font-family: 'IBM Plex Mono', monospace;
}

.history-view-buttons {
    margin-top: 0;
}

.history-collapse-summary {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
}

.inventory-actions,
.snapshot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.saved-shop-queue-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px dashed rgba(31, 26, 18, 0.2);
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    font-size: 0.73rem;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.saved-shop-queue-toggle input {
    margin: 0;
}

#cityManagerResumeHint,
#dashboardRefreshSelectionSummary {
    margin-top: 0.4rem;
}

.dashboard-quick-actions,
.dashboard-daily-actions {
    margin-top: 0.55rem;
    border: 1px dashed rgba(31, 26, 18, 0.2);
    border-radius: 10px;
    padding: 0.5rem 0.55rem;
    background: linear-gradient(175deg, rgba(255, 255, 255, 0.9), rgba(246, 238, 219, 0.45));
}

.dashboard-daily-actions {
    display: grid;
    gap: 0.34rem;
    border-style: solid;
    border-color: rgba(14, 122, 85, 0.2);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(236, 249, 243, 0.72));
}

.dashboard-daily-actions-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-daily-actions-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-daily-mode {
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
}

.dashboard-daily-actions-toggle {
    margin-top: 0;
    min-height: 1.85rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.58rem;
}

.dashboard-daily-actions-toggle[aria-pressed="true"] {
    border-color: rgba(14, 122, 85, 0.45);
    background: rgba(14, 122, 85, 0.12);
    color: var(--accent-strong);
}

.dashboard-daily-actions[data-lane-mode="batch-queue-lane"] {
    border-color: rgba(14, 122, 85, 0.34);
    box-shadow: inset 0 0 0 1px rgba(14, 122, 85, 0.12);
}

.dashboard-daily-actions[data-lane-mode="focused-shop-lane"] {
    border-color: rgba(217, 180, 91, 0.5);
    box-shadow: inset 0 0 0 1px rgba(217, 180, 91, 0.2);
}

.dashboard-quick-label,
.dashboard-shortcut-hint {
    margin: 0;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.dashboard-quick-label {
    font-size: 0.76rem;
}

.dashboard-shortcut-hint {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    line-height: 1.35;
}

.dashboard-daily-queue-row,
.dashboard-quick-button-row {
    margin-top: 0.1rem;
}

.dashboard-daily-secondary-action[hidden] {
    display: none !important;
}

.dashboard-daily-telemetry {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.7rem;
    line-height: 1.35;
    font-family: 'IBM Plex Mono', monospace;
}

.dashboard-promoted-action {
    border-color: rgba(217, 180, 91, 0.55) !important;
    background: linear-gradient(170deg, rgba(217, 180, 91, 0.2), rgba(255, 255, 255, 0.9));
    color: var(--ink);
}

#dashboardQueueSelectionPreview {
    margin: 0;
}

.shop-detail-summary-card {
    background: linear-gradient(145deg, rgba(255, 253, 247, 0.98), rgba(240, 247, 243, 0.92));
    border: 1px solid rgba(14, 122, 85, 0.16);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.05rem;
    display: grid;
    gap: 0.8rem;
}

.shop-detail-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.shop-detail-summary-header h2 {
    margin: 0.18rem 0 0;
    font-size: clamp(1.18rem, 2.1vw, 1.5rem);
}

.shop-detail-summary-message {
    margin: 0.3rem 0 0;
    max-width: 68ch;
    color: var(--ink-soft);
    line-height: 1.45;
}

.shop-detail-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.55rem;
}

.shop-detail-stat-card {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 12px;
    padding: 0.75rem 0.8rem;
    background: rgba(255, 255, 255, 0.84);
    display: grid;
    gap: 0.22rem;
}

.shop-detail-stat-label,
.shop-detail-stat-note {
    margin: 0;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.shop-detail-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.shop-detail-stat-value {
    margin: 0;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 700;
}

.shop-detail-stat-note {
    font-size: 0.7rem;
    line-height: 1.35;
}

.shop-detail-summary-actions {
    margin-top: 0;
}

.shop-detail-primary-actions {
    margin-top: 0.38rem;
}

.workflow-path-callout {
    margin-top: 0.45rem;
    border: 1px solid rgba(52, 36, 14, 0.2);
    border-radius: 12px;
    padding: 0.5rem 0.58rem;
    background:
        radial-gradient(circle at 12% 0, rgba(190, 134, 48, 0.18), transparent 28%),
        linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(246, 232, 204, 0.84));
    display: grid;
    gap: 0.35rem;
}

.workflow-path-label {
    margin: 0;
    font-size: 0.69rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.workflow-path-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.primary-action-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.primary-action-row .dashboard-quick-label {
    flex: 1 1 260px;
}

.workflow-path-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.22rem 0.58rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.71rem;
    font-family: 'IBM Plex Mono', monospace;
    line-height: 1.25;
    color: var(--ink-soft);
    text-decoration: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 238, 219, 0.72));
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.workflow-path-chip.is-city {
    border-color: rgba(14, 122, 85, 0.52);
    background: linear-gradient(180deg, rgba(14, 122, 85, 0.23), rgba(14, 122, 85, 0.11));
    color: var(--accent-strong);
    font-weight: 700;
}

.workflow-path-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.workflow-path-chip.is-standalone:hover {
    border-color: rgba(31, 26, 18, 0.3);
    color: var(--ink);
}

.workflow-path-chip.is-standalone {
    opacity: 0.92;
}

.generator-section-header {
    margin-bottom: 0.9rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(14, 122, 85, 0.18);
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(236, 249, 243, 0.82));
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
}

.generator-section-header h2 {
    margin: 0.12rem 0 0.3rem;
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.generator-section-header .inventory-summary {
    max-width: 70ch;
}

.inventory-header > div .workflow-step-kicker,
.pinboard-header .workflow-step-kicker {
    margin-bottom: 0.2rem;
}

body.table-mode #generatorPanel {
    border-color: rgba(14, 122, 85, 0.28);
    box-shadow: 0 16px 36px rgba(40, 28, 8, 0.14), 0 0 0 1px rgba(14, 122, 85, 0.08);
    scroll-margin-top: 0.75rem;
}

body.table-mode .generator-section-header {
    padding: 0.7rem 0.85rem;
    border-color: rgba(14, 122, 85, 0.24);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.99), rgba(236, 249, 243, 0.9));
}

body.table-mode .generator-section-header h2 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

body.table-mode .workflow-step-overview {
    border-color: rgba(14, 122, 85, 0.24);
    box-shadow: 0 14px 30px rgba(40, 28, 8, 0.12), 0 0 0 1px rgba(14, 122, 85, 0.06);
}

body.table-mode .workflow-step-card[data-step-state="waiting"] {
    opacity: 1;
}

body.table-mode .shop-detail-summary-card {
    border-color: rgba(14, 122, 85, 0.22);
    box-shadow: 0 14px 30px rgba(40, 28, 8, 0.12), 0 0 0 1px rgba(14, 122, 85, 0.06);
}

body.table-mode .workflow-path-callout {
    margin-top: 0.35rem;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(243, 251, 247, 0.84));
}

body.table-mode .shop-form {
    display: grid;
    gap: 0.65rem;
}

body.table-mode .field {
    padding: 0.8rem 0.85rem;
}

.dashboard-quick-button-row {
    margin-top: 0.35rem;
}

.snapshot-grid {
    margin-top: 0.45rem;
}

.shop-metadata-grid {
    margin-top: 0.55rem;
}

.saved-snapshot-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.city-stat-grid,
.city-context-grid {
    margin-top: 0.55rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.45rem;
}

.city-context-card {
    align-content: start;
}

.city-context-copy {
    margin: 0;
    color: var(--ink);
    line-height: 1.45;
}

@media (max-width: 720px) {
    .workflow-step-overview-header {
        align-items: start;
    }

    .workflow-step-grid {
        grid-template-columns: 1fr;
    }

    .shop-detail-stat-grid {
        grid-template-columns: 1fr;
    }
}

.city-inline-link {
    text-decoration: none;
}

.snapshot-card {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: #fff;
}

.snapshot-card.is-selected {
    border-color: rgba(14, 122, 85, 0.45);
    box-shadow: inset 0 0 0 1px rgba(14, 122, 85, 0.18);
}

.snapshot-card.is-editing {
    border-color: rgba(14, 122, 85, 0.58);
    box-shadow: inset 0 0 0 1px rgba(14, 122, 85, 0.24), 0 6px 18px rgba(14, 122, 85, 0.08);
    background: linear-gradient(175deg, #ffffff, rgba(237, 249, 244, 0.95));
}

.saved-shop-card {
    cursor: pointer;
}

.saved-shop-card:focus-within,
.saved-shop-card:hover {
    border-color: rgba(14, 122, 85, 0.42);
}

.snapshot-card-header {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: baseline;
}

.snapshot-card-header h3 {
    margin: 0;
    font-size: 0.94rem;
}

.snapshot-title-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.shop-edit-toggle {
    padding: 0.14rem 0.48rem;
    font-size: 0.68rem;
}

.saved-shop-compact-settings {
    margin: 0.38rem 0 0;
    color: var(--ink-soft);
    font-size: 0.73rem;
    font-family: 'IBM Plex Mono', monospace;
    border: 1px dashed rgba(31, 26, 18, 0.18);
    border-radius: 8px;
    padding: 0.3rem 0.4rem;
    background: rgba(246, 238, 219, 0.35);
}

.saved-shop-compact-settings.is-hidden {
    display: none;
}

.saved-shop-source-audit,
.saved-shop-confidence-row,
.saved-shop-confidence-legend {
    margin-top: 0.38rem;
}

.saved-shop-confidence-legend {
    margin-bottom: 0;
    color: var(--ink-soft);
    font-size: 0.7rem;
    line-height: 1.4;
    font-family: 'IBM Plex Mono', monospace;
}

.saved-shop-compact-fields {
    margin-top: 0.42rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.38rem;
}

.saved-shop-compact-fields.is-hidden {
    display: none;
}

.saved-shop-compact-field {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 238, 219, 0.52));
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.saved-shop-compact-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.saved-shop-compact-value {
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-meta-stack {
    margin-top: 0.45rem;
    display: grid;
    gap: 0.35rem;
}

.shop-meta-block {
    border: 1px dashed rgba(31, 26, 18, 0.18);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    background: rgba(246, 238, 219, 0.35);
}

.shop-meta-block strong {
    display: block;
    color: var(--ink-soft);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'IBM Plex Mono', monospace;
}

.shop-meta-block p {
    margin: 0.18rem 0 0;
    color: var(--ink);
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.snapshot-card-meta,
.snapshot-card-summary {
    margin: 0.22rem 0 0;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-family: 'IBM Plex Mono', monospace;
}

.saved-shop-edit-grid {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.4rem;
}

.saved-shop-edit-grid.is-collapsed {
    display: none;
}

.saved-shop-edit-field {
    display: grid;
    gap: 0.2rem;
}

.saved-shop-edit-field-wide {
    grid-column: 1 / -1;
}

.saved-shop-edit-field.is-dirty span {
    color: #8f1d22;
}

.saved-shop-edit-field span {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
}

.saved-shop-edit-field input,
.saved-shop-edit-field textarea {
    width: 100%;
    border: 1px solid rgba(31, 26, 18, 0.2);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 0.35rem 0.45rem;
    font-size: 0.78rem;
    font-family: 'IBM Plex Mono', monospace;
}

.saved-shop-edit-field textarea {
    min-height: 5.25rem;
    resize: vertical;
}

.saved-shop-edit-field input.is-hidden {
    display: none;
}

.saved-shop-edit-field textarea.is-hidden {
    display: none;
}

.saved-shop-edit-field input:focus,
.saved-shop-edit-field textarea:focus {
    outline: none;
    border-color: rgba(14, 122, 85, 0.65);
    box-shadow: 0 0 0 2px rgba(14, 122, 85, 0.12);
}

.saved-shop-edit-field input.is-dirty,
.saved-shop-edit-field textarea.is-dirty {
    border-color: rgba(143, 29, 34, 0.45);
    background: rgba(143, 29, 34, 0.06);
}

.saved-shop-name-button {
    justify-self: start;
    margin-top: 0.1rem;
}

.saved-shop-dirty-state {
    margin: 0.45rem 0 0;
    min-height: 1rem;
    color: rgba(143, 29, 34, 0.92);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    visibility: hidden;
}

.saved-shop-dirty-state.is-visible {
    visibility: visible;
}

.saved-shop-dirty-state.is-collapsed {
    display: none;
}

.ghost-button.is-hidden {
    display: none;
}

.action-status {
    min-height: 1rem;
    margin: 0.3rem 0 0;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-family: 'IBM Plex Mono', monospace;
}

.pinboard-subtitle {
    margin: 0.2rem 0 0.7rem;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.error {
    color: var(--danger);
    min-height: 1.3rem;
    margin-top: 0.45rem;
}

.view-mode-note {
    min-height: 1rem;
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-top: 0.25rem;
}

.inventory-grid {
    margin-top: 0.4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 0.8rem;
}

.rarity-card {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 12px;
    padding: 0.8rem;
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.95), rgba(246, 238, 219, 0.7));
    animation: rise-in 300ms ease-out both;
    position: relative;
    overflow: hidden;
}

.rarity-card::before,
.rarity-card::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.rarity-card::before {
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(62, 42, 17, 0), rgba(62, 42, 17, 0.45) 50%, rgba(62, 42, 17, 0));
}

.rarity-card::after {
    top: 0.4rem;
    right: 0.4rem;
    width: 0.72rem;
    height: 0.72rem;
    border: 1px solid rgba(62, 42, 17, 0.34);
    border-radius: 2px;
    transform: rotate(45deg);
    background: rgba(255, 255, 255, 0.72);
}

.rarity-card.rarity-common {
    border-color: rgba(79, 91, 109, 0.36);
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.95), rgba(220, 228, 239, 0.78));
}

.rarity-card.rarity-common::before {
    background: linear-gradient(90deg, rgba(79, 91, 109, 0), rgba(79, 91, 109, 0.74) 50%, rgba(79, 91, 109, 0));
}

.rarity-card.rarity-uncommon {
    border-color: rgba(43, 127, 86, 0.38);
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.96), rgba(216, 241, 226, 0.78));
}

.rarity-card.rarity-uncommon::before {
    background: linear-gradient(90deg, rgba(43, 127, 86, 0), rgba(43, 127, 86, 0.74) 50%, rgba(43, 127, 86, 0));
}

.rarity-card.rarity-rare {
    border-color: rgba(47, 83, 148, 0.4);
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.96), rgba(214, 226, 250, 0.8));
}

.rarity-card.rarity-rare::before {
    background: linear-gradient(90deg, rgba(47, 83, 148, 0), rgba(47, 83, 148, 0.74) 50%, rgba(47, 83, 148, 0));
}

.rarity-card.rarity-very_rare {
    border-color: rgba(109, 78, 159, 0.4);
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.96), rgba(229, 217, 248, 0.82));
}

.rarity-card.rarity-very_rare::before {
    background: linear-gradient(90deg, rgba(109, 78, 159, 0), rgba(109, 78, 159, 0.76) 50%, rgba(109, 78, 159, 0));
}

.rarity-card.rarity-legendary {
    border-color: rgba(173, 94, 16, 0.42);
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.96), rgba(248, 226, 188, 0.86));
}

.rarity-card.rarity-legendary::before {
    background: linear-gradient(90deg, rgba(173, 94, 16, 0), rgba(173, 94, 16, 0.82) 50%, rgba(173, 94, 16, 0));
}

.rarity-card.rarity-always_in_stock {
    border-color: rgba(107, 91, 71, 0.42);
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.95), rgba(227, 217, 203, 0.86));
}

.rarity-card.rarity-always_in_stock::before {
    background: linear-gradient(90deg, rgba(107, 91, 71, 0), rgba(107, 91, 71, 0.78) 50%, rgba(107, 91, 71, 0));
}

.rarity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rarity-header h3 {
    margin: 0;
    text-transform: capitalize;
    font-size: 1rem;
}

.count-badge {
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    background: rgba(14, 122, 85, 0.14);
    color: var(--accent-strong);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
}

.count-badge.count-common {
    background: rgba(79, 91, 109, 0.18);
    color: #334258;
}

.count-badge.count-uncommon {
    background: rgba(43, 127, 86, 0.2);
    color: #1f6141;
}

.count-badge.count-rare {
    background: rgba(47, 83, 148, 0.2);
    color: #224177;
}

.count-badge.count-very_rare {
    background: rgba(109, 78, 159, 0.2);
    color: #503377;
}

.count-badge.count-legendary {
    background: rgba(173, 94, 16, 0.22);
    color: #7d4204;
}

.count-badge.count-always_in_stock {
    background: rgba(107, 91, 71, 0.22);
    color: #4c3f32;
}

.item-list,
.pinboard-items {
    display: grid;
    gap: 0.55rem;
}

.item-row {
    border: 1px solid rgba(31, 26, 18, 0.1);
    border-radius: 10px;
    padding: 0.5rem 0.55rem;
    background: #fff;
}

.item-main {
    margin-bottom: 0.3rem;
}

.item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.tiny-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 238, 219, 0.9));
    color: var(--ink);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 0 rgba(62, 42, 17, 0.24);
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.tiny-button::before,
.ghost-button::before {
    content: "";
    width: 0.62rem;
    height: 0.62rem;
    flex: 0 0 0.62rem;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    opacity: 0.82;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

#dashboardQuickViewHistoryButton::before,
#dashboardHistoryCollapseOlderButton::before,
#dashboardHistoryExpandAllButton::before,
#dashboardMobileHistoryButton::before {
    border-radius: 999px;
    border-top-color: transparent;
    border-left-color: transparent;
}

#dashboardQuickRefreshShopButton::before,
#dashboardRefreshButton::before,
#dashboardRefreshSelectedButton::before,
#dashboardRefreshAllButton::before,
#cityManagerRefreshButton::before,
#refreshCitiesButton::before,
#dashboardMobileRestockButton::before,
#dashboardMobileRunQueueButton::before {
    border-radius: 999px;
    border-right-color: transparent;
}

#dashboardQuickCopyNotesButton::before,
#dashboardQuickCopyDetailsButton::before,
#copyInventoryListButton::before,
#copyInventoryJsonButton::before,
#dashboardCopySessionPacketButton::before,
#dashboardMobilePacketButton::before {
    border-radius: 2px;
    box-shadow: -2px -2px 0 -1px currentColor;
}

#saveSnapshotButton::before,
#dashboardQuickSaveButton::before,
#dashboardCreateCityButton::before,
#createCityButton::before,
#cityManagerPrimaryActionButton::before {
    border-radius: 0;
    background: linear-gradient(180deg, transparent 0 30%, currentColor 30% 38%, transparent 38% 100%);
}

#dashboardQueueAllButton::before,
#dashboardQueueClearButton::before,
#dashboardMobileQueueActiveButton::before {
    border-radius: 999px;
    background:
        linear-gradient(180deg, transparent 0 24%, currentColor 24% 34%, transparent 34% 44%, currentColor 44% 54%, transparent 54% 64%, currentColor 64% 74%, transparent 74% 100%);
}

#dashboardOpenShopsButton::before,
#cityManagerOpenShopsButton::before,
#cityManagerResumeShopButton::before,
#dashboardQuickToggleEditButton::before,
#generateShopNameButton::before,
#compareRollButton::before {
    border-radius: 50% 50% 2px 2px;
}

#dashboardDeleteCityButton::before,
#clearPinsButton::before {
    border-radius: 999px;
    background:
        linear-gradient(45deg, transparent 0 40%, currentColor 40% 60%, transparent 60% 100%),
        linear-gradient(-45deg, transparent 0 40%, currentColor 40% 60%, transparent 60% 100%);
}

#dashboardExportRuntimeButton::before,
#dashboardImportRuntimeButton::before {
    border-radius: 2px;
    background: linear-gradient(180deg, transparent 0 48%, currentColor 48% 56%, transparent 56% 100%);
}

.ghost-button.flow-primary-button {
    border-color: rgba(15, 78, 65, 0.55);
    background: linear-gradient(150deg, rgba(15, 78, 65, 0.22), rgba(234, 250, 243, 0.98));
    color: var(--accent-strong);
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(15, 78, 65, 0.18), 0 2px 0 rgba(47, 30, 8, 0.24);
}

.ghost-button.flow-primary-button:hover {
    border-color: var(--accent-strong);
    background: linear-gradient(150deg, rgba(15, 78, 65, 0.3), rgba(236, 252, 244, 0.98));
}

.tiny-button:hover,
.ghost-button:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft), 0 2px 0 rgba(47, 30, 8, 0.18);
}

.danger-button {
    border-color: rgba(143, 29, 34, 0.35);
    color: var(--danger);
}

.danger-button:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.ghost-button.is-active {
    border-color: var(--accent);
    color: var(--accent-strong);
    background: linear-gradient(160deg, rgba(14, 122, 85, 0.18), rgba(234, 250, 243, 0.84));
}

.ghost-button:active,
.tiny-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 0 rgba(47, 30, 8, 0.2);
}

.item-label {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.35;
}

.item-meta {
    margin: 0.2rem 0 0;
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-family: 'IBM Plex Mono', monospace;
}

.price-badge,
.history-item-price {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.04rem 0.45rem;
    border-radius: 999px;
    background: rgba(14, 122, 85, 0.11);
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
    white-space: nowrap;
}

.price-badge.is-estimated,
.history-item-price.is-estimated {
    background: rgba(176, 118, 46, 0.14);
    color: #8b5a12;
}

.price-badge.is-fallback-band,
.history-item-price.is-fallback-band {
    background: rgba(176, 118, 46, 0.16);
    color: #8b5a12;
}

.price-badge.is-fallback-rarity,
.history-item-price.is-fallback-rarity {
    background: rgba(109, 78, 159, 0.14);
    color: #5a3d88;
}

.price-badge.is-unknown,
.history-item-price.is-unknown {
    background: rgba(143, 29, 34, 0.1);
    color: var(--danger);
}

.trace-details {
    margin-top: 0.38rem;
    border-top: 1px dashed rgba(31, 26, 18, 0.16);
    padding-top: 0.3rem;
}

.trace-details summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 500;
}

.trace-body {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--ink-soft);
    display: grid;
    gap: 0.22rem;
}

.trace-body.trace-compact .trace-detail {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trace-step {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.4rem;
    align-items: start;
}

.trace-kind {
    border-radius: 999px;
    padding: 0.03rem 0.42rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
    color: #fff;
    background: #6c5d46;
}

.trace-kind.kind-primary_roll { background: #0e7a55; }
.trace-kind.kind-nested_roll { background: #885e16; }
.trace-kind.kind-nested_hint { background: #6d4e9f; }
.trace-kind.kind-nested_cycle_blocked { background: #8f1d22; }

.trace-detail {
    color: var(--ink-soft);
}

.trace-expanded .trace-detail {
    white-space: normal;
    overflow-wrap: anywhere;
}

.flat-list {
    display: grid;
    gap: 0.55rem;
}

.flat-item,
.pin-item {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
    background: #fff;
}

.rarity-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.04rem 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 0.32rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.rarity-chip::before {
    content: "";
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.32);
    flex: 0 0 0.38rem;
}

.chip-common { background: #4f5b6d; }
.chip-uncommon { background: #2b7f56; }
.chip-rare { background: #2f5394; }
.chip-very_rare { background: #6d4e9f; }
.chip-legendary { background: #ad5e10; }
.chip-always_in_stock { background: #6b5b47; }

.chip-legendary::before {
    border-radius: 2px;
    transform: rotate(45deg);
}

.chip-very_rare::before {
    background: rgba(255, 255, 255, 0.44);
}

.chip-always_in_stock::before {
    border-radius: 2px;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35) 1px, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0.05) 2px);
}

.empty-note {
    margin: 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.history-list {
    gap: 0.75rem;
}

.history-day-divider {
    margin-top: 0.1rem;
    padding-top: 0.2rem;
}

.history-day-divider-label {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.74rem;
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.history-snapshot-disclosure {
    border: 1px solid rgba(31, 26, 18, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.history-snapshot-disclosure > summary {
    list-style: none;
}

.history-snapshot-disclosure > summary::-webkit-details-marker {
    display: none;
}

.history-snapshot-summary {
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(31, 26, 18, 0.08);
    background: linear-gradient(180deg, rgba(250, 243, 225, 0.92), rgba(255, 255, 255, 0.95));
}

.history-snapshot-disclosure:not([open]) .history-snapshot-summary {
    border-bottom: 0;
}

.history-snapshot-summary-title {
    color: var(--ink);
    font-size: 0.78rem;
    font-family: 'IBM Plex Mono', monospace;
}

.history-snapshot-summary-meta {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
}

.history-snapshot-disclosure .history-card {
    border: 0;
    border-radius: 0;
    margin: 0;
}

.history-list.history-density-compact {
    gap: 0.5rem;
}

.history-list.history-density-compact .history-card {
    padding: 0.45rem 0.55rem;
}

.history-list.history-density-compact .snapshot-card-meta,
.history-list.history-density-compact .snapshot-card-summary,
.history-list.history-density-compact .history-source-audit,
.history-list.history-density-compact .history-filter-summary {
    font-size: 0.72rem;
}

.history-list.history-density-compact .history-item-row {
    padding: 0.3rem 0.35rem;
}

.history-list.history-density-cozy .history-card {
    padding: 0.65rem 0.75rem;
}

.history-card {
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(250, 243, 225, 0.82));
}

.history-diff-grid {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.history-diff {
    margin: 0;
    font-size: 0.76rem;
    font-family: 'IBM Plex Mono', monospace;
}

.history-source-audit {
    margin: 0.38rem 0 0;
    border-radius: 8px;
    border: 1px dashed rgba(31, 26, 18, 0.18);
    padding: 0.3rem 0.4rem;
    background: rgba(246, 238, 219, 0.35);
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
}

.history-item-grid {
    margin-top: 0.45rem;
    display: grid;
    gap: 0.28rem;
}

.history-item-row {
    border: 1px solid rgba(31, 26, 18, 0.1);
    border-radius: 8px;
    background: #fff;
    padding: 0.32rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
}

.history-item-left {
    display: grid;
    gap: 0.22rem;
    min-width: 0;
}

.history-item-label {
    margin: 0;
    color: var(--ink);
    font-size: 0.74rem;
    line-height: 1.2;
}

.history-item-source {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 0.04rem 0.44rem;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
    color: #fff;
}

.history-item-source.source-always_in_stock { background: #6b5b47; }
.history-item-source.source-common { background: #4f5b6d; }
.history-item-source.source-uncommon { background: #2b7f56; }
.history-item-source.source-rare { background: #2f5394; }
.history-item-source.source-very_rare { background: #6d4e9f; }
.history-item-source.source-legendary { background: #ad5e10; }

.history-item-overflow {
    margin: 0.12rem 0 0;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
}

.history-added {
    color: var(--accent-strong);
}

.history-removed {
    color: var(--danger);
}

.pinned-manager-controls {
    display: grid;
    gap: 0.35rem;
    justify-items: end;
}

.pinned-filter-field {
    min-width: 180px;
}

.pinned-filter-field span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 0.15rem;
}

.insight-chip-row {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.insight-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.24rem 0.52rem;
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
    border: 1px solid rgba(31, 26, 18, 0.14);
    background: rgba(31, 26, 18, 0.05);
    color: var(--ink-soft);
}

.insight-chip.insight-positive {
    border-color: rgba(14, 122, 85, 0.35);
    background: rgba(14, 122, 85, 0.14);
    color: var(--accent-strong);
}

.insight-chip.insight-negative {
    border-color: rgba(143, 29, 34, 0.32);
    background: rgba(143, 29, 34, 0.12);
    color: var(--danger);
}

.insight-chip.insight-neutral {
    border-color: rgba(31, 26, 18, 0.18);
    background: rgba(31, 26, 18, 0.05);
    color: var(--ink-soft);
}

.insight-empty {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-family: 'IBM Plex Mono', monospace;
}

.mobile-quick-bar {
    display: none;
}

.mobile-quick-summary {
    display: none;
}

.page-footer {
    margin-top: 0.1rem;
    border: 1px solid rgba(52, 36, 14, 0.18);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    background:
        radial-gradient(circle at 6% 40%, rgba(190, 134, 48, 0.16), transparent 24%),
        linear-gradient(170deg, rgba(255, 252, 245, 0.98), rgba(245, 233, 207, 0.84));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.page-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0.9rem;
    right: 0.9rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(181, 121, 43, 0), rgba(181, 121, 43, 0.78) 50%, rgba(181, 121, 43, 0));
}

.page-footer-copy {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
}

.page-footer-links {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.page-footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.24rem 0.66rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.74rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 238, 219, 0.76));
}

.page-footer-link:hover {
    color: var(--accent-strong);
    border-color: var(--accent);
    box-shadow: var(--shadow-soft);
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.65rem;
}

.compare-diff-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.compare-card,
.compare-diff-card {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 12px;
    padding: 0.7rem 0.75rem;
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(246, 238, 219, 0.72));
}

.compare-card h3,
.compare-diff-card h3 {
    margin: 0;
    font-size: 0.95rem;
}

.compare-meta,
.compare-summary,
.compare-source-line,
.compare-confidence-line,
.compare-detail {
    margin: 0.22rem 0 0;
    color: var(--ink-soft);
    font-size: 0.76rem;
    font-family: 'IBM Plex Mono', monospace;
}

.confidence-chip-row {
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.confidence-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.48rem;
    font-size: 0.69rem;
    font-family: 'IBM Plex Mono', monospace;
    border: 1px solid rgba(31, 26, 18, 0.16);
    color: var(--ink-soft);
    background: rgba(31, 26, 18, 0.04);
}

.confidence-title {
    color: var(--ink);
    border-color: rgba(31, 26, 18, 0.24);
}

.confidence-exact {
    color: var(--accent-strong);
    border-color: rgba(14, 122, 85, 0.34);
    background: rgba(14, 122, 85, 0.1);
}

.confidence-estimated {
    color: #8a5c10;
    border-color: rgba(138, 92, 16, 0.32);
    background: rgba(230, 198, 123, 0.26);
}

.confidence-fallback-band {
    color: #8a5c10;
    border-color: rgba(138, 92, 16, 0.32);
    background: rgba(230, 198, 123, 0.26);
}

.confidence-fallback-rarity {
    color: #5a3d88;
    border-color: rgba(109, 78, 159, 0.28);
    background: rgba(109, 78, 159, 0.1);
}

.confidence-unknown {
    color: var(--danger);
    border-color: rgba(143, 29, 34, 0.28);
    background: rgba(143, 29, 34, 0.1);
}

.confidence-hint {
    max-width: 42ch;
}

.confidence-chip-row.is-compact .confidence-chip {
    font-size: 0.66rem;
    padding: 0.18rem 0.42rem;
}

.confidence-chip-row.is-compact .confidence-hint {
    max-width: 100%;
    flex-basis: 100%;
}

.compare-detail.compare-added {
    color: var(--accent-strong);
}

.compare-detail.compare-removed {
    color: var(--danger);
}

.change-highlight-grid {
    margin-top: 0.45rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.4rem;
}

.change-highlight-card {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 10px;
    padding: 0.45rem 0.52rem;
    background: rgba(255, 255, 255, 0.75);
    display: grid;
    gap: 0.18rem;
}

.change-highlight-positive {
    border-color: rgba(14, 122, 85, 0.26);
    background: rgba(14, 122, 85, 0.08);
}

.change-highlight-negative {
    border-color: rgba(143, 29, 34, 0.22);
    background: rgba(143, 29, 34, 0.08);
}

.change-highlight-label {
    color: var(--ink-soft);
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
}

.change-highlight-value {
    color: var(--ink);
    font-size: 0.78rem;
    line-height: 1.35;
}

.compare-diff-summary-card,
.compare-diff-row {
    border: 1px solid rgba(31, 26, 18, 0.12);
    border-radius: 12px;
    padding: 0.68rem 0.75rem;
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(246, 238, 219, 0.72));
}

.compare-diff-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.compare-diff-label {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

.compare-diff-name {
    margin: 0;
    font-size: 0.84rem;
    color: var(--ink);
}

.compare-diff-counts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-left: auto;
}

.compare-diff-count {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.22rem 0.5rem;
    font-size: 0.7rem;
    font-family: 'IBM Plex Mono', monospace;
    background: rgba(31, 26, 18, 0.06);
    color: var(--ink-soft);
}

.compare-diff-previous {
    background: rgba(31, 26, 18, 0.06);
}

.compare-diff-current {
    background: rgba(14, 122, 85, 0.12);
    color: var(--accent-strong);
}

.compare-diff-delta.compare-added {
    background: rgba(14, 122, 85, 0.12);
    color: var(--accent-strong);
}

.compare-diff-delta.compare-removed {
    background: rgba(143, 29, 34, 0.12);
    color: var(--danger);
}

.pinned-manager-list {
    gap: 0.6rem;
}

.pin-item-manager {
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(246, 238, 219, 0.78));
}

.launch-dashboard {
    display: grid;
    gap: 0.9rem;
}

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

.launch-card {
    border: 1px solid rgba(52, 36, 14, 0.18);
    border-radius: 14px;
    padding: 0.85rem;
    background:
        radial-gradient(circle at 85% 10%, rgba(30, 107, 89, 0.16), transparent 42%),
        linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(246, 232, 204, 0.88));
    display: grid;
    gap: 0.55rem;
    position: relative;
    overflow: hidden;
}

.launch-card::before {
    content: "";
    position: absolute;
    inset: 0.45rem auto auto 0.45rem;
    width: 14px;
    height: 14px;
    border-top: 1px solid rgba(181, 121, 43, 0.45);
    border-left: 1px solid rgba(181, 121, 43, 0.45);
    border-radius: 2px;
}

.launch-card h3 {
    margin: 0;
    font-size: 1rem;
}

.launch-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.35;
}

.launch-button {
    justify-self: start;
    text-decoration: none;
}

.launch-flow {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.4rem;
    color: var(--ink-soft);
}

body.reduced-motion * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

body.reduced-motion .hero,
body.reduced-motion .control-panel,
body.reduced-motion .diagnostics,
body.reduced-motion .inventory-section,
body.reduced-motion .pinboard {
    animation: none !important;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes workflow-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 122, 85, 0.22), var(--shadow);
    }
    100% {
        box-shadow: 0 0 0 8px rgba(14, 122, 85, 0), var(--shadow);
    }
}

@media (max-width: 820px) {
    .page-shell {
        margin-top: 1rem;
        width: 94vw;
        gap: 0.85rem;
    }

    .hero {
        padding: 1rem 0.95rem;
    }

    .site-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.65rem;
    }

    .site-brand {
        font-size: 0.74rem;
    }

    .site-nav-links {
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .site-nav-quicklinks {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.15rem;
        scrollbar-width: thin;
    }

    .site-nav-theme-control {
        width: fit-content;
    }

    .site-nav-future {
        display: none;
    }

    .site-nav-link,
    .site-nav-quicklink {
        font-size: 0.72rem;
        padding: 0.22rem 0.58rem;
    }

    .field-grid,
    .diag-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        position: sticky;
        bottom: 0;
        background: linear-gradient(180deg, rgba(255, 253, 247, 0.2), rgba(255, 253, 247, 0.95));
        padding-top: 0.5rem;
    }

    .trace-step {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    #generateButton {
        width: 100%;
    }

    .inventory-actions,
    .snapshot-actions {
        width: 100%;
    }

    .inventory-actions .ghost-button,
    .snapshot-actions .ghost-button {
        flex: 1 1 48%;
    }

    .dashboard-quick-button-row .ghost-button,
    .dashboard-daily-queue-row .ghost-button {
        flex: 1 1 46%;
    }

    .history-snapshot-summary {
        align-items: flex-start;
    }

    .saved-shop-edit-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .mobile-quick-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
        position: fixed;
        left: 0.65rem;
        right: 0.65rem;
        bottom: 0.7rem;
        z-index: 58;
        padding: 0.45rem;
        border: 1px solid rgba(31, 26, 18, 0.2);
        border-radius: 14px;
        background: linear-gradient(160deg, rgba(255, 253, 247, 0.97), rgba(245, 235, 212, 0.96));
        box-shadow: 0 10px 26px rgba(31, 26, 18, 0.2);
        backdrop-filter: blur(2px);
    }

    .mobile-quick-summary {
        display: block;
        grid-column: 1 / -1;
        margin: 0;
        color: var(--ink-soft);
        font-size: 0.68rem;
        font-family: 'IBM Plex Mono', monospace;
    }

    .mobile-quick-bar .ghost-button {
        margin-top: 0;
        min-height: 2.2rem;
        padding: 0.34rem 0.5rem;
        font-size: 0.72rem;
        justify-content: center;
    }

    body {
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 1099px) {
    .page-content-shell {
        grid-template-columns: 1fr;
    }

    .section-nav-rail,
    body.table-mode .section-nav-rail {
        display: none;
    }

    .section-nav-mobile {
        display: block;
        position: fixed;
        right: 0.85rem;
        bottom: 5.1rem;
        z-index: 40;
        max-width: min(84vw, 340px);
    }

    body.table-mode .section-nav-mobile {
        display: block;
    }
}
