:root {
    --market-green: #16855f;
    --market-green-soft: #dff3e9;
    --market-red: #cf4d37;
    --market-red-soft: #fbe8e2;
    --market-dark: #172127;
    --market-grid: rgba(255, 255, 255, .055);
}

.market-page {
    min-height: 100vh;
    background-color: #efede7;
    background-image:
        linear-gradient(rgba(29, 37, 43, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(29, 37, 43, .035) 1px, transparent 1px);
    background-size: 32px 32px;
}

.market-page .site-header {
    position: relative;
}

.market-header-meta {
    margin-left: 0;
}

.market-hero {
    position: relative;
    overflow: visible;
    padding: 74px 0 84px;
    color: #f7f2e8;
    background-color: var(--market-dark);
    background-image:
        linear-gradient(var(--market-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--market-grid) 1px, transparent 1px);
    background-size: 36px 36px;
    border-bottom: 5px solid var(--brand);
}

.market-hero::before {
    content: "KM / MARKET WATCH";
    position: absolute;
    right: max(24px, calc((100vw - var(--container)) / 2));
    top: 25px;
    color: rgba(255, 255, 255, .35);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .2em;
}

.market-hero::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: 8%;
    bottom: -235px;
    border: 1px solid rgba(242, 95, 58, .35);
    border-radius: 50%;
    pointer-events: none;
}

.market-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(520px, 1.15fr);
    align-items: end;
    gap: 84px;
}

.market-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 19px;
    color: #c7cec9;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
}

.market-eyebrow span {
    padding: 5px 7px;
    color: #fff;
    background: var(--brand);
}

.market-intro h1 {
    max-width: 590px;
    margin: 0;
    font-size: clamp(48px, 5vw, 76px);
    line-height: .93;
    letter-spacing: -.065em;
}

.market-intro h1 em {
    display: inline-block;
    margin-top: 9px;
    color: #ffa172;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    letter-spacing: -.055em;
}

.market-intro > p:last-child {
    max-width: 540px;
    margin: 27px 0 0;
    color: #c9ceca;
    font-size: 16px;
    line-height: 1.7;
}

.market-search-shell {
    position: relative;
    z-index: 5;
    padding: 22px;
    color: var(--ink);
    background: #fffaf0;
    border: 1px solid #000;
    box-shadow: 8px 8px 0 var(--brand);
}

.market-search-label {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
}

.market-search-label small {
    color: var(--muted);
    letter-spacing: .04em;
}

.market-search-control {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 62px;
    background: #fff;
    border: 2px solid var(--ink);
}

.market-search-control:focus-within {
    border-color: var(--brand);
    box-shadow: inset 0 -3px 0 rgba(233, 84, 50, .16);
}

.search-glyph {
    position: relative;
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    margin-left: 18px;
    border: 2px solid var(--ink);
    border-radius: 50%;
}

.search-glyph::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    right: -6px;
    bottom: -3px;
    background: var(--ink);
    rotate: 45deg;
}

.market-search-control input {
    min-width: 0;
    flex: 1;
    padding: 17px 14px 17px 16px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    font-weight: 650;
}

.market-search-control input::placeholder {
    color: #8b918e;
    font-weight: 500;
}

