﻿:root {
  --ink: #14241f;
  --green: #0f6b4c;
  --green-dark: #0b4b36;
  --paper: #f3f6f4;
  --card: #ffffff;
  --line: #d5e0da;
  --muted: #5d6f68;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.mark { color: var(--green-dark); font-weight: 700; text-decoration: none; letter-spacing: 0.08em; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: flex-end; }
nav a, nav button {
  margin: 0;
  color: var(--green-dark);
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  min-height: 44px;
  padding: 4px 2px;
}
main { max-width: 720px; margin: 32px auto; padding: 0 16px 48px; }
main.v11 { max-width: 1100px; }
.v11-panel { position: relative; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px 28px; }
.wait { display: none; position: fixed; inset: 0; z-index: 30; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(255,255,255,0.92); text-align: center; padding: 24px; }
.wait.show { display: flex; }
.wait p { margin: 0; font-size: 18px; font-weight: 700; }
.spinner { width: 54px; height: 54px; border: 6px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.v11-title { text-align: center; margin: 4px 0 12px; letter-spacing: 0.04em; }
.metric { margin: 2px 0; font-weight: 700; font-size: 18px; }
.metric.total { color: #1a73e8; font-size: 20px; }
.fold-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 8px;
}
.fold-row > .timing-fold { flex: 1 1 auto; min-width: 0; margin: 0; }
.fold-row > .settings-fold {
  flex: 0 1 46%;
  margin-left: auto;
}
.fold-row > .settings-fold summary { justify-content: flex-end; }
.timing-fold { margin: 0 0 8px; }
.timing-fold .check { margin-top: 4px; }
.timing-fold summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.timing-fold summary::-webkit-details-marker { display: none; }
.timing-fold summary::before { content: "▸"; }
.timing-fold[open] summary::before { content: "▾"; }
.timing-fold[open] summary { margin-bottom: 4px; }
.pair, .row, .buttons, .box-head { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
[hidden] { display: none !important; }
.pair label, .row label { width: 150px; margin: 0; color: var(--ink); font-weight: 700; font-size: 16px; }
.pair select, .row select { flex: 1; min-height: 42px; font-size: 16px; }
.check-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}
label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 12px 14px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  cursor: pointer;
}
.chat-detail-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 10px 0 4px;
  width: 100%;
}
.chat-detail-choice .chat-detail-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-right: 4px;
}
.chat-detail-choice label.check {
  width: auto;
  flex: 1 1 200px;
  max-width: 100%;
}
label.check input[type="checkbox"],
label.check input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  max-width: 1.15rem;
  margin: 0.12rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--green);
  border-radius: 4px;
  cursor: pointer;
}
.hint {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.45;
}
.sentiment-panel {
  --sent-bg: #141922;
  --sent-surface: #1a1f2e;
  --sent-border: #2a3142;
  --sent-text: #e8eaf0;
  --sent-muted: #a8b0c4;
  --sent-green: #4ade80;
  margin-top: 14px;
  padding: 16px 18px 14px;
  background: var(--sent-bg);
  border: 1px solid var(--sent-border);
  border-radius: 16px;
  color: var(--sent-text);
}
.sentiment-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--sent-text);
}
.sentiment-title-sub { font-weight: 600; color: var(--sent-muted); font-size: 0.88rem; }
.sentiment-analysis-tag {
  margin: 8px 0 12px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--sent-green);
}
.sentiment-dots { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.sentiment-dot {
  width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; opacity: 0.55;
}
.sentiment-dot.on { opacity: 1; outline: 2px solid #e8eaf0; outline-offset: 2px; }
.sentiment-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 10px; }
.sentiment-card-item, .sentiment-tone-row {
  padding: 12px 14px;
  background: var(--sent-surface);
  border-radius: 10px;
  border-left: 3px solid var(--sent-border);
}
.sentiment-tone-row { margin-bottom: 12px; }
.sentiment-card-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sent-muted);
  margin-bottom: 6px;
}
.sentiment-card-value { display: block; font-size: 1.05rem; font-weight: 650; color: var(--sent-text); }
.sentiment-card-sub { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--sent-muted); font-weight: 650; }
.sentiment-intensity-pill {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--sent-text);
  background: #2a3142;
  padding: 3px 8px;
  border-radius: 999px;
}
.sentiment-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.sentiment-pill {
  font-size: 0.82rem;
  color: var(--sent-text);
  background: var(--sent-surface);
  border: 1px solid var(--sent-border);
  padding: 5px 10px;
  border-radius: 999px;
}
.sentiment-highlight {
  margin-top: 0;
  padding: 12px 14px;
  background: #0c0e12;
  border: 1px solid var(--sent-border);
  border-radius: 10px;
  color: var(--sent-text);
  line-height: 1.55;
}
.sentiment-highlight .sent-pos { background: rgba(74, 222, 128, 0.28); color: #bbf7d0; border-radius: 4px; padding: 0 2px; }
.sentiment-highlight .sent-neg { background: rgba(248, 113, 113, 0.28); color: #fecaca; border-radius: 4px; padding: 0 2px; }
.sentiment-highlight .sent-mix { background: rgba(251, 191, 36, 0.25); color: #fde68a; border-radius: 4px; padding: 0 2px; }
.sentiment-why-box { margin-top: 12px; }
.sentiment-why-box .box-head strong { color: var(--sent-text); }
.sentiment-why-box textarea {
  background: #0c0e12;
  color: var(--sent-text);
  border-color: var(--sent-border);
  min-height: 72px;
}
.sentiment-disclaimer { margin: 12px 0 0; font-size: 0.75rem; color: var(--sent-muted); font-style: italic; }
.buttons button { width: auto; flex: 1; margin-top: 8px; min-height: 50px; font-size: 18px; }
.box-head { justify-content: space-between; }
.box-head button { width: auto; margin: 0; padding: 8px 14px; }
textarea { width: 100%; min-height: 120px; margin-top: 6px; font-size: 18px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.chat-detail-view { min-height: 280px; max-height: 520px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-y: auto; }
.chat-detail-view.chat-thinking { color: #5a6578; font-style: italic; }
.chat-detail-hint { margin: 6px 0 0; }
textarea:disabled { background: #f3f5f4; color: #6d7c76; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
label { display: block; margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
input:not([type="checkbox"]):not([type="radio"]), select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
button.primary, button.stop {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: 0;
  border-radius: 999px;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button.primary { background: var(--green); }
button.stop { background: #8d2f2f; }
button.load-best {
  width: 100%;
  margin-top: 4px;
  padding: 10px 14px;
  font-size: 14px;
  background: #2a4a6e;
  color: #f0f4f8;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
button.load-best:hover { background: #355d87; }
.status { margin-top: 16px; color: var(--green-dark); }
.panel { margin-top: 16px; padding: 12px; background: #f7faf8; border-radius: 10px; min-height: 48px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.hint { color: var(--muted, #5c6b63); font-size: 13px; }
.error { color: #8d2f2f; }
.ok { color: #1f6b3a; }
.wide { max-width: 1280px; margin: 32px auto; }
