:root {
  --ink: #1d1d1b;
  --sub: #6b6862;
  --line: rgba(29, 29, 27, .12);
  --card: rgba(252, 251, 248, .92);
  --solid: #fcfbf8;
  --brand: #e0775a;
  --brand2: #c45f43;
  --mint: #7cc4b6;
  --ok: #3f7d5c;
  --shadow: 0 18px 50px rgba(20, 18, 14, .18);
  --r: 16px;
  font-family: "Noto Sans JP", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfd8de; color: var(--ink); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
.muted { color: var(--sub); font-size: 13px; line-height: 1.7; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }

/* loading */
#loading { position: fixed; inset: 0; z-index: 50; background: #fbedcf; display: grid; place-content: center; gap: 14px; text-align: center; transition: opacity .6s; }
#loading.out { opacity: 0; pointer-events: none; }
.ld-mark { font-family: "M PLUS Rounded 1c", "Noto Sans JP", sans-serif; font-weight: 800; letter-spacing: .3em; font-size: 22px; }
.ld-bar { width: 220px; height: 3px; background: #e2dcd2; overflow: hidden; border-radius: 3px; }
.ld-bar i { display: block; width: 40%; height: 100%; background: var(--brand); animation: ld 1.1s infinite ease-in-out; }
@keyframes ld { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
#loading p { color: var(--sub); font-size: 13px; margin: 0; }

/* top bar */
#topbar { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 10; display: flex; align-items: center; gap: 12px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; background: var(--card); backdrop-filter: blur(14px); padding: 9px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; letter-spacing: .12em; }
.logo { display: inline-block; width: 28px; height: 28px; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.brandlink { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; white-space: nowrap; }
.brand { flex: none; }
.seg { display: flex; background: var(--card); backdrop-filter: blur(14px); padding: 4px; border-radius: 12px; box-shadow: var(--shadow); }
.seg button { padding: 8px 14px; border-radius: 9px; font-size: 13px; white-space: nowrap; color: var(--sub); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button.walk { color: var(--brand2); font-weight: 700; }
.seg button.walk.on { background: var(--brand); color: #fff; }
.tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tools .icon { width: 40px; height: 40px; border-radius: 12px; background: var(--card); backdrop-filter: blur(14px); box-shadow: var(--shadow); font-size: 16px; }
.time { display: flex; align-items: center; gap: 8px; background: var(--card); backdrop-filter: blur(14px); padding: 8px 12px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; }
.time input { width: 130px; accent-color: var(--brand); }
#timeLabel { width: 40px; font-variant-numeric: tabular-nums; }

/* panel */
#panel { position: fixed; top: 72px; right: 12px; bottom: 12px; width: 360px; z-index: 9; background: var(--card); backdrop-filter: blur(18px); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 6px 6px 0; }
.tabs button { flex: 1; padding: 10px 4px 12px; font-size: 13px; color: var(--sub); border-bottom: 2px solid transparent; position: relative; }
.tabs button.on { color: var(--ink); border-color: var(--ink); font-weight: 700; }
.badge { position: absolute; top: 4px; right: 8px; background: var(--brand); color: #fff; font-size: 10px; border-radius: 10px; padding: 1px 6px; }
.tabbody { overflow-y: auto; padding: 16px 18px 24px; flex: 1; }
.sec { margin-bottom: 22px; }
.sec h3 { font-size: 12px; letter-spacing: .08em; color: var(--sub); margin: 0 0 10px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; background: #fff; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.sw.on { box-shadow: 0 0 0 2px var(--ink); }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.toggle small { display: block; color: var(--sub); font-size: 11px; }
.sw2 { width: 42px; height: 24px; border-radius: 99px; background: #d8d3ca; position: relative; transition: .2s; flex: none; }
.sw2::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.sw2.on { background: var(--ok); }
.sw2.on::after { left: 21px; }
.field { display: block; font-size: 12px; color: var(--sub); margin: 10px 0; }
.field input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; color: var(--ink); }
.primary { background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 12px; font-weight: 700; }
.primary:disabled { opacity: .35; }
.brandbtn { background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; width: 100%; }
.ghost { padding: 12px 18px; border-radius: 12px; color: var(--sub); }
.outline { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 14px; }

/* 間取りリスト */
.rooms { font-size: 13px; }
.rooms .fl { font-weight: 700; margin: 14px 0 6px; }
.rooms .r { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rooms .r span:last-child { color: var(--sub); font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11px; color: var(--sub); }
.minimap { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }

/* 見積り */
.price-total { background: var(--ink); color: #fff; border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.price-total small { opacity: .7; font-size: 12px; }
.price-total b { display: block; font-size: 34px; font-family: "Shippori Mincho", serif; margin: 4px 0; font-variant-numeric: tabular-nums; }
.price-total .m { font-size: 13px; opacity: .85; }
.plines .l { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plines .l span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* party */
.room-code { font-family: ui-monospace, monospace; font-size: 26px; letter-spacing: .2em; text-align: center; background: #fff; border: 1px dashed var(--brand); border-radius: 12px; padding: 12px; margin: 10px 0; }
.members { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.member { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 14px; }
.member .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.member .where { margin-left: auto; font-size: 11px; color: var(--sub); }
.member button { font-size: 11px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); }
.chatlog { height: 160px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.chatlog p { margin: 4px 0; line-height: 1.5; }
.chatlog b { margin-right: 6px; }
.colors { display: flex; gap: 8px; margin: 8px 0 4px; }

/* wizard */
#wizard { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; padding: 24px; pointer-events: none; }
#wizard .wz-card { pointer-events: auto; width: min(520px, 100%); max-height: calc(100% - 20px); overflow-y: auto; background: var(--card); backdrop-filter: blur(20px); border-radius: 22px; box-shadow: var(--shadow); padding: 26px 28px 22px; }
.wz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.wz-brand { display: flex; align-items: center; gap: 8px; letter-spacing: .14em; font-size: 13px; }
.wz-steps { display: flex; gap: 5px; }
.wz-steps i { width: 18px; height: 4px; border-radius: 4px; background: #ddd6cb; }
.wz-steps i.on { background: var(--brand); }
.wz-q { font-family: "Shippori Mincho", serif; font-size: 26px; line-height: 1.45; margin: 0 0 6px; }
.wz-sub { color: var(--sub); font-size: 13px; margin: 0 0 18px; line-height: 1.7; }
.hero h1 { font-family: "Shippori Mincho", serif; font-size: 34px; line-height: 1.4; margin: 6px 0 12px; }
.hero ul { padding: 0; list-style: none; margin: 18px 0 4px; display: grid; gap: 10px; }
.hero li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.6; }
.hero li b { display: block; }
.hero li .n { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; transition: .15s; }
.opt:hover { border-color: #bdb5a8; }
.opt.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.opt b { display: block; font-size: 16px; margin-bottom: 3px; }
.opt span { font-size: 12px; color: var(--sub); line-height: 1.5; }
.opt .pal { display: flex; gap: 4px; margin-bottom: 8px; }
.opt .pal i { width: 18px; height: 18px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset; }
.opt .big { font-size: 26px; display: block; margin-bottom: 6px; }
.wz-foot { display: flex; justify-content: space-between; margin-top: 22px; }
.wz-hint { position: fixed; right: 24px; bottom: 24px; background: rgba(20, 20, 20, .7); color: #fff; padding: 8px 14px; border-radius: 99px; font-size: 12px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(20, 18, 14, .35); display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--solid); border-radius: 20px; padding: 24px; width: min(420px, 100%); box-shadow: var(--shadow); }
.modal-card h2 { font-family: "Shippori Mincho", serif; margin: 0 0 6px; }

/* walk HUD */
#walkHud { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.hud-tip { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); background: rgba(20, 20, 20, .6); color: #fff; padding: 8px 14px; border-radius: 99px; font-size: 12px; white-space: nowrap; transition: opacity 1s; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .hud-tip { white-space: normal; text-align: center; border-radius: 14px; bottom: 200px; } }
.hud-room { position: absolute; left: 24px; top: 74px; font-family: "Shippori Mincho", serif; font-size: 22px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
#joy { position: absolute; left: 28px; bottom: 70px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .5); pointer-events: auto; display: none; touch-action: none; }
#joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; background: rgba(255, 255, 255, .85); }
.touch #joy { display: block; }
.emotes { position: absolute; right: 392px; bottom: 20px; display: flex; gap: 6px; pointer-events: auto; }
.emotes button { width: 42px; height: 42px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 20px; }
body.nopanel .emotes { right: 20px; }

/* labels */
.room-label { background: rgba(255, 255, 255, .92); border-radius: 8px; padding: 4px 9px 5px; font-size: 12px; line-height: 1.25; text-align: center; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); pointer-events: auto; cursor: pointer; white-space: nowrap; transition: background .15s; }
.room-label:hover { background: var(--ink); color: #fff; }
.room-label:hover small, .room-label:hover em { color: #ddd; }
.room-label b { display: block; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.room-label small { display: block; color: #2c2f33; font-size: 12px; font-weight: 600; }
.room-label em { display: block; font-style: normal; color: var(--sub); font-size: 10px; }
.room-label.sm { padding: 2px 6px; font-size: 10px; display: flex; gap: 4px; align-items: baseline; }
.room-label.sm b { font-size: 11px; display: inline; }
.room-label.sm small { display: inline; font-size: 10px; font-weight: 500; color: var(--sub); }
.plan-dim { font: 600 12px/1 system-ui, sans-serif; color: #2f3236; background: rgba(255, 255, 255, .85); padding: 2px 5px; border-radius: 4px; pointer-events: none; letter-spacing: .03em; }
.plan-dim.v { writing-mode: vertical-rl; padding: 5px 2px; }
.plan-road { font: 700 13px/1 system-ui, sans-serif; color: #fff; background: rgba(60, 64, 70, .75); padding: 4px 14px; border-radius: 4px; letter-spacing: .4em; pointer-events: none; }
.plan-north { pointer-events: none; }
.plan-north span { display: flex; flex-direction: column; align-items: center; width: 34px; height: 34px; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 6px rgba(0, 0, 0, .2); color: #c4473a; font-size: 13px; line-height: 1; }
.plan-north b { color: #2c2f33; font-size: 11px; }
.nametag { transform: translateY(-6px); text-align: center; pointer-events: none; }
.nametag .n { display: inline-block; padding: 3px 9px; border-radius: 99px; color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.nametag .bubble { display: block; margin: 0 auto 4px; background: #fff; color: var(--ink); padding: 6px 10px; border-radius: 12px; font-size: 13px; max-width: 220px; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); white-space: normal; }
.nametag .emo { display: block; font-size: 34px; animation: pop .4s; }
@keyframes pop { from { transform: scale(.2); } }

/* chat float */
#chatFloat { position: fixed; left: 16px; bottom: 16px; z-index: 9; width: 300px; }
#chatFloatLog { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
#chatFloatLog p { margin: 0; background: rgba(20, 20, 20, .55); color: #fff; padding: 5px 10px; border-radius: 10px; font-size: 13px; width: fit-content; max-width: 100%; animation: fade 8s forwards; }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#chatFloatInput { width: 100%; padding: 9px 12px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .9); box-shadow: var(--shadow); font-size: 13px; }
.touch #chatFloat { left: auto; right: 16px; bottom: 210px; width: 220px; }

#toast { position: fixed; top: 76px; left: 50%; transform: translate(-50%, -20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 13px; z-index: 60; opacity: 0; transition: .3s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  #topbar { flex-wrap: wrap; top: 8px; left: 8px; right: 8px; gap: 6px; }
  .brand b { display: none; }
  .seg button { padding: 7px 9px; font-size: 12px; }
  .tools { margin-left: 0; width: 100%; }
  .time { flex: 1; }
  .time input { flex: 1; width: auto; min-width: 0; }
  .tools .icon { width: 36px; height: 36px; flex: none; }
  #panel { top: auto; left: 8px; right: 8px; width: auto; height: 46vh; bottom: 8px; }
  #wizard { align-items: flex-end; padding: 10px; }
  #wizard .wz-card { padding: 20px 18px 16px; max-height: 64vh; }
  .wz-q { font-size: 21px; }
  .hero h1 { font-size: 25px; }
  .wz-hint { display: none; }
  .emotes { right: 16px; bottom: auto; top: 120px; flex-direction: column; }
  .hud-room { top: 112px; font-size: 18px; }
}

/* タップして編集 */
#partPop { position: fixed; z-index: 30; width: 300px; background: var(--solid); border-radius: 16px; box-shadow: 0 20px 60px rgba(20, 18, 14, .28); padding: 14px 16px 16px; animation: ppIn .18s ease-out; }
@keyframes ppIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.pp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pp-head b { font-size: 15px; }
.pp-head button { width: 28px; height: 28px; border-radius: 50%; background: #efebe4; font-size: 12px; }
#partPop .sec { margin-bottom: 12px; }
#partPop .sec:last-child { margin-bottom: 0; }
.tap-hint { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 8; background: rgba(20, 20, 20, .7); color: #fff; padding: 8px 16px; border-radius: 99px; font-size: 12px; pointer-events: none; transition: opacity .6s; }
@media (max-width: 900px) { #partPop { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: 8px; max-height: 50vh; overflow-y: auto; } }

.landbtn { height: 40px; padding: 0 14px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; }
#photoBar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 12; width: min(760px, calc(100% - 32px)); background: var(--card); backdrop-filter: blur(16px); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 16px; display: grid; gap: 10px; }
.pb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.pb-tip { font-size: 12px; }
.pb-slider { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); }
.pb-slider input { width: 160px; accent-color: var(--brand); }
#pbExit { margin-left: auto; padding: 9px 18px; }
#pbSuggest .chip { margin-left: 4px; }
body.photo #panel, body.photo #modes [data-mode="walk"] { display: none !important; }
@media (max-width: 900px) { .landbtn { padding: 0 10px; font-size: 12px; height: 36px; } .pb-tip { display: none; } }

@media (max-width: 600px) { .lb-t { display: none; } .landbtn { width: 36px; padding: 0; } }
/* 土地の入力 */
.lotinputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.lotinputs label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); }
.lotinputs span { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.lotinputs input, .lotinputs select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; background: #fff; }
.lotresult { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6; }
.lotresult p { margin: 4px 0 0; }
.lotresult.ok { background: #e8f4ee; color: #24583f; }
.lotresult.ng { background: #fbece6; color: #8a3a1e; }
/* スタイル選び：写真つきカード */
.opt.has-img { padding: 8px 8px 12px; }
.opt .thumb { display: block; position: relative; margin-bottom: 8px; border-radius: 10px; overflow: hidden; aspect-ratio: 16/10; background: #eee; }
.opt .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.opt .thumb em { position: absolute; left: 6px; top: 6px; font-style: normal; font-size: 10px; font-weight: 700; background: rgba(28, 28, 28, .82); color: #fff; padding: 2px 8px; border-radius: 99px; letter-spacing: .06em; }
.opt.has-img b, .opt.has-img > span:not(.thumb) { padding: 0 4px; }

/* ---------- 間取りエディタ ---------- */
#editor { position: fixed; z-index: 15; left: 12px; top: 72px; bottom: 12px; width: min(720px, 56vw); background: var(--card); backdrop-filter: blur(18px); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 14px 16px 12px; gap: 10px; }
body.editing #panel { display: none !important; }
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ed-head b { font-size: 16px; display: block; }
.ed-head small { color: var(--sub); font-size: 12px; }
.ed-floors { display: flex; background: #efe9de; border-radius: 10px; padding: 3px; }
.ed-floors button { padding: 6px 16px; border-radius: 8px; font-size: 13px; color: var(--sub); }
.ed-floors button.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.ed-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 12px; cursor: grab; touch-action: none; user-select: none; }
.ed-chip:hover { border-color: var(--ink); }
.ed-chip i { width: 12px; height: 12px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12) inset; }
.ed-canvas { flex: 1; min-height: 220px; position: relative; }
.ed-canvas canvas { position: absolute; inset: 0; touch-action: none; }
.ed-sel { display: flex; align-items: center; gap: 8px; font-size: 12px; background: #fff; border-radius: 10px; padding: 6px 10px; border: 1px solid var(--line); }
.ed-sel span { flex: 1; }
.ed-sel button { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12px; background: #fff; }
.ed-status { font-size: 12px; max-height: 110px; overflow-y: auto; }
.ed-status .ed-kpi { display: flex; gap: 16px; color: var(--sub); flex-wrap: wrap; }
.ed-status .ed-kpi b { color: var(--ink); }
.ed-status ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.ed-status .err { color: #c2412b; }
.ed-status .warn { color: #a06a1a; }
.ed-status .ok { color: #3f7d5c; margin: 6px 0 0; }
.ed-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ed-foot .ghost { padding: 8px 10px; font-size: 12px; }
.ed-foot .primary { padding: 10px 22px; }
.seg button.edit { color: var(--brand2); font-weight: 700; }
@media (max-width: 900px) {
  #editor { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 62vh; border-radius: 18px 18px 0 0; padding: 10px 12px; }
  .ed-palette { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .ed-chip { flex: none; }
  .ed-head small { display: none; }
  .ed-foot .ghost { display: none; }
}
.lotinputs .lot-trap { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.lotinputs .lot-trap input { width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--brand); }
.lot-preview { grid-column: 1 / -1; display: flex; justify-content: center; padding: 6px 0 0; }
.lot-preview svg { max-width: 100%; height: auto; }

/* ---------- 設計図面ビューア ---------- */
.drawbtn { height: 40px; padding: 0 14px; border-radius: 12px; background: #fff; color: var(--ink, #2b2b2b); font-weight: 700; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; border: 1.5px solid #2b2b2b; }
#drawView { position: fixed; inset: 0; z-index: 80; background: #e9e7e3; display: flex; flex-direction: column; }
#drawView.hidden { display: none; }
.dv-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.08); flex-wrap: wrap; }
.dv-bar b { font-size: 15px; white-space: nowrap; }
.dv-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.dv-tabs button, .dv-bar > button { border: 1px solid #d8d4cc; background: #faf8f4; border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.dv-sp { flex: 1; }
.dv-bar .dv-print { background: #2b2b2b; color: #fff; border-color: #2b2b2b; font-weight: 700; }
.dv-body { flex: 1; overflow: auto; padding: 24px 16px 60px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.dv-sheet { width: min(1200px, 100%); box-shadow: 0 10px 30px rgba(0,0,0,.15); background: #fff; scroll-margin-top: 16px; }
.dv-sheet svg { display: block; width: 100%; height: auto; }
.dv-wait { margin-top: 80px; color: #6b6b70; }
@media print {
  @page { size: A3 landscape; margin: 0; }
  body.drawing > *:not(#drawView) { display: none !important; }
  body.drawing #drawView { position: static; background: #fff; display: block; }
  body.drawing .dv-bar { display: none; }
  body.drawing .dv-body { padding: 0; display: block; overflow: visible; }
  body.drawing .dv-sheet { width: 420mm; height: 297mm; box-shadow: none; break-after: page; page-break-after: always; }
  body.drawing .dv-sheet svg { width: 420mm; height: 297mm; }
}

/* ---------- かんたん操作：画面下のボタン ---------- */
body.has-dock #modes, body.has-dock #btnDraw { display: none; }
#dock { position: fixed; z-index: 12; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; background: var(--card); backdrop-filter: blur(16px); border-radius: 20px; box-shadow: 0 10px 34px rgba(0, 0, 0, .18); }
#dock.hidden { display: none; }
body.has-dock:not(.nopanel) #dock { left: calc((100% - 384px) / 2); }
#dock button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px; padding: 8px 8px 7px; border-radius: 14px; font-size: 12px; font-weight: 700; color: var(--ink); background: transparent; transition: background .15s, transform .1s; }
#dock button i { font-style: normal; font-size: 22px; line-height: 1; }
#dock button:hover { background: rgba(0, 0, 0, .05); }
#dock button:active { transform: scale(.96); }
#dock button.on { background: var(--ink); color: #fff; }
#dock button.lead { background: var(--brand); color: #fff; margin-left: 4px; }
#dock button.lead:hover { filter: brightness(1.05); }
body.has-dock .tap-hint, body.has-dock .hud-tip { bottom: 104px; }

@media (max-width: 900px) {
  body.has-dock #btnShot, body.has-dock #btnLand { display: none; }
  #dock, body.has-dock:not(.nopanel) #dock { left: 6px; right: 6px; bottom: 6px; transform: none; justify-content: space-between; gap: 2px; padding: 5px; border-radius: 18px; }
  #dock button { min-width: 0; flex: 1; padding: 7px 2px 6px; font-size: 10px; letter-spacing: -.02em; }
  #dock button i { font-size: 20px; }
  #dock button.lead { margin-left: 0; }
  body.has-dock #panel { bottom: 78px; height: 44vh; }
  body.has-dock .tap-hint, body.has-dock .hud-tip { bottom: 88px; }
  body.has-dock #joy { bottom: 100px; }
}

/* ---------- この家で相談する ---------- */
#leadView { position: fixed; inset: 0; z-index: 70; background: rgba(20, 18, 14, .45); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
#leadView.hidden { display: none; }
.lead-card { position: relative; width: min(520px, 100%); background: var(--solid, #fff); border-radius: 22px; padding: 26px 24px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); display: grid; gap: 10px; max-height: calc(100vh - 32px); overflow-y: auto; }
.lead-card h2 { margin: 0; font-size: 22px; }
.lead-card .muted { margin: 0; font-size: 13px; line-height: 1.8; }
.lead-x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .06); font-size: 18px; }
.lead-sum { display: grid; gap: 2px; background: #f4efe6; border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.lead-sum b { font-size: 12px; color: var(--brand); }
.lead-card label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.lead-card .req { display: inline-block; margin-left: 6px; font-size: 10px; color: #fff; background: var(--brand); border-radius: 4px; padding: 0 5px; }
.lead-card input:not([type=checkbox]), .lead-card select, .lead-card textarea { font: inherit; font-weight: 500; font-size: 16px; padding: 10px 12px; border: 1px solid #e3dccf; border-radius: 10px; background: #fffdf9; width: 100%; box-sizing: border-box; }
.lead-card .chk { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 12px; line-height: 1.7; }
.lead-card .chk input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.lead-send { background: var(--brand); color: #fff; font-weight: 700; font-size: 16px; padding: 14px; border-radius: 99px; margin-top: 4px; }
.lead-send:disabled { opacity: .6; }
.lead-msg { margin: 0; background: #e8f4ee; color: #24583f; border-radius: 10px; padding: 10px 12px; font-size: 13px; }

#dock button em { display: none; font-style: normal; }
@media (max-width: 900px) { #dock button span { display: none; } #dock button em { display: block; font-size: 11px; } }
.lot-pick { display: flex; align-items: center; gap: 12px; background: #fff; border: 2px solid var(--brand); border-radius: 16px; padding: 14px 16px; text-decoration: none; color: var(--ink); margin-bottom: 10px; }
.lot-pick > span { font-size: 26px; }
.lot-pick b { display: block; font-size: 15px; }
.lot-pick small { color: #77706a; font-size: 12px; }
.lot-pick em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--brand); font-size: 18px; }
.chosen-land { background: #fdf0ea; border-radius: 12px; padding: 8px 12px; font-size: 13px; margin: 0 0 12px; }

/* ---------- 決まったルートで歩く ---------- */
#joy, .touch #joy { display: none !important; }
#routeBar { position: absolute; left: 50%; top: 72px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; pointer-events: auto; background: var(--card); backdrop-filter: blur(16px); border-radius: 18px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
#routeBar button { height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 15px; background: rgba(0,0,0,.06); color: var(--ink); white-space: nowrap; }
#routeBar button.next { background: var(--ink); color: #fff; min-width: 110px; }
#routeBar button:disabled { opacity: .35; }
.rt-mid { min-width: 150px; text-align: center; display: grid; }
.rt-mid b { font-size: 17px; }
.rt-mid small { font-size: 12px; color: #77706a; }
body.has-dock .hud-tip { bottom: 180px; }
@media (max-width: 900px) {
  #routeBar { left: 8px; right: 8px; transform: none; top: 104px; justify-content: space-between; }
  #routeBar button { padding: 0 12px; font-size: 14px; }
  #routeBar button.next { min-width: 92px; }
  .rt-mid { min-width: 0; flex: 1; }
  body.has-dock .hud-tip { bottom: 156px; }
}
#hudTip, #hudRoom { display: none !important; }
body[data-mode="walk"] .tap-hint { display: none; }

/* ---------- 閉じるボタン（表示したものには必ず） ---------- */
.xbtn { flex: none; height: 34px; padding: 0 12px; border-radius: 99px; background: rgba(0,0,0,.07); color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.xbtn:hover { background: rgba(0,0,0,.12); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px 18px; }
.panel-head b { font-size: 14px; }
#wzClose { margin-left: 10px; width: 34px; padding: 0; }
.pp-head .xbtn { height: 30px; font-size: 12px; }
.pp-head .xbtn { width: auto; border-radius: 99px; padding: 0 10px; }

#routeBar button.free { width: 48px; padding: 0; font-size: 20px; }
#routeBar button.free.on { background: var(--brand); color: #fff; }
body.free-walk.touch #joy { display: block !important; bottom: 100px; }
#tpFade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 7; }
#tpFade.go { animation: tpfade .45s ease-out; }
@keyframes tpfade { 0% { opacity: .85; } 100% { opacity: 0; } }
