:root {
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-300: #7dd3fc;
  --sky-700: #0369a1;
  --sky-800: #075985;
  --slate-50: #f8fafc;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --coral: #dd684f;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--sky-100); color: var(--slate-900); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI", Meiryo, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.page-container { width: min(1100px, calc(100% - 32px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { background: var(--sky-300); border-bottom: 1px solid var(--slate-200); position: sticky; top: 0; z-index: 40; }
.site-header-inner { width: min(1100px, calc(100% - 32px)); min-height: 88px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { display: block; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.brand a { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.tagline { color: var(--slate-500); font-size: 16px; }
.desktop-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.desktop-nav a:hover, .desktop-nav .active, .mobile-nav .active { color: var(--sky-800); }
.desktop-nav .active, .mobile-nav a.active { font-weight: 650; }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--slate-300); border-radius: 12px; background: transparent; color: var(--slate-900); font-size: 21px; }
.mobile-nav { position: absolute; right: 16px; top: 76px; width: 220px; padding: 16px; background: white; border: 1px solid var(--slate-200); border-radius: 16px; box-shadow: 0 16px 38px rgba(15,23,42,.16); }
.mobile-nav a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 16px; font-weight: 600; }
.mobile-nav a:hover { background: var(--slate-50); }

.title-band { padding: 32px 0 40px; background: white; border-block: 1px solid var(--slate-200); }
.title-band h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; }
.title-band p { margin: 4px 0 0; color: var(--slate-500); font-size: 14px; line-height: 1.6; }
.page-main { padding-block: 32px 20px; }

