:root {
  --navy-0: #020a18;
  --navy-1: rgba(4, 16, 36, 0.82);
  --navy-2: rgba(8, 28, 56, 0.72);
  --cyan: #3ee8ff;
  --cyan-soft: rgba(62, 232, 255, 0.55);
  --cyan-dim: rgba(62, 232, 255, 0.22);
  --green: #3dffb4;
  --violet: #9a7bff;
  --yellow: #ffe14a;
  --amber: #ffb547;
  --text: #eaf7ff;
  --text-dim: #a9c4d8;
  --glow: 0 0 14px rgba(62, 232, 255, 0.35), 0 0 2px rgba(62, 232, 255, 0.9);
  --font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--navy-0);
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 背景：元素騎士の世界（フィルターなし） ---------- */
.bg {
  position: fixed; inset: 0; z-index: -2;
  background: url("img/bg-city.jpg") center / cover no-repeat;
}

.app {
  max-width: 1680px; margin: 0 auto; padding: 14px 22px 22px;
  height: 100vh; min-height: 760px; display: flex; flex-direction: column; gap: 14px;
}

/* ---------- ヘッダー ---------- */
.header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { width: 58px; height: 58px; filter: drop-shadow(0 0 10px rgba(56, 201, 255, 0.8)); }
.brand h1 {
  margin: 0; font-size: clamp(22px, 2.4vw, 36px); font-weight: 800; letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(62, 232, 255, 0.55), 0 2px 0 rgba(0, 0, 0, 0.5);
}
.brand-sub { margin: 2px 0 0; font-size: 13px; letter-spacing: 0.22em; color: #cfeeff; }

.tabs { display: flex; gap: 14px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; min-height: 54px;
  font-size: 18px; font-weight: 700;
  background: var(--navy-2); border: 1.5px solid rgba(110, 160, 255, 0.45);
  border-radius: 10px; cursor: pointer; position: relative;
  box-shadow: inset 0 0 18px rgba(40, 120, 255, 0.15);
}
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tab .flame { fill: #ff5a3c; stroke: #ffb38a; }
.tab.is-active {
  border-color: var(--cyan); background: rgba(10, 60, 90, 0.75);
  box-shadow: var(--glow), inset 0 0 20px rgba(62, 232, 255, 0.25);
}
.tab:disabled { cursor: not-allowed; opacity: 0.85; }
.soon {
  position: absolute; top: -9px; right: 10px; font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px; background: #1b2f55; border: 1px solid var(--violet); color: #d8ccff;
}

/* ---------- レイアウト ---------- */
.main {
  flex: 1; min-height: 0; display: grid; gap: 18px;
  grid-template-columns: minmax(0, 1.75fr) minmax(360px, 1fr);
}
.left { display: grid; gap: 18px; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; }

/* ---------- パネル共通 ---------- */
.panel {
  position: relative; min-width: 0;
  background: var(--navy-1);
  border: 1.5px solid var(--cyan-soft);
  border-radius: 14px;
  box-shadow: var(--glow), inset 0 0 30px rgba(0, 160, 255, 0.12);
  backdrop-filter: blur(6px);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 26px; height: 26px; pointer-events: none;
  border: 3px solid var(--cyan); filter: drop-shadow(0 0 6px var(--cyan));
}
.panel::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.panel::after { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--cyan-dim);
  background: linear-gradient(90deg, rgba(62, 232, 255, 0.12), transparent 60%);
  border-radius: 14px 14px 0 0;
}
.panel-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.panel-head h2 small { font-size: 14px; font-weight: 600; color: var(--text-dim); }
.ico { width: 24px; height: 24px; fill: none; stroke: var(--cyan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.queue, .online { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); white-space: nowrap; }
.queue b, .online b { font-size: 26px; color: var(--yellow); text-shadow: 0 0 10px rgba(255, 225, 74, 0.5); }
.online b { font-size: 22px; }
.queue span, .online span { color: var(--yellow); }

/* ---------- AI回答ウインドウ ---------- */
.answer-panel { display: grid; grid-template-columns: minmax(220px, 34%) 1fr; overflow: hidden; }
.char-frame {
  position: relative; overflow: hidden;
  border-right: 1px solid var(--cyan-dim);
  border-radius: 14px 0 0 14px; background: #000;
}
#charCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.char-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, 0.18) 2px 3px);
  mix-blend-mode: multiply;
}
.char-scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 18%;
  background: linear-gradient(transparent, rgba(62, 255, 200, 0.10), transparent);
  animation: sweep 5s linear infinite;
}
@keyframes sweep { from { top: -20%; } to { top: 110%; } }
.char-hud {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  font: 700 12px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: 0.12em;
  color: var(--green); padding: 6px 10px; border-radius: 6px;
  background: rgba(0, 20, 16, 0.6); border: 1px solid rgba(61, 255, 180, 0.45);
}
.hud-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.answer-body { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.answer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0 0; flex-wrap: wrap; }
.tag-title {
  margin: 0 0 0 -1px; padding: 10px 40px 10px 22px; font-size: 22px; font-weight: 800;
  background: linear-gradient(90deg, rgba(30, 120, 200, 0.85), rgba(10, 50, 100, 0.8));
  clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%);
  text-shadow: 0 0 8px rgba(62, 232, 255, 0.6);
}
.tag-title small { font-size: 15px; font-weight: 600; }
.answer-meta { display: flex; gap: 8px; }
.chip {
  font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 8px;
  background: rgba(10, 40, 70, 0.8); border: 1px solid var(--cyan-dim); color: #bfe9ff;
  font-variant-numeric: tabular-nums;
}
.chip-db { color: #b9ffcf; border-color: rgba(61, 255, 140, 0.5); background: rgba(10, 60, 30, 0.6); }
.chip-db.is-warn { color: #ffe2b0; border-color: rgba(255, 181, 71, 0.6); background: rgba(70, 45, 5, 0.6); }

.answer-content { flex: 1; overflow-y: auto; padding: 16px 22px 20px; min-height: 0; }
.answer-content::-webkit-scrollbar, .chat-log::-webkit-scrollbar { width: 6px; }
.answer-content::-webkit-scrollbar-thumb, .chat-log::-webkit-scrollbar-thumb { background: var(--cyan-soft); border-radius: 3px; }

.a-title { margin: 0 0 6px; font-size: clamp(22px, 2vw, 30px); font-weight: 800; line-height: 1.3; }
.a-lead { margin: 0 0 14px; color: #d7ecfa; line-height: 1.7; }
.a-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.a-step {
  display: grid; grid-template-columns: 48px minmax(120px, 0.8fr) 1.6fr; align-items: center;
  background: rgba(10, 40, 70, 0.55); border: 1px solid var(--cyan-dim); border-radius: 8px; overflow: hidden;
  opacity: 0; transform: translateX(10px); animation: stepIn 0.45s forwards;
}
@keyframes stepIn { to { opacity: 1; transform: none; } }
.a-num {
  align-self: stretch; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--cyan);
  background: rgba(62, 232, 255, 0.12); border-right: 1px solid var(--cyan-soft);
  clip-path: polygon(0 0, 80% 0, 100% 50%, 80% 100%, 0 100%);
}
.a-label { padding: 10px 12px; font-weight: 800; }
.a-detail { padding: 10px 14px; font-size: 14px; color: var(--text-dim); line-height: 1.55; }
.a-note { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--violet); background: rgba(80, 60, 160, 0.18); color: #e2dcff; font-size: 14px; line-height: 1.6; }

.box {
  border: 1px solid var(--cyan-dim); border-radius: 10px; padding: 12px 16px;
  background: rgba(4, 24, 44, 0.6);
}
.box h3 { margin: 0 0 8px; font-size: 16px; color: var(--cyan); }
.box ul { margin: 0; padding-left: 1.1em; font-size: 13.5px; line-height: 1.8; color: #d4e8f5; }
.box a { color: #6fc7ff; }
.sources { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.board-box { display: grid; gap: 8px; align-content: center; font-size: 13px; color: var(--text-dim); max-width: 210px; }
.btn-ghost {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--cyan-soft); background: rgba(10, 50, 90, 0.6);
  font-weight: 700; font-size: 14px; cursor: not-allowed; opacity: 0.7;
}

/* 質問前 */
.idle-hero { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.idle-hero svg { width: 64px; height: 64px; flex: none; fill: none; stroke: var(--cyan); stroke-width: 1.6; filter: drop-shadow(0 0 8px var(--cyan)); }
.idle-hero p { margin: 4px 0 0; color: #d7ecfa; line-height: 1.7; }
.faq { margin-bottom: 14px; }
.faq ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.faq button {
  width: 100%; text-align: left; display: grid; grid-template-columns: 44px 1fr; align-items: center;
  background: rgba(10, 40, 70, 0.55); border: 1px solid var(--cyan-dim); border-radius: 8px; overflow: hidden;
  font-weight: 700; font-size: 16px; cursor: pointer; padding: 0;
}
.faq button:hover, .faq button:focus-visible { border-color: var(--cyan); box-shadow: var(--glow); outline: none; }
.faq .a-num { font-size: 18px; padding: 8px 0; }
.faq button span:last-child { padding: 10px 14px; }

/* 処理中 */
.proc { display: grid; gap: 14px; padding-top: 8px; }
.proc-q { font-size: 15px; color: var(--text-dim); }
.proc-q b { color: var(--text); }
.proc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.proc-steps li {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px;
  border: 1px solid var(--cyan-dim); background: rgba(6, 30, 56, 0.6); color: var(--text-dim);
  font-family: ui-monospace, Menlo, monospace; font-size: 14px;
}
.proc-steps li.is-active { color: var(--green); border-color: rgba(61, 255, 180, 0.6); box-shadow: 0 0 12px rgba(61, 255, 180, 0.2); }
.proc-steps li.is-done { color: var(--cyan); }
.proc-steps li::before { content: "○"; width: 1em; }
.proc-steps li.is-active::before { content: "◎"; animation: blink 0.6s steps(2) infinite; }
.proc-steps li.is-done::before { content: "●"; }
.proc-bar { height: 4px; border-radius: 2px; background: rgba(62, 232, 255, 0.15); overflow: hidden; }
.proc-bar span { display: block; height: 100%; width: 30%; background: linear-gradient(90deg, transparent, var(--green), transparent); animation: bar 1.2s linear infinite; }
@keyframes bar { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* ---------- AIナビゲーション ---------- */
.nav-body { display: flex; gap: 20px; align-items: center; padding: 14px 22px 18px; }
.nav-face {
  width: 104px; height: 104px; flex: none; border-radius: 50%; position: relative; overflow: hidden;
  border: 2px solid var(--cyan-soft); box-shadow: var(--glow), inset 0 0 18px rgba(0, 0, 0, 0.6); background: #000;
}
.nav-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face-ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(62, 232, 255, 0.35), transparent 18%);
  mix-blend-mode: screen; opacity: 0; animation: spin 3.4s linear infinite;
}
.nav-face.is-busy .face-ring { opacity: 1; animation-duration: 1.2s; }
/* 口：普段は細い光の線。--open（0〜1）で縦に開く */
.mouth {
  --open: 0;
  position: absolute; left: 50.5%; top: 61%; width: 13%; height: 7%;
  transform: translate(-50%, -50%) scaleY(calc(0.12 + var(--open) * 0.88));
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(4, 30, 30, 0.95) 0 45%, rgba(120, 255, 225, 0.9) 70%, transparent 74%);
  box-shadow: 0 0 6px rgba(120, 255, 225, 0.8);
  opacity: 0.85;
  transition: transform 70ms linear;
}
.nav-face.is-speak { box-shadow: 0 0 18px rgba(62, 232, 255, 0.7), inset 0 0 18px rgba(0, 0, 0, 0.6); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.5); } }

.nav-bubble {
  position: relative; flex: 1; min-height: 96px; padding: 16px 22px;
  border: 1.5px solid var(--cyan-soft); border-radius: 12px; background: rgba(6, 30, 56, 0.7);
  font-size: 17px; line-height: 1.75; white-space: pre-wrap;
}
.nav-bubble::before {
  content: ""; position: absolute; left: -11px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%) rotate(45deg);
  background: rgba(6, 30, 56, 1); border-left: 1.5px solid var(--cyan-soft); border-bottom: 1.5px solid var(--cyan-soft);
}
.nav-bubble .who { display: block; font-size: 12px; color: var(--text-dim); font-family: ui-monospace, Menlo, monospace; }
.nav-bubble.is-error { border-color: rgba(255, 120, 120, 0.6); }
.caret::after { content: "▌"; color: var(--cyan); animation: blink 0.8s steps(2) infinite; }

.ask-form, .chat-form { display: flex; gap: 10px; }
.ask-form { padding: 6px 22px 18px; }
.ask-form input, .chat-input {
  flex: 1; min-width: 0; padding: 12px 16px; border-radius: 10px;
  background: rgba(2, 14, 30, 0.85); border: 1.5px solid var(--cyan-dim); outline: none;
}
.ask-form input:focus, .chat-input:focus-within { border-color: var(--cyan); box-shadow: var(--glow); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; min-height: 48px;
  border-radius: 10px; border: 1.5px solid var(--cyan); font-weight: 800; font-size: 17px; cursor: pointer;
  background: linear-gradient(180deg, rgba(30, 150, 210, 0.9), rgba(10, 80, 140, 0.9));
  box-shadow: var(--glow);
}
.btn-primary .ico { stroke: #fff; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

/* ---------- 公開チャットルーム ---------- */
.chat-panel { display: flex; flex-direction: column; min-height: 0; }
.chat-log { list-style: none; margin: 0; padding: 10px 14px; flex: 1; overflow-y: auto; min-height: 240px; }
.msg {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 12px; padding: 12px 8px;
  border-bottom: 1px solid rgba(62, 232, 255, 0.12); animation: msgIn 0.35s ease-out;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.avatar {
  grid-row: span 2; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #5b7bd6, #2b3d84); border: 2px solid rgba(140, 170, 255, 0.6);
}
.avatar svg { width: 30px; height: 30px; fill: #e9efff; }
.avatar.ai { background: radial-gradient(circle, #0e5a64, #06323c); border-color: var(--cyan); box-shadow: 0 0 10px rgba(62, 232, 255, 0.5); }
.avatar.ai svg { fill: none; stroke: var(--cyan); stroke-width: 1.8; }
.msg-name { font-weight: 800; color: #9fc4ff; }
.msg.ai .msg-name { color: var(--cyan); }
.msg-time { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.msg-text { grid-column: 2 / 4; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.msg-text .wait { color: var(--yellow); }

.chat-foot { padding: 12px 16px 16px; border-top: 1px solid var(--cyan-dim); display: grid; gap: 10px; }
.name-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.name-row input {
  width: 150px; padding: 6px 10px; border-radius: 6px; background: rgba(2, 14, 30, 0.85);
  border: 1px solid var(--cyan-dim); outline: none;
}
.name-row input:focus { border-color: var(--cyan); }
.status { margin-left: auto; font-family: ui-monospace, Menlo, monospace; font-size: 11px; text-align: right; line-height: 1.4; }
.status .ok { color: var(--green); }
.status .ng { color: var(--amber); }
.chat-input { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; }
.chat-input input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 6px 0; }

/* ---------- テキストデコード演出 ---------- */
.decode { font-family: inherit; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 1180px), (max-height: 700px) {
  .app { height: auto; min-height: 100vh; }
  .left { grid-template-rows: minmax(560px, auto) auto; }
}
@media (max-width: 1180px) {
  .main { grid-template-columns: 1fr; }
  .chat-panel { max-height: 640px; }
}
@media (max-width: 760px) {
  .answer-panel { grid-template-columns: 1fr; }
  .char-frame { height: 300px; border-right: 0; border-bottom: 1px solid var(--cyan-dim); border-radius: 14px 14px 0 0; }
  .a-step { grid-template-columns: 40px 1fr; }
  .a-detail { grid-column: 2; padding-top: 0; }
  .sources { grid-template-columns: 1fr; }
  .tab { font-size: 15px; padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ================================================================ 掲示板 */
a.tab { text-decoration: none; }
/* タブ：明るい背景の上でも読めるよう、文字色を明示し下地を濃くする */
.tab {
  color: var(--text);
  background: rgba(6, 22, 46, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.tab:hover { border-color: var(--cyan-soft); background: rgba(10, 40, 72, 0.95); }
.tab.is-active { color: #fff; background: rgba(8, 70, 104, 0.95); }
.tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }
.board-view { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.board-panel, .post-panel { display: flex; flex-direction: column; min-height: 0; }
.panel-head h2 small b { color: var(--yellow); font-size: 18px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }

.board-tools { display: flex; gap: 12px; padding: 12px 18px 4px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
  background: rgba(2, 14, 30, 0.85); border: 1.5px solid var(--cyan-dim);
}
.search:focus-within { border-color: var(--cyan); box-shadow: var(--glow); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
select, .post-form input, .post-form textarea, .comment-form textarea {
  background: rgba(2, 14, 30, 0.85); border: 1.5px solid var(--cyan-dim); border-radius: 8px; color: var(--text);
  padding: 8px 10px; outline: none; font: inherit;
}
select:focus, .post-form input:focus, .post-form textarea:focus, .comment-form textarea:focus { border-color: var(--cyan); box-shadow: var(--glow); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 12px; border-bottom: 1px solid var(--cyan-dim); }
.chip-btn {
  font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(10, 40, 70, 0.6); border: 1px solid var(--cyan-dim); color: var(--text-dim);
}
.chip-btn:hover { color: var(--text); border-color: var(--cyan-soft); }
.chip-btn.is-active { background: var(--cyan); color: #041a24; border-color: var(--cyan); }

.board-list { list-style: none; margin: 0; padding: 8px 12px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.board-list::-webkit-scrollbar, .post-body::-webkit-scrollbar { width: 6px; }
.board-list::-webkit-scrollbar-thumb, .post-body::-webkit-scrollbar-thumb { background: var(--cyan-soft); border-radius: 3px; }
.board-empty { padding: 40px 10px; text-align: center; color: var(--text-dim); }
.post-row {
  display: grid; gap: 6px; padding: 12px 14px; margin-bottom: 8px; border-radius: 10px; text-decoration: none; color: inherit;
  background: rgba(8, 30, 56, 0.55); border: 1px solid rgba(62, 232, 255, 0.14);
  transition: border-color 0.15s, background 0.15s;
}
.post-row:hover, .post-row:focus-visible { border-color: var(--cyan-soft); background: rgba(12, 44, 80, 0.7); outline: none; }
.post-row.is-open { border-color: var(--cyan); box-shadow: var(--glow); }
.post-title { font-size: 16px; line-height: 1.45; }
.post-excerpt { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.post-tags > span { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; }
.cat { background: rgba(62, 232, 255, 0.14); color: var(--cyan); border: 1px solid var(--cyan-dim); }
.kind { background: rgba(169, 196, 216, 0.12); color: #d4e8f5; border: 1px solid rgba(169, 196, 216, 0.35); }
.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
select:disabled { opacity: 0.5; }
@media (max-width: 760px) { .form-row { grid-template-columns: 1fr; } }
.kind-ai { background: rgba(154, 123, 255, 0.18); color: #d8ccff; border: 1px solid rgba(154, 123, 255, 0.5); }
.st { border: 1px solid; }
.st-unverified { color: #ffd59a; border-color: rgba(255, 181, 71, 0.5); background: rgba(80, 50, 5, 0.4); }
.st-ai { color: #b9ffe2; border-color: rgba(61, 255, 180, 0.5); background: rgba(5, 60, 40, 0.45); }
.st-multi { color: #bfe0ff; border-color: rgba(110, 170, 255, 0.55); background: rgba(10, 40, 90, 0.5); }
.st-official { color: #fff3b0; border-color: rgba(255, 225, 74, 0.6); background: rgba(80, 70, 5, 0.45); }
.ev { color: var(--text-dim); border: 1px solid rgba(169, 196, 216, 0.35); }
.ico-s { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; flex: none; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-dim); align-items: center; }
.stat { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.stat.is-liked { color: #ff7aa8; }
.stat.is-liked .ico-s { fill: currentColor; }

.post-panel .panel-head { flex-wrap: wrap; }
.post-panel .panel-head h2 { font-size: 18px; }
.post-id { font: 700 12px ui-monospace, Menlo, monospace; color: var(--text-dim); }
.post-body { padding: 16px 22px 22px; overflow-y: auto; flex: 1; min-height: 0; display: grid; gap: 14px; align-content: start; }
.post-body .lead { margin: 0; color: #d7ecfa; line-height: 1.75; }
.post-body .box ul + ul { margin-top: 4px; }
.detail-title { margin: 0; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.4; }
.q-line { margin: 0; color: var(--text-dim); }
.q-line b { color: var(--text); }
.post-text { white-space: pre-wrap; word-break: break-word; line-height: 1.8; font-size: 15.5px; }
.no-ev { margin: 0; font-size: 13px; color: var(--text-dim); }
.a-steps.static .a-step { animation: none; opacity: 1; transform: none; }
.post-body .a-lead, .post-body .a-steps, .post-body .a-note { margin: 0; }
.badge-legend { list-style: none; padding-left: 0 !important; }
.badge-legend li { margin-bottom: 4px; }

.detail-actions { display: flex; gap: 10px; align-items: center; }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 700;
  background: rgba(10, 40, 70, 0.7); border: 1.5px solid rgba(255, 122, 168, 0.5); color: #ffc3d7;
}
.like-btn .ico-s { width: 18px; height: 18px; }
.like-btn.is-liked { background: rgba(255, 90, 150, 0.22); border-color: #ff7aa8; color: #fff; }
.like-btn.is-liked .ico-s { fill: #ff7aa8; stroke: #ff7aa8; }
.like-btn b { font-variant-numeric: tabular-nums; }
.btn-ghost2 {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--cyan-soft); background: rgba(10, 50, 90, 0.5);
  font-weight: 700; cursor: pointer;
}
.btn-ghost2:hover { border-color: var(--cyan); }
.btn-board {
  display: inline-block; text-align: center; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--cyan);
  background: rgba(10, 60, 100, 0.75); font-weight: 700; font-size: 14px; color: var(--text); text-decoration: none;
  box-shadow: var(--glow);
}

.comments-wrap { border-top: 1px solid var(--cyan-dim); padding-top: 14px; display: grid; gap: 10px; }
.comments-wrap h3 { margin: 0; font-size: 16px; color: var(--cyan); }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.comments li { padding: 10px 14px; border-radius: 8px; background: rgba(8, 30, 56, 0.55); border: 1px solid rgba(62, 232, 255, 0.12); }
.c-head { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.c-head b { color: #9fc4ff; }
.c-head time { color: var(--text-dim); font-size: 12px; }
.comments p { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.comment-form { display: flex; gap: 10px; align-items: stretch; }
.comment-form textarea { flex: 1; resize: vertical; }
.comment-form .btn-primary { min-height: auto; font-size: 15px; }

.post-form { display: grid; gap: 14px; }
.post-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.post-form label small { font-weight: 400; color: var(--text-dim); }
.post-form textarea { resize: vertical; line-height: 1.6; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-error { margin: 0; color: #ff9b9b; font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }

@media (max-width: 1180px) {
  .board-view { grid-template-columns: 1fr; }
  .board-panel { max-height: 560px; }
}

/* ---------- 掲示板：利用ルール ---------- */
.board-head-actions { display: flex; gap: 8px; align-items: center; }
.btn-sm2 { font-size: 13px; padding: 7px 12px; }
.rules { margin: 0; padding-left: 1.2em; line-height: 1.8; }
.rules li { margin-bottom: 2px; }
.rules-note { margin: 0; font-size: 13px; color: #b9ffe2; line-height: 1.6; }
.rules-dialog {
  width: min(620px, calc(100vw - 32px)); padding: 26px 30px 24px; color: var(--text);
  background: rgba(4, 16, 36, 0.96); border: 1.5px solid var(--cyan); border-radius: 14px;
  box-shadow: var(--glow), 0 20px 60px rgba(0, 0, 0, 0.6);
}
.rules-dialog::backdrop { background: rgba(0, 6, 16, 0.55); }
.rules-dialog[open] { animation: dlgIn 0.25s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.rules-dialog h2 { margin: 0 0 14px; font-size: 21px; color: var(--cyan); text-shadow: 0 0 8px rgba(62, 232, 255, 0.5); }
.rules-dialog .rules { font-size: 15.5px; margin-bottom: 14px; }
.rules-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ---------- 24時間のホットトピック ---------- */
.hot-view { grid-template-columns: minmax(0, 1100px); justify-content: center; }
.hot-panel { display: flex; flex-direction: column; min-height: 0; }
.flame-ico { stroke: #ff8a5c; fill: rgba(255, 90, 60, 0.35); }
.hot-list { list-style: none; margin: 0; padding: 12px 16px 16px; overflow-y: auto; flex: 1; min-height: 0; display: grid; gap: 10px; align-content: start; }
.hot-list::-webkit-scrollbar { width: 6px; }
.hot-list::-webkit-scrollbar-thumb { background: var(--cyan-soft); border-radius: 3px; }
.hot-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 16px;
  padding: 12px 16px; border-radius: 12px; background: rgba(8, 30, 56, 0.6); border: 1px solid rgba(62, 232, 255, 0.16);
}
.hot-row:hover { border-color: var(--cyan-soft); }
.hot-rank {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%;
  font: 800 24px/1 var(--font); color: var(--cyan); border: 2px solid var(--cyan-soft); background: rgba(62, 232, 255, 0.08);
}
.rank-1 .hot-rank { color: #ffe14a; border-color: #ffe14a; box-shadow: 0 0 14px rgba(255, 225, 74, 0.5); font-size: 28px; }
.rank-2 .hot-rank { color: #dfe8f5; border-color: #c9d6e8; box-shadow: 0 0 10px rgba(220, 232, 245, 0.35); }
.rank-3 .hot-rank { color: #ffb37a; border-color: #e8975c; box-shadow: 0 0 10px rgba(232, 151, 92, 0.35); }
.rank-1 { border-color: rgba(255, 225, 74, 0.45); }
.hot-main { display: grid; gap: 5px; min-width: 0; text-decoration: none; color: inherit; }
.hot-main:hover .post-title, .hot-main:focus-visible .post-title { color: var(--cyan); }
.hot-score { text-align: center; min-width: 88px; }
.hot-24 { display: grid; }
.hot-24 b { font-size: 26px; color: #ff9cc0; text-shadow: 0 0 10px rgba(255, 122, 168, 0.5); font-variant-numeric: tabular-nums; }
.hot-24 small { font-size: 11px; color: var(--text-dim); }
.hot-actions { display: flex; gap: 8px; }
.board-empty a { color: var(--cyan); }

/* ---------- 通報 ---------- */
.report-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 700;
  background: rgba(40, 20, 20, 0.5); border: 1.5px solid rgba(255, 140, 120, 0.45); color: #ffc0b5;
}
.report-btn:hover:not(:disabled) { border-color: #ff8c78; color: #fff; }
.report-btn:disabled { opacity: 0.5; cursor: default; }
.report-btn .ico-s { width: 16px; height: 16px; }
.report-form { display: grid; gap: 14px; }
.report-form fieldset { border: 1px solid var(--cyan-dim); border-radius: 10px; padding: 10px 14px 12px; margin: 0; display: grid; gap: 6px; }
.report-form legend { padding: 0 6px; font-weight: 700; color: var(--cyan); }
.radio { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.radio input { margin-top: 4px; accent-color: var(--cyan); }
.report-detail { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.report-detail textarea {
  background: rgba(2, 14, 30, 0.85); border: 1.5px solid var(--cyan-dim); border-radius: 8px; color: var(--text); padding: 8px 10px; font: inherit; resize: vertical;
}
.report-target { margin: -6px 0 6px; font-size: 14px; color: var(--text-dim); }
#reportDialog .rules-note { margin-bottom: 12px; }
#reportDialog .rules-actions { gap: 10px; }
.report-result { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--cyan-dim); line-height: 1.7; }
.report-result p { margin: 0; }
.report-result.is-removed { border-color: rgba(255, 140, 120, 0.6); background: rgba(80, 20, 15, 0.35); }
.report-result.is-kept { border-color: rgba(61, 255, 180, 0.5); background: rgba(5, 60, 40, 0.3); }
.report-reason { margin-top: 6px !important; font-size: 13px; color: var(--text-dim); }

@media (max-width: 760px) {
  .hot-row { grid-template-columns: 48px minmax(0, 1fr); }
  .hot-score, .hot-actions { grid-column: 2; justify-self: start; }
  .hot-rank { width: 42px; height: 42px; font-size: 20px; }
}

/* 回答ソースの優先度 */
.tier { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; border: 1px solid; white-space: nowrap; }
.tier-1 { color: #b9ffe2; border-color: rgba(61, 255, 180, 0.5); background: rgba(5, 60, 40, 0.45); }
.tier-2 { color: #bfe0ff; border-color: rgba(110, 170, 255, 0.55); background: rgba(10, 40, 90, 0.5); }
.tier-3 { color: #e4d4ff; border-color: rgba(180, 140, 255, 0.55); background: rgba(40, 20, 80, 0.5); }
.tier-4 { color: #ffe3b0; border-color: rgba(255, 190, 90, 0.6); background: rgba(70, 40, 5, 0.5); }

/* ---------- 確認状況 ---------- */
.ver-box dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 8px; font-size: 14px; align-items: center; }
.ver-box dt { color: var(--text-dim); font-weight: 700; }
.ver-box dd { margin: 0; line-height: 1.6; }
.ver-box dd.is-checking { color: var(--green); }
.confirm-btn {
  margin-left: 8px; padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700;
  background: rgba(10, 40, 90, 0.6); border: 1.5px solid rgba(110, 170, 255, 0.55); color: #cfe4ff;
}
.confirm-btn.is-on { background: rgba(110, 170, 255, 0.25); color: #fff; }
.confirm-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- 管理者画面 ---------- */
.admin-view { grid-template-columns: minmax(0, 1200px); justify-content: center; }
.admin-login { display: grid; gap: 10px; max-width: 420px; }
.admin-login input { background: rgba(2, 14, 30, 0.85); border: 1.5px solid var(--cyan-dim); border-radius: 8px; color: var(--text); padding: 10px 12px; font: inherit; }
.admin-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-count { margin-left: auto; color: var(--text-dim); font-size: 13px; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.admin-card { display: grid; gap: 8px; padding: 14px 16px; border-radius: 12px; background: rgba(8, 30, 56, 0.6); border: 1px solid rgba(62, 232, 255, 0.18); }
.admin-card.is-removed { border-color: rgba(255, 140, 120, 0.5); opacity: 0.85; }
.admin-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-head > span:not(.post-id) { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.admin-open { margin-left: auto; color: var(--cyan); font-size: 13px; }
.admin-body { margin: 0; white-space: pre-wrap; font-size: 14px; color: #d4e8f5; line-height: 1.6; }
.admin-ev, .admin-reports ul { margin: 0; padding-left: 1.2em; font-size: 13px; }
.admin-ev a { color: #6fc7ff; word-break: break-all; }
.admin-ver { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.admin-ver dt { color: var(--text-dim); }
.admin-ver dd { margin: 0; }
.admin-reports { font-size: 13px; }
.admin-reports .is-resolved { opacity: 0.55; }
.admin-removed { margin: 0; color: #ffc0b5; font-size: 13px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 公式リンクの案内 ---------- */
.link-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.link-card {
  position: relative; border-radius: 10px; background: rgba(10, 40, 70, 0.55); border: 1px solid var(--cyan-dim);
  opacity: 0; transform: translateX(10px); animation: stepIn 0.4s forwards;
}
.link-card:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.link-card a { display: grid; gap: 2px; padding: 10px 120px 10px 16px; color: inherit; text-decoration: none; }
.link-card strong { font-size: 16px; color: #fff; }
.link-desc { font-size: 13px; color: var(--text-dim); }
.link-url { font-size: 12px; color: #6fc7ff; word-break: break-all; }
.link-kind {
  position: absolute; top: 10px; right: 12px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
  color: #d8ccff; border: 1px solid rgba(154, 123, 255, 0.5); background: rgba(154, 123, 255, 0.15);
}
.link-kind.is-official { color: #b9ffe2; border-color: rgba(61, 255, 180, 0.5); background: rgba(5, 60, 40, 0.45); }

/* ---------- 情報求む ---------- */
.post-tags > span.wanted, span.wanted, s.wanted {
  font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 4px;
  color: #1a1100; background: var(--yellow); border: 1px solid #ffe98a;
}
.wanted-filter {
  font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(80, 70, 5, 0.35); border: 1px solid rgba(255, 225, 74, 0.55); color: #ffe98a;
}
.wanted-filter[aria-pressed="true"] { background: var(--yellow); color: #1a1100; }
.wanted-check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; font-weight: 600; }
.wanted-check input { accent-color: var(--yellow); width: 18px; height: 18px; }
.chat-hint { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.chat-hint a { color: var(--yellow); }

/* ---------- 画像の添付と表示 ---------- */
.img-field { display: grid; gap: 6px; }
.field-label { font-size: 14px; font-weight: 700; }
.field-label small { font-weight: 400; color: var(--text-dim); }
.img-picker { display: grid; gap: 8px; }
.img-pick-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.img-pick-row small { color: var(--text-dim); font-size: 12px; line-height: 1.5; flex: 1; min-width: 200px; }
.img-pick { font-size: 13px; }
.img-previews { display: flex; gap: 8px; flex-wrap: wrap; }
.img-preview { position: relative; margin: 0; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--cyan-dim); }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 0; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 16px; line-height: 1;
}
.img-list { display: flex; gap: 8px; flex-wrap: wrap; }
.img-thumb { display: block; width: 180px; height: 120px; border-radius: 8px; overflow: hidden; border: 1px solid var(--cyan-dim); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.img-state { font-size: 12.5px; padding: 8px 12px; border-radius: 8px; border: 1px dashed var(--cyan-dim); color: var(--text-dim); }
.img-state.is-checking { color: var(--green); border-color: rgba(61, 255, 180, 0.5); }
.img-state.is-rejected { color: #ffc0b5; border-color: rgba(255, 140, 120, 0.5); }
.comments .img-list { margin-top: 6px; }
.comments .img-thumb { width: 140px; height: 94px; }
.admin-images { display: grid; gap: 8px; font-size: 13px; }
.admin-img-list { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-img-item { margin: 0; display: grid; gap: 6px; width: 240px; }
.admin-img { width: 240px; height: 160px; object-fit: contain; background: #000; border-radius: 8px; border: 1px solid rgba(255, 225, 74, 0.5); }

/* ---------- 共有（X・LINE・リンクのコピー） ---------- */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-label { font-size: 0.85rem; color: var(--muted, #9fc3dd); margin-right: 2px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 0.85rem;
  background: rgba(10, 40, 70, 0.7); border: 1.5px solid rgba(120, 200, 255, 0.4); color: #d6efff;
}
.share-btn:hover { border-color: #8fd8ff; color: #fff; }
.share-btn:focus-visible { outline: 2px solid #8fd8ff; outline-offset: 2px; }
.share-btn .ico-s { width: 16px; height: 16px; }
.share-btn .ico-fill { fill: currentColor; stroke: none; }
.share-btn.is-line { border-color: rgba(6, 199, 85, 0.55); }
.share-btn.is-line:hover { border-color: #06c755; }
.share-row.is-compact .share-btn { padding: 6px 9px; }
.share-status { font-size: 0.8rem; color: #8fe3b0; min-width: 6em; }
.board-box .share-row { margin-top: 8px; width: 100%; }

/* ---------- 非表示（通報でAIが判断できず、管理者の確認待ち）・削除されたコメント ---------- */
.post-row.is-hidden .post-title { color: var(--text-dim); font-weight: 600; }
.hidden-note { color: #ffcf9e; }
.comments li.is-hidden { background: rgba(60, 35, 10, 0.35); border-color: rgba(255, 190, 90, 0.3); }
.comments li.is-hidden .hidden-note { margin: 0; font-size: 13px; }
.c-head .report-btn.is-compact { margin-left: auto; padding: 3px 8px; }
.admin-comments { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: rgba(8, 30, 56, 0.45); }
.admin-comments li { margin: 6px 0; }
.admin-comments .admin-actions { display: inline-flex; gap: 6px; margin-left: 8px; }
.admin-hidden { color: #ffcf9e; }
.admin-chat li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid rgba(62, 232, 255, 0.1); }
.admin-chat .msg-text { flex: 1; }

/* ---------- 「情報求む」の切り替え（質問の投稿・本人だけ） ---------- */
.wanted-toggle { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 10px 0; padding: 10px 12px; border-radius: 8px;
  background: rgba(70, 50, 5, 0.35); border: 1px solid rgba(255, 210, 90, 0.35); }
.wanted-toggle small { color: var(--text-dim); flex: 1 1 240px; }

/* ---------- 「情報求む」に回答が付いたとき：横線＋「回答あり」 ---------- */
.wanted-answered { display: inline-flex; gap: 4px; align-items: center; }
.post-tags s.wanted.is-answered, s.wanted.is-answered { opacity: 0.55; text-decoration: line-through; text-decoration-thickness: 2px; }
.post-tags .answered, span.answered {
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; white-space: nowrap;
  color: #062a14; background: #5fe39a;
}

/* ================================================================ スマホ（幅 760px 以下） */
.chat-fab, .drawer-close, .board-back, .drawer-backdrop, .see-answer { display: none; }

@media (max-width: 760px) {
  .app { padding: 10px 10px 20px; gap: 10px; height: auto; min-height: 100vh; }

  /* ヘッダー：ドリペディアの下に「AIサポート｜掲示板｜ホットトピック」を1行で。
     画面の上に固定し、スクロールするのはその下（「チャットで質問する」ボタンから下）だけにする */
  .header {
    flex-direction: column; align-items: stretch; gap: 8px;
    position: sticky; top: 0; z-index: 45;
    margin: -10px -10px 0; padding: 10px 10px 8px;
    background: linear-gradient(180deg, rgba(4, 16, 34, 0.92), rgba(4, 16, 34, 0.82));
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }
  .brand { gap: 8px; }
  .brand-icon { width: 32px; height: 32px; }
  .brand h1 { font-size: clamp(15px, 4.6vw, 19px); white-space: nowrap; }
  .brand-sub { display: none; }
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; flex-wrap: nowrap;
    border: 1.5px solid rgba(110, 160, 255, 0.45); border-radius: 10px; overflow: hidden; }
  .tab { justify-content: center; gap: 4px; min-height: 42px; padding: 6px 2px; font-size: clamp(11.5px, 3.5vw, 13.5px);
    border: 0; border-radius: 0; box-shadow: none; white-space: nowrap; }
  .tab + .tab { border-left: 1px solid rgba(110, 160, 255, 0.35); }
  .tab svg { width: 16px; height: 16px; flex: none; }
  .tab-long { display: none; }

  /* AIサポート：上のウインドウ（ホログラムとAI回答）と下のウインドウ（JES） */
  .main { gap: 10px; }
  .left { gap: 10px; grid-template-rows: auto auto; }
  .char-frame { height: 210px; }
  .nav-body { gap: 10px; }
  .nav-panel .panel-head { flex-wrap: nowrap; gap: 8px; }
  .nav-panel .panel-head h2 { white-space: nowrap; font-size: 17px; }
  .nav-panel .panel-head h2 small { display: none; }
  .nav-panel .queue { font-size: 12.5px; white-space: nowrap; margin-left: auto; }

  /* 公開チャットルーム：右から出てくる */
  .chat-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(92vw, 420px); max-height: none; border-radius: 14px 0 0 14px;
    transform: translateX(105%); transition: transform 0.3s ease; visibility: hidden;
    background: rgba(4, 16, 34, 0.97);
  }
  body.chat-open .chat-panel { transform: none; visibility: visible; }
  body.chat-open { overflow: hidden; }
  .chat-panel .panel-head { gap: 8px; flex-wrap: nowrap; }
  .chat-panel .panel-head h2 { font-size: 16px; white-space: nowrap; }
  .chat-panel .online { font-size: 12px; white-space: nowrap; margin-left: auto; }
  .chat-foot { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 14px; }
  .chat-log { min-height: 0; }
  .msg { grid-template-columns: 38px 1fr auto; padding: 10px 4px; }
  .avatar { width: 36px; height: 36px; }
  .avatar svg { width: 22px; height: 22px; }
  .name-row { flex-wrap: wrap; }
  .name-row input { flex: 1; min-width: 0; width: auto; }
  .chat-form { gap: 8px; }
  .chat-input { flex: 1; min-width: 0; }
  .chat-form .btn-primary { padding: 10px 12px; }

  .drawer-close {
    display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; cursor: pointer;
    border-radius: 8px; border: 1px solid var(--cyan-dim); background: rgba(6, 22, 46, 0.9); color: var(--text);
  }
  .drawer-close .ico { width: 20px; height: 20px; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.5); }
  .drawer-backdrop[hidden] { display: none; }

  /* 「チャットで質問する」：タブのすぐ下（JES の絵の上）に横幅いっぱいで出す */
  .chat-fab {
    display: flex; align-items: center; justify-content: center; gap: 8px; order: -1; width: 100%;
    padding: 12px 16px; border-radius: 12px; font-size: 16px; font-weight: 800; cursor: pointer;
    color: #04121f; background: linear-gradient(135deg, #8ff3ff, #38c9ff); border: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 16px rgba(62, 232, 255, 0.45);
  }
  .chat-fab .ico { width: 20px; height: 20px; stroke: #04121f; }
  .fab-badge { min-width: 20px; padding: 1px 6px; border-radius: 999px; font-size: 12px; text-align: center; color: #fff; background: #ff4f6d; }

  /* 掲示板：一覧を出し、投稿の詳細・新規投稿は右から出てくる */
  .board-view { grid-template-columns: 1fr; }
  .board-panel { max-height: none; }
  .board-tools { flex-wrap: wrap; }
  .board-panel > .panel-head, .hot-panel > .panel-head { flex-wrap: wrap; gap: 8px; }
  .board-panel > .panel-head h2, .hot-panel > .panel-head h2 { font-size: 17px; white-space: nowrap; }
  .board-head-actions { margin-left: auto; }
  .board-head-actions button { white-space: nowrap; }
  .hot-panel > .panel-head h2 { white-space: normal; }
  .hot-panel > .panel-head h2 small { display: block; margin-top: 2px; font-size: 12px; }
  .hot-actions { flex-wrap: wrap; align-items: center; }
  .hot-actions .like-btn, .hot-actions .report-btn { white-space: nowrap; padding: 7px 12px; }
  .hot-actions .share-row { flex-wrap: nowrap; }
  .post-panel {
    position: fixed; inset: 0; z-index: 60; border-radius: 0; overflow-y: auto;
    padding-top: 52px; background: rgba(4, 16, 34, 0.98);
    transform: translateX(105%); transition: transform 0.3s ease; visibility: hidden;
  }
  body.board-detail-open .post-panel { transform: none; visibility: visible; }
  body.board-detail-open { overflow: hidden; }
  body.board-detail-open .board-back {
    display: inline-flex; align-items: center; gap: 4px; position: fixed; top: 10px; left: 10px; z-index: 61;
    padding: 6px 14px 6px 8px; border-radius: 8px; font-weight: 700; cursor: pointer;
    color: var(--text); background: rgba(6, 22, 46, 0.95); border: 1px solid var(--cyan-dim);
  }
  .board-back .ico { width: 20px; height: 20px; }

  /* 「AI結果を見る」：回答が届いたら JES のウインドウに出る */
  .see-answer:not([hidden]) {
    display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 28px); margin: 0 14px 14px;
    padding: 11px 14px; border-radius: 10px; font-size: 15px; font-weight: 800; cursor: pointer;
    color: #04121f; background: linear-gradient(135deg, #8ff3ff, #38c9ff); border: 0;
    box-shadow: 0 0 14px rgba(62, 232, 255, 0.45);
  }
  .see-answer .ico { width: 20px; height: 20px; stroke: #04121f; }
}

.board-box-wanted { display: grid; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255, 210, 90, 0.35); }

/* ---------- コメントのエビデンスと JES の返信 ---------- */
.comment-form { flex-wrap: wrap; }
.c-evidence-input { flex: 1 1 100%; min-width: 0; padding: 7px 10px; border-radius: 6px; background: rgba(2, 14, 30, 0.85); border: 1px solid var(--cyan-dim); outline: none; font-size: 13px; }
.c-evidence-input:focus { border-color: var(--cyan); }
.c-evidence { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; color: var(--text-dim); word-break: break-all; }
.c-evidence a { color: var(--cyan); }
.c-verify { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 4px; color: var(--text-dim); border: 1px solid rgba(160, 180, 210, 0.35); }
.c-verify.is-ok { color: #062a14; background: #5fe39a; border-color: #5fe39a; }
.c-verify.is-checking { color: #ffe9a8; border-color: rgba(255, 210, 90, 0.45); }
.comments li.is-ai-reply { margin-left: 22px; background: rgba(5, 50, 60, 0.45); border-color: rgba(62, 232, 255, 0.3); }
.comments li.is-ai-reply .c-head b { color: var(--cyan); }
.c-reply-to { font-size: 12px; color: var(--text-dim); }

/* ---------- AI回答ウインドウ：待機中の自動切り替え ---------- */
.slide-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.slide-tab {
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  color: var(--text-dim); background: rgba(6, 22, 46, 0.7); border: 1px solid rgba(110, 160, 255, 0.35);
}
.slide-tab.is-active { color: #04121f; background: var(--cyan); border-color: var(--cyan); }
.slide-lead { margin: 4px 0 12px; color: var(--text-dim); font-size: 13.5px; }
.hot-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hot-mini-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px;
  border-radius: 10px; text-decoration: none; color: var(--text);
  background: rgba(8, 30, 56, 0.6); border: 1px solid rgba(62, 232, 255, 0.18);
}
.hot-mini-row:hover, .hot-mini-row:focus-visible { border-color: var(--cyan); outline: none; }
.hot-mini-rank { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: var(--yellow); border: 2px solid var(--yellow); }
.hot-mini-body { display: grid; gap: 4px; min-width: 0; }
.hot-mini-body strong { font-size: 14.5px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hot-mini-likes { color: #ff9cc0; font-weight: 800; white-space: nowrap; }
.hot-mini-empty { padding: 14px; color: var(--text-dim); }

/* ---------- 参考動画（YouTube。公式の情報ではない） ---------- */
.video-box { margin: 12px 0; border-color: rgba(255, 120, 120, 0.35); }
.video-box h3 { color: #ffb4b4; }
.video-note { margin: 0 0 8px; font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.video-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.video-box li { display: grid; gap: 2px; }
.video-box a { display: inline-flex; gap: 6px; align-items: flex-start; color: #ffd6d6; text-decoration: none; font-weight: 700; line-height: 1.5; }
.video-box a:hover { text-decoration: underline; }
.video-box a .ico-s { width: 18px; height: 18px; flex: none; margin-top: 2px; stroke: #ff6b6b; }
.video-box small { padding-left: 24px; color: var(--text-dim); font-size: 12px; }

/* ---------- AI回答への評価（イイネ・ワルイネ・回答が間違ってる） ---------- */
.feedback-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.feedback-label { font-size: 13px; color: var(--text-dim); margin-right: 2px; }
.feedback-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700;
  color: var(--text); background: rgba(6, 22, 46, 0.8); border: 1.5px solid rgba(110, 160, 255, 0.4);
}
.feedback-btn .ico-s { width: 16px; height: 16px; }
.feedback-btn b { font-variant-numeric: tabular-nums; color: var(--text-dim); }
.feedback-btn:hover { border-color: var(--cyan-soft); }
.feedback-btn.is-good.is-on { background: rgba(61, 255, 180, 0.2); border-color: #3dffb4; }
.feedback-btn.is-bad.is-on { background: rgba(140, 160, 200, 0.25); border-color: #9fb4d8; }
.feedback-btn.is-wrong.is-on { background: rgba(255, 120, 90, 0.22); border-color: #ff8c78; }
.feedback-btn.is-on b { color: var(--text); }
.feedback-btn:disabled { opacity: 0.6; cursor: wait; }

/* ---------- 「チャット入力へ」（PCで幅を狭くして、チャットが下に回り込むときだけ） ---------- */
.tab-chat { display: none; }
@media (min-width: 761px) and (max-width: 1180px) {
  .tab-chat { display: inline-flex; color: #04121f; background: linear-gradient(135deg, #8ff3ff, #38c9ff); border-color: #8ff3ff; text-shadow: none; }
  .tab-chat svg { stroke: #04121f; }
  .tab-chat:hover { color: #04121f; filter: brightness(1.08); }
}
