:root {
  --brand: #2f6b5a;
  --brand-soft: #dcede7;
  --accent: #c89b5a;
  --ink: #1f2933;
  --caution: #b45309;
  --page: #f8faf9;
  --line: #d7e6e0;
  --font: "IBM Plex Sans JP", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.top-inner, .wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 18px;
}
.top-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.logo { margin: 0; font-size: 0.82rem; font-weight: 800; color: var(--brand); letter-spacing: 0.04em; }
.top h1 { margin: 4px 0 0; font-size: 1.35rem; font-weight: 650; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 800;
}
.layout { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 210px 1fr; }
.side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 12px;
}
.side a {
  display: block;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #35534a;
}
.side a.is-on { background: var(--brand); color: #fff; }
.main { padding: 18px 20px 28px; }
.note {
  background: #fff7ed;
  border: 1px solid #f3ddc0;
  color: var(--caution);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.foot {
  background: #fff;
  border-top: 1px solid var(--line);
  text-align: center;
  color: #667;
  font-size: 0.75rem;
  padding: 14px;
}
.btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid #cfe0da; }
.btn.ghost.is-on { background: #eef7f3; border-color: #9fc4b7; font-weight: 800; }
.btn.block { width: 100%; min-height: 46px; margin-top: 12px; }
.btn:disabled { opacity: 0.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.card, .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.card h3, .panel h3 { margin: 0 0 8px; font-size: 1.05rem; }
.muted { color: #5b6b66; }
.effect { color: var(--brand); font-weight: 800; font-size: 0.88rem; }
.field { display: grid; gap: 4px; font-size: 0.82rem; font-weight: 800; color: #4d5c57; margin-top: 10px; }
.field input, .field select, .field textarea {
  font-weight: 500;
  border: 1px solid #d5e3de;
  border-radius: 12px;
  padding: 9px 10px;
  width: 100%;
}
.field textarea { min-height: 140px; }
pre.out, pre.prompt, textarea.prompt-edit {
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
}
textarea.prompt-edit {
  width: 100%;
  min-height: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  resize: vertical;
}
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.result-action-bar { position: relative; flex-shrink: 0; }
.copy-msg {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
  pointer-events: none;
}
.loading { color: var(--brand); font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
.sales-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 12px; }
.sales-kpi-item {
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}
.sales-kpi-item strong { display: block; font-size: 1.02rem; color: var(--brand); margin-top: 4px; }
.sales-kpi-item span { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.chart-card {
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px 10px;
}
.chart-card h3 { margin: 0 0 8px; font-size: 0.88rem; }
.chart-cols {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-height: 160px;
}
.chart-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chart-col-val {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 4px;
  white-space: nowrap;
}
.chart-col-track {
  flex: 1 1 auto;
  width: 100%;
  max-width: 36px;
  background: var(--brand-soft);
  border-radius: 8px 8px 4px 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: 90px;
}
.chart-col-track i {
  display: block;
  width: 100%;
  background: var(--brand);
  border-radius: 8px 8px 0 0;
}
.chart-col-name {
  margin-top: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  word-break: break-all;
}
.pies { display: flex; flex-wrap: wrap; gap: 8px; }
.pie-item { font-size: 0.8rem; }
.steps { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.audio-box .voice-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 8px 0 12px;
  font-size: 0.82rem;
  color: #5b6b66;
}
.audio-box .voice-legend i { font-style: normal; margin-right: 4px; }
.spk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  font-style: normal;
}
.spk.yamada { background: #dcede7; color: #2f6b5a; }
.spk.sato { background: #dbe4f0; color: #2c4a6e; }
.spk.tanaka { background: #f4e6d0; color: #8a6230; }
.audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.audio-now { margin: 0; font-size: 0.82rem; color: #2f6b5a; font-weight: 700; }
.clip-list { display: grid; gap: 6px; }
.clip-line {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: start;
  width: 100%;
  text-align: left;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
}
.clip-line.is-on {
  background: #eef7f3;
  border-color: #9fc4b7;
}
.clip-text { font-weight: 500; font-size: 0.84rem; line-height: 1.55; }
.clip-num { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.clip-play { font-size: 0.72rem; font-weight: 800; color: var(--brand); white-space: nowrap; padding-top: 2px; }
.scan-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.scan-actions .btn { min-height: 44px; min-width: 140px; }
.receipt-sample-label { margin: 12px 0 8px; }
.receipt-samples { display: flex; gap: 10px; flex-wrap: wrap; }
.receipt-thumb {
  width: 118px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  color: inherit;
  text-align: center;
}
.receipt-thumb img {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: #fff;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}
.receipt-thumb span { display: block; margin-top: 6px; font-size: 0.78rem; font-weight: 800; }
.receipt-thumb.is-on { background: #eef7f3; border-color: #9fc4b7; }
.receipt-preview-wrap {
  position: relative;
  margin-top: 12px;
  background: #1f2933;
  border-radius: 18px;
  padding: 18px 16px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.receipt-preview {
  max-width: 240px;
  width: 100%;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.receipt-preview-empty { color: #d7e6e0; font-size: 0.82rem; text-align: center; max-width: 240px; }
.receipt-scan-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31,41,51,.72);
  color: #fff;
  font-weight: 800;
  border-radius: 18px;
  z-index: 1;
}
.receipt-scan-msg[hidden],
.receipt-preview[hidden],
.receipt-preview-empty[hidden] { display: none !important; }
@media (max-width: 980px) {
  .scan-actions { flex-direction: column; }
  .scan-actions .btn { width: 100%; }
}
@media (max-width: 980px) {
  .clip-line { grid-template-columns: 52px 1fr; }
  .clip-play { grid-column: 2; }
}
@media (max-width: 980px) {
  .layout, .grid2, .cards, .charts, .steps, .sales-kpi { grid-template-columns: 1fr; }
  .side { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side a { white-space: nowrap; }
}