.workspace { display: grid; grid-template-columns: 320px minmax(0,1fr); min-height: 670px; background: white; border: 1px solid var(--slate-200); border-radius: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.06); overflow: hidden; }
[hidden] { display: none !important; }
.workspace-toolbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; background: white; border-bottom: 1px solid var(--slate-200); }
.mode-switch { display: flex; gap: 3px; }
.mode-button { border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--slate-700); padding: 9px 15px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.mode-button:hover { background: var(--slate-50); }
.mode-button.active { background: var(--sky-100); border-color: #bae6fd; color: var(--sky-800); }
.tooltip-details-control { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 9px; border-radius: 9px; color: var(--slate-700); font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.tooltip-details-control:hover { background: var(--slate-50); }
.tooltip-details-control:focus-within { outline: 2px solid #0ea5e9; outline-offset: 2px; }
.tooltip-details-control input { width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--sky-700); cursor: pointer; }
.controls { padding: 24px; border-right: 1px solid var(--slate-200); background: var(--slate-50); }
.control-section { margin-bottom: 22px; }
.control-section > label, .two-up label, .label-row label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
.count { color: var(--slate-500); font-weight: 400; }
input, select { width: 100%; min-height: 42px; border: 1px solid var(--slate-300); background: white; color: var(--slate-900); border-radius: 10px; padding: 8px 11px; font: inherit; font-size: 14px; outline: none; }
input:focus, select:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.18); }
.combobox { position: relative; }
.combobox-results { position: absolute; z-index: 35; top: calc(100% + 5px); width: 100%; max-height: 390px; overflow-y: auto; padding: 5px; background: white; border: 1px solid var(--slate-300); border-radius: 12px; box-shadow: 0 16px 38px rgba(15,23,42,.18); }
.category-browser > .combobox-results.browse-results { position: static; width: 100%; max-height: 300px; margin-top: 10px; }
.browse-group-heading { padding: 9px 10px 5px; color: var(--slate-500); font-size: 11px; font-weight: 700; border-bottom: 1px solid var(--slate-200); }
.item-result { display: block; width: 100%; padding: 10px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--slate-900); font: inherit; text-align: left; cursor: pointer; }
.item-result:hover, .item-result.active { background: var(--sky-50); outline: 1px solid #bae6fd; }
.item-result strong, .item-result span, .item-result small, .item-result em { display: block; }
.item-result strong { font-size: 14px; font-weight: 650; }
.item-result span { margin-top: 2px; color: var(--slate-700); font-size: 12px; }
.item-result small { margin-top: 3px; color: var(--slate-500); font-size: 11px; }
.item-result em { margin-top: 4px; color: var(--sky-800); font-size: 11px; font-style: normal; }
.combobox-empty { margin: 0; padding: 13px 11px; color: var(--slate-500); font-size: 12px; }
.selected-item { min-height: 17px; margin: 7px 0 0; color: var(--slate-500); font-size: 12px; }
.category-browser { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--slate-200); }
.category-browser summary { color: var(--sky-700); font-size: 12px; font-weight: 650; cursor: pointer; }
.category-browser label { display: block; margin: 9px 0 5px; color: var(--slate-500); font-size: 11px; font-weight: 650; }
.category-browser select { min-height: 38px; }
.advanced-filters { padding-top: 10px; border-top: 1px solid var(--slate-200); }
.advanced-filters summary { color: var(--slate-700); font-size: 13px; font-weight: 650; cursor: pointer; }
.advanced-filter-content { padding-top: 12px; }
.advanced-filter-content > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
select[aria-invalid="true"] { border-color: #b91c1c; }
.hint { margin: 7px 0 0; color: var(--slate-500); font-size: 11px; line-height: 1.45; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.text-button { border: 0; background: none; color: var(--sky-700); padding: 0 0 8px; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.text-button:hover { color: var(--sky-800); text-decoration: underline; }
.date-range-row { display: grid; grid-template-columns: 38px minmax(82px,1fr) minmax(112px,1.35fr); align-items: center; gap: 8px; margin-bottom: 8px; }
.range-name { color: var(--slate-500); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.validation { margin: 8px 0 0; color: #b91c1c; font-size: 12px; line-height: 1.4; }
.quick-ranges { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 4px; margin: 0 0 10px; }
.quick-range-button { min-width: 0; min-height: 34px; border: 1px solid var(--slate-300); border-radius: 8px; background: white; color: var(--slate-700); padding: 6px 3px; font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.quick-range-button:hover { border-color: #7dd3fc; color: var(--sky-800); }
.quick-range-button.active { border-color: #7dd3fc; background: var(--sky-100); color: var(--sky-800); }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary { width: 100%; border: 0; border-radius: 12px; background: var(--sky-700); color: white; padding: 12px; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: background .15s; }
.primary:hover { background: var(--sky-800); }
.primary:disabled { opacity: .55; cursor: wait; }

.results { min-width: 0; padding: 28px 30px 20px; }
.result-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--sky-700); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.result-head h2 { margin: 0 0 4px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.result-head p:last-child { margin: 0; color: var(--slate-500); font-size: 13px; }
.result-head .series-item-ja { margin: 0 0 3px; color: var(--slate-700); font-size: 14px; }
.status { padding: 6px 10px; color: var(--slate-500); border: 1px solid var(--slate-200); border-radius: 999px; font-size: 11px; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); margin: 20px 0; border-block: 1px solid var(--slate-200); }
.metrics div { padding: 15px 0; }
.metrics div + div { padding-left: 20px; border-left: 1px solid var(--slate-200); }
.metrics span { display: block; color: var(--slate-500); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.metrics strong { display: block; margin-top: 5px; font-size: 20px; font-weight: 650; }
.chart-panel + .chart-panel { margin-top: 7px; }
.chart-label { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--slate-500); font-size: 11px; }
.chart-label b { font-weight: 600; }
.chart-help { margin: 0 0 5px; color: var(--slate-500); font-size: 10px; line-height: 1.4; }
.workspace.seasonal-mode #price-panel .chart-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.workspace.seasonal-mode #price-panel .chart-label { justify-content: flex-start; gap: 7px; white-space: nowrap; }
.workspace.seasonal-mode #price-panel .chart-help { text-align: right; }
.canvas-wrap { position: relative; height: 260px; }
.workspace:not(.seasonal-mode) .canvas-wrap { height: 390px; }
.canvas-wrap.short { height: 155px; }
.workspace.seasonal-mode .canvas-wrap { height: 285px; }
.workspace.seasonal-mode .canvas-wrap.short { height: 215px; }
.seasonal-chart-tooltip { position: fixed; z-index: 100; max-width: min(440px, calc(100vw - 16px)); padding: 6px; border-radius: 6px; background: rgba(0,0,0,.8); color: white; font: 12px/1.2 Arial, sans-serif; pointer-events: none; white-space: normal; }
.seasonal-chart-tooltip[hidden] { display: none; }
.seasonal-tooltip-title { margin-bottom: 2px; font-weight: 700; }
.seasonal-tooltip-group + .seasonal-tooltip-group { margin-top: 2px; }
.seasonal-tooltip-series { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.seasonal-tooltip-detail { padding-left: 15px; }
.seasonal-tooltip-marker { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; background: var(--tooltip-marker-color); }
.seasonal-tooltip-marker.marker-circle { border-radius: 50%; }
.seasonal-tooltip-marker.marker-rectRot { transform: rotate(45deg) scale(.78); }
.seasonal-tooltip-marker.marker-triangle { width: 0; height: 0; background: transparent; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 10px solid var(--tooltip-marker-color); }
.seasonal-tooltip-marker.marker-line { width: 13px; height: 0; background: transparent; border-top: 2px dashed var(--tooltip-marker-color); }
.low-volume-warning { display: flex; align-items: flex-start; gap: 7px; }
.low-volume-warning > span:first-child { flex: none; font-size: 14px; line-height: 1.15; }
.low-volume-warning strong { font-weight: 700; }
.navigator-panel { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--slate-200); }
.navigator-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 2px; color: var(--slate-500); font-size: 10px; }
.navigator-heading span { font-weight: 650; }
.navigator-heading b { font-weight: 500; }
.navigator-wrap { position: relative; height: 92px; pointer-events: none; }
.methodology { margin: 18px 0 0; border: 1px solid var(--slate-200); border-radius: 8px; background: #fff; }
.methodology summary { min-height: 44px; display: flex; align-items: center; padding: 0 16px; cursor: pointer; color: var(--slate-900); font-weight: 700; }
.methodology-content { padding: 0 16px 14px; color: var(--slate-700); font-size: 13px; line-height: 1.55; }
.methodology-content p { margin: 9px 0 0; }
.series-visibility { margin: 14px 0 0; padding: 0; border: 0; }
.series-visibility legend { margin-bottom: 7px; color: var(--slate-500); font-size: 11px; font-weight: 650; }
.series-visibility > div { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.series-visibility label { display: inline-flex; align-items: center; gap: 6px; color: var(--slate-700); font-size: 12px; cursor: pointer; }
.series-visibility input { width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: var(--sky-700); }
.benchmark-note { margin: 12px 0 0; padding: 10px 12px; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 10px; color: var(--slate-500); font-size: 11px; line-height: 1.5; }
.handoff { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; background: var(--sky-50); border: 1px solid #bae6fd; border-radius: 10px; color: var(--slate-700); font-size: 12px; }
.handoff span { width: 3px; height: 28px; flex: none; background: var(--coral); }
.handoff p, .warning { margin-block: 0; }
.warning { margin-top: 10px; padding: 10px 12px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; color: #9a3412; font-size: 12px; }
.empty { padding: 70px 20px; color: var(--slate-500); text-align: center; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 14px 2px; color: var(--slate-500); font-size: 11px; }

@media (max-width: 1100px) {
  .tagline { display: none; }
  .desktop-nav { gap: 18px; }
}

@media (max-width: 1024px) {
  .site-header { position: static; }
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .menu-button { display: inline-grid; place-items: center; }
  .workspace { grid-template-columns: 1fr; }
  .mode-button { min-height: 44px; }
  .controls { border-right: 0; border-bottom: 1px solid var(--slate-200); }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .controls .primary { align-self: end; margin-bottom: 22px; }
  .category-browser summary, .advanced-filters summary { min-height: 44px; padding-block: 13px; }
  .quick-range-button { min-height: 44px; }
  .series-visibility label { min-height: 44px; padding-block: 6px; }
}

@media (max-width: 640px) {
  .page-container, .site-header-inner { width: min(100% - 24px, 1100px); }
  .site-header-inner { min-height: 72px; }
  .workspace-toolbar { padding: 9px; }
  .mode-switch { flex: 1; }
  .mode-button { flex: 1; padding-inline: 8px; }
  .tooltip-details-control { display: none !important; }
  .brand-logo { width: 48px; height: 48px; }
  .title-band { padding: 24px 0 26px; }
  .title-band h1 { font-size: 20px; }
  .page-main { padding-top: 20px; }
  .controls { display: block; padding: 20px; }
  .results { padding: 22px 16px 18px; }
  .result-head { display: block; }
  .status { display: inline-block; margin-top: 10px; }
  .metrics { grid-template-columns: 1fr; }
  .metrics div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--slate-200); }
  .two-up { grid-template-columns: 1fr; }
  .date-range-row { grid-template-columns: 38px minmax(76px,.8fr) minmax(118px,1.2fr); }
  .canvas-wrap { height: 235px; }
  .workspace:not(.seasonal-mode) .canvas-wrap { height: 300px; }
  .canvas-wrap.short { height: 145px; }
  .workspace.seasonal-mode .canvas-wrap { height: 270px; }
  .workspace.seasonal-mode .canvas-wrap.short { height: 210px; }
  .navigator-wrap { height: 82px; }
  .workspace.seasonal-mode #price-panel .chart-heading-row { display: block; }
  .workspace.seasonal-mode #price-panel .chart-help { text-align: left; }
  .series-visibility > div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
  .series-visibility label { align-items: center; line-height: 1.35; }
  footer { display: block; line-height: 1.8; }
}
