* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.5;
}
a { color: #06c; }

/* ===== Auth (login) ===== */
.auth-wrap { max-width: 360px; margin: 80px auto; padding: 24px; }
.auth-card {}
.brand { margin-bottom: 20px; }
.brand .logo { font-size: 20px; font-weight: 700; }
.brand .logo span { color: #888; }
.brand .subtitle { color: #666; font-size: 12px; }

.auth-card form label { display: block; margin-bottom: 12px; }
.auth-card form label span { display: block; font-size: 13px; margin-bottom: 4px; }
.auth-card form input {
  width: 100%; padding: 6px 8px;
  border: 1px solid #ccc; font-size: 14px;
}
.btn-primary {
  padding: 6px 14px; background: #fff; color: #222;
  border: 1px solid #888; cursor: pointer; font-size: 14px;
}
.btn-primary:hover { background: #f0f0f0; }
.alert {
  background: #fff; color: #c00;
  border: 1px solid #c00; padding: 6px 8px;
  font-size: 13px; margin-bottom: 12px;
}
.hint {
  margin-top: 16px; padding: 8px 10px;
  background: #f6f6f6; border: 1px solid #ddd;
  font-size: 12px; color: #555; line-height: 1.6;
}
.footer { color: #999; font-size: 11px; margin-top: 18px; }

/* ===== Topbar (common) ===== */
.topbar {
  border-bottom: 1px solid #ccc;
  padding: 14px 26px;
  display: flex; align-items: center; gap: 20px;
}
.topbar .logo {
  display: block; line-height: 1.15;
  font-size: 11px; color: #888; font-weight: 500; letter-spacing: 0.04em;
}
.topbar .logo::before {
  content: "ゼロフラクト";
  display: block;
  font-size: 19px; font-weight: 700; color: #222;
  letter-spacing: 0; line-height: 1.1;
}
.topbar .logo span { color: #888; }
.topbar .user-area { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.user-info { font-size: 17px; color: #555; }
.badge { font-size: 14px; color: #555; border: 1px solid #999; padding: 2px 7px; margin-left: 3px; }
.btn-ghost { font-size: 15px; padding: 7px 14px; background: #fff; border: 1px solid #999; cursor: pointer; }
.btn-ghost:hover { background: #f0f0f0; }
.back-link { color: #06c; text-decoration: none; font-size: 17px; }
.back-link:hover { text-decoration: underline; }
.proposal-tag { padding: 3px 10px; border: 1px solid #888; font-size: 14px; }

/* ===== Dashboard ===== */
.main { max-width: 1180px; margin: 36px auto; padding: 0 28px; }
.hero { margin-bottom: 36px; }
.hero-eyebrow { font-size: 15px; color: #666; letter-spacing: 0.4px; }
.hero h1 { font-size: 29px; margin: 8px 0 0; line-height: 1.3; }
.hero .h1-en { font-size: 14px; color: #888; font-weight: 500; letter-spacing: 0.04em; margin: 0 0 12px; }
.hero .lead { color: #555; font-size: 17px; line-height: 1.7; }

.proposal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.proposal-card {
  display: block;
  text-decoration: none; color: inherit;
  border: 1px solid #999; padding: 22px;
}
.proposal-card:hover { background: #f6f6f6; }
.proposal-card.is-dimmed { opacity: 0.45; filter: grayscale(1); }
.proposal-card.is-dimmed:hover { opacity: 0.65; }
.proposal-card::before { display: none; }
.proposal-num { font-size: 16px; color: #666; }
.proposal-card h3 { font-size: 21px; margin: 8px 0 10px; line-height: 1.35; }
.proposal-tagline { font-size: 17px; margin: 0 0 10px; line-height: 1.55; }
.proposal-summary { font-size: 16px; color: #555; margin: 0 0 14px; line-height: 1.65; }
.proposal-audience { font-size: 16px; color: #555; border-top: 1px dashed #ccc; padding-top: 10px; margin-bottom: 10px; line-height: 1.55; }
.proposal-audience strong { color: #222; }
.proposal-link { font-size: 16px; color: #06c; }

/* ===== Proposal page common ===== */
.proposal-header { padding: 12px 20px; background: #f6f6f6; border-bottom: 1px solid #ccc; }
.proposal-header h1 { font-size: 18px; margin: 0; }
.proposal-header p { font-size: 13px; color: #555; margin: 4px 0 0; }
.mock-wrap { max-width: 1100px; margin: 16px auto 32px; padding: 0 20px; }
.mock-frame { border: 1px solid #999; }
.mock-note { margin-top: 14px; padding: 10px 14px; background: #f6f6f6; border: 1px solid #ccc; font-size: 13px; }
.mock-note strong { display: block; margin-bottom: 4px; }
.mock-note ul { margin: 0; padding-left: 20px; line-height: 1.7; }

/* ===== A: Wizard ===== */
.wizard-progress {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid #ccc;
}
.wizard-progress .step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wizard-progress .dot {
  width: 24px; height: 24px; border-radius: 999px;
  border: 1px solid #888; background: #fff; color: #555;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.wizard-progress .lbl { font-size: 11px; color: #555; }
.wizard-progress .step.done .dot { background: #ccc; }
.wizard-progress .step.current .dot { border-color: #222; font-weight: 700; }
.wizard-progress .line { flex: 1; height: 1px; background: #aaa; margin: 0 6px; margin-bottom: 18px; }

.wizard-body {
  display: grid; grid-template-columns: 1fr 240px; gap: 18px;
  padding: 18px 20px;
}
.wizard-main h2 { margin: 0 0 4px; font-size: 16px; }
.hint-text { color: #666; font-size: 12px; margin: 0 0 14px; }

.choice-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px; margin-bottom: 16px;
}
.choice {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid #ccc;
  cursor: pointer; font-size: 13px;
}
.choice.selected { border-color: #222; background: #f0f0f0; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; margin-bottom: 4px; }
.form-input { width: 100%; padding: 6px 8px; border: 1px solid #ccc; font-size: 13px; }

.wizard-actions { display: flex; justify-content: space-between; }
.btn-primary-wizard, .btn-primary-block, .btn-send {
  background: #fff; color: #222; border: 1px solid #888;
  padding: 6px 14px; cursor: pointer; font-size: 13px;
}
.btn-primary-wizard:hover, .btn-primary-block:hover, .btn-send:hover { background: #f0f0f0; }
.btn-secondary {
  background: #fff; color: #555; border: 1px solid #ccc;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
}

.wizard-preview { border: 1px solid #ccc; padding: 12px; }
.wizard-preview h4 { margin: 0 0 8px; font-size: 12px; color: #555; }
.wizard-preview dl { margin: 0; font-size: 12px; }
.wizard-preview dt { color: #777; margin-top: 8px; font-size: 11px; }
.wizard-preview dt:first-child { margin-top: 0; }
.wizard-preview dd { margin: 1px 0 0; color: #222; }
.wizard-preview dd.pending { color: #aaa; }
.editing { color: #666; font-size: 11px; }

/* ===== B: Chat ===== */
.chat-frame {
  display: grid; grid-template-columns: 200px 1fr 220px;
  min-height: 500px;
}
.chat-sidebar { border-right: 1px solid #ccc; padding: 12px; }
.new-story {
  width: 100%; background: #fff; color: #222; border: 1px solid #888;
  padding: 6px; cursor: pointer; font-size: 12px; margin-bottom: 10px;
}
.story-list { display: flex; flex-direction: column; gap: 2px; }
.story-item { padding: 6px 8px; font-size: 13px; color: #444; cursor: pointer; }
.story-item:hover { background: #f0f0f0; }
.story-item.active { background: #eee; font-weight: 700; }
.story-item.muted { color: #999; font-size: 11px; margin-top: 6px; cursor: default; }

.chat-main { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid #ccc; }
.chat-header { padding: 10px 14px; border-bottom: 1px solid #ccc; }
.chat-header h3 { margin: 0; font-size: 14px; }
.chat-sub { font-size: 11px; color: #777; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.msg {
  max-width: 80%; padding: 8px 10px; font-size: 13px; line-height: 1.5;
  border: 1px solid #999;
}
.msg.user { align-self: flex-end; background: #f6f6f6; }
.msg.ai { align-self: flex-start; background: #fff; }
.msg em { font-style: italic; color: #555; }
.msg.typing .cursor { color: #888; font-weight: 700; }
@keyframes blink { 50% { opacity: 0; } }
.cursor { animation: blink 1s infinite; }

.chat-input { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #ccc; }
.chat-input textarea { flex: 1; border: 1px solid #ccc; padding: 6px; font-size: 13px; resize: none; font-family: inherit; }

.chat-meta { padding: 12px; font-size: 12px; }
.chat-meta h4 { margin: 0 0 8px; font-size: 12px; color: #555; }
.chat-meta dl { margin: 0; }
.chat-meta dt { color: #777; font-size: 11px; margin-top: 8px; }
.chat-meta dt:first-child { margin-top: 0; }
.chat-meta dd { margin: 1px 0 0; color: #222; }
.btn-export { width: 100%; margin-top: 12px; padding: 5px; background: #fff; border: 1px solid #888; cursor: pointer; font-size: 12px; }

/* ===== C: Block ===== */
.block-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid #ccc; gap: 10px; flex-wrap: wrap;
}
.title-input {
  background: transparent; border: none; font-size: 16px; font-weight: 700;
  padding: 2px; outline: none;
}
.title-input:focus { background: #fff; border: 1px solid #ccc; }
.genre-chip, .genre-chip-light {
  border: 1px solid #888; padding: 2px 8px; font-size: 11px; margin-left: 4px;
}
.block-layout { display: grid; grid-template-columns: 200px 1fr; }
.palette { border-right: 1px solid #ccc; padding: 14px; }
.palette h4 { margin: 0 0 10px; font-size: 12px; color: #555; }
.palette-section { margin-bottom: 14px; }
.pal-label { font-size: 11px; color: #777; margin-bottom: 4px; }
.chip {
  display: inline-block; padding: 3px 8px;
  border: 1px solid #999; font-size: 11px; margin: 2px 3px 2px 0; cursor: grab;
}

.canvas { padding: 16px; overflow-x: auto; }
.canvas-title { margin: 0 0 10px; font-size: 12px; color: #555; }
.scene-row { display: flex; gap: 10px; padding-bottom: 8px; }
.scene-card {
  flex: 0 0 220px; border: 1px solid #999; padding: 10px;
  position: relative;
}
.scene-card.current { border-color: #222; border-width: 2px; }
.scene-num {
  position: absolute; top: -8px; left: 8px;
  background: #fff; border: 1px solid #888;
  width: 18px; height: 18px; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.scene-card h5 { margin: 2px 0 8px; font-size: 13px; }
.scene-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.tag { padding: 1px 6px; border: 1px solid #999; font-size: 10px; }
.scene-card p { margin: 0; font-size: 12px; color: #555; }
.muted-text { color: #aaa !important; }
.scene-editing { position: absolute; top: 8px; right: 8px; font-size: 10px; color: #555; }
.scene-add {
  border: 1px dashed #999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #777; font-size: 12px; cursor: pointer;
}
.scene-add .plus { font-size: 20px; line-height: 1; margin-bottom: 4px; }
.scene-add:hover { background: #f6f6f6; }

@media (max-width: 900px) {
  .wizard-body { grid-template-columns: 1fr; }
  .chat-frame { grid-template-columns: 1fr; }
  .chat-sidebar, .chat-meta { display: none; }
  .block-layout { grid-template-columns: 1fr; }
}

/* === Interaction states === */
.choice { cursor: pointer; }
.chip { user-select: none; }
.chip.selected-chip { background: #ddd; border-color: #222; font-weight: 700; }
.scene-card { cursor: pointer; }
.wizard-progress .step:hover .dot { border-color: #222; }

/* === Drag & Drop (C) === */
.chip { cursor: grab; }
.chip:active { cursor: grabbing; }
.chip.dragging { opacity: 0.4; }
.scene-card.drop-target { outline: 2px dashed #222; outline-offset: -2px; background: #fafafa; }
.scene-card.drop-flash { background: #fffbe6; transition: background 0.35s; }
.scene-card.drop-reject { outline: 2px solid #c00; outline-offset: -2px; }
.scene-tags .tag { transition: opacity 0.15s; }
.scene-tags .tag:hover { opacity: 0.5; text-decoration: line-through; }
.pal-hint { font-size: 11px; color: #888; margin-bottom: 10px; padding: 6px 8px; background: #f6f6f6; border: 1px solid #ddd; }

/* === Demo player === */
.demo-player {
  position: fixed; right: 14px; bottom: 14px;
  background: #fff; border: 1px solid #888;
  padding: 8px 12px;
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; z-index: 9000;
  max-width: 440px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.demo-btn {
  background: #fff; border: 1px solid #222;
  padding: 4px 12px; cursor: pointer; font-size: 12px;
  white-space: nowrap; min-width: 90px;
}
.demo-btn:hover { background: #f0f0f0; }
.demo-btn.playing { background: #fff5f5; border-color: #c00; color: #c00; }
.demo-status { color: #555; font-size: 11px; line-height: 1.4; }

/* === Sticky notes === */
.sticky-note {
  position: absolute;
  width: 200px;
  min-height: 140px;
  background: #fffbcc;
  border: 1px solid #d4cc7a;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  display: flex; flex-direction: column;
  z-index: 8000;
}
.sticky-note.dragging { opacity: 0.92; box-shadow: 0 8px 20px rgba(0,0,0,0.25); }
.sticky-header {
  background: rgba(0,0,0,0.06);
  height: 22px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 6px;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}
.sticky-grip { color: #888; font-size: 11px; letter-spacing: -2px; }
.sticky-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 14px; line-height: 1; color: #777;
  width: 18px; height: 18px; padding: 0;
}
.sticky-close:hover { color: #c00; background: rgba(0,0,0,0.06); }
.sticky-body {
  flex: 1; padding: 8px 10px;
  font-size: 13px; line-height: 1.5;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  color: #333;
  min-height: 100px;
  overflow-wrap: break-word;
}
.sticky-body:focus { outline: 1px dashed #888; outline-offset: -8px; }
.sticky-body:empty::before {
  content: 'クリックして記入...';
  color: #aaa;
  pointer-events: none;
}
.sticky-add-btn {
  position: fixed; left: 14px; bottom: 14px;
  background: #fffbcc; border: 1px solid #d4cc7a;
  padding: 6px 14px; cursor: pointer;
  font-size: 12px; z-index: 9000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
  font-weight: 600;
}
.sticky-add-btn:hover { background: #fff39a; }

/* === Generation modal === */
.gen-modal { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center; }
.gen-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.gen-window {
  position: relative; background: #fff; border: 1px solid #888;
  width: min(640px, 92vw); max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.gen-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid #ddd; flex-shrink: 0;
}
.gen-title { font-size: 14px; font-weight: 700; }
.gen-close { background: transparent; border: none; cursor: pointer; font-size: 18px; padding: 2px 8px; }
.gen-close:hover { color: #c00; }
.gen-progress { height: 3px; background: #eee; flex-shrink: 0; }
.gen-bar { width: 0; height: 100%; background: #222; transition: width 1.2s ease-out; }
.gen-body {
  flex: 1; padding: 22px 26px;
  font-size: 14.5px; line-height: 1.95;
  white-space: pre-wrap; overflow-y: auto;
  color: #1f2937;
  font-family: "Hiragino Mincho ProN","Yu Mincho","Noto Serif JP", serif;
}
.gen-meta { padding: 10px 18px; border-top: 1px solid #eee; font-size: 11px; color: #888; flex-shrink: 0; }

/* チャット内生成バブル */
.gen-bubble { max-width: 90% !important; }
.gen-bubble.gen-bubble-ready {
  font-family: "Hiragino Mincho ProN","Yu Mincho","Noto Serif JP", serif;
  line-height: 1.85;
  white-space: pre-wrap;
}

/* === Wizard A — 詳細セクション === */
.step-content { padding: 4px 0; }
.step-content[hidden] { display: none; }
.ax-section { border-top: 1px dashed #ddd; padding: 14px 0 4px; }
.ax-section:first-of-type { border-top: none; }
.ax-section-label { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: #222; }
.group-block { margin-bottom: 10px; }
.group-name { font-size: 11px; color: #777; margin: 4px 0 4px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.other-input-wrap { display: inline-flex; }
.other-input { font: inherit; font-size: 12px; padding: 3px 8px; border: 1px solid #aaa; background: #fff; width: 160px; }
.other-input:focus { outline: 1px solid #222; outline-offset: -1px; }
.opt-chip {
  display: inline-block; padding: 4px 10px;
  border: 1px solid #aaa; font-size: 12px; cursor: pointer;
  user-select: none;
}
.opt-chip:hover { background: #f0f0f0; }
.opt-chip.selected { border-color: #222; background: #222; color: #fff; }
.ax-select { padding: 4px 8px; border: 1px solid #aaa; font-size: 13px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row .ax-range { flex: 1; max-width: 280px; }
.range-val { font-size: 12px; color: #555; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.params-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 6px 16px; }
.param-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.param-name { min-width: 110px; }
.param-row .ax-range { flex: 1; }

/* === Palette C — 軸別ブロック === */
.palette-tall { max-height: none; }
.palette-axis { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed #ddd; }
.palette-axis:last-child { border-bottom: none; }
.palette-axis-title { font-size: 12px; font-weight: 700; color: #222; margin-bottom: 6px; }
.palette-subsection { margin-bottom: 8px; }
.pal-group-name { font-size: 10px; color: #888; margin: 4px 0 2px; }
.chip.range-chip { background: #f0f0f0; }

/* === Admin === */
.admin-wrap { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 50px); }
.admin-side { background: #f6f6f6; border-right: 1px solid #ccc; padding: 16px 0; }
.admin-side-title { font-size: 12px; color: #777; padding: 0 18px 10px; letter-spacing: 1px; }
.admin-side nav { display: flex; flex-direction: column; }
.admin-nav-item {
  display: block; padding: 8px 18px;
  color: #333; text-decoration: none; font-size: 13px;
  border-left: 3px solid transparent;
}
.admin-nav-item:hover { background: #eee; }
.admin-nav-item.active { background: #fff; border-left-color: #222; font-weight: 700; }

.admin-main { padding: 24px 28px; max-width: 1100px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-panel h2 { margin: 0 0 6px; font-size: 20px; }
.admin-panel h3 { margin: 20px 0 8px; font-size: 14px; color: #444; }

.admin-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.admin-table th, .admin-table td { border-bottom: 1px solid #ddd; padding: 8px 10px; text-align: left; }
.admin-table th { background: #f6f6f6; font-size: 12px; color: #555; font-weight: 600; }
.admin-table code { font-size: 12px; background: #f4f4f4; padding: 1px 4px; }
.admin-table tr.current-row { background: #fffbe6; font-weight: 600; }

.btn-mini { padding: 2px 8px !important; font-size: 11px !important; }
.badge.ok { background: #e6f4e6; border-color: #5a5; color: #265; }
.badge.warn { background: #fff3e0; border-color: #c80; color: #843; }
.badge.muted { color: #888; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.kpi-card { border: 1px solid #ccc; padding: 14px; background: #fff; }
.kpi-card.kpi-positive { border-color: #5a5; }
.kpi-label { font-size: 11px; color: #777; }
.kpi-value { font-size: 22px; font-weight: 700; margin: 4px 0; }
.kpi-progress { width: 100%; height: 6px; background: #eee; margin: 6px 0; }
.kpi-progress > div { height: 100%; background: #222; }
.kpi-sub { font-size: 11px; color: #555; }

.bar { width: 100%; height: 10px; background: #eee; }
.bar > div { height: 100%; background: #888; }
.balance-table .bar { min-width: 120px; }

.form-input-num { width: 130px; text-align: right; }
.filter-row { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.admin-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

/* === Admin entry gate === */
.admin-gate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.admin-gate-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.admin-gate-window {
  position: relative; background: #fff; border: 1px solid #888;
  width: min(460px, 92vw); padding: 22px 26px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.admin-gate-window h3 { margin: 0 0 10px; font-size: 16px; color: #b00; }
.admin-gate-window p { margin: 6px 0; font-size: 13px; line-height: 1.6; }
.admin-gate-window .note { color: #555; padding: 8px 10px; background: #f6f6f6; border-left: 3px solid #888; font-size: 12px; }
.admin-gate-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.admin-gate-actions .btn-primary {
  padding: 6px 14px; background: #222; color: #fff;
  border: 1px solid #222; cursor: pointer; font-size: 13px;
}
.admin-gate-actions .btn-primary:hover { background: #000; }

/* === SVG icons === */
.svg-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; display: inline-block; }
.svg-icon-lg { width: 18px; height: 18px; vertical-align: -3px; }
.admin-nav-item .svg-icon { margin-right: 8px; color: #555; }
.admin-nav-item.active .svg-icon { color: #222; }
.admin-panel h2 .svg-icon { width: 18px; height: 18px; vertical-align: -3px; }
.admin-panel h3 .svg-icon { width: 14px; height: 14px; }
.admin-gate-window h3 .svg-icon { color: #b00; margin-right: 6px; }

/* === Trend chart === */
.chart-card { border: 1px solid #ddd; padding: 14px; background: #fff; margin: 6px 0; }
.chart-legend { display: flex; gap: 18px; font-size: 11px; color: #555; margin-bottom: 8px; }
.lg-sw { display: inline-block; width: 12px; height: 8px; vertical-align: middle; margin-right: 4px; }
.lg-rev { background: #9bd5a7; }
.lg-exp { background: #5a7a64; }
.lg-target { background: transparent; border-top: 2px dashed #c00; height: 0; vertical-align: middle; }
.chart-scroll { overflow-x: auto; }
.trend-chart { width: 100%; min-width: 760px; height: auto; display: block; }
.trend-chart rect { transition: opacity 0.15s; }
.trend-chart rect:hover { opacity: 0.7; }
.chart-sub { font-size: 11px; color: #888; margin-top: 6px; }

/* === AI Advice === */
.advice-meta { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 14px; font-size: 11px; color: #777; }
.advice-meta button { font-size: 11px !important; }

.advice-banner {
  border: 1px solid #ccc; padding: 14px 16px; margin-bottom: 16px;
  border-left-width: 4px;
}
.advice-banner-title { font-size: 14px; margin-bottom: 4px; }
.advice-banner-body { font-size: 13px; color: #444; line-height: 1.65; }
.advice-banner.advice-ok { border-left-color: #5a5; background: #f4faf4; }
.advice-banner.advice-warn { border-left-color: #d80; background: #fdf6e9; }
.advice-banner.advice-danger { border-left-color: #c33; background: #fdf2f2; }

.advice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.advice-card {
  border: 1px solid #ddd; padding: 14px 16px;
  background: #fff;
  border-left-width: 4px;
}
.advice-card.advice-card-ok { border-left-color: #5a5; }
.advice-card.advice-card-warn { border-left-color: #d80; }
.advice-card.advice-card-danger { border-left-color: #c33; }
.advice-card.advice-card-info { border-left-color: #36c; background: #f7f9ff; }
.advice-card h3 { margin: 0 0 8px; font-size: 14px; }

.advice-observation, .advice-action { font-size: 12px; line-height: 1.7; margin-top: 8px; }
.advice-observation strong, .advice-action strong { color: #222; }
.advice-observation ul, .advice-action ol { margin: 4px 0 0; padding-left: 18px; color: #444; }
.advice-observation li, .advice-action li { margin-bottom: 3px; }

.priority-list { margin: 0; padding-left: 18px; font-size: 13px; }
.priority-list li { margin-bottom: 6px; }

.advice-footer { font-size: 11px; padding: 10px 14px; background: #f6f6f6; border-left: 3px solid #aaa; }
.muted { color: #999; }

/* === Dev Request Board === */
.dr-kpi { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.dr-chip {
  display: inline-block; padding: 4px 10px;
  border: 1px solid #aaa; text-decoration: none; color: inherit; font-size: 12px;
}
.dr-chip span { color: #888; margin-left: 4px; font-weight: 600; }
.dr-chip:hover { background: #f0f0f0; }
.dr-chip.active { background: #222; color: #fff; border-color: #222; }
.dr-chip.active span { color: #ddd; }

.dr-table { font-size: 12px; }
.dr-table td.dr-content { max-width: 360px; }
.dr-table code { font-size: 11px; }
.dr-actions { white-space: nowrap; }
.dr-actions button { margin: 0 2px; }

.badge.prio-高 { background: #fee; color: #900; border-color: #900; }
.badge.prio-中 { background: #fff; color: #444; }
.badge.prio-低 { background: #f6f6f6; color: #888; }
.badge.st-未着手 { background: #fff; }
.badge.st-実行中 { background: #e6f4ff; color: #036; border-color: #036; }
.badge.st-待機中 { background: #f5f5dc; color: #663; }
.badge.st-完了 { background: #e6f4e6; color: #265; border-color: #5a5; }
.badge.st-保留 { background: #f3e8ff; color: #5b21b6; border-color: #5b21b6; }
.badge.st-失敗 { background: #fee; color: #900; border-color: #900; }
.badge.st-再実行 { background: #fff3e0; color: #843; }

.dr-detail-row { background: #fafafa; }
.dr-terminal {
  background: #1e1e1e; color: #d4d4d4; padding: 8px 12px;
  font-family: "SF Mono","Consolas","Menlo",monospace; font-size: 12px;
  margin: 4px 0;
}
.dr-terminal-header { color: #4fc3f7; font-weight: 700; margin-bottom: 4px; font-size: 11px; }
.dr-terminal-body { white-space: pre-wrap; margin: 0; max-height: 240px; overflow-y: auto; color: #d4d4d4; }
.dr-approval { background: #f3e8ff; border: 1px solid #c084fc; border-left-width: 4px; padding: 10px 14px; margin: 6px 0; }
.dr-approval p { margin: 4px 0; }
.dr-result { padding: 8px 12px; background: #f6f6f6; margin: 6px 0; }
.dr-result summary { cursor: pointer; font-size: 12px; }
.dr-result pre { margin: 6px 0 0; font-size: 11px; white-space: pre-wrap; }

.dr-modal { position: fixed; inset: 0; z-index: 9700; display: flex; align-items: center; justify-content: center; }
.dr-modal[hidden] { display: none; }
.dr-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.dr-modal-window { position: relative; background: #fff; border: 1px solid #888; width: min(540px, 92vw); padding: 22px 26px; max-height: 86vh; overflow-y: auto; }
.dr-modal-window h3 { margin: 0 0 10px; font-size: 16px; }
.dr-modal-window label { display: block; font-size: 12px; color: #555; margin: 10px 0 4px; }
.dr-modal-window .form-input, .dr-modal-window .ax-select { width: 100%; }
.dr-modal-window textarea { font-family: inherit; }
.dr-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dr-modal-actions .btn-primary { padding: 6px 14px; background: #222; color: #fff; border: 1px solid #222; cursor: pointer; font-size: 13px; }

/* === Prompt Vault (プロンプト保管) === */
.prompt-gate {
  display: flex; gap: 22px; align-items: flex-start;
  padding: 22px 24px; margin-top: 14px;
  background: linear-gradient(180deg, #fffaf0 0%, #fff5e1 100%);
  border: 1px solid #d8a040; border-left: 6px solid #b87326;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(184, 115, 38, 0.08);
}
.prompt-gate-icon {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: #b87326; color: #fff; border-radius: 50%;
}
.prompt-gate-icon .svg-icon { width: 32px; height: 32px; }
.prompt-gate-body { flex: 1; min-width: 0; }
.prompt-gate-body h3 { margin: 0 0 8px; font-size: 15px; color: #7a4a10; }
.prompt-gate-body p { margin: 6px 0; font-size: 13px; line-height: 1.7; color: #4a3010; }
.prompt-gate-reqs {
  list-style: none; padding: 0; margin: 14px 0;
  display: flex; flex-direction: column; gap: 10px;
}
.prompt-gate-reqs li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; background: #fff; border: 1px solid #e0c890;
  border-radius: 2px;
}
.prompt-gate-reqs li strong { font-size: 13px; color: #333; }
.prompt-gate-reqs li small { font-size: 11.5px; color: #777; display: block; margin-top: 2px; line-height: 1.55; }
.prompt-gate-reqs li .svg-icon { width: 14px; height: 14px; vertical-align: -2px; color: #b87326; margin-right: 4px; }
.prompt-gate-req-num {
  flex: 0 0 auto;
  font-weight: bold; color: #b87326; font-size: 18px;
  width: 24px; text-align: center;
}
.prompt-gate-status {
  margin-top: 14px; padding: 10px 12px;
  background: #fff3d6; border-left: 3px solid #d80;
  font-size: 12px; line-height: 1.65;
}
.prompt-gate-status .badge { margin-right: 8px; }
.prompt-gate-body .admin-actions { margin-top: 14px; }
.prompt-gate-body .admin-actions button[disabled] {
  opacity: 0.55; cursor: not-allowed;
}
@media (max-width: 720px) {
  .prompt-gate { flex-direction: column; gap: 12px; padding: 16px; }
  .prompt-gate-icon { width: 48px; height: 48px; }
  .prompt-gate-icon .svg-icon { width: 24px; height: 24px; }
}
