:root {
  --navy: #12366b;
  --navy-soft: #e8eef6;
  --teal: #0f766e;
  --teal-soft: #e6f4f2;
  --bg: #eef2f6;
  --white: #fff;
  --ink: #1f2937;
  --muted: #5b677a;
  --line: #d7e0ea;
  --star: #c98512;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
}
button, textarea { font: inherit; }
button { cursor: pointer; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 18px; color: var(--navy); }
.topbar .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.badge-demo {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}
.btn {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  padding: 8px 12px;
}
.btn:hover { border-color: var(--teal); color: var(--teal); }
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: #0e2d5a; color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
}
.list-pane {
  background: var(--white);
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 14px;
}
.list-pane h2 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}
.review-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  margin-bottom: 8px;
  color: inherit;
}
.review-item:hover { border-color: #9bb0cc; }
.review-item.is-on {
  border-color: var(--navy);
  background: var(--navy-soft);
  box-shadow: 0 0 0 2px rgba(18, 54, 107, 0.12);
}
.review-item .meta { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.review-item .stars { color: var(--star); font-weight: 800; letter-spacing: 1px; }
.review-item .snip {
  margin: 6px 0 0;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.main-pane { overflow: auto; padding: 18px; }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 1100px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}
.card h3 { margin: 0 0 10px; color: var(--navy); font-size: 15px; }
.meta { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.body-box {
  margin-top: 10px;
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
}
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  margin-right: 4px;
}
.chip.warn { background: #fff7e8; color: #8a5a00; }

.reply-draft {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid var(--navy);
  background: linear-gradient(180deg, #f3f7fc 0%, #fff 28%);
  box-shadow: 0 0 0 4px rgba(18, 54, 107, 0.08);
}
.reply-draft-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.reply-draft-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.reply-draft-sub { font-size: 12px; font-weight: 700; color: var(--navy); }
.field { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--navy); }
.field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 200px;
  border: 1px solid #9bb0cc;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 600;
  line-height: 1.7;
  resize: vertical;
}
.intent-note { font-size: 12px; font-weight: 700; color: var(--teal); }
.intent-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.intent-wrap button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}
.intent-wrap button:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.intent-wrap button:disabled { opacity: 0.45; cursor: default; }
.intent-wrap button[data-action="reset-default"] {
  border-color: var(--navy);
  background: var(--navy-soft);
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.loading-bar {
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  z-index: 20;
}
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 30;
}
.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 18px;
}
.modal h3 { margin: 0 0 10px; color: var(--navy); }
.alert-info {
  background: #fff7e8;
  border: 1px solid #fde68a;
  color: #8a5a00;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .list-pane { border-right: 0; border-bottom: 1px solid var(--line); max-height: 240px; }
  .grid { grid-template-columns: 1fr; }
}
