/* RoShopWatcher — Codex design study, 2026-10-24.
   Existing markup, API and local search history are preserved. */
:root {
  --font: "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ink: #182a3d;
  --muted: #5f7082;
  --accent: #285fd1;
  --line: #dfe5ed;
  --paper: #fff;
  font-family: var(--font);
  color: var(--ink);
  background: #f3f5f8;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 13px; line-height: 1.65; color: var(--ink); background: #f3f5f8; }
button, input, select { font-family: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, summary):focus-visible { outline: 3px solid #86a9f0; outline-offset: 3px; }
button { transition: background-color .12s, border-color .12s; }
a { color: #255bbb; text-underline-offset: 3px; }
.top {
  position: relative;
  padding: 18px max(24px, calc((100% - 1616px) / 2));
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.top h1 { font-size: 21px; font-weight: 700; letter-spacing: -.04em; color: var(--ink); margin: 0; }
.top h1::before { content: ""; display: inline-block; width: 10px; height: 20px; margin-right: 10px; border-radius: 3px; background: var(--accent); vertical-align: -2px; }
.top p { font-size: 11px; color: var(--muted); margin: 3px 0 0 20px; }
.workspace {
  width: min(1680px, 100%); max-width: 1680px; margin: 0 auto;
  padding: 24px 32px 56px;
  display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 28px; align-items: start;
}
.sidebar {
  min-width: 0;
  position: sticky; top: 20px; max-height: calc(100vh - 40px);
  overflow-y: auto; scrollbar-width: thin;
  padding: 20px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 3px 10px #1d355006;
}
.search-panel { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 24px; }
.search-panel > * { min-width: 0; }
.search-title { color: var(--ink); font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.search-composer {
  width: 100%; min-width: 0;
  height: 42px; padding: 3px 4px 3px 12px; gap: 8px;
  border: 1px solid #b9c7da; border-radius: 8px; background: #fff; box-shadow: none;
}
.search-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #285fd114; }
.search-composer input { flex: 1 1 0; width: 0; min-width: 0; font-size: 14px; color: var(--ink); background: transparent; }
.search-composer button { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 6px; background: var(--accent); color: #fff; }
.search-composer button:hover { background: #194bae; }
.search-hint { font-size: 10px; line-height: 1.6; color: var(--muted); margin: 7px 0 0; }
.filter-fields { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 10px; }
.filter-heading { font-size: 12px; font-weight: 700; color: var(--ink); margin: 0 0 0; }
.filter-fields label { min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 5px; font-size: 11px; color: var(--muted); }
.filter-fields input, .filter-fields select {
  width: 100%; min-width: 0; height: 36px; padding: 0 7px;
  border: 1px solid #d4dce7; border-radius: 6px; background: #fbfcfe; color: var(--ink); font-size: 12px;
}
.filter-fields input:hover, .filter-fields select:hover { border-color: #9bacbf; }
.shop-type-field, .date-range-field { grid-column: 1 / -1; }
.date-range-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.date-range-field legend { padding: 0; margin: 0 0 5px; color: var(--muted); font-size: 11px; }
.date-range-inputs { display: flex; align-items: center; gap: 3px; min-height: 38px; padding: 0 4px; border: 1px solid #d4dce7; border-radius: 6px; background: #fbfcfe; }
.date-range-inputs:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #285fd114; }
.filter-fields .date-range-inputs input { flex: 1 1 0; width: 0; min-width: 0; padding: 0 1px; border: 0; background: transparent; font-size: 11px; }
.date-range-inputs span { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.history { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.history-head { margin-bottom: 18px; }
.history-head h2 { color: var(--ink); font-size: 12px; font-weight: 700; }
.history-help { margin: -10px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.history-group { margin-top: 18px; }
.history-group h3 { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .04em; margin-bottom: 6px; }
.history-list { gap: 3px; }
.history-row { border-radius: 6px; }
.history-row:hover { background: #f0f4fb; }
.history-drag-handle { position: relative; display: inline-flex; flex: 0 0 36px; width: 36px; height: 38px; align-items: center; justify-content: center; overflow: hidden; border-radius: 6px; cursor: grab; user-select: none; touch-action: none; }
.history-drag-handle img { display: block; width: 36px; height: 36px; max-width: 100%; object-fit: contain; pointer-events: none; }
.history-drag-handle:hover, .history-drag-handle:focus-visible { background: #fff0f2; outline: 1px solid #f1a7b2; }
.history-drag-handle:active { cursor: grabbing; }
.history-row.history-dragging { opacity: .45; }
.history-row.history-drop-target { outline: 1px dashed #3978ca; outline-offset: -1px; background: #eaf2ff; }
.history-query { padding: 8px 6px; font-size: 12px; line-height: 1.5; color: #30465f; background: transparent; }
.history-query:hover { color: #194bae; background: transparent; }
.history-action { color: #7a899a; background: transparent; }
.history-action:hover { color: var(--accent); background: #e5edfb; }
.history-action.pinned { color: #a86e0c; }
.history-clear { font-size: 10px; color: var(--muted); background: transparent; }
.history-clear:hover { color: #a52d3b; background: #fff1f2; }
.history-empty { color: #6a798a; font-size: 11px; line-height: 1.7; }
.results { min-width: 0; }
[hidden] { display: none !important; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 18px; }
.result-heading h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.025em; }
#result-context { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.aggregation-rules { max-width: 100%; margin-left: auto; }
.aggregation-rules > summary { color: #285fa1; font-size: 11px; padding: 4px 0; list-style: none; }
.aggregation-rules > summary::-webkit-details-marker { display: none; }
.aggregation-rules > summary::after { content: ' ＋'; }
.aggregation-rules[open] > summary::after { content: ' −'; }
.aggregation-rules[open] { flex-basis: 100%; }
.aggregation-rules[open] > summary { text-align: right; }
.aggregation-rules > div { padding: 8px 18px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 11px; line-height: 1.9; }
.result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-tile { min-width: 0; padding: 16px; border: 1px solid #d8e3f4; border-radius: 11px; background: #f6f9ff; color: #285fa1; }
.stat-label { display: block; font-size: 11px; margin-bottom: 3px; }
.stat-tile strong { font-family: var(--mono); font-size: 27px; line-height: 1.6; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-unit { margin-left: 5px; font-size: 11px; }
.stat-note { display: block; margin-top: 4px; font-size: 10px; line-height: 1.7; }
.stat-tile-pending { background: #fff8e9; border-color: #efd18e; color: #875500; }
.result-empty { padding: 28px 12px 34px; text-align: center; }
.empty-search-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%; background: #edf1f7; color: #68778a; font-size: 34px; line-height: 1; }
.result-empty h3 { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.result-empty > p { max-width: 600px; margin: 0 auto; color: var(--muted); font-size: 12px; line-height: 1.9; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.empty-actions button { padding: 10px 16px; border: 1px solid #ced9e8; border-radius: 8px; background: #fff; color: #304e77; font-size: 12px; font-weight: 500; }
.empty-actions button:hover { background: #edf3ff; border-color: #9ab6e6; }
.empty-actions .pending-action { background: #fff8e9; color: #875500; border-color: #efd18e; }
.empty-actions .pending-action:hover { background: #fff0cb; border-color: #ddb55d; }
#pending-section { scroll-margin-top: 20px; }
#summary:empty { display: none; }
.right-note {
  margin: 0 0 18px; padding: 0 2px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted); font-size: 11px; line-height: 1.8;
}
.panel {
  margin-bottom: 20px; padding: 22px 24px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 3px 10px #1d355004;
}
.results > .panel:first-of-type { border-top: 3px solid var(--accent); }
#summary { color: #30465f; font-size: 13px; font-weight: 500; line-height: 1.85; padding-bottom: 4px; }
.panel > h2 { color: var(--ink); font-size: 15px !important; font-weight: 700; letter-spacing: .01em; margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.8; }
.sub { color: var(--muted); font-size: 11px; line-height: 1.7; margin-top: 5px; }
.panel > p.sub { margin: 0 0 18px; font-size: 11px; }
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #b7c4d5 transparent; }
table { width: 100%; min-width: 940px; border-collapse: collapse; table-layout: auto; }
th {
  padding: 11px 10px; border-bottom: 1px solid #d8e1ec;
  background: #f5f7fb; color: #596d85; font-size: 11px; font-weight: 500;
  text-align: left; white-space: nowrap;
}
td {
  padding: 17px 10px; border-top: 0; border-bottom: 1px solid #e9edf3;
  color: #263c54; font-family: var(--font); font-size: 12px; vertical-align: top; line-height: 1.75;
}
tbody tr:hover { background: #f7faff; }
tbody tr:last-child td { border-bottom: 0; }
.results > .panel:first-of-type th:nth-child(3),
.results > .panel:first-of-type th:nth-child(4),
.results > .panel:first-of-type td:nth-child(3),
.results > .panel:first-of-type td:nth-child(4) { text-align: right; white-space: nowrap; }
.results > .panel:first-of-type td:nth-child(3) { font-size: 14px; font-weight: 700; color: #172b45; font-variant-numeric: tabular-nums; }
.results > .panel:first-of-type td:nth-child(4) { font-variant-numeric: tabular-nums; }
.results > .panel:first-of-type td:nth-child(2) { min-width: 175px; font-weight: 500; color: #152b48; }
.results > .panel:first-of-type td:nth-child(5) { min-width: 155px; overflow-wrap: anywhere; }
.results > .panel:first-of-type td:nth-child(6) { min-width: 170px; }
.results > .panel:first-of-type td:nth-child(7) { min-width: 144px; font-variant-numeric: tabular-nums; }
.shop { font-weight: 500; }
.item-name-trigger { display: inline; max-width: 100%; padding: 0; border: 0; border-radius: 2px; background: transparent; color: #254f91; font: inherit; font-weight: 600; text-align: left; line-height: inherit; text-decoration: underline dotted #9eb2cf; text-underline-offset: 4px; overflow-wrap: anywhere; cursor: pointer; }
.item-name-trigger:hover { background: transparent; color: #123c7a; text-decoration-style: solid; }
.modifier-chip { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px; width: fit-content; max-width: 100%; margin: 5px 0 0; padding: 2px 8px; border: 1px solid; border-radius: 7px; font-size: 11px; line-height: 1.65; font-weight: 400; overflow-wrap: anywhere; }
.modifier-card { color: #a13b70; background: #fff1f8; border-color: #e8bdd3; }
.modifier-enchant { color: #376d3d; background: #f1f8eb; border-color: #c1d8b1; }
.modifier-option { color: #285c8b; background: #edf6ff; border-color: #bcd4eb; }
.modifier-unknown { color: #5f6573; background: #f4f5f7; border-color: #cfd3dc; border-style: dashed; }
.modifier-option-unknown { border-style: dashed; }
.modifier-kind { font-size: 9px; opacity: .85; margin-right: 2px; }
.modifier-chip.item-description-trigger { cursor: help; }
.item-description-popover { position: fixed; z-index: 100; display: flex; flex-direction: column; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 1px solid #c1cddd; border-radius: 11px; background: #fffdf6; color: #403d34; box-shadow: 0 12px 40px #182a3d30; overflow: hidden; }
.item-description-head { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; color: #fff; background: #546f96; }
.item-description-head > div { flex: 1; min-width: 0; }
.item-description-head strong { display: block; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.item-description-head span { display: block; margin-top: 3px; color: #e3eaf5; font-size: 10px; }
.item-description-head button { flex: 0 0 26px; width: 26px; height: 26px; padding: 0; border-radius: 5px; background: #ffffff17; color: #fff; font-size: 20px; line-height: 1; }
.item-description-head button:hover { background: #ffffff35; }
.item-description-body { min-height: 0; max-height: min(440px, 60vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 15px 18px; font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.item-description-foot { margin: 0; padding: 9px 14px; border-top: 1px solid #e9e2d2; color: #79705b; font-size: 10px; line-height: 1.7; }
.rotool-inline-link { color: #255bbb; font-weight: 500; text-decoration-color: #a4bde6; text-underline-offset: 3px; }
.rotool-inline-link:hover { color: #103e8c; background: transparent; text-decoration-color: currentColor; }
.badge { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 10px; line-height: 1.8; font-weight: 500; color: #256c50; background: #e8f4ed; }
.badge.buy { color: #a33f50; background: #fbecef; }
.badge.pending { color: #86580a; background: #fff2d9; border: 1px solid #f2d9a6; }
.pending-notice { padding: 11px 14px; background: #fffbf2; border-left: 3px solid #e6b957; border-radius: 0 6px 6px 0; color: #796033; font-size: 11px; line-height: 1.9; }
.pending-table { min-width: 860px; }
.pending-table td { font-size: 12px; }
.pending-reason { color: #87611e; font-size: 11px; }
.pending-diagnostic, .position-history { font-size: 10px; line-height: 1.8; margin-top: 6px; color: #65758a; }
details summary { cursor: pointer; }
.position-history summary, .pending-diagnostic summary { color: #526d90; }
.position-history[open], .pending-diagnostic[open] { padding: 8px; background: #f4f7fb; border-radius: 5px; }
.panel td.empty { padding: 56px 24px; text-align: center; color: var(--muted); font-size: 13px; }
.pagination { justify-content: flex-end; gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }
.pagination button { min-width: 76px; height: 34px; padding: 0 14px; border: 1px solid #d6dfeb; border-radius: 6px; color: #304e77; background: #fff; font-size: 12px; font-weight: 500; }
.pagination button:hover:not(:disabled) { color: #194bae; background: #edf3ff; border-color: #9ab6e6; }
.pagination button:disabled { color: #8a95a3; background: #f5f6f8; cursor: default; }
#page-label { font-size: 11px; }
#capture-diagnostics > summary, #packet-diagnostics > summary { color: #52677f; font-size: 12px; }
.rotool-pane { border-color: var(--line); box-shadow: -12px 0 40px #182a3d14; }
.rotool-pane-head { background: #f7f9fc; border-color: var(--line); }
body.rotool-open .workspace { width: calc(100% - var(--rotool-pane-width)); max-width: none; margin: 0; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; padding: 20px; }
@media (max-width: 1200px) {
  .result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 290px minmax(0, 1fr); padding: 20px; gap: 20px; }
  .panel { padding: 18px; }
}
@media (max-width: 980px) {
  .workspace { grid-template-columns: 280px minmax(0, 1fr); padding: 16px; gap: 16px; }
  .sidebar { padding: 16px; }
  body.rotool-open .workspace { display: none; }
}
@media (max-width: 760px) {
  .result-heading h2 { font-size: 17px; }
  .stat-tile { padding: 12px; }
  .stat-tile strong { font-size: 24px; }
  .result-empty { padding: 24px 0; }
  .top { padding: 16px; }
  .workspace { display: flex; flex-direction: column; width: 100%; padding: 14px; gap: 18px; }
  .sidebar { position: static; width: 100%; max-height: none; overflow: visible; }
  .results { width: 100%; }
  .panel { padding: 16px; }
  .right-note { margin-bottom: 14px; }
  .pagination { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

/* CASE-0007 public page: preserve Python layout with only the two approved datasets. */
.result-stats{grid-template-columns:repeat(3,minmax(0,1fr))}

.error-message{margin:0 0 12px;padding:12px 14px;border:1px solid #f0b8b8;border-radius:8px;background:#fff4f4;color:#9e2424;font-size:13px}
.error-message{margin:0 0 12px;padding:10px 14px;border:1px solid #d98b8b;border-radius:8px;background:#fff4f4;color:#8f2020;font-size:13px}.result-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
.error-message{color:#536276;background:#f7f9fc;border-color:#dfe5ed}

/* Keep all three summary values aligned when labels or notes wrap. */
.result-stats .stat-tile{display:grid;grid-template-rows:18px 36px 17px;row-gap:2px;align-content:start;padding:10px 16px}
.result-stats .stat-label{margin:0;font-size:11px;line-height:18px;overflow-wrap:anywhere}
.result-stats .stat-value{align-self:center;line-height:1;white-space:nowrap}
.result-stats .stat-value strong{font-size:27px;line-height:1.3}
.result-stats .stat-note{margin:0;font-size:10px;line-height:17px;overflow-wrap:anywhere}
.page-jump{position:fixed;z-index:40;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));display:grid;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(8px);transition:opacity .2s ease,transform .2s ease,visibility 0s linear .2s}
.page-jump.is-visible{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);transition-delay:0s}
.page-jump button{display:grid;place-items:center;width:42px;height:42px;padding:0;border:1px solid rgba(103,157,217,.5);border-radius:10px;background:rgba(196,222,250,.55);color:#245b94;font-size:23px;line-height:1;box-shadow:0 3px 12px #18304b24}
.page-jump button:hover{background:rgba(196,222,250,.8)}.page-jump button:focus-visible{outline:3px solid #e2a831;outline-offset:3px}
@media(min-width:981px){body.rotool-open .page-jump{right:calc(var(--rotool-pane-width) + 16px)}}
@media(max-width:980px){body.rotool-open .page-jump{display:none}}
@media(max-width:640px){.result-stats{grid-template-columns:1fr}.result-stats .stat-tile{grid-template-rows:auto auto auto;row-gap:4px}.result-stats .stat-value strong{font-size:24px}}

@media(min-width:641px) and (max-width:1000px){.result-stats .stat-tile{grid-template-rows:32px 34px 30px;padding:10px 12px}}
@media(prefers-reduced-motion:reduce){.page-jump{transition:none;transform:none}}
