/* Unified Demo Platform — Visual Core CSS (Palette E: Warm Ground) */
:root {
  --bg: #F5F3EF; --bg-card: #FFFFFF; --bg-dark: #2C2826;
  --text: #2C2826; --text-secondary: #7A7672; --text-muted: #B8B4AF;
  --text-light: #F5F3EF;
  --accent: #4A7C7F; --accent-light: #6A9C9F;
  --accent-dim: rgba(74,124,127,0.08);
  --success: #5A9E6F; --success-dim: rgba(90,158,111,0.08);
  --warning: #C4943C; --warning-dim: rgba(196,148,60,0.08);
  --danger: #C45A4A; --danger-dim: rgba(196,90,74,0.08);
  --border: #E8E5E0; --border-dark: rgba(255,255,255,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --font-display: 'Cormorant Garamond', serif;
  --font-display-jp: 'Noto Serif JP', serif;
  --font-body: 'Inter', -apple-system, 'Noto Sans JP', sans-serif;
  --font-mono: 'SF Mono', 'Menlo', monospace;
  --radius: 12px; --radius-sm: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body); background: var(--bg);
  color: var(--text); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; padding-bottom: 72px;
}

/* Header */
.header {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 16px 32px; display: flex; align-items: center;
  justify-content: space-between; box-shadow: var(--shadow);
}
.header-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
}
.header-subtitle {
  font-size: 13px; color: var(--text-secondary); margin-top: 2px;
}

/* Step Progress Bar */
.step-bar {
  display: flex; gap: 2px; padding: 12px 32px;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.step-item {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-muted); transition: all 0.4s;
}
.step-item.active {
  background: var(--accent-dim); color: var(--accent); font-weight: 600;
}
.step-item.done { color: var(--success); }
.step-item .check { display: none; color: var(--success); font-weight: bold; }
.step-item.done .check { display: inline; }

/* Flow container */
.flow-container { max-width: 960px; margin: 0 auto; padding: 24px 32px; }
.demo-section { margin-bottom: 12px; }

/* Cards */
.card {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px;
  border: 1px solid var(--border); margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.accent-line {
  width: 40px; height: 3px; background: var(--accent);
  border-radius: 2px; margin-bottom: 16px;
}

/* Buttons */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 28px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: var(--font-body); transition: all 0.15s;
}
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 28px; border-radius: var(--radius-sm);
  font-size: 14px; cursor: pointer; font-family: var(--font-body);
}

/* Agent steps */
.agent-step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  margin-bottom: 6px; opacity: 0.3; transition: all 0.4s;
}
.agent-step.processing { opacity: 1; background: var(--warning-dim); }
.agent-step.completed { opacity: 1; color: var(--success); }
.agent-step .spinner {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; display: none;
}
.agent-step.processing .spinner { display: block; }
.agent-step .check-icon { display: none; }
.agent-step.completed .check-icon { display: inline; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Rank badges */
.rank-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; margin: 16px 0;
}
.rank-card {
  text-align: center; padding: 16px 12px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card);
}
.rank-card .rank-letter {
  font-family: var(--font-display); font-size: 32px;
  font-weight: 700; line-height: 1;
}
.rank-card .rank-count {
  font-size: 28px; font-weight: 700; margin-top: 4px;
  font-family: var(--font-display);
}
.rank-card .rank-label { font-size: 11px; color: var(--text-muted); }
.rank-s .rank-letter { color: var(--accent); }
.rank-a .rank-letter { color: var(--success); }
.rank-b .rank-letter { color: var(--warning); }
.rank-c .rank-letter { color: var(--text-secondary); }
.rank-ng .rank-letter { color: var(--danger); }

