:root { color-scheme:light; --price-green:#4f9875; --price-deep:#236b50; --price-soft:#e8f4ec; --price-line:#d7e5dc; --price-muted:#63786f; --price-red:#c44954; }
[hidden] { display:none!important; }
html { background:#edf5ef; }
body { color:#18352b; background:radial-gradient(circle at 8% 0,rgba(126,185,146,.2),transparent 30rem),linear-gradient(180deg,#f7fbf7,#eef6f0); }
.site-header { border-bottom-color:#d7e6df; }
.brand { color:#183d30; }
.brand small,.status-pill { color:#66756f; }
.status-pill { border-color:#cfe0d8; background:#fff; }
.primary-nav a { color:#597168; }
.primary-nav a:hover { color:var(--price-deep); }
.primary-nav a.is-active { color:var(--price-deep); border-bottom-color:var(--price-green); }
.eyebrow { color:var(--price-green); }
.prices-page { width:min(1240px,calc(100% - 40px)); max-width:none; margin:0 auto; padding:18px 0 48px; }
.prices-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:14px; }
.prices-hero > div:first-child { display:flex; align-items:baseline; gap:14px; min-width:0; }
.prices-hero h1 { margin:0; color:#194f3b; font:700 1.75rem/1.2 "STKaiti","KaiTi",serif; white-space:nowrap; }
.prices-hero p { margin:0; color:var(--price-muted); font-size:.83rem; line-height:1.5; }
.mode-tabs { display:flex; padding:3px; border:1px solid var(--price-line); border-radius:11px; background:#fff; }
.mode-tab { border:0; border-radius:8px; background:transparent; padding:8px 14px; color:#607069; font:inherit; font-weight:700; }
.mode-tab.is-active { background:var(--price-deep); color:#fff; }
.mode-tab:disabled { cursor:not-allowed; opacity:.58; }
.mode-tab small { display:block; font-size:10px; font-weight:500; }
.prices-layout { display:grid; grid-template-columns:270px minmax(0,1fr); gap:18px; align-items:start; }
.filter-card,.results-card { background:#fff; border:1px solid var(--price-line); border-radius:20px; box-shadow:0 14px 38px rgba(27,79,60,.07); }
.filter-card { padding:19px; position:sticky; top:16px; }
.filter-heading,.results-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.filter-heading h2,.results-heading h2 { margin:0; font-size:1.15rem; }
.text-button { border:0; background:none; color:var(--price-green); font:inherit; cursor:pointer; }
.search-field,.select-field { display:grid; gap:7px; margin-top:18px; font-size:.88rem; font-weight:700; }
.search-field input,.select-field select { width:100%; min-width:0; border:1px solid #ccdcd4; border-radius:11px; padding:11px 12px; background:#fbfcf8; font:inherit; color:#20372e; }
.filter-card fieldset { border:0; padding:0; margin:19px 0 0; }
.filter-card legend { font-size:.88rem; font-weight:700; margin-bottom:8px; }
.choice-row { display:flex; flex-wrap:wrap; gap:7px; }
.choice-row button { border:1px solid #cfe0d8; border-radius:9px; padding:7px 10px; background:#fff; color:#41554d; font:inherit; font-size:.83rem; cursor:pointer; }
.choice-row button.is-selected { border-color:var(--price-deep); background:var(--price-deep); color:#fff; font-weight:700; }
.results-card { padding:20px; min-width:0; }
.results-heading p { margin:5px 0 0; color:var(--price-muted); font-size:.82rem; }
.refresh-button,.state-panel button,.pagination button { border:1px solid var(--price-green); border-radius:10px; padding:8px 13px; background:#fff; color:var(--price-deep); font:inherit; font-weight:700; cursor:pointer; }
.refresh-button:disabled { opacity:.45; cursor:wait; }
.stale-notice { margin-top:14px; padding:10px 12px; border-radius:10px; background:#fff5df; color:#805b15; font-size:.86rem; }
.summary-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:16px 0; }
.summary-grid div { padding:12px; border-radius:13px; background:#f4f9f7; }
.summary-grid span { display:block; color:var(--price-muted); font-size:.78rem; }
.summary-grid strong { display:block; margin-top:4px; font-size:1.18rem; }
.state-panel { min-height:250px; display:grid; place-content:center; justify-items:center; gap:10px; text-align:center; color:var(--price-muted); }
.loading-dot { width:28px; height:28px; border:3px solid var(--price-line); border-top-color:var(--price-green); border-radius:50%; animation:spin .8s linear infinite; }
.quote-header,.quote-row { display:grid; grid-template-columns:minmax(130px,1.3fr) minmax(60px,.7fr) minmax(78px,.8fr) minmax(62px,.65fr) minmax(62px,.65fr) minmax(72px,.65fr); align-items:center; gap:8px; }
.quote-header { padding:0 15px 8px; color:var(--price-muted); font-size:.76rem; text-align:right; }
.quote-header span:first-child { text-align:left; }
.quote-header span:nth-child(2) { text-align:center; }
.quote-list { display:grid; gap:9px; }
.quote-row { padding:13px 14px; border:1px solid #e1ece7; border-radius:14px; }
.quote-server { min-width:0; }
.quote-server-title { display:flex; align-items:baseline; flex-wrap:wrap; column-gap:7px; min-width:0; }
.quote-server strong,.quote-server span { display:block; overflow-wrap:anywhere; }
.quote-server-title strong { min-width:0; }
.quote-server span { color:var(--price-muted); font-size:.78rem; margin-top:3px; }
.quote-server .quote-rank { flex:none; margin:0; color:var(--price-deep); font-size:.76rem; font-weight:800; white-space:nowrap; }
.tag { justify-self:center; padding:4px 8px; border-radius:999px; background:#f0f5f3; color:#61716b; font-size:.76rem; }
.tag.is-hot { background:#fff0f1; color:#b53e48; }
.quote-price { font-size:1.16rem; color:var(--price-deep); font-weight:800; text-align:right; }
.change { text-align:right; font-variant-numeric:tabular-nums; }
.change.up { color:var(--price-red); } .change.down { color:var(--price-green); }
.quote-action { text-align:right; }
.quote-history-button { border:1px solid #b9d4c8; border-radius:9px; padding:7px 10px; background:#fff; color:var(--price-deep); font:inherit; font-size:.8rem; font-weight:700; cursor:pointer; white-space:nowrap; }
.quote-history-button:hover { background:#f0f7f4; }
.quote-history-button:focus-visible,.gold-history-dialog button:focus-visible,.gold-history-point:focus-visible { outline:3px solid rgba(43,122,90,.28); outline-offset:2px; }
.pagination { display:flex; align-items:center; justify-content:center; gap:14px; margin-top:18px; color:var(--price-muted); font-size:.86rem; }
.pagination button { white-space:nowrap; }
.pagination button:disabled { opacity:.42; cursor:not-allowed; }
.source-note { text-align:center; color:var(--price-muted); font-size:.79rem; margin:16px 0 0; }
.source-note a { color:var(--price-deep); }
.gold-history-dialog { width:min(820px,calc(100% - 32px)); max-width:none; max-height:calc(100vh - 32px); padding:0; border:0; border-radius:20px; color:#20372e; background:#fff; box-shadow:0 24px 70px rgba(20,57,43,.28); }
.gold-history-dialog::backdrop { background:rgba(16,38,30,.52); backdrop-filter:blur(2px); }
.gold-history-panel { padding:22px; }
.gold-history-panel > header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.gold-history-panel h2,.gold-history-panel p { margin:0; }
.gold-history-panel h2 { margin-top:3px; color:#194f3b; font-size:1.3rem; }
.gold-history-eyebrow { color:var(--price-green); font-size:.78rem; font-weight:800; letter-spacing:.04em; }
.gold-history-close,.gold-history-state button { border:1px solid #b9d4c8; border-radius:9px; padding:8px 12px; background:#fff; color:var(--price-deep); font:inherit; font-weight:700; cursor:pointer; }
.gold-history-granularities { display:flex; gap:8px; margin:18px 0 10px; }
.gold-history-granularities button { min-width:64px; border:1px solid #cfe0d8; border-radius:9px; padding:8px 14px; background:#fff; color:#41554d; font:inherit; font-weight:700; cursor:pointer; }
.gold-history-granularities button[aria-pressed="true"] { border-color:var(--price-deep); background:var(--price-deep); color:#fff; }
.gold-history-state { min-height:250px; display:grid; place-content:center; justify-items:center; gap:12px; color:var(--price-muted); text-align:center; }
.gold-history-state.is-loading::before { content:""; width:28px; height:28px; border:3px solid var(--price-line); border-top-color:var(--price-green); border-radius:50%; animation:spin .8s linear infinite; }
.gold-history-chart { width:100%; min-height:190px; }
.gold-history-chart svg { display:block; width:100%; height:auto; overflow:visible; }
.gold-history-grid { stroke:#e2ece7; stroke-width:1; }
.gold-history-axis-label { fill:#74857d; font-size:11px; }
.gold-history-line { fill:none; stroke:#2b7a5a; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.gold-history-dot { fill:#fff; stroke:#2b7a5a; stroke-width:3; vector-effect:non-scaling-stroke; pointer-events:none; }
.gold-history-point { fill:transparent; stroke:transparent; cursor:pointer; }
.gold-history-tooltip { position:fixed; z-index:2; width:max-content; max-width:min(320px,calc(100vw - 24px)); box-sizing:border-box; margin:0!important; padding:8px 10px; border:1px solid #c9dfcf; border-radius:9px; background:#fff; color:#315246; box-shadow:0 8px 24px rgba(25,57,34,.18); font-size:.82rem; font-weight:700; line-height:1.35; overflow-wrap:anywhere; pointer-events:none; visibility:hidden; }
.gold-history-tooltip.is-visible { visibility:visible; }
.gold-history-window { margin-top:8px!important; color:var(--price-muted); font-size:.78rem; line-height:1.5; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width:1100px) { .prices-layout { grid-template-columns:1fr; } .filter-card { position:static; } }
@media (max-width:760px) {
  .prices-page { width:min(100% - 24px,1240px); padding:14px 0 40px; } .prices-hero { align-items:flex-start; flex-direction:column; gap:10px; }
  .prices-hero > div:first-child { flex-direction:column; align-items:flex-start; gap:4px; }
  .prices-hero h1 { font-size:1.5rem; }
  .mode-tabs { width:100%; } .mode-tab { flex:1; } .summary-grid { grid-template-columns:repeat(2,1fr); }
  .quote-header { display:none!important; } .quote-row { grid-template-columns:minmax(0,1fr) auto; gap:7px; }
  .quote-server { grid-column:1/2; grid-row:1; } .tag { grid-column:2/3; grid-row:1; justify-self:end; } .quote-price { grid-column:2/3; grid-row:2; }
  .change { font-size:.82rem; text-align:left; } .change::before { color:var(--price-muted); } .change.day { grid-column:1; grid-row:2; } .change.week { grid-column:1; grid-row:3; } .change.day::before { content:'1日 '; } .change.week::before { content:'7日 '; }
  .quote-action { grid-column:2; grid-row:3; align-self:end; }
  .state-panel { min-height:190px; }
  .gold-history-dialog { width:calc(100% - 20px); max-height:calc(100vh - 20px); border-radius:16px; }
  .gold-history-panel { padding:16px; }
  .gold-history-state { min-height:210px; }
}
@media (max-width:390px) { .filter-card,.results-card { border-radius:16px; padding:15px; } .summary-grid { gap:7px; } .quote-row { padding:11px; } .pagination { gap:8px; } .pagination button { padding:7px 9px; } .gold-history-panel { padding:14px; } .gold-history-granularities button { flex:1; min-width:0; } }
@media (prefers-reduced-motion:reduce) { .loading-dot { animation:none; } }

/* Both price modes share the same result and filter shell. */
.prices-filter-toggle { display:none; }
#gold-market-view .prices-layout .filter-card,
#item-market-view .prices-layout .filter-card {
  max-height:none;
  overflow:visible;
}
.item-market-layout > .item-market-results {
  grid-column:1;
  grid-row:1;
  min-width:0;
}
.item-market-layout > .item-market-filter-card {
  grid-column:2;
  grid-row:1;
}
.item-market-filter-card .item-market-filters {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
  padding:0;
  border:0;
  background:transparent;
  margin-top:18px;
}
.item-market-filter-card .item-market-category-filter { grid-column:auto; }
.item-market-filter-card .item-market-filters label,
.item-market-filter-card .item-market-server-picker,
.item-market-filter-card .item-market-category-filter {
  gap:7px;
  color:#20372e;
  font-size:.88rem;
}
.item-market-filter-card .item-market-filters input {
  height:44px;
  border-color:#ccdcd4;
  border-radius:11px;
  background:#fbfcf8;
}
.item-market-filter-card .item-market-category-buttons { gap:7px; }
.item-market-filter-card .item-market-category-buttons button {
  min-height:36px;
  padding:7px 10px;
  border-color:#cfe0d8;
  font-size:.83rem;
}
.item-market-filter-card .item-market-category-buttons button[aria-pressed="true"] {
  border-color:var(--price-deep);
  background:var(--price-deep);
  color:#fff;
}
.prices-layout .filter-card :is(button,input):focus-visible,
.prices-filter-toggle:focus-visible { outline:3px solid rgba(43,122,90,.38); outline-offset:2px; }

@media (max-width:1100px) {
  .prices-layout { display:flex; flex-direction:column; }
  .prices-filter-toggle {
    display:block;
    order:0;
    align-self:stretch;
    width:100%;
    box-sizing:border-box;
    position:sticky;
    top:0;
    z-index:2;
    min-height:44px;
    padding:9px 16px;
    border:1px solid var(--price-deep);
    border-radius:11px;
    background:var(--price-deep);
    color:#fff;
    box-shadow:0 3px 10px rgba(24,55,38,.18);
    font:inherit;
    font-weight:700;
    cursor:pointer;
  }
  .prices-filter-toggle:hover,
  .prices-filter-toggle[aria-expanded="true"] { background:#1d5d45; border-color:#1d5d45; color:#fff; }
  .prices-filter-toggle:active { background:#174d39; border-color:#174d39; color:#fff; }
  .prices-layout > .filter-card { order:1; width:100%; box-sizing:border-box; position:static; }
  .prices-layout > :is(.results-card,.item-market-results) { order:2; width:100%; box-sizing:border-box; }
}

.prices-filter-dialog {
  position:fixed;
  margin:0;
  padding:0;
  box-sizing:border-box;
  max-width:none;
  border:1px solid var(--price-line);
  border-radius:0 0 16px 16px;
  background:#fff;
  box-shadow:0 20px 55px rgba(24,55,38,.25);
  overflow:hidden;
  max-height:90vh;
  max-height:90dvh;
}
.prices-filter-dialog[open] { display:flex; flex-direction:column; }
.prices-filter-dialog::backdrop { background:rgba(22,39,29,.42); }
.prices-filter-dialog-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding-top:env(safe-area-inset-top); }
#prices-filter-dialog .filter-card {
  position:static;
  grid-column:auto;
  grid-row:auto;
  width:100%;
  box-sizing:border-box;
  max-height:none;
  overflow:visible;
  padding:16px;
  border:0;
  border-radius:0;
  box-shadow:none;
}
#prices-filter-dialog :is(.item-market-server-options,.cbg-prices-server-options) {
  position:static;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  margin-top:5px;
}
.prices-filter-dialog-footer {
  flex:none;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top:1px solid var(--price-line);
  background:#fff;
}
.prices-filter-dialog-footer button {
  width:100%;
  min-height:44px;
  border:1px solid var(--price-line);
  border-radius:10px;
  background:var(--price-soft);
  color:var(--price-deep);
  font:inherit;
  font-weight:700;
  cursor:pointer;
}

/* Current-filter sharing: the tabs and copy action wrap within narrow screens. */
.prices-hero { flex-wrap:wrap; }
.prices-hero > div:first-child { flex:1 1 180px; }
.prices-hero .mode-tabs { flex:0 1 auto; }
.prices-share-button,.prices-share-feedback button { min-height:44px; padding:10px 18px; border:1px solid #b6d8c8; border-radius:12px; background:#e8f4ed; color:#20563e; font:inherit; cursor:pointer; }
.prices-share-button:focus-visible,.prices-share-feedback button:focus-visible,.prices-share-feedback textarea:focus-visible { outline:3px solid #478665; outline-offset:2px; }
.prices-share-feedback { min-width:0; margin:0 0 12px; color:#3e6552; }
.prices-share-feedback p { margin:0; overflow-wrap:anywhere; }
.prices-share-feedback p:not(:empty) { margin:8px 0; }
#prices-share-fallback { max-width:100%; padding:12px; border:1px solid #cce0d3; border-radius:12px; background:#f3f8f5; }
#prices-share-fallback label { display:block; margin-bottom:8px; }
#prices-share-link { display:block; width:100%; min-width:0; box-sizing:border-box; resize:vertical; overflow-wrap:anywhere; padding:10px; border:1px solid #b6d8c8; border-radius:8px; font:inherit; }
#prices-share-close { margin-top:8px; }
@media (max-width:760px) { .prices-hero > div:first-child,.prices-hero .mode-tabs { flex:none; } .prices-hero .mode-tabs { align-self:stretch; } .prices-share-button { align-self:flex-end; } }
