:root {
  --cyan: #38c6f4; --cyan-d: #0a9fd1; --yellow: #ffd93d; --green: #3ddc84; --green-d: #12a85a; --pink: #ff6fae; --pink-d: #e0407f;
  --ink: #1d2b3a; --bg: #e6f8ff; --card: #ffffff; --muted: #5b6b7b; --line: #bfe6f5;
  --r: 18px;
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --dot: "DotGothic16", "Zen Maru Gothic", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font-family: var(--font); font-weight: 500; line-height: 1.6;
  background-color: var(--bg);
  background-image: radial-gradient(#bfe9f8 1.5px, transparent 1.5px); background-size: 22px 22px;
}
h1, h2, h3 { margin: 0; font-weight: 900; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ── ヘッダー ── */
.topbar { background: var(--cyan); border-bottom: 4px solid var(--ink); position: sticky; top: 0; z-index: 30; }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo .robot { margin: -4px 0; }
.logo b { font-size: 26px; letter-spacing: .04em; color: var(--ink); text-shadow: 2px 2px 0 var(--yellow); }
.logo small { display: block; font-size: 11px; font-weight: 700; margin-top: -4px; }
.spacer { flex: 1; }
.ai-state { font-size: 12px; font-weight: 700; padding: 4px 12px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; }
.ai-state.on { background: var(--green); }
.ai-state.off { background: var(--yellow); }

.stepnav { max-width: 1280px; margin: 14px auto 0; padding: 0 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.step {
  border: 3px solid var(--ink); background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 900; font-size: 14px; color: var(--ink);
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.step:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.step.on { background: var(--yellow); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.step i { font-style: normal; display: inline-block; width: 22px; height: 22px; line-height: 18px; text-align: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--pink); margin-right: 6px; font-size: 12px; }
.step:nth-child(2n) i { background: var(--green); }
.step:nth-child(3n) i { background: var(--cyan); }

/* ── レイアウト ── */
.layout { max-width: 1280px; margin: 18px auto 60px; padding: 0 20px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } .side { position: static !important; order: -1; } }

.card {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--r); padding: 20px 22px; margin-bottom: 20px;
  box-shadow: 6px 6px 0 var(--cyan);
}
.card.y { box-shadow: 6px 6px 0 var(--yellow); }
.card.g { box-shadow: 6px 6px 0 var(--green); }
.card.p { box-shadow: 6px 6px 0 var(--pink); }
.card h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card h2 .tag { font-size: 11px; background: var(--pink); color: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 0 8px; }
.card h3 { font-size: 15px; margin: 14px 0 8px; }
.lead { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }

/* ── ボタン ── */
.btn {
  border: 3px solid var(--ink); background: var(--yellow); color: var(--ink); font-weight: 900; font-size: 15px;
  padding: 10px 20px; border-radius: 14px; box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.cy { background: var(--cyan); } .btn.gr { background: var(--green); } .btn.pk { background: var(--pink); color: #fff; } .btn.wh { background: #fff; }
.btn.sm { font-size: 12px; padding: 5px 12px; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }
.btn.lg { font-size: 18px; padding: 14px 28px; }
.btnrow { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ── フォーム ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 16px; }
.grid.w2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.f > label { font-size: 12px; font-weight: 900; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.f > label .u { color: var(--muted); font-weight: 700; }
.f .hint { font-size: 11px; color: var(--muted); }
.f .calc { font-size: 12px; font-weight: 900; color: var(--cyan-d); min-height: 18px; }
input[type=text], input[type=number], select, textarea, input[type=date] {
  width: 100%; font: inherit; font-weight: 700; padding: 8px 10px; border: 3px solid var(--ink); border-radius: 12px; background: #f7fdff; color: var(--ink);
  transition: box-shadow .1s, background .1s;
}
input:focus, select:focus, textarea:focus { outline: none; background: #fff; box-shadow: 0 0 0 4px var(--yellow); }
input.ai, select.ai, textarea.ai { background: #fff0f7; border-color: var(--pink-d); }
textarea { min-height: 84px; resize: vertical; }
.span2 { grid-column: span 2; } .spanall { grid-column: 1 / -1; }
details.sec { border: 3px solid var(--ink); border-radius: 14px; margin: 12px 0; background: #fbfeff; }
details.sec > summary { cursor: pointer; font-weight: 900; padding: 10px 14px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.sec > summary::before { content: "▶"; font-size: 11px; color: var(--cyan-d); transition: transform .15s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec > .in { padding: 4px 14px 16px; }
details.sec.rel { border-color: var(--green-d); }

.typecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.typecard { border: 3px solid var(--ink); border-radius: 14px; padding: 12px 14px; background: #fff; text-align: left; font-weight: 700; box-shadow: 0 4px 0 var(--ink); }
.typecard b { display: block; font-size: 16px; } .typecard small { color: var(--muted); font-size: 11.5px; line-height: 1.4; display: block; }
.typecard.on { background: var(--yellow); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.typecard .em { font-size: 24px; }

/* ── ドロップゾーン ── */
.drop {
  border: 4px dashed var(--cyan-d); background: #f0fbff; border-radius: 22px; padding: 28px; text-align: center; transition: .15s; cursor: pointer;
}
.drop.over { background: #fff9d6; border-color: var(--pink-d); transform: scale(1.01); }
.drop b { font-size: 20px; display: block; margin-top: 4px; }
.drop small { color: var(--muted); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { border: 3px solid var(--ink); border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 900; background: #fff; display: inline-flex; gap: 8px; align-items: center; }
.chip button { border: 0; background: var(--pink); color: #fff; width: 18px; height: 18px; border-radius: 50%; font-weight: 900; line-height: 16px; padding: 0; }
.scanning { text-align: center; padding: 20px; }
.scanning .robot { animation: bob .6s infinite alternate; }
.scanline { height: 12px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; max-width: 360px; margin: 10px auto; }
.scanline i { display: block; height: 100%; width: 40%; background: repeating-linear-gradient(45deg, var(--green), var(--green) 8px, var(--cyan) 8px, var(--cyan) 16px); animation: slide 1.1s linear infinite; }

/* ── サイドパネル ── */
.side { position: sticky; top: 84px; }
.panel { background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--pink); overflow: hidden; }
.panel-top { background: var(--cyan); padding: 12px 14px; display: flex; gap: 8px; align-items: flex-end; border-bottom: 3px solid var(--ink); }
.bubble { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 12px; font-size: 13px; font-weight: 900; line-height: 1.45; flex: 1; }
.bubble::before { content: ""; position: absolute; left: -12px; bottom: 16px; border: 8px solid transparent; border-right-color: var(--ink); }
.bubble::after { content: ""; position: absolute; left: -7px; bottom: 17px; border: 7px solid transparent; border-right-color: #fff; }
.panel-body { padding: 14px; }
.lcd { background: #123; color: #7dffb3; border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; font-family: var(--dot); box-shadow: inset 0 0 12px #0008; }
.lcd small { color: #8fd8ff; font-size: 11px; display: block; letter-spacing: .08em; }
.lcd b { font-size: 26px; font-weight: 400; display: block; line-height: 1.2; }
.lcd.y b { color: var(--yellow); } .lcd.p b { color: #ff9cc7; }
.verdict { text-align: center; font-weight: 900; font-size: 15px; border: 3px solid var(--ink); border-radius: 12px; padding: 8px; margin: 8px 0; }
.verdict.go { background: var(--green); } .verdict.nego { background: var(--yellow); } .verdict.hard { background: #ffb36b; } .verdict.pass { background: var(--pink); color: #fff; } .verdict.none { background: #e9eef2; }
.gauge { height: 18px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; position: relative; overflow: hidden; margin: 6px 0 2px; }
.gauge i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); transition: width .4s; }
.gauge i.over { background: var(--pink); }
.gauge s { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--ink); }
.minilist { font-size: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.minilist li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 2px dotted var(--line); }
.pm { font-weight: 900; } .pm.plus { color: var(--green-d); } .pm.minus { color: var(--pink-d); }

/* ── ロボット ── */
.robot { overflow: visible; flex: none; }
.r-antenna { transform-origin: 60px 26px; animation: wob 2s ease-in-out infinite; }
.robot-happy, .robot-scan { animation: bob 1.4s ease-in-out infinite alternate; }
.robot-alert { animation: shake .4s infinite; }
.robot .fill { fill: #1d2b3a; } .robot .scanbar { fill: var(--pink); animation: blink 1s infinite; }
.robot .dotty { animation: blink 1s infinite; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes wob { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ── 結果 ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat { border: 3px solid var(--ink); border-radius: 16px; padding: 12px 16px; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.stat small { font-weight: 900; font-size: 12px; color: var(--muted); }
.stat b { display: block; font-family: var(--dot); font-weight: 400; font-size: 28px; line-height: 1.25; }
.stat.c1 { background: #d9f3ff; } .stat.c2 { background: #fff5bf; } .stat.c3 { background: #d6f8e5; } .stat.c4 { background: #ffe1ef; }
.stat em { font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 700; display: block; }

table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; }
table.t th { background: var(--cyan); text-align: left; padding: 7px 10px; font-weight: 900; border-bottom: 3px solid var(--ink); white-space: nowrap; }
table.t td { padding: 6px 10px; border-bottom: 2px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.strong td { background: #fff5bf; font-weight: 900; }
table.t td.r, table.t th.r { text-align: right; white-space: nowrap; }
table.t td.f2 { color: var(--muted); font-size: 12px; }
table.t.rules tr.plus td:first-child { box-shadow: inset 5px 0 0 var(--green); }
table.t.rules tr.minus td:first-child { box-shadow: inset 5px 0 0 var(--pink); }
table.t.rules tr.unknown td:first-child { box-shadow: inset 5px 0 0 var(--yellow); }
.badge { display: inline-block; min-width: 64px; text-align: center; font-weight: 900; font-size: 13px; border: 3px solid var(--ink); border-radius: 999px; padding: 0 10px; font-family: var(--dot); }
.badge.plus { background: var(--green); } .badge.minus { background: var(--pink); color: #fff; } .badge.neutral { background: #fff; color: var(--muted); } .badge.unknown { background: var(--yellow); }
.grp { font-size: 11px; font-weight: 900; background: #e6f8ff; border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; white-space: nowrap; }
.bars { display: grid; gap: 10px; }
.barrow { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; font-size: 13px; font-weight: 900; }
.bar { height: 26px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--cyan); }
.bar.main i { background: var(--green); }
.bar.ref i { background: #cfd9e0; }
.bar s { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--pink-d); }
.waterfall { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 900; margin-bottom: 12px; }
.wf { border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; background: #fff; text-align: center; }
.wf small { display: block; font-size: 11px; color: var(--muted); }
.wf b { font-family: var(--dot); font-weight: 400; font-size: 18px; }
.wf.plus { background: var(--green); } .wf.minus { background: var(--pink); color: #fff; } .wf.minus small { color: #fff; } .wf.fin { background: var(--yellow); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.filters button { border: 2px solid var(--ink); background: #fff; border-radius: 999px; font-weight: 900; font-size: 12px; padding: 2px 12px; }
.filters button.on { background: var(--ink); color: #fff; }

/* ── 助言 ── */
.adv { display: grid; gap: 12px; }
.advc { border: 3px solid var(--ink); border-left-width: 12px; border-radius: 14px; padding: 10px 14px; background: #fff; }
.advc b { font-size: 14px; display: block; } .advc p { margin: 4px 0 0; font-size: 13px; }
.advc .ask { margin-top: 6px; font-size: 12px; font-weight: 900; background: #e6f8ff; border-radius: 8px; padding: 4px 8px; display: inline-block; }
.advc.danger { border-left-color: var(--pink-d); background: #fff4f9; } .advc.warn { border-left-color: #ffa21a; background: #fff9ed; }
.advc.check { border-left-color: var(--yellow); } .advc.info { border-left-color: var(--cyan); } .advc.good { border-left-color: var(--green); background: #f1fff7; }
.advc .lv { font-size: 11px; font-weight: 900; border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; margin-right: 6px; background: #fff; }
.boss-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.boss-head .bubble { font-size: 16px; padding: 14px 18px; }
.checks { display: grid; gap: 6px; }
.checks label { display: flex; gap: 8px; font-size: 13px; font-weight: 700; align-items: flex-start; }
.checks input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--green-d); }
.aitext { white-space: pre-wrap; background: #f7fdff; border: 3px solid var(--ink); border-radius: 14px; padding: 14px; font-size: 14px; }

.notice { border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; background: #fff9d6; font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.notice.err { background: #ffe1ef; }
.market-res { background: #f1fff7; border: 3px solid var(--ink); border-radius: 14px; padding: 12px 14px; margin-top: 12px; font-size: 13px; }
.market-res ul { margin: 6px 0; padding-left: 20px; }
.kv { display: grid; grid-template-columns: 170px 1fr auto; gap: 4px 10px; font-size: 13px; align-items: center; }
.kv b { font-weight: 900; }
.tablewrap { overflow-x: auto; }
.rule-grp { margin-top: 14px; }
.rule-input { width: 80px !important; padding: 3px 6px !important; text-align: right; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 900; z-index: 99; border: 3px solid var(--yellow); }
.small { font-size: 12px; color: var(--muted); }
.caselist { display: grid; gap: 8px; }
.caseitem { display: flex; gap: 10px; align-items: center; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; background: #fff; }
.caseitem b { flex: 1; font-size: 14px; }
.caseitem small { color: var(--muted); }
@media print { .topbar, .stepnav, .side { display: none; } }

/* ── 売却査定 ── */
.compcard { border: 3px solid var(--ink); border-radius: 16px; padding: 12px 14px; margin-top: 14px; background: #fbfeff; }
.compcard.use-ref { background: #f6f6f6; border-style: dashed; }
.compcard.use-exclude { background: #f0f0f0; border-style: dotted; opacity: .7; }
.comphead { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.comphead .f { width: 120px; } .comphead .f label { display: none; }
.complabel { display: inline-block; min-width: 38px; height: 38px; line-height: 32px; text-align: center; font-size: 20px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 50%; font-family: var(--dot); }
.presets { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
table.t.sale { font-size: 11.5px; } table.t.sale td, table.t.sale th { padding: 5px 6px; }
table.t tr.dim td { color: #8a97a3; background: #f7f7f7; }
.schemes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.scheme.best h3 { color: var(--green-d); }

.srctag { display: inline-block; font-size: 11px; font-weight: 900; border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.srctag.manual { background: var(--green); } .srctag.net { background: var(--cyan); } .srctag.prov { background: var(--yellow); }
.tag.lv-rough { background: var(--cyan-d) !important; } .tag.lv-precise { background: var(--pink) !important; } .tag.lv-final { background: var(--green-d) !important; }
