/* Marketplace uses the same quiet navy-and-gold palette as the timers. */
.market-page main { max-width: 1440px; padding-top: 24px; }
.market-page main > *, .market-page * { animation: none !important; }
.market-page h1 { font: 400 clamp(26px, 3vw, 32px)/1.2 var(--display); margin: 0 0 8px; letter-spacing: -.02em; }
.market-page h2 { font-size: 19px; letter-spacing: .01em; text-transform: none; color: var(--text); }
.market-page h3 { font-size: 14px; margin: 0 0 8px; }
.market-page a { color: var(--gold); }
.market-intro { padding: 0; }
.intro-copy { color: var(--dim); margin: 0; max-width: 550px; font-size: 14px; }
.source-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.source-banner p { color: var(--dim); font-size: 12px; margin: 0; }
.source-banner a { margin-left: auto; white-space: nowrap; font-size: 12px; }
.market-page label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--dim); }
.market-page input, .market-page select { font: 400 13px var(--ui); color: var(--text); background: #101526; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; max-width: 100%; }
.market-page input::placeholder { color: var(--dim); }
.market-nav { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.market-nav a { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13px; text-decoration: none; color: var(--dim); }
.market-nav a[aria-current="page"] { border-color: var(--gold); color: var(--gold); }
.market-nav span { font-size: 11px; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.workspace { min-height: 420px; }
.workspace > .hint { max-width: 85ch; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.section-head .hint { font-size: 12px; margin: 0; }
.filters { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; gap: 10px; }
.filters input { width: 100%; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-count { font-size: 12px; margin: 12px 0; }
.table-wrap { position: relative; width: calc(100% - 2px); margin: 1px; overflow-x: auto; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.market-page table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
.market-page th { font-weight: 500; font-size: 11px; letter-spacing: .06em; color: var(--dim); background: #ffffff03; padding: 12px 14px; white-space: nowrap; text-transform: uppercase; }
.market-page td { padding: 11px 14px; border-top: 1px solid #2a315099; }
.market-page tbody tr:hover { background: #ffffff02; }
.item-cell { display: flex; align-items: center; gap: 12px; min-width: 175px; }
.item-icon { width: 38px; height: 38px; object-fit: contain; background: #090d19; border: 1px solid var(--line); border-radius: 6px; }
.item-name { min-width: 44px; min-height: 36px; border: 0; background: transparent; padding: 0; color: var(--text); text-align: left; cursor: pointer; font: 500 14px/1.4 var(--ui); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.item-name:hover { color: var(--gold); }
.item-meta, .price-meta { display: block; color: var(--dim); font-size: 12px; margin-top: 4px; }
.rarity { color: #b5bdd7; }
.rarity[data-grade="Rare"] { color: #7cc7ff; }
.rarity[data-grade="Epic"] { color: #c084fc; }
.rarity[data-grade="Unique"] { color: var(--gold); }
.price-number { display: block; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-missing { color: var(--dim); font-weight: 400; }
.watch-button { width: 44px; min-height: 44px; background: none; color: var(--dim); border: 0; padding: 7px; cursor: pointer; font-size: 21px; line-height: 1; }
.watch-button[aria-pressed="true"] { color: var(--gold); }
.item-table td:first-child, .item-table th:first-child { padding-right: 0; width: 44px; }
.item-table td:last-child { width: 90px; }
.category-col { color: var(--dim); font-size: 12px; }
.market-page .btn { font-size: 12px; padding: 8px 12px; white-space: nowrap; text-decoration: none; }
.market-page button:disabled { opacity: .4; cursor: default; }
.pagination { display: flex; align-items: center; justify-content: end; gap: 16px; margin-top: 14px; }
.pagination span { font-size: 11px; color: var(--dim); }
.watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); gap: 12px; margin-top: 18px; }
.watch-grid > .empty { grid-column: 1 / -1; }
.empty p { margin: 0 0 14px; }
.watch-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #11162ab3; }
.watch-card header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.watch-card .item-cell { min-width: 0; }
.watch-card .price-number { font-size: 22px; }
.watch-card footer { text-align: left; font-size: 11px; padding: 14px 0 0; }
.target-hit { color: var(--live); }
.estimate-bar { display: flex; align-items: center; gap: 20px; justify-content: space-between; background: #11162a; border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-top: 16px; }
.estimate-bar .total-label { display: block; color: var(--dim); font-size: 12px; }
.estimate-bar strong { display: block; font-size: 25px; font-variant-numeric: tabular-nums; }
.estimate-bar p { flex: 1; margin: 0; }
.plan-table { min-width: 590px; }
.plan-table input { width: 84px; padding: 7px 8px; }
.shopping-budget { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 40px; padding: 22px 0 28px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.budget-notes, .budget-breakdown { min-width: 0; }
.budget-cost { margin: 16px 0; }
.budget-cost strong { display: block; font-size: clamp(24px, 2.8vw, 34px); font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.budget-cost > span { display: block; font-size: 12px; color: var(--dim); margin-top: 4px; }
.budget-notes .hint, .budget-breakdown .hint { font-size: 12px; margin: 8px 0 12px; }
.coverage-bar { display: flex; height: 8px; gap: 2px; margin: 12px 0 22px; overflow: hidden; }
.coverage-fresh { background: var(--live); }
.coverage-stale { background: var(--gold); }
.coverage-missing { background: var(--line); }
.budget-change { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; margin: 0; }
.budget-breakdown { margin: 0; }
.budget-bars { list-style: none; margin: 18px 0 0; padding: 0; }
.budget-bars li { display: block; padding: 0; border: 0; border-radius: 0; background: none; margin-bottom: 12px; }
.budget-bar-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.budget-bar-label .price-link { min-width: 0; text-align: left; line-height: 1.5; }
.budget-bar-label > span { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.budget-bar-track { height: 8px; background: var(--line); }
.budget-bar-track > span { display: block; height: 100%; background: var(--rift); }
.price-link { min-height: 44px; min-width: 44px; background: none; border: 0; color: var(--gold); padding: 6px 0; font: inherit; cursor: pointer; text-align: inherit; text-decoration: underline; text-underline-offset: 3px; }
.item-table td:nth-child(4), .item-table th:nth-child(4), .plan-table td:nth-child(4), .plan-table th:nth-child(4), .history-table td:nth-child(2), .history-table th:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-hint { display: none; }
.recipe-settings { display: block; margin-top: 22px; }
.recipe-settings fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.recipe-settings legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 12px; }
.recipe-fields { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(0, 1fr)); gap: 14px; }
.sale-assumptions { margin-top: 14px; }
.sale-assumptions summary { cursor: pointer; color: var(--dim); font-size: 13px; padding-block: 10px; }
.sale-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 600px; margin-top: 8px; }
.ingredient-form { display: flex; align-items: end; gap: 10px; margin: 24px 0 12px; }
.ingredient-form label { flex: 1 1 240px; min-width: 0; max-width: 420px; }
.recipe-results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.recipe-results > div { padding: 15px; border: 1px solid var(--line); background: #11162a; border-radius: 8px; }
.recipe-results span { font-size: 12px; color: var(--dim); }
.recipe-results strong { display: block; font-size: 21px; margin-top: 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.data-panel { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 18px; }
.data-panel summary { font-size: 12px; color: var(--dim); cursor: pointer; }
.data-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 22px; }
.data-columns p { max-width: 72ch; font-size: 12px; color: var(--dim); }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 15px 0; }
.error-message { color: #ffb4bb; font-size: 12px; background: #ff5d7310; border: 1px solid #ff5d7340; border-radius: 6px; padding: 12px; }
.market-page dialog { width: min(620px, calc(100vw - 28px)); padding: 24px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.dialog-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.dialog-head h2 { line-height: 1.4; font-size: 23px; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0; }
.dialog-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-left: auto; }
.dialog-actions a { font-size: 11px; }
.dialog-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
#price-form, #target-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 12px; }
#price-form label, #target-form label { flex: 1; min-width: 160px; }
.history-table { margin-top: 0; }
.history-table td { font-variant-numeric: tabular-nums; }
.history-chart { margin: 12px 0 18px; }
.market-summary { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0; }
.error-text { color: var(--pvp); }
#market-feed-status a { color: var(--gold); }
.history-chart figcaption { margin-bottom: 12px; font-size: 12px; }
.history-plot { overflow-x: auto; }
.history-plot svg { display: block; width: 100%; height: auto; }
.chart-axis { fill: var(--dim); font: 13px var(--ui); font-variant-numeric: tabular-nums; }
.chart-value-axis { font-size: 11px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-price-line { fill: none; stroke: var(--rift); stroke-width: 2; stroke-linejoin: round; }
.chart-price-dot { fill: var(--rift); stroke: var(--bg); stroke-width: 1.5; }
#history-rows .btn { padding: 4px 8px; }
#market-status { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; align-items: center; gap: 14px; background: #192037; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px #0008; color: var(--text); padding: 12px 18px; max-width: calc(100vw - 32px); font-size: 12px; }
#market-status:empty { display: none; }
@media (max-width: 760px) {
  .market-page main { padding-top: 18px; }
  .source-banner a { margin-left: 0; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters label { min-width: 0; }
  .search-label { grid-column: 1 / -1; }
  .filters label:last-child { grid-column: 1 / -1; }
  .market-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; overflow: visible; }
  .market-nav a { font-size: 12px; }
  .section-head { align-items: start; flex-direction: column; gap: 8px; }
  .category-col { display: none; }
  .market-page td { padding: 10px 8px; }
  .market-page th { padding: 11px 8px; }
  .item-table td:first-child { width: 48px; padding-left: 8px; }
  .item-table .item-cell { min-width: 0; gap: 8px; }
  .item-icon { height: 30px; width: 30px; }
  .item-table .item-icon { display: none; }
  .item-table .item-name { font-size: 13px; }
  .item-table .price-number { font-size: 12px; }
  .item-table td:last-child { width: 62px; padding-right: 12px; }
  .item-table .btn { font-size: 12px; padding: 7px 8px; }
  .item-table .price-meta { max-width: 98px; }
  .estimate-bar { align-items: start; flex-wrap: wrap; padding: 14px; }
  .estimate-bar p { min-width: 150px; }
  .shopping-budget { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .budget-bar-label { flex-wrap: wrap; gap: 0 12px; padding-bottom: 8px; }
  .budget-bar-label .price-link { flex: 1 1 160px; }
  .recipe-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .output-field { grid-column: 1 / -1; }
  .scroll-hint { display: block; margin: 12px 0 8px; font-size: 12px; }
  .recipe-results { grid-template-columns: 1fr 1fr; }
  .data-columns { grid-template-columns: 1fr; gap: 15px; }
  .market-page dialog { padding: 18px; }
  #price-form, #target-form { display: grid; grid-template-columns: minmax(0, 1fr); }
  .dialog-links { margin-left: 0; }
  .market-page .brand span { font-size: 16px; }
  .site-nav a { padding: 6px 8px; font-size: 12px; }
}
@media (pointer: coarse), (max-width: 760px) {
  .market-page input, .market-page select { font-size: 16px; }
  .item-name { min-height: 44px; }
  .source-banner a { display: inline-flex; align-items: center; min-height: 44px; }
}