/* KPI cards */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.kpi-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); text-align: center;
  box-shadow: var(--shadow);
}
.kpi-card .value {
  font-family: var(--font-display); font-size: 36px; font-weight: 700;
  color: var(--accent);
}
.kpi-card .change { font-size: 13px; font-weight: 600; color: var(--success); }
.kpi-card .label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ROI section */
.roi-section { text-align: center; padding: 40px; }
.roi-grid {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 24px; align-items: center; margin-bottom: 32px;
}
.roi-box {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px;
  border: 1px solid var(--border);
}
.roi-box.before { border-color: var(--danger); }
.roi-box.after { border-color: var(--success); }
.roi-label {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 8px;
}
.roi-value {
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
}
.roi-detail { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.roi-arrow { font-size: 32px; color: var(--accent); }
.roi-highlight {
  background: var(--accent); border-radius: var(--radius); padding: 24px;
  color: #fff;
}
.roi-highlight .big {
  font-family: var(--font-display); font-size: 48px; font-weight: 700;
}
.roi-highlight .sub { font-size: 14px; opacity: 0.85; margin-top: 4px; }
.roi-extra { font-size: 13px; color: var(--text-secondary); margin-top: 16px; }

/* Hero / PDF drop */
.hero-section { text-align: center; padding: 48px 24px; }
.hero-title {
  font-family: var(--font-display); font-size: 36px; font-weight: 700;
  margin-bottom: 8px;
}
.hero-sub {
  font-size: 15px; color: var(--text-secondary); margin-bottom: 24px;
}
.drop-zones {
  display: flex; gap: 16px; justify-content: center; margin-bottom: 24px;
}
.drop-zone {
  width: 200px; height: 120px; border: 2px dashed var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.drop-zone:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
}
.drop-zone .icon { font-size: 32px; }
.company-btns { display: flex; gap: 8px; justify-content: center; }
.company-btn {
  padding: 8px 20px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg-card); cursor: pointer; font-size: 13px;
  font-family: var(--font-body); color: var(--text); transition: all 0.15s;
}
.company-btn:hover, .company-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* Preview card */
.preview-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); margin-bottom: 12px;
  opacity: 0; transition: opacity 0.5s;
}
.preview-card.visible { opacity: 1; }
.preview-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.05em; margin-bottom: 4px;
}
.preview-value { font-size: 16px; font-weight: 700; color: var(--accent); }

/* Completion hero */
.completion-hero {
  text-align: center; padding: 40px 24px; background: var(--accent);
  border-radius: var(--radius); color: #fff; margin-bottom: 20px;
}

/* Progress bar */
.progress-track {
  background: var(--border); border-radius: 999px; height: 6px;
  overflow: hidden; margin: 16px auto; max-width: 400px;
}
.progress-fill {
  height: 100%; background: var(--accent); border-radius: 999px;
  transition: width 2s ease-out;
}

/* Candidate table */
.candidate-table-wrap {
  max-height: 400px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius); margin-top: 12px;
}
.candidate-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.candidate-table th {
  position: sticky; top: 0; background: var(--bg); padding: 8px 10px;
  font-size: 11px; font-weight: 600; text-align: left;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.candidate-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--border);
}
.candidate-table tr:hover { background: var(--accent-dim); }

/* Tabs */
.tab-bar {
  display: flex; gap: 4px; padding: 12px 32px;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 8px 20px; border-radius: var(--radius-sm); border: none;
  background: none; font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: var(--font-body); color: var(--text-muted);
  transition: all 0.15s;
}
.tab-btn.active {
  background: var(--accent-dim); color: var(--accent); font-weight: 600;
}
.tab-btn:hover { background: var(--accent-dim); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Agent grid toggle */
.agent-grid-toggle {
  max-width: 960px; margin: 16px auto 0; padding: 12px 32px;
  cursor: pointer; font-weight: 600; font-size: 14px;
  color: var(--text-secondary); user-select: none;
  transition: color 0.15s;
}
.agent-grid-toggle:hover { color: var(--text); }

/* Agent grid */
.agent-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; padding: 24px 32px; max-width: 960px; margin: 0 auto;
}
.agent-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border); text-align: center;
  box-shadow: var(--shadow); transition: all 0.15s;
}
.agent-card:hover { box-shadow: var(--shadow-md); }
.agent-card.coming-soon { opacity: 0.5; }
.agent-card .agent-icon { font-size: 28px; margin-bottom: 8px; }
.agent-card .agent-name {
  font-size: 13px; font-weight: 600; margin-bottom: 4px;
}
.agent-card .agent-desc {
  font-size: 11px; color: var(--text-muted);
}
.agent-card .coming-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: var(--border); font-size: 10px; color: var(--text-muted);
  margin-top: 6px;
}

/* Approval box */
.approval-box {
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.approval-box .question {
  font-size: 15px; font-weight: 600; color: var(--text);
}
.approval-box .detail {
  font-size: 13px; color: var(--text-secondary); margin-top: 4px;
}

/* Scout message */
.scout-message {
  background: var(--bg); border-radius: var(--radius-sm); padding: 20px;
  border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.8;
  white-space: pre-line;
}

/* Claude input */
.claude-input {
  background: var(--bg-dark); color: var(--text-light);
  border-radius: var(--radius); padding: 20px 24px;
  font-family: var(--font-mono); font-size: 14px;
  margin-bottom: 24px; line-height: 1.7;
}
.claude-input .prompt { color: var(--accent-light); font-weight: 600; }
.typing-cursor {
  display: inline-block; width: 2px; height: 1em;
  background: var(--accent-light); margin-left: 2px;
  animation: blink 0.7s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Fixed bottom bar */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 12px 32px; display: flex; justify-content: flex-end;
  align-items: center; box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.bottom-bar .btn-primary { padding: 12px 36px; font-size: 15px; }

/* Split view */
.split-view {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}

/* Fade-in */
.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
