:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --surface-2: #f0ede7;
  --line: #e2ddd4;
  --ink: #1f1d1a;
  --ink-2: #57524b;
  --ink-3: #8a847a;
  --accent: #2f4a3e;      /* deep loden green */
  --accent-2: #e8efe9;
  --warm: #b4572d;        /* terracotta for alerts / rush */
  --warm-2: #f8ebe3;
  --up: #2e7d4f;
  --down: #b4442d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 29, 26, .06), 0 4px 16px rgba(31, 29, 26, .05);
  --font: "Noto Sans JP", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* Shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #f1eee8; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; letter-spacing: .02em; padding: 4px 10px 18px; font-size: 15px; }
.brand small { display: block; font-weight: 400; color: #b9b3a8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #d9d4ca; text-decoration: none; }
.nav a.on, .nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.side .foot { margin-top: auto; font-size: 12px; color: #b9b3a8; display: grid; gap: 8px; padding: 0 10px; }
.side .foot select { background: transparent; border: 1px solid #4a463f; border-radius: 6px; padding: 4px 6px; color: #f1eee8; }
.side .foot button { background: none; border: 0; color: #b9b3a8; padding: 0; text-align: left; cursor: pointer; }
.meter { height: 4px; background: #3a3732; border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: #9fc2ad; }
main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0; letter-spacing: .01em; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); padding: 6px 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent); }
label.field { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > .grow { flex: 1 1 220px; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; background: var(--surface-2); color: var(--ink-2); }
.pill.introduction { background: #e6eefb; color: #2b4f8c; }
.pill.growth { background: var(--accent-2); color: var(--accent); }
.pill.maturity { background: #f3eedf; color: #7b6420; }
.pill.decline { background: var(--warm-2); color: var(--warm); }
.pill.rush { background: var(--warm-2); color: var(--warm); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 12px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.up { color: var(--up); } .down { color: var(--down); }

/* Stepper */
.steps { display: flex; gap: 6px; margin: 0 0 18px; overflow-x: auto; }
.steps button { flex: 1 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; cursor: pointer; text-align: left; min-width: 140px; }
.steps button b { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.steps button.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.steps button.on b { color: #cfe0d5; }
.steps button.done:not(.on) { border-color: #b7cdbf; }

/* Fabric tiles */
.fabric { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: start; }
.fabric img, .ph { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.fabric .t { font-weight: 600; font-size: 13px; }
.fabric .s { font-size: 12px; color: var(--ink-2); }
.tile { cursor: pointer; }
.tile:hover { border-color: var(--ink-3); }
.prod img { aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; background: var(--surface-2); width: 100%; }
.prod .n { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; }
.rank { position: absolute; top: 6px; left: 6px; background: var(--ink); color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 6px; }

/* Bars */
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 64px; gap: 8px; align-items: center; font-size: 12px; }
.bar .track { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.tbl tr.sel td { background: var(--accent-2); }

/* Charts */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid line { stroke: var(--line); }
svg.chart text { fill: var(--ink-3); font-size: 10px; }

/* Chat */
.chat { display: grid; grid-template-columns: 240px 1fr; gap: 16px; height: calc(100vh - 110px); }
.threads { overflow-y: auto; display: grid; align-content: start; gap: 4px; }
.threads a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.threads a.on, .threads a:hover { background: var(--surface); color: var(--ink); }
.convo { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.msgs { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 16px; align-content: start; }
.msg { max-width: 860px; }
.msg.user { justify-self: end; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 14px 14px 2px 14px; white-space: pre-wrap; }
.msg.assistant .body { line-height: 1.7; }
.msg.assistant .body p { margin: 0 0 8px; }
.msg.assistant .body table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.msg.assistant .body th, .msg.assistant .body td { border: 1px solid var(--line); padding: 4px 8px; }
.toolchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 99px; padding: 3px 10px; margin: 0 6px 6px 0; }
.toolchip.err { background: var(--warm-2); color: var(--warm); }
.toolchip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.toolchip.run .dot { animation: pulse 1s infinite; background: var(--ink-3); }
@keyframes pulse { 50% { opacity: .3; } }
.compose { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 8px; }
.compose textarea { min-height: 46px; max-height: 200px; }
.cards { display: grid; gap: 10px; margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cards .wide { grid-column: 1 / -1; }

/* Overlays */
.modal-bg { position: fixed; inset: 0; background: rgba(31,29,26,.35); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { background: var(--surface); border-radius: 12px; padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; display: grid; gap: 12px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); box-shadow: -8px 0 30px rgba(0,0,0,.12); z-index: 15; overflow-y: auto; padding: 22px; display: grid; gap: 14px; align-content: start; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 30; max-width: 90vw; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.status.err { color: var(--warm); }
.note { font-size: 12px; color: var(--ink-3); border-left: 3px solid var(--line); padding-left: 10px; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.imgs figure { margin: 0; } .imgs img { border-radius: 8px; border: 1px solid var(--line); width: 100%; }
.imgs video { border-radius: 8px; border: 1px solid var(--line); width: 100%; background: #000; display: block; }
.chip-card { margin-top: 8px; } .imgs .fabric img { width: 84px; border: 0; }
.imgs figcaption { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background:
  radial-gradient(1200px 600px at 10% -10%, #e4ebe5 0, transparent 60%), var(--bg); }
.login .card { width: min(380px, 100%); padding: 28px; display: grid; gap: 14px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .brand { padding: 0 8px 0 0; } .brand small { display: none; }
  .nav { display: flex; flex-wrap: wrap; }
  .side .foot { margin: 0 0 0 auto; grid-auto-flow: column; align-items: center; }
  .meter, .side .foot .who { display: none; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .threads { display: none; }
  .convo { height: calc(100vh - 160px); }
}

/* ── v2 UX ── */
.hero { padding: 6px 0 18px; } .hero h1 { font-size: 26px; } .hero p { margin: 6px 0 0; }
.qa-card { display: grid; gap: 6px; text-decoration: none; color: inherit; min-height: 92px; align-content: start; }
.qa-card b { font-size: 15px; color: var(--accent); }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-row:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.lab-grid { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
.lab-side { display: grid; gap: 14px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.qlist { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; margin-top: 6px; }
.qitem { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px; cursor: pointer; }
.qitem:hover { border-color: var(--accent); }
.qitem img, .qitem .ph { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.qitem b { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qitem small { display: block; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrow { display: grid; grid-template-columns: 92px 1fr 38px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); }
.wrow input[type=range] { width: 100%; accent-color: var(--accent); }
.wrow em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.qcard { display: grid; gap: 8px; border-color: var(--accent); }
.result { position: relative; }
.rank-n { position: absolute; top: -8px; left: -8px; background: var(--ink); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.score { font-size: 20px; color: var(--accent); }
.fscores { display: grid; gap: 3px; margin-top: 6px; }
.fs { display: grid; grid-template-columns: 82px 1fr 28px; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-2); }
.fs i { height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.fs i b { display: block; height: 100%; background: var(--accent); opacity: .75; }
.fs em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.drop { border: 2px dashed var(--line); border-radius: 12px; min-height: 200px; display: grid; place-items: center; text-align: center; cursor: pointer; color: var(--ink-3); padding: 12px; background: var(--surface-2); }
.drop.over { border-color: var(--accent); background: var(--accent-2); }
.drop img { max-height: 260px; border-radius: 8px; }
.raw { max-height: 420px; overflow: auto; font-size: 11px; background: var(--surface-2); padding: 12px; border-radius: 8px; }
.empty { text-align: center; padding: 28px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; cursor: pointer; font-size: 13px; max-width: 100%; text-align: left; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.guide { margin: -8px 0 16px; font-size: 13px; color: var(--ink-2); background: var(--accent-2); border-radius: 8px; padding: 9px 12px; }
@media (max-width: 960px) { .lab-grid { grid-template-columns: 1fr; } .lab-side { position: static; max-height: none; } }
.tpe textarea { min-height: 90px; }
table.edit input { width: 100%; min-width: 70px; padding: 5px 6px; font-size: 12px; }
table.edit input.w-s { min-width: 56px; } table.edit input.w-n { min-width: 64px; } table.edit input.w-l { min-width: 220px; }
table.edit td.num { font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.fb-btn { position: fixed; right: 18px; bottom: 18px; z-index: 12; background: var(--ink); color: #fff; border: 0; border-radius: 99px; padding: 10px 16px; box-shadow: var(--shadow); cursor: pointer; font-size: 13px; }
.fb-btn:hover { background: var(--accent); }
.stars { display: flex; gap: 4px; } .stars button { border: 0; background: none; font-size: 26px; color: var(--line); cursor: pointer; padding: 0 2px; } .stars button.on { color: #c9962c; }
.answer-fb { display: flex; gap: 6px; margin-top: 6px; opacity: .75; } .answer-fb:hover { opacity: 1; }
.th-row { display: flex; align-items: center; } .th-row a { flex: 1; min-width: 0; }
.th-del { border: 0; background: none; color: var(--ink-3); cursor: pointer; opacity: 0; padding: 4px 6px; } .th-row:hover .th-del { opacity: 1; }
.help h3 { margin-top: 18px; } .help p, .help li { line-height: 1.8; }
@media (max-width: 860px) { .fb-btn { bottom: 12px; right: 12px; padding: 8px 12px; } }
.msg.assistant .body hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.msg.assistant .body ol, .msg.assistant .body ul { margin: 4px 0 10px; padding-left: 22px; }
.msg.assistant .body td, .msg.assistant .body th { vertical-align: top; }
.msg.assistant .body th { background: var(--surface-2); text-align: left; }

.cards-h { margin: 12px 0 6px; font-weight: 600; }
.more-cards { margin-top: 8px; }
.more-cards > summary { cursor: pointer; color: var(--ink-2, #555); padding: 6px 0; }

/* Consumer panel */
.bar .track.ci { position: relative; overflow: visible; }
.bar .track.ci b { position: absolute; top: -3px; height: 14px; border-left: 1px solid var(--ink-3); border-right: 1px solid var(--ink-3); }
.quote { margin: 2px 0 0 10px; color: var(--ink-2); }
details summary { cursor: pointer; margin-top: 8px; }

/* ── Workspace: tool rail (left of the canvas) + AI chat dock (right), Miro-style ── */
.shell { grid-template-columns: 220px minmax(0, 1fr); }
.shell.dock-open { grid-template-columns: 220px minmax(0, 1fr) 400px; }
.dock { display: none; }
.shell.dock-open .dock { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-left: 1px solid var(--line); background: var(--surface); min-width: 0; }
.work { display: grid; grid-template-columns: 64px minmax(0, 1fr); min-width: 0; }
.shell.no-dock .work { grid-template-columns: 64px minmax(0, 1fr); }
.rail { position: sticky; top: 16px; align-self: start; margin: 16px 0 0 10px; display: grid; gap: 2px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); width: 52px; z-index: 5; }
.rail button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink-2); }
.rail button:hover, .rail button.on { background: var(--accent-2); color: var(--accent); }
.rail svg, .btn.icon svg, .lv-add svg, .qa-card svg, .lv-img svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail button span { position: absolute; left: 48px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--ink); color: #fff; font-size: 12px;
  padding: 4px 8px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.rail button:hover span { opacity: 1; }
.dock-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.dock-body { flex: 1; min-height: 0; display: flex; }
.dock-body .convo { flex: 1; border: 0; border-radius: 0; }
.convo.compact .msgs { padding: 14px; }
.convo.compact .msg { max-width: 100%; }
.convo.compact .cards { grid-template-columns: 1fr; }
#cv { min-height: 0; display: flex; } #cv .convo { flex: 1; }
.btn.icon { padding: 6px; }
.att { display: flex; gap: 6px; padding: 8px 12px 0; flex-wrap: wrap; }
.thumb { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; border: 0; background: rgba(0,0,0,.55); color: #fff; border-radius: 99px; width: 18px; height: 18px; line-height: 16px; cursor: pointer; padding: 0; }
.msg-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.msg-imgs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.pmenu { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); display: grid; padding: 4px; min-width: 180px; }
.pmenu button { border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.pmenu button:hover { background: var(--surface-2); }
.cam video { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; }
.pick { border: 2px solid transparent; border-radius: 10px; background: var(--surface-2); padding: 4px; cursor: pointer; display: grid; gap: 4px; }
.pick img { aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; width: 100%; }
.pick.on { border-color: var(--accent); }
.seg { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.meter.light { background: var(--surface-2); margin-top: 10px; height: 6px; }
.meter.light i { background: var(--accent); }

/* Scenario on home */
.scen { margin-bottom: 18px; }
.scen-steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; counter-reset: s; }
.scen-steps li button { width: 100%; height: 100%; display: grid; gap: 4px; align-content: start; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; position: relative; }
.scen-steps li button:hover { border-color: var(--accent); }
.scen-steps li:not(:last-child) button::after { content: "→"; position: absolute; right: -9px; top: 18px; color: var(--ink-3); font-size: 12px; background: var(--bg); }
.scen-steps svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.6; }
.scen-steps .n { position: absolute; top: 10px; right: 10px; font-size: 11px; color: var(--ink-3); }
.scen-steps li.dim { opacity: .35; }
.scen-hint { margin-top: 10px; padding: 8px 10px; background: var(--accent-2); border-radius: 8px; color: var(--accent); }

/* 顧客の声 */
.scope { background: var(--accent-2); color: var(--ink-2); border-radius: 10px; padding: 10px 14px; font-size: 12.5px; }
.scope b { color: var(--accent); margin-right: 6px; }
.ai-credit { font-size: 11px; color: var(--ink-3); margin: 18px 0 0; }
.qa-card b { display: flex; align-items: center; gap: 8px; }
.lv-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.lv-item { display: grid; gap: 8px; align-content: start; }
.lv-img { position: relative; aspect-ratio: 1/1; max-height: 240px; background: var(--surface-2); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.lv-img img { width: 100%; height: 100%; object-fit: cover; }
.lv-img > .btn { flex-direction: column; white-space: normal; text-align: center; font-size: 12px; background: transparent; border-style: dashed; }
.lv-img > .btn.sm { position: absolute; top: 6px; right: 6px; background: var(--surface); border-style: solid; }
.lv-add { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 160px; border-style: dashed; cursor: pointer; color: var(--accent); font: inherit; }
.lv-rank { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lv-card { position: relative; padding: 0; overflow: hidden; display: grid; align-content: start; }
.lv-card > img, .lv-noimg { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: var(--surface-2); }
.lv-noimg { display: grid; place-items: center; padding: 16px; text-align: center; font-weight: 600; color: var(--ink-2); }
.lv-body { padding: 12px 14px 14px; }
.lv-badge { position: absolute; top: 10px; left: 10px; width: 32px; height: 32px; border-radius: 99px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: var(--shadow); }
.lv-badge.sm { position: static; width: 22px; height: 22px; font-size: 12px; }
.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ibar { position: relative; height: 8px; background: var(--surface-2); border-radius: 6px; margin-top: 4px; }
.ibar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 6px; opacity: .85; }
.ibar b { position: absolute; top: -3px; height: 14px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.buybar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; margin-top: 10px; background: var(--surface-2); }
.buybar .b { background: var(--up); } .buybar .u { background: #d6c58f; } .buybar .n { background: var(--down); opacity: .7; }
.trust .grid > div { display: grid; gap: 2px; align-content: start; }
.jpmap { width: 100%; height: auto; }
.jpmap path { stroke: #fff; stroke-width: .7; cursor: pointer; }
.jpmap path.sel { stroke: var(--ink); stroke-width: 1.4; }
.jpmap .inset { fill: none; stroke: var(--line); }
.jpmap .dots circle { fill: rgba(31,29,26,.55); stroke: #fff; stroke-width: .8; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; align-items: center; margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.legend .grad { width: 120px; height: 10px; border-radius: 4px; background: linear-gradient(90deg, rgb(232,239,233), rgb(47,74,62)); }
.heat td.num { text-align: center; }
.lv-detail details { border-top: 1px solid var(--line); padding: 10px 0; }
.lv-detail summary { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.lv-thumb { object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); display: inline-block; }
.vfilters { gap: 8px; margin: 10px 0; flex-wrap: wrap; align-items: end; }
.vfilters .field { width: 150px; } .vfilters .field.grow { flex: 1; min-width: 160px; }
.voice { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 8px; }
.voice .who { display: grid; gap: 2px; }
.vitem { display: grid; grid-template-columns: 40px 1fr; gap: 10px; font-size: 13px; }
.vvote { color: var(--ink-2); background: var(--surface-2); border-radius: 6px; padding: 6px 8px; }
.up { color: var(--up); } .down { color: var(--down); }
.lv-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.lv-mini > div { display: grid; gap: 4px; position: relative; }
.lv-mini img { aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; width: 100%; }
.lv-mini .lv-badge { position: absolute; top: 4px; left: 4px; }

@media (max-width: 1280px) { .shell.dock-open { grid-template-columns: 220px minmax(0, 1fr) 340px; } .scen-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell.dock-open, .shell { grid-template-columns: 1fr; }
  .work, .shell.no-dock .work { grid-template-columns: 1fr; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; margin: 0; border-radius: 0; grid-auto-flow: column; justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 30; }
  .rail button span { display: none; }
  main { padding-bottom: 90px; }
  .shell.dock-open .dock { position: fixed; inset: 0 0 calc(56px + env(safe-area-inset-bottom, 0px)) 0; height: auto; z-index: 40; border: 0; }
  .scen-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scen-steps li button::after { display: none; }
  .fb-btn { bottom: 76px; }
}
div.field { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.shell.dock-open ~ .fb-btn, .fb-btn.docked { right: 416px; }
@media (max-width: 1600px) { .shell.dock-open .scen-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } .shell.dock-open .scen-steps li:nth-child(3) button::after { display: none; } }
@media (max-width: 1280px) { .shell.dock-open ~ .fb-btn { right: 356px; } }
@media (max-width: 860px) { .shell.dock-open ~ .fb-btn { right: 12px; } }
.tbl.wo input { width: 80px; padding: 4px 6px; } .tbl.wo td:first-child input { width: 140px; }
.rail [data-tool="feedback"] { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
@media (min-width: 861px) { .fb-btn { display: none; } }
@media (max-width: 860px) { .rail [data-tool="feedback"] { display: none; } }

/* ── Login: StyleM brand panel + form ── */
.lg { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); background: var(--bg); }
.lg-brand { position: relative; overflow: hidden; background: var(--ink); color: #f1eee8; padding: 44px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; gap: 40px; }
.lg-mark { font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.lg-mark small { display: block; font-weight: 400; color: #b9b3a8; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.lg-mark.sm { font-size: 16px; color: var(--ink); } .lg-mark.sm small { color: var(--ink-3); }
.lg-copy { margin-top: auto; max-width: 520px; position: relative; z-index: 1; }
.lg-copy h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.3; margin: 0 0 14px; letter-spacing: .01em; text-wrap: balance; word-break: keep-all; }
.lg-copy p { color: #cfc9be; margin: 0 0 26px; line-height: 1.8; }
.lg-copy ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lg-copy li { display: flex; align-items: center; gap: 12px; color: #e6e1d8; font-size: 13.5px; }
.lg-copy li svg { width: 20px; height: 20px; flex: none; stroke: #9fc2ad; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lg-foot { margin-top: auto; font-size: 11px; color: #8a847a; letter-spacing: .08em; position: relative; z-index: 1; }
/* a quiet woven texture in loden: warp and weft lines */
.lg-weave { position: absolute; right: -80px; top: -60px; width: 420px; height: 420px; opacity: .22; transform: rotate(12deg);
  background: repeating-linear-gradient(0deg, #2f4a3e 0 6px, transparent 6px 12px), repeating-linear-gradient(90deg, #9fc2ad 0 6px, transparent 6px 12px);
  -webkit-mask: radial-gradient(circle at 60% 40%, #000 0 45%, transparent 70%); mask: radial-gradient(circle at 60% 40%, #000 0 45%, transparent 70%); }
.lg-form { display: grid; place-items: center; padding: 32px 20px; }
.lg-form form { width: min(400px, 100%); display: grid; gap: 14px; }
.lg-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.lg-top select { width: auto; padding: 5px 8px; font-size: 12px; }
.lg-form h2 { font-size: 22px; margin: 0; }
.lg-form p { margin: 0; }
.pw { position: relative; display: block; } .pw input { padding-right: 64px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--accent); font-size: 12px; cursor: pointer; }
.lg-go { justify-content: center; padding: 11px 14px; font-size: 15px; margin-top: 4px; }
.lg-help { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px !important; }
@media (max-width: 860px) {
  .lg { grid-template-columns: 1fr; }
  .lg-brand { padding: 28px 22px; gap: 18px; } .lg-copy { margin-top: 0; } .lg-copy ul, .lg-foot { display: none; }
  .lg-weave { width: 260px; height: 260px; right: -90px; }
}
@media (min-width: 861px) { .lg-top .lg-mark { visibility: hidden; } }
.credit-rakuten { font-size: 10.5px; } .credit-rakuten a { color: #b9b3a8; }
@media (max-width: 860px) { .credit-rakuten { display: none; } }
