:root {
  color-scheme: light;
  --ink: #192230;
  --muted: #596a7d;
  --nav: #192231;
  --blue: #0751c4;
  --line: #d8dfe7;
  --surface: #fff;
  --background: #f2f4f7;
  --sidebar: 220px;
  --gutter: clamp(16px, 1.6vw, 24px);
  --bottom-nav: 60px;
  font: 16px/1.55 "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--background); }
button, input, select { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.25; letter-spacing: .02em; }
h1:focus { outline: none; }
h2 { font-size: 1.15rem; line-height: 1.35; }
h3 { font-size: 1.07rem; line-height: 1.4; }
.muted, .metric-note, .updated { font-size: .875rem; }
.muted, .metric-note { color: var(--muted); }
.muted { margin-top: 4px; }
.icon { display: inline-grid; align-items: center; justify-items: center; font-size: 1.2em; font-weight: 800; line-height: 1; flex: 0 0 1.15em; }
.sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: grid; place-items: center; height: 84px; }
.brand img { display: block; max-width: 72%; object-fit: contain; }
nav { display: grid; gap: 4px; padding: 4px 10px; }
nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 5px; text-decoration: none; color: #4b5f76; font-size: .99rem; }
nav a:hover { background: #eef2f7; }
nav a[aria-current] { background: var(--nav); color: white; font-weight: 700; }
.workspace { margin-left: var(--sidebar); min-width: 0; }
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 var(--gutter); }
.bottom-nav, .mobile-brand { display: none; }
.mock-label { background: #e9eef4; border-radius: 4px; color: #46586d; font-size: .75rem; font-weight: 700; padding: 3px 9px; }
.menu-toggle, .close-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 5px; font-size: 1.2rem; }
.menu-toggle { margin-left: -13px; color: var(--muted); }
.menu-toggle:hover, .close-button:hover { background: #eef2f7; }
@media (min-width: 901px) {
  body.menu-open .sidebar { display: none; }
  body.menu-open .workspace { margin-left: 0; }
  .scrim { display: none; }
}
main { padding: 16px var(--gutter) 28px; min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; }
.updated { color: var(--muted); }
.button { font-size: .93rem; font-weight: 700; display: inline-flex; gap: 5px; align-items: center; justify-content: center; min-height: 36px; white-space: nowrap; border: 1px solid var(--nav); border-radius: 8px; background: white; padding: 5px 12px; text-decoration: none; }
.button:hover { background: #eef2f7; }
.primary { background: var(--nav); color: white; }
.primary:hover { background: #304359; }
.period-area { margin-bottom: 13px; }
.segments { width: fit-content; max-width: 100%; display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: white; }
.segments button { background: transparent; border: none; border-radius: 999px; padding: 5px 19px; min-width: 76px; min-height: 35px; color: var(--muted); font-size: .94rem; white-space: nowrap; }
.segments button:hover { background: #eef2f7; }
.segments button[aria-pressed="true"] { background: var(--nav); color: white; font-weight: 700; }
.period-form, .filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.period-form { margin-top: 12px; }
label, legend { font-weight: 600; font-size: .875rem; }
label { display: grid; gap: 5px; min-width: 0; }
input, select { min-height: 36px; background: white; width: 100%; border: 1px solid #bcc8d5; border-radius: 7px; padding: 4px 8px; }
input[type="date"] { min-width: 139px; }
.form-error { color: #982b24; width: 100%; font-size: .875rem; }
.form-error:empty { display: none; }
.metric-grid { display: grid; gap: 12px; }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { background: var(--surface); border: 1px solid #e3e7ec; border-radius: 10px; padding: 9px 15px; min-width: 0; min-height: 96px; font-variant-numeric: tabular-nums; }
.metric-label { display: flex; align-items: center; gap: 6px; font-size: clamp(.9rem, 1vw, 1rem); }
.metric-label .icon { color: var(--blue); }
.metric-value { margin-top: 2px; font-size: clamp(1.7rem, 2.5vw, 2.3rem); line-height: 1.1; font-weight: 750; letter-spacing: -.025em; overflow-wrap: anywhere; }
.metric-value span { margin-left: 4px; font-size: .49em; letter-spacing: 0; }
.metric-value span:empty { display: none; }
.metric-note { margin-top: 3px; line-height: 1.3; font-size: .8rem; }
.secondary-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; background: var(--surface); border: 1px solid #e3e7ec; border-radius: 9px; }
.secondary-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; padding: 7px 13px; }
.secondary-metrics > div + div { border-left: 1px solid #e3e7ec; }
.secondary-metrics dt { color: var(--muted); font-size: .82rem; }
.secondary-metrics dd { font-size: 1rem; font-variant-numeric: tabular-nums; font-weight: 750; overflow-wrap: anywhere; }
.secondary-metrics small { margin-left: 3px; font-size: .75em; }
.panel { background: var(--surface); border: 1px solid #e3e7ec; border-radius: 10px; padding: 12px 15px; min-width: 0; }
.panel-header, .section-header { display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.section-header { margin-bottom: 7px; }
.sales-panel { margin-top: 14px; }
.sales-panel h2 { font-size: 1.1rem; }
.chart-controls { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.legend { display: inline-flex; gap: 7px; align-items: center; color: #4b5e74; font-size: .875rem; white-space: nowrap; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #293c52; }
.issued-dot { background: var(--blue); }
.empty { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 2px 8px; padding: 14px 0 6px; text-align: center; }
.empty p { grid-column: 1 / -1; }
.empty p { color: var(--muted); font-size: .9rem; }
.inbox { width: 20px; height: 17px; background: #82909f; clip-path: polygon(22% 0,78% 0,100% 57%,100% 100%,0 100%,0 57%,13% 57%,35% 57%,41% 72%,59% 72%,65% 57%,87% 57%,70% 17%,30% 17%,13% 57%,0 57%); }
.section, .dashboard-coupons { margin-top: 14px; }
.first-section { margin-top: 0; }
.coupon-chart { padding-block: 0; }
.coupon-chart > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; list-style: none; font-size: 1.1rem; font-weight: 750; }
.coupon-chart > summary::-webkit-details-marker { display: none; }
.chevron { width: 8px; height: 8px; flex: 0 0 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); margin-inline: 3px; }
.coupon-chart[open] > summary .chevron, [aria-expanded="true"] .chevron { transform: translateY(2px) rotate(225deg); }
.chart-content { border-top: 1px solid #e3e7ec; padding-block: 6px; }
.chart-wrap { position: relative; height: 196px; margin-top: 4px; }
.chart-wrap.chart-empty { height: 62px; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; }
.chart-tooltip { position: absolute; pointer-events: none; display: grid; gap: 3px; background: #192231; color: white; padding: 8px 11px; border-radius: 6px; font-size: .78rem; box-shadow: 0 2px 8px #19223129; }
.chart-values { margin-top: 5px; color: var(--muted); font-size: .85rem; }
.chart-values summary { width: fit-content; padding-block: 4px; }
.chart-table { max-height: 260px; margin-top: 8px; }
.chart-table th:first-child { text-align: left; }
.featured { display: grid; grid-template-columns: minmax(350px, 1fr) minmax(0, 1.3fr); align-items: center; gap: 14px; }
.product { display: flex; align-items: center; gap: 11px; min-width: 0; }
.product img { display: block; width: 104px; height: 76px; border-radius: 7px; object-fit: cover; }
.product-content { min-width: 0; flex: 1; }
.product-title { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.product-title h3 { font-size: 1.12rem; }
.product-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 10px; color: var(--muted); font-size: .82rem; }
.product-prices strong { color: var(--blue); font-size: .98rem; }
.product-listing, .product-terms { color: var(--muted); font-size: .79rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; color: #485c71; background: #edf1f5; white-space: nowrap; }
.badge.active { color: #13623d; background: #e5f4ed; }
.badge.stopped { color: #84521c; background: #fbefd9; }
.ticket-facts, .inline-totals { display: flex; flex-wrap: wrap; gap: 11px 24px; }
.ticket-facts dt, .inline-totals dt { color: var(--muted); font-size: .82rem; }
.ticket-facts dd { margin-top: 3px; font-size: .93rem; font-weight: 650; }
.ticket-facts .price { color: var(--blue); }
.product-performance { border-left: 1px solid #e5e9ee; padding-left: 14px; }
.product-performance .muted { margin-top: 0; }
.product-performance .inline-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.product-performance .inline-totals dd { font-size: 1.03rem; overflow-wrap: anywhere; }
.detail-performance { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e5e9ee; }
.inline-totals { margin-top: 11px; gap: 12px 22px; }
.inline-totals > div { flex: 1 0 95px; }
.inline-totals dd { font-size: 1.23rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.inline-totals small { margin-left: 3px; font-size: .65em; }
.information { display: flex; gap: 7px; margin-top: 6px; padding: 5px 9px; border: 1px solid #dbe6f6; border-radius: 7px; background: #edf4fd; color: #264b7c; font-size: .82rem; }
.information span { font-weight: 750; }
.history-panel { padding: 0; }
.history-note { margin-bottom: 7px; }
.button.history-toggle, .history-cards { display: none; }
.filters { padding: 10px 12px 7px; gap: 8px; }
.filters fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.filters legend { margin-bottom: 5px; padding: 0; }
.filter-dates { display: flex; align-items: center; gap: 6px; }
.filter-dates input { min-width: 0; }
.history-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 8px; color: var(--muted); padding: 0 12px 6px; font-size: .83rem; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; background: white; font-size: .83rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; white-space: nowrap; padding: 6px 8px; border-bottom: 1px solid #e6ebf1; }
thead th { background: #f6f8fb; color: #41546b; }
.history th:nth-child(-n+5), .history td:nth-child(4), .history td:nth-child(5) { text-align: left; }
.history tbody th { position: sticky; left: 0; background: white; }
.history thead th:first-child { position: sticky; left: 0; z-index: 1; }
.history tr:last-child > * { border-bottom: 0; }
.history .no-results { text-align: center; color: var(--muted); padding: 24px; }
.text-button { text-align: left; background: none; border: 0; padding: 1px 0; color: var(--blue); font-weight: 700; }
.text-button:hover { text-decoration: underline; }
dialog { color: var(--ink); width: min(680px, calc(100% - 28px)); max-height: calc(100dvh - 36px); overflow: auto; border: 1px solid var(--line); border-radius: 13px; padding: 22px; }
dialog::backdrop, .scrim { background: #17233866; }
.detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
dialog .ticket-facts { margin: 15px 0; }
#notice:not(:empty) { position: fixed; z-index: 10; right: 15px; bottom: 15px; border-radius: 8px; background: var(--nav); padding: 11px 14px; color: white; font-size: .88rem; }
@media (max-width: 1100px) {
  .featured { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .product-performance { border-left: 0; padding-left: 0; border-top: 1px solid #e5e9ee; padding-top: 6px; }
}
@media (max-width: 900px) {
  :root { --gutter: 18px; }
  .workspace { margin-left: 0; }
  .sidebar { visibility: hidden; transform: translateX(-100%); width: min(280px, 85vw); transition: transform .18s ease, visibility .18s; }
  .menu-open .sidebar { visibility: visible; transform: translateX(0); }
  .scrim { position: fixed; inset: 0; z-index: 4; border: 0; width: 100%; }
  .history-table { display: none; }
  .history-cards { display: grid; gap: 7px; list-style: none; margin: 0; padding: 3px 10px 10px; }
  .history-card { display: grid; gap: 3px; width: 100%; min-height: 44px; background: #f6f8fb; border: 1px solid #e3e7ec; border-radius: 8px; padding: 7px 9px; text-align: left; }
  .history-card:hover { background: #edf3fa; }
  .history-card-title { display: flex; align-items: center; gap: 4px 8px; min-width: 0; color: var(--blue); }
  .history-card-title .chevron { margin-left: auto; transform: rotate(-45deg); }
  .history-card-period, .history-card-metrics { color: var(--muted); font-size: .8rem; }
  .history-card-metrics { display: flex; flex-wrap: wrap; gap: 0 8px; }
  .history-card-metrics strong { color: var(--ink); }
}
@media (max-width: 640px) {
  :root { --gutter: 12px; }
  .sidebar, .menu-toggle, .scrim { display: none !important; }
  .topbar { height: calc(36px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .mobile-brand { display: block; width: 85px; height: auto; }
  .bottom-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; z-index: 5; inset: auto 0 0; min-height: calc(var(--bottom-nav) + env(safe-area-inset-bottom)); padding: 3px max(4px, env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: var(--surface); }
  .bottom-nav a { flex-direction: column; justify-content: center; gap: 3px; min-width: 0; min-height: 49px; padding: 3px 0; text-align: center; font-size: .75rem; line-height: 1.25; }
  .bottom-nav a .icon { flex-basis: auto; font-size: 1.55em; }
  main { padding-top: 8px; padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 14px); }
  #notice:not(:empty) { bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 9px); }
  .page-heading { gap: 6px; margin-bottom: 7px; }
  .page-title { display: grid; gap: 1px; }
  .page-heading .button { font-size: .83rem; padding-inline: 7px; }
  .updated { font-size: .75rem; line-height: 1.25; }
  .period-area { margin-bottom: 7px; }
  .period-area .segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .segments { gap: 2px; padding: 2px; }
  .segments button { padding: 4px 7px; min-width: 0; min-height: 44px; font-size: .9rem; }
  .button, input, select { min-height: 44px; }
  input, select { font-size: 1rem; }
  input[type="date"] { min-width: 0; }
  .period-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .period-form .button, .form-error { grid-column: 1 / -1; }
  .metric-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .metric { min-height: 66px; padding: 5px 9px; }
  .metric-label { font-size: .88rem; }
  .metric-value { font-size: clamp(1.6rem, 7vw, 2rem); }
  .metric-note { font-size: .75rem; margin-top: 2px; }
  .section, .dashboard-coupons, .sales-panel { margin-top: 8px; }
  .first-section { margin-top: 0; }
  .section-header { margin-bottom: 5px; }
  .section-header h2 { font-size: 1.03rem; }
  .section-header .muted { margin-top: 1px; font-size: .78rem; }
  .first-section .section-header > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 7px; }
  .first-section .section-header > p { flex-basis: 100%; }
  .secondary-metrics { margin-top: 6px; }
  .secondary-metrics > div { flex-wrap: wrap; align-items: baseline; padding: 4px 6px; }
  .secondary-metrics dt { font-size: .76rem; }
  .secondary-metrics dd { font-size: .9rem; }
  .panel { padding-inline: 9px; }
  .chart-controls { width: 100%; gap: 6px; }
  .chart-controls .grain { margin-left: auto; }
  .chart-controls .legend { font-size: .77rem; gap: 4px; }
  .chart-controls .grain button { min-width: 44px; }
  .chart-values summary { display: flex; align-items: center; gap: 5px; min-height: 44px; }
  .chart-values summary::before { content: "▸"; }
  .chart-values[open] summary::before { content: "▾"; }
  .featured { padding-block: 5px; gap: 4px; }
  .product { gap: 8px; }
  .product img { width: clamp(65px, 20vw, 90px); height: 63px; }
  .product-title h3 { font-size: 1.03rem; }
  .product-listing, .product-terms, .product-performance .muted { font-size: .75rem; line-height: 1.4; }
  .product-performance { padding-top: 4px; }
  .product-performance .inline-totals { gap: 3px; }
  .product-performance .inline-totals dt { font-size: .75rem; }
  .product-performance .inline-totals dd { font-size: .94rem; }
  .product-performance .inline-totals small { margin-left: 1px; font-size: .72em; }
  .information { font-size: .78rem; }
  .history-panel { padding: 0; }
  .button.history-toggle { display: inline-flex; }
  .history-heading:has(.history-toggle[aria-expanded="false"]) + #history-content { display: none; }
  .search-field { flex-basis: 100%; }
  .filters fieldset { width: 100%; }
  .filter-dates input { flex: 1; }
  .chart-table th, .chart-table td { white-space: normal; }
  .empty p { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}

