:root {
  --ink: #18334b;
  --muted: #6b8092;
  --line: #dbe8ee;
  --paper: #ffffff;
  --wash: #f5fbfc;
  --aqua: #13a6a6;
  --aqua-dark: #087d83;
  --sky: #dff6f5;
  --coral: #e9685d;
  --green: #14876d;
  --amber: #b77a11;
  --shadow: 0 18px 50px rgba(37, 82, 103, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0, var(--wash) 74%, #eef8f9 100%);
  font-family: Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
.ambient { position: fixed; border-radius: 50%; filter: blur(1px); z-index: -1; opacity: .55; }
.ambient-a { width: 420px; height: 420px; right: -170px; top: 110px; background: #d8f4f2; }
.ambient-b { width: 280px; height: 280px; left: -130px; top: 520px; background: #e5f0ff; }
.topbar {
  height: 76px; display: flex; align-items: center; justify-content: space-between;
  max-width: 1240px; margin: auto; padding: 0 24px;
}
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; font-weight: 900; letter-spacing: -.05em;
  background: linear-gradient(145deg, #0eb7b2, #087b88);
  box-shadow: 0 8px 20px rgba(13, 151, 156, .25);
}
.brand strong, .brand small { display: block; line-height: 1.3; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.safety {
  font-size: 12px; font-weight: 700; color: var(--green); padding: 7px 12px;
  border: 1px solid #c9e9df; border-radius: 999px; background: #f4fffb;
}
.safety span { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #19a77e; margin-right: 5px; }
.header-meta { display: flex; align-items: center; gap: 10px; }
.produced { color: var(--aqua-dark); font-size: 11px; font-weight: 900; letter-spacing: .03em; }
.shell { max-width: 1240px; margin: auto; padding: 36px 24px 80px; }
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 54px; align-items: center;
  padding: 42px 0 56px;
}
.eyebrow { margin: 0 0 8px; color: var(--aqua-dark); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.hero h1 { margin: 0; font-size: clamp(38px, 5vw, 64px); line-height: 1.22; letter-spacing: -.05em; }
.hero h1 em { color: var(--aqua-dark); font-style: normal; }
.hero-copy { max-width: 620px; margin: 20px 0 0; color: var(--muted); font-size: 16px; }
.hero-side { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(180px, 1fr); gap: 14px; align-items: end; }
.kurage-stage {
  min-height: 260px; position: relative; border-radius: 28px;
  background: radial-gradient(circle at 50% 20%, #fff 0, #e9faf8 52%, #dff3f6 100%);
  border: 1px solid #d4e9eb; overflow: hidden;
}
.kurage-stage > img { position: absolute; width: 220px; max-width: none; left: 50%; bottom: -62px; transform: translateX(-50%); filter: drop-shadow(0 15px 20px rgba(31,102,117,.15)); }
.kurage-message { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 12px 13px; border-radius: 14px; background: rgba(255,255,255,.92); border: 1px solid rgba(190,224,226,.9); box-shadow: 0 10px 24px rgba(43,100,114,.12); backdrop-filter: blur(10px); }
.kurage-message span, .brain-chip span { display: block; color: var(--aqua-dark); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.kurage-message strong { display: block; font-size: 15px; }
.kurage-message p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.brain-chip { padding: 14px; display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.brain-chip img { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; }
.brain-chip strong { display: block; font-size: 13px; line-height: 1.35; }
.hero-flow { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: -30px 0 40px auto; width: fit-content; }
.hero-flow div { min-width: 90px; padding: 16px 10px; text-align: center; background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 14px; }
.hero-flow b, .hero-flow span { display: block; }
.hero-flow b { color: var(--aqua); font-size: 11px; }
.hero-flow span { font-size: 12px; font-weight: 700; }
.hero-flow i { color: #9db4bf; font-style: normal; }
.workspace { display: grid; grid-template-columns: 350px 1fr; gap: 22px; align-items: start; }
.control-card, .result-panel, .history-section {
  background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.control-card { padding: 24px; position: sticky; top: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.step { font-weight: 900; font-size: 18px; }
.badge { color: var(--aqua-dark); background: var(--sky); padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
label { display: block; margin: 0 0 16px; font-size: 12px; font-weight: 800; }
input, select, textarea {
  width: 100%; margin-top: 6px; border: 1px solid #cadde5; background: #fbfefe; color: var(--ink);
  border-radius: 12px; padding: 11px 12px; outline: none; transition: .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(19,166,166,.12); background: #fff; }
textarea { resize: vertical; line-height: 1.55; font-size: 13px; }
.symbol-input { display: flex; align-items: center; position: relative; }
.symbol-input input { font-size: 22px; font-weight: 900; letter-spacing: .08em; padding-right: 48px; }
.symbol-input span { position: absolute; right: 13px; top: 17px; color: var(--muted); font-weight: 800; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.optional { color: var(--muted); font-size: 10px; font-weight: 500; }
.primary {
  width: 100%; border: 0; border-radius: 13px; padding: 14px 16px; color: #fff; cursor: pointer;
  display: flex; justify-content: space-between; background: linear-gradient(135deg, #0caaa8, #087c88);
  box-shadow: 0 10px 22px rgba(9, 139, 144, .22); font-weight: 800;
}
.primary:hover { transform: translateY(-1px); }
.primary:disabled { opacity: .55; cursor: wait; transform: none; }
.fine-print { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 14px 2px 0; }
.result-panel { min-height: 620px; padding: 30px; }
.empty-state, .loading-state { min-height: 555px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.empty-state h2, .loading-state h2 { margin: 25px 0 4px; }
.empty-state p, .loading-state p { color: var(--muted); font-size: 13px; }
.orbit { width: 136px; height: 136px; border: 1px solid #cce4e8; border-radius: 50%; display: grid; place-items: center; position: relative; background: #f7ffff; }
.orbit:before, .orbit:after { content: ""; position: absolute; border: 1px solid #d9edef; border-radius: 50%; }
.orbit:before { inset: 18px; } .orbit:after { inset: 38px; }
.orbit b { z-index: 2; color: var(--aqua-dark); font-size: 22px; }
.orbit span { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--aqua); z-index: 2; }
.orbit span:nth-child(1) { top: 7px; } .orbit span:nth-child(2) { right: 11px; top: 38px; background: #72a8db; }
.orbit span:nth-child(3) { bottom: 11px; } .orbit span:nth-child(4) { left: 11px; top: 42px; background: var(--coral); }
.loader { width: 66px; height: 66px; border: 4px solid #dceff0; border-top-color: var(--aqua); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.error-state { margin: 20px 0; padding: 16px 18px; border: 1px solid #f3cac6; border-radius: 14px; background: #fff6f5; color: #963d36; }
.error-state p { margin: 4px 0 0; font-size: 13px; }
.result-head { display: flex; align-items: end; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.result-head h2 { margin: 0; font-size: 27px; }
.muted { color: var(--muted); font-size: 12px; }
.price-block { text-align: right; }
.price-block strong { display: block; font-size: 30px; line-height: 1.2; }
.price-block span { font-size: 13px; font-weight: 800; }
.positive { color: var(--green); } .negative { color: var(--coral); }
.decision-card {
  margin: 22px 0 16px; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center;
  border-radius: 18px; background: linear-gradient(135deg, #ecfbf9, #f7ffff); border: 1px solid #ccebe7;
}
.decision-card > div > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.decision-card > div > strong { display: block; font-size: 32px; line-height: 1.3; color: var(--aqua-dark); }
.decision-card p { margin: 5px 0 0; font-size: 13px; }
.confidence-ring { width: 86px; height: 86px; flex: 0 0 86px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: #fff; border: 7px solid #9adfd7; }
.confidence-ring span { color: var(--muted); font-size: 9px; }
.confidence-ring b { font-size: 20px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metrics div { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfefe; }
.metrics span, .metrics b { display: block; }
.metrics span { color: var(--muted); font-size: 10px; }
.metrics b { margin-top: 3px; font-size: 16px; }
.result-section { padding-top: 30px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-title span { color: var(--aqua-dark); font-size: 10px; font-weight: 900; background: var(--sky); padding: 4px 8px; border-radius: 7px; }
.section-title h3 { margin: 0; font-size: 17px; }
.agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agent-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.agent-card header { display: flex; justify-content: space-between; gap: 8px; }
.agent-card h4 { margin: 0; font-size: 13px; }
.stance { padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 900; background: #eef3f5; }
.stance.強気 { color: var(--green); background: #eaf8f3; }
.stance.弱気 { color: var(--coral); background: #fff0ee; }
.agent-card p { margin: 9px 0; color: #455e70; font-size: 12px; }
.agent-card small { color: var(--muted); }
.evidence-status { font-weight: 800; }
.debate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.debate-grid > div { padding: 17px; border-radius: 14px; font-size: 12px; }
.debate-grid span { font-weight: 900; }
.debate-grid p { margin: 6px 0 0; }
.bull { background: #effaf6; border: 1px solid #d0eadf; }
.bear { background: #fff4f2; border: 1px solid #f0d6d1; }
.unresolved { margin-top: 9px; color: var(--amber); font-size: 11px; }
.risk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.risk-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; }
.risk-card header { display: flex; justify-content: space-between; }
.risk-card h4 { margin: 0; }
.risk-card .approved { color: var(--green); } .risk-card .rejected { color: var(--coral); }
.risk-card strong { display: block; margin-top: 12px; font-size: 22px; }
.risk-card small, .risk-card p { color: var(--muted); font-size: 10px; }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.evidence-grid > div { padding: 16px; background: #f9fcfd; border: 1px solid var(--line); border-radius: 14px; }
.evidence-grid h4 { margin: 0 0 8px; font-size: 13px; }
.evidence-grid ul { margin: 0; padding-left: 18px; color: #526a79; font-size: 11px; }
.history-section { margin-top: 22px; padding: 24px; }
.history-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.history-item { cursor: pointer; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfefe; }
.history-item:hover { border-color: var(--aqua); }
.history-item header { display: flex; justify-content: space-between; font-size: 11px; }
.history-item strong { display: block; margin-top: 7px; }
.history-item small { color: var(--muted); }
.site-footer { padding: 38px 24px 50px; text-align: center; color: var(--muted); font-size: 11px; }
.site-footer strong, .site-footer span { display: block; }
.site-footer strong { color: var(--ink); font-size: 14px; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.site-footer a { color: var(--aqua-dark); text-decoration: none; font-weight: 800; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero-flow { justify-content: flex-start; overflow-x: auto; margin: -12px 0 32px; width: 100%; }
  .workspace { grid-template-columns: 1fr; }
  .control-card { position: static; }
  .history-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .safety { display: none; }
  .produced { font-size: 9px; }
  .shell { padding: 12px 14px 50px; }
  .hero { padding: 28px 0 38px; }
  .hero h1 { font-size: 38px; }
  .hero-side { grid-template-columns: 1fr; }
  .kurage-stage { min-height: 290px; }
  .hero-flow i { display: none; }
  .hero-flow div { min-width: 82px; }
  .result-panel { padding: 18px; }
  .agent-grid, .debate-grid, .risk-grid, .evidence-grid, .history-list { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .decision-card { align-items: flex-start; }
  .confidence-ring { width: 72px; height: 72px; flex-basis: 72px; border-width: 5px; }
}