.market-search-control kbd {
    margin-right: 13px;
    padding: 4px 7px;
    color: var(--muted);
    background: #f2eee5;
    border: 1px solid var(--line-strong);
    font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.market-search-results {
    position: absolute;
    z-index: 20;
    top: calc(100% - 62px);
    left: 22px;
    right: 22px;
    max-height: 360px;
    overflow-y: auto;
    background: #fffdf8;
    border: 2px solid var(--ink);
    box-shadow: 7px 7px 0 rgba(23, 33, 39, .25);
}

.market-search-result {
    width: 100%;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    color: var(--ink);
    text-align: left;
    background: #fffdf8;
    border: 0;
    border-bottom: 1px solid var(--line);
}

.market-search-result:last-child {
    border-bottom: 0;
}

.market-search-result:hover,
.market-search-result:focus-visible {
    outline: 0;
    background: #f1ede4;
}

.market-search-result > b {
    font: 800 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.market-search-result > span {
    display: grid;
}

.market-search-result > span strong {
    font-size: 13px;
}

.market-search-result > span small {
    color: var(--muted);
    font-size: 10px;
}

.market-search-result > strong {
    white-space: nowrap;
    font: 750 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.market-search-empty {
    display: block;
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
}

.search-suggestions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
    color: var(--muted);
    font-size: 10px;
}

.search-suggestions button {
    padding: 4px 7px;
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid var(--line-strong);
    font-size: 10px;
}

.search-suggestions button:hover {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
}

.market-ticker {
    overflow: hidden;
    min-height: 45px;
    color: #e8ece8;
    background: #10181c;
    border-bottom: 1px solid #000;
}

.market-ticker-track {
    min-width: 100%;
    width: max-content;
    min-height: 45px;
    display: flex;
    align-items: stretch;
}

.market-ticker-track.loaded {
    animation: market-ticker-scroll 46s linear infinite;
}

.ticker-item,
.ticker-loading {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 22px;
    border-right: 1px solid rgba(255, 255, 255, .12);
    font: 750 10px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .03em;
}

.ticker-item {
    color: inherit;
    background: transparent;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
}

.ticker-item:hover {
    background: rgba(255, 255, 255, .055);
}

.ticker-item b {
    color: #fff;
}

.ticker-item strong {
    color: #f6c5a9;
}

.ticker-item i {
    font-style: normal;
}

.ticker-item.up i { color: #65d5aa; }
.ticker-item.down i { color: #ff8f77; }
.ticker-item.flat i { color: #cbd1ce; }

.market-content {
    padding-block: 48px 72px;
}

.instrument-spotlight {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(190px, .8fr) minmax(145px, .55fr) minmax(230px, .9fr);
    align-items: center;
    gap: 28px;
    margin-bottom: 22px;
    padding: 23px 58px 23px 24px;
    color: #fff;
    background: var(--market-dark);
    border: 2px solid #000;
    box-shadow: 6px 6px 0 var(--brand);
}

.instrument-spotlight[hidden] {
    display: none;
}

.spotlight-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.spotlight-identity > span {
    min-width: 64px;
    padding: 9px 7px;
    color: var(--market-dark);
    background: #ffa172;
    text-align: center;
    font: 900 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.spotlight-identity div,
.spotlight-quote,
.spotlight-change {
    display: grid;
    gap: 3px;
}

.instrument-spotlight small {
    color: #9da8a4;
    font: 750 8px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .1em;
}

.spotlight-identity h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.15;
}

.spotlight-quote strong {
    font: 800 22px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.spotlight-change strong {
    font: 850 20px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.spotlight-change.up strong { color: #65d5aa; }
.spotlight-change.down strong { color: #ff8f77; }

.spotlight-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.spotlight-meta span {
    display: grid;
    gap: 3px;
}

.spotlight-meta b {
    font-size: 12px;
}

#closeSpotlight {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    color: #cbd1ce;
    background: transparent;
    border: 0;
    font-size: 23px;
    line-height: 1;
}

#closeSpotlight:hover { color: #fff; }

.market-board {
    overflow: hidden;
    background: #fffdf8;
    border: 2px solid var(--ink);
    box-shadow: 8px 8px 0 #cec9bf;
}

.board-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 29px 30px 25px;
    border-bottom: 2px solid var(--ink);
}

.board-heading p {
    margin: 0 0 7px;
    color: var(--brand);
    font: 850 9px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .15em;
}

.board-heading h2 {
    margin: 0;
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1;
    letter-spacing: -.045em;
}

.board-heading div:first-child > span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.board-period {
    min-width: 210px;
    display: grid;
    justify-items: end;
    gap: 3px;
    padding-left: 22px;
    border-left: 1px solid var(--line);
}

.board-period small {
    color: var(--muted);
    font: 750 8px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .13em;
}

.board-period strong {
    font: 850 17px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.board-period span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
}

.board-period i {
    width: 6px;
    height: 6px;
    background: var(--brand);
    border-radius: 50%;
}

.board-columns,
.market-row {
    display: grid;
    grid-template-columns: minmax(280px, 1.4fr) minmax(160px, .7fr) minmax(135px, .55fr) minmax(175px, .7fr) 36px;
    align-items: center;
    gap: 18px;
}

.board-columns {
    min-height: 38px;
    padding: 0 25px;
    color: #777f7c;
    background: #eeeae1;
    border-bottom: 1px solid var(--line-strong);
    font: 800 8px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .1em;
}

.market-group {
    border-bottom: 1px solid var(--line);
}

.market-group:last-child {
    border-bottom: 0;
}

.market-row {
    width: 100%;
    min-height: 84px;
    padding: 14px 25px;
    color: var(--ink);
    text-align: left;
    background: #fffdf8;
    border: 0;
}

.market-row:hover,
.market-row:focus-visible,
.market-group.open > .market-row {
    outline: 0;
    background: #f5f1e8;
}

.market-group.open > .market-row {
    box-shadow: inset 4px 0 0 var(--brand);
}

.market-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 14px;
}

.market-rank {
    width: 31px;
    flex: 0 0 31px;
    color: #818783;
    font: 800 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.market-symbol {
    min-width: 55px;
    padding: 8px 6px;
    color: #fff;
    background: var(--ink);
    text-align: center;
    font: 850 9px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .04em;
}

.market-name {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.market-name strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-name small,
.market-reference small,
.market-price small,
.market-delta small {
    color: var(--muted);
    font-size: 10px;
}

.market-price,
.market-delta,
.market-reference {
    display: grid;
    gap: 3px;
}

.market-price strong,
.market-delta strong {
    white-space: nowrap;
    font: 800 15px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.market-delta.up strong { color: var(--market-green); }
.market-delta.down strong { color: var(--market-red); }

.market-search-result > i.market-delta {
    display: block;
    color: var(--muted);
    font: 800 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.market-search-result > i.market-delta.up { color: var(--market-green); }
.market-search-result > i.market-delta.down { color: var(--market-red); }

.market-reference strong {
    font-size: 12px;
}

.market-chevron {
    position: relative;
    width: 27px;
    height: 27px;
    border: 1px solid var(--ink);
}

.market-chevron::before,
.market-chevron::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 1px;
    background: var(--ink);
    translate: -50% -50%;
    transition: rotate .2s ease;
}

.market-chevron::after {
    rotate: 90deg;
}

.market-group.open .market-chevron::after {
    rotate: 0deg;
}

.model-drawer {
    background: #1c282e;
    border-top: 1px solid #000;
}

.model-drawer[hidden] {
    display: none;
}

.model-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(280px, 1.4fr) minmax(160px, .7fr) minmax(135px, .55fr) minmax(175px, .7fr) 36px;
    align-items: center;
    gap: 18px;
    min-height: 70px;
    padding: 11px 25px 11px 70px;
    color: #f4f2ec;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.model-row:last-child {
    border-bottom: 0;
}

.model-row:hover,
.model-row:focus-visible {
    outline: 0;
    background: rgba(255, 255, 255, .06);
}

.model-row .market-symbol {
    color: var(--ink);
    background: #ffa172;
}

.model-row .market-name small,
.model-row .market-reference small,
.model-row .market-price small,
.model-row .market-delta small {
    color: #9eaaa5;
}

.model-row .market-price strong,
.model-row .market-reference strong {
    color: #fff;
}

.model-row .market-chevron {
    border-color: #68746f;
}

.model-row .market-chevron::before {
    rotate: -45deg;
    width: 7px;
}

.model-row .market-chevron::after {
    display: none;
}

.board-skeleton {
    height: 84px;
    background: linear-gradient(90deg, #eeeae1 20%, #faf8f2 50%, #eeeae1 80%);
    background-size: 220% 100%;
    border-bottom: 1px solid var(--line);
    animation: market-loading 1.2s ease-in-out infinite;
}

.market-board-error {
    padding: 42px 28px;
    color: var(--market-red);
    text-align: center;
}

.market-method {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 23px;
    margin-top: 28px;
    padding: 22px;
    background: #e7e3da;
    border: 1px solid var(--line-strong);
}

.method-index {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--ink);
    font-family: Georgia, serif;
    font-style: italic;
}

.market-method strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
}

.market-method p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

@keyframes market-loading {
    to { background-position: -120% 0; }
}

@keyframes market-ticker-scroll {
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .market-ticker-track.loaded {
        animation: none;
    }

    .board-skeleton {
        animation: none;
    }
}

@media (max-width: 1020px) {
    .market-hero-grid {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 44px;
    }

    .market-search-shell {
        max-width: 760px;
    }

    .instrument-spotlight {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .spotlight-meta {
        grid-column: 1 / -1;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, .15);
    }

    .board-columns,
    .market-row,
    .model-row {
        grid-template-columns: minmax(250px, 1.25fr) minmax(145px, .7fr) minmax(115px, .55fr) 30px;
    }

    .board-columns span:nth-child(4),
    .market-row .market-reference,
    .model-row .market-reference {
        display: none;
    }

    .market-method {
        grid-template-columns: 34px 1fr 1fr;
    }

}

@media (max-width: 760px) {
    .market-hero {
        padding: 52px 0 61px;
    }

    .market-intro h1 {
        font-size: 47px;
    }

    .market-intro > p:last-child {
        font-size: 14px;
    }

    .market-search-shell {
        padding: 14px;
        box-shadow: 5px 5px 0 var(--brand);
    }

    .market-search-control {
        min-height: 56px;
    }

    .market-search-control input {
        padding-inline: 12px 8px;
        font-size: 14px;
    }

    .market-search-control kbd,
    .market-search-label small {
        display: none;
    }

    .market-search-results {
        top: calc(100% - 54px);
        left: 14px;
        right: 14px;
    }

    .market-search-result {
        grid-template-columns: 50px minmax(0, 1fr) auto;
    }

    .market-search-result > i {
        display: none;
    }

    .market-content {
        padding-block: 32px 54px;
    }

    .instrument-spotlight {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding: 21px 45px 21px 18px;
    }

    .spotlight-identity {
        grid-column: 1 / -1;
    }

    .board-heading {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px 18px;
    }

    .board-period {
        width: 100%;
        justify-items: start;
        padding: 13px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .board-columns {
        display: none;
    }

    .market-row,
    .model-row {
        grid-template-columns: minmax(0, 1fr) auto 28px;
        gap: 10px;
        padding: 13px 14px;
    }

    .model-row {
        padding-left: 35px;
    }

    .market-row .market-price,
    .model-row .market-price {
        grid-column: 1 / 2;
        padding-left: 45px;
    }

    .market-row .market-delta,
    .model-row .market-delta {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        justify-items: end;
    }

    .market-row .market-chevron,
    .model-row .market-chevron {
        grid-column: 3 / 4;
        grid-row: 1 / 3;
    }

    .market-reference {
        display: none !important;
    }

    .market-name strong {
        font-size: 14px;
    }

    .market-rank {
        width: 24px;
        flex-basis: 24px;
    }

    .market-symbol {
        min-width: 44px;
    }

    .market-method {
        grid-template-columns: 30px 1fr;
        gap: 17px;
    }

    .market-method > div:nth-of-type(3) {
        grid-column: 2;
    }
}

@media (max-width: 480px) {
    .market-page .brand-copy {
        display: none;
    }

    .market-page .site-nav {
        margin-left: auto;
    }

    .market-intro h1 {
        font-size: 41px;
    }

    .search-suggestions span {
        width: 100%;
    }

    .instrument-spotlight {
        grid-template-columns: 1fr;
    }

    .spotlight-identity,
    .spotlight-meta {
        grid-column: auto;
    }

    .market-row,
    .model-row {
        min-height: 92px;
    }

    .market-rank {
        display: none;
    }
}

/* Decision tools: deliberately share the board's editorial, non-dashboard language. */
.budget-lab {
    margin-bottom: 30px;
    padding: 28px;
    background: #fffdf8;
    border: 2px solid var(--ink);
    box-shadow: 8px 8px 0 #d9d4ca;
}

.feature-heading {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 24px;
}

.feature-number {
    display: grid;
    flex: 0 0 48px;
    height: 48px;
    place-items: center;
    color: #fff;
    background: var(--market-dark);
    font: 900 14px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.feature-heading p,
.workspace-card header p,
.budget-form label > span:first-child {
    margin: 0 0 6px;
    color: var(--brand);
    font: 850 9px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .13em;
}

.feature-heading h2,
.workspace-card h2 {
    margin: 0;
    color: var(--market-dark);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.035em;
}

.feature-heading span {
    display: block;
    max-width: 760px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.budget-form {
    display: grid;
    grid-template-columns: 1.35fr repeat(5, minmax(105px, 1fr)) auto;
    align-items: end;
    gap: 10px;
}

.budget-form label {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.budget-form input,
.budget-form select,
.money-input {
    width: 100%;
    min-width: 0;
    height: 48px;
    color: var(--ink);
    background: #f5f2ea;
    border: 1px solid #beb9ae;
    border-radius: 0;
    font: 750 13px var(--font, system-ui, sans-serif);
}

.budget-form input,
.budget-form select {
    padding: 0 12px;
}

.budget-form input:focus,
.budget-form select:focus,
.money-input:focus-within {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
    border-color: var(--brand);
}

.money-input {
    display: flex;
    align-items: center;
    background: #fff;
    border-width: 2px;
    border-color: var(--market-dark);
}

.money-input input {
    height: 44px;
    padding-right: 5px;
    background: transparent;
    border: 0;
    outline: 0 !important;
    font: 900 18px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.money-input b {
    padding-right: 12px;
    color: var(--brand);
    font: 900 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.budget-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    height: 48px;
    padding: 0 16px;
    color: #fff;
    background: var(--market-dark);
    border: 2px solid var(--market-dark);
    font-weight: 850;
    white-space: nowrap;
}

.budget-submit:hover { background: var(--brand); border-color: var(--brand); }
.budget-submit:disabled { cursor: wait; opacity: .65; }
.budget-submit b { color: #ff9a68; font-size: 19px; }

.budget-status {
    margin-top: 12px;
    color: var(--muted);
    font-size: 11px;
}

.budget-status.error { color: var(--market-red); }

.budget-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.budget-results[hidden] { display: none; }

.budget-lane {
    min-width: 0;
    background: #f5f2ea;
    border: 1px solid #c9c4b9;
}

.budget-lane > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    color: #fff;
    background: var(--market-dark);
}

.budget-lane.cheaper > header { background: #235d4d; }
.budget-lane.stretch > header { background: #7a3b2d; }
.budget-lane > header strong { font-size: 13px; }
.budget-lane > header span { color: rgba(255,255,255,.7); font-size: 10px; }

.budget-lane-empty {
    display: block;
    padding: 24px 15px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.budget-option {
    display: grid;
    gap: 11px;
    padding: 15px;
    border-top: 1px solid #d5d0c6;
}

.budget-option:first-of-type { border-top: 0; }
.budget-option-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.budget-option-head strong { font-size: 15px; line-height: 1.2; }
.budget-option-head b { font: 900 14px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.budget-option-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.budget-option-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.budget-option-chips span { padding: 4px 6px; background: #e6e1d7; font-size: 9px; font-weight: 750; }
.budget-option p { margin: 0; min-height: 46px; color: #555d61; font-size: 11px; line-height: 1.4; }
.budget-option-actions { display: flex; gap: 7px; }
.budget-option-actions button,
.spotlight-actions button,
.workspace-action {
    padding: 8px 10px;
    color: var(--market-dark);
    background: transparent;
    border: 1px solid currentColor;
    font-size: 10px;
    font-weight: 850;
}
.budget-option-actions button:first-child { color: #fff; background: var(--market-dark); }
.budget-option-actions button:hover,
.spotlight-actions button:hover,
.workspace-action:hover { color: #fff; background: var(--brand); border-color: var(--brand); }

.spotlight-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 9px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,.15);
}

.spotlight-actions button { color: #fff; }
.spotlight-actions button.active { color: var(--market-dark); background: #ffa172; border-color: #ffa172; }

.spotlight-history {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: stretch;
    gap: 16px;
}

.history-heading {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 13px;
    background: rgba(255,255,255,.06);
}

.history-heading span { display: grid; gap: 5px; }
.history-heading b { font-size: 12px; }
.history-heading em { color: #ffa172; font: 800 10px ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal; }

.history-chart {
    min-width: 0;
    min-height: 155px;
    padding: 7px 9px;
    color: #9da8a4;
    background: #10171b;
    border: 1px solid rgba(255,255,255,.12);
    font-size: 11px;
}

.history-chart svg { display: block; width: 100%; height: 155px; overflow: visible; }
.history-chart .chart-line { fill: none; stroke: #ff8d58; stroke-width: 3; }
.history-chart .chart-area { fill: url(#historyGradient); opacity: .55; }
.history-chart .chart-point { fill: #172127; stroke: #ff9a68; stroke-width: 3; }
.history-chart .chart-guide { stroke: rgba(255,255,255,.12); stroke-dasharray: 3 5; }
.history-chart text { fill: #cbd1ce; font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.history-chart .chart-price { fill: #fff; font-size: 11px; }

.market-workspace {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 16px;
    margin-bottom: 30px;
}

.workspace-card {
    overflow: hidden;
    min-width: 0;
    background: #fffdf8;
    border: 2px solid var(--ink);
}

.workspace-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.workspace-card h2 { font-size: 21px; }
.workspace-card header > span {
    padding: 6px 8px;
    color: #fff;
    background: var(--market-dark);
    font: 850 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

#refreshWatchlist {
    padding: 7px 9px;
    color: var(--market-dark);
    background: transparent;
    border: 1px solid currentColor;
    font-size: 10px;
    font-weight: 850;
}

.workspace-content { min-height: 170px; padding: 12px; }
.workspace-empty { display: grid; min-height: 145px; place-items: center; padding: 22px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.5; }

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

.compare-card,
.watch-row {
    position: relative;
    min-width: 0;
    padding: 13px;
    background: #f3f0e8;
    border: 1px solid #cec9be;
}

.compare-card > b { display: block; padding-right: 20px; font-size: 13px; }
.compare-card > strong { display: block; margin: 12px 0; font: 900 15px ui-monospace, SFMono-Regular, Menlo, monospace; }
.compare-metrics { display: grid; gap: 7px; }
.compare-metrics span { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.compare-metrics b { color: var(--ink); font-size: 10px; text-align: right; }
.remove-tool-item { position: absolute; top: 7px; right: 7px; width: 24px; height: 24px; color: var(--muted); background: transparent; border: 0; font-size: 18px; }
.remove-tool-item:hover { color: var(--market-red); }

.watch-list { display: grid; gap: 7px; }
.watch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-right: 34px; }
.watch-row > span { min-width: 0; }
.watch-row > span b { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.watch-row > span small { color: var(--muted); font-size: 9px; }
.watch-quote { display: grid; justify-items: end; gap: 2px; }
.watch-quote strong { font: 850 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.watch-quote em { color: var(--market-green); font: 800 9px ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal; }
.watch-quote em.down { color: var(--market-red); }

@media (max-width: 1180px) {
    .budget-form { grid-template-columns: repeat(3, 1fr); }
    .budget-primary-field { grid-column: span 2; }
    .budget-submit { grid-column: span 1; }
}

@media (max-width: 900px) {
    .budget-results,
    .market-workspace { grid-template-columns: 1fr; }
    .budget-lane { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .budget-lane > header { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .budget-lab { padding: 19px 15px; box-shadow: 5px 5px 0 #d9d4ca; }
    .feature-heading { gap: 12px; }
    .feature-number { flex-basis: 38px; height: 38px; }
    .feature-heading h2 { font-size: 24px; }
    .budget-form { grid-template-columns: 1fr 1fr; }
    .budget-primary-field,
    .budget-submit { grid-column: 1 / -1; }
    .budget-results { gap: 9px; }
    .budget-lane { grid-template-columns: 1fr; }
    .spotlight-history { grid-template-columns: 1fr; }
    .history-heading { min-height: 76px; }
    .compare-grid { grid-template-columns: 1fr; }
    .workspace-card > header { padding: 16px; }
}

@media (max-width: 420px) {
    .budget-form { grid-template-columns: 1fr; }
    .budget-primary-field,
    .budget-submit { grid-column: auto; }
    .spotlight-actions { flex-direction: column; }
    .spotlight-actions button { width: 100%; }
    .watch-row { grid-template-columns: 1fr; }
    .watch-quote { justify-items: start; }
}
