:root {
  font-family: "Inter", "Yu Gothic UI", Meiryo, sans-serif;
  color: #172b24;
  background: #f2f4ee;
  font-variant-numeric: tabular-nums;
  --green: #225344;
  --line: #dce4d9;
  --muted: #50645b;
  --soft: #eaf0e8;
  --paper: #fefffc;
}
* { box-sizing: border-box; }
body { margin: 0; display: grid; min-height: 100dvh; grid-template-columns: 222px minmax(0, 1fr); }
[hidden] { display: none !important; }
h1, h2, dl, dd, p { margin: 0; }
button, input, select { font: inherit; }
button { min-height: 43px; border: 1px solid #cddbd0; border-radius: 8px; background: #fff; color: inherit; padding: 5px 13px; font-weight: 700; cursor: pointer; }
button:not(:disabled):hover { border-color: #82a08d; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #986538; outline-offset: 2px; }
a { color: var(--green); }
.primary { background: var(--green); border-color: var(--green); color: #fff; }
.sidebar { padding: 27px 16px 20px; border-right: 1px solid var(--line); background: #fbfcf8; display: flex; flex-direction: column; gap: 32px; }
.brand { display: flex; gap: 11px; align-items: center; padding-left: 4px; }
.brand-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; color: white; background: var(--green); font-size: 21px; font-weight: 780; }
.brand div { display: grid; gap: 2px; }
.brand div span { color: var(--muted); font-size: 12px; }
nav { display: grid; gap: 6px; }
nav button { text-align: left; background: transparent; border-color: transparent; }
nav button[aria-current="page"] { background: var(--soft); color: var(--green); border-color: #d5e3d5; }
.google-link { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.google-link h2 { margin: 0; font-size: 14px; }
.google-link p { margin: 0; color: var(--muted); }
.google-link p.error { color: #b42318; }
.google-link a { text-underline-offset: 3px; }
.button-link { min-height: 43px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--green); color: #fff; font-weight: 700; text-decoration: none; }
.side-bottom { display: grid; gap: 8px; margin-top: auto; padding: 4px; font-size: 13px; }
.side-bottom a { min-height: 44px; display: flex; align-items: center; text-underline-offset: 3px; }
#management-access { width: min(500px, 92vw); }
#management-access > * + * { margin-top: 16px; }
#management-access-status { line-height: 1.65; }
main { width: min(100%, 1460px); min-width: 0; margin-inline: auto; padding: 36px clamp(18px, 3vw, 48px); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
h1 { font-size: clamp(24px, 3.2vw, 36px); line-height: 1.2; letter-spacing: -.04em; }
.page-head p { color: var(--muted); margin-top: 9px; font-size: 14px; }
.page-head > button { white-space: nowrap; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.filters fieldset { border: 0; padding: 3px; margin: 0; background: var(--soft); border-radius: 8px; display: flex; gap: 2px; }
.filters fieldset label { position: relative; cursor: pointer; display: block; }
.filters fieldset input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.filters fieldset span { display: grid; place-items: center; padding-inline: 15px; min-height: 39px; border-radius: 6px; }
.filters fieldset input:checked + span { background: #fff; color: var(--green); box-shadow: 0 1px 3px #12351d24; }
.filters fieldset input:focus-visible + span { outline: 2px solid #986538; }
.date-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-left: auto; }
label { display: grid; gap: 5px; font-weight: 650; font-size: 13px; }
input[type="date"], input[type="search"], input[type="number"], input[list], .text-fields input:not([type="checkbox"]), select {
  min-width: 0; min-height: 43px; border: 1px solid #cddbd0; border-radius: 8px; padding: 6px 9px; background: white; color: inherit; font-size: 16px;
}
.search { flex: 1; min-width: min(100%, 240px); }
.feedback { margin-block: 12px; color: var(--muted); font-size: 14px; }
.feedback:empty { display: none; }
.feedback.error { color: #852f23; }
.summary, .charts { display: grid; gap: 12px; margin-bottom: 14px; }
.summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary > div, .card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.summary > div { min-width: 0; padding: 14px; }
.summary > div:first-child { color: #fff; background: var(--green); border-color: var(--green); }
.summary dt { font-size: 13px; font-weight: 650; margin-bottom: 7px; opacity: .85; }
.summary dd { font-weight: 810; font-size: clamp(21px, 2.4vw, 35px); letter-spacing: -.035em; overflow-wrap: anywhere; }
.charts { grid-template-columns: 1fr 1fr; }
.charts .card { min-width: 0; padding: 16px; }
h2 { font-size: 18px; }
.chart { min-height: 155px; padding-top: 12px; }
.chart-empty { min-height: 130px; display: grid; place-items: center; text-align: center; font-size: 14px; color: var(--muted); }
.plot { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: 6px; padding-bottom: 3px; }
.axis { position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 120px; color: var(--muted); font-size: 11px; }
.chart-scroll { overflow-x: auto; min-width: 0; }
.bars { display: flex; align-items: stretch; gap: 3px; min-height: 145px; }
.bar-column { flex: 1 0 9px; min-width: 0; display: grid; grid-template-rows: 120px 23px; }
.bar-track { display: flex; align-items: end; justify-content: center; background: linear-gradient(to bottom, #dce4d9 1px, transparent 1px 49%, #edf0eb 49% 50%, transparent 50% calc(100% - 1px), #dce4d9 calc(100% - 1px)); }
.bar-fill { width: 72%; height: var(--value); max-width: 36px; background: #34735d; border-radius: 3px 3px 0 0; }
.chart-count .bar-fill { background: #8b6839; }
.bar-column > span { font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; padding-top: 5px; }
.report-table h2 { padding: 16px 16px 4px; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; white-space: nowrap; }
th, td { border-bottom: 1px solid #edf0eb; padding: 10px 13px; }
th { font-weight: 650; color: var(--muted); background: #fafcf8; }
tbody tr:last-child td { border-bottom: 0; }
.product-title { display: flex; align-items: center; gap: 10px; }
.product-title strong { display: block; white-space: normal; }
.product-title small { color: var(--muted); }
.thumb, .thumb-empty { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 6px; background: var(--soft); object-fit: contain; }
.pill { display: inline-block; border-radius: 6px; background: var(--soft); padding: 3px 7px; color: var(--green); font-size: 12px; font-weight: 700; }
.pill.inactive { color: var(--muted); background: #eff0eb; }
dialog { border: 1px solid var(--line); border-radius: 16px; width: min(94vw, 690px); max-height: 90dvh; padding: 22px; background: var(--paper); color: inherit; }
dialog::backdrop { background: #142c2366; }
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.editor-head button { width: 44px; border: 0; font-size: 23px; padding: 0; }
.editor-fields { display: grid; grid-template-columns: minmax(170px, 2fr) minmax(190px, 3fr); gap: 16px; }
.photo-field, .text-fields { display: grid; align-content: start; gap: 11px; min-width: 0; }
.photo-preview { display: grid; place-items: center; min-height: 136px; border: 1px dashed #b7c8bb; border-radius: 9px; background: var(--soft); color: var(--muted); font-size: 13px; }
.photo-preview img { width: 100%; height: 150px; object-fit: contain; }
.photo-field input[type="file"] { max-width: 100%; min-height: 42px; }
.check { display: flex; gap: 7px; align-items: center; min-height: 36px; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.editor-actions { display: flex; justify-content: end; gap: 8px; margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .sidebar { padding: 12px 16px; gap: 8px; border: 0; border-bottom: 1px solid var(--line); }
  nav { display: flex; flex-wrap: wrap; }
  .side-bottom { display: flex; padding: 0; margin: 0; }
  main { padding-block: 23px; }
}
@media (max-width: 650px) {
  .date-fields { margin: 0; }
  .summary { grid-template-columns: 1fr 1fr; }
  .charts, .editor-fields { grid-template-columns: 1fr; }
  .page-head { align-items: start; flex-direction: column; }
}
