/* 安原工業団地 3Dマップ（既存サイトのトークンに合わせる: --font-sans / --c-navy / --c-gold / --c-border / --radius） */
.y3d { position: relative; width: 100%; height: var(--y3d-height, 640px); min-height: 360px; border-radius: var(--radius, 8px); overflow: hidden; border: 1px solid var(--c-border, #ddd); background: #DDE3D6; font-family: var(--font-sans, "Noto Sans JP", system-ui, sans-serif); color: var(--c-text, #222); }
.y3d__stage { position: absolute; inset: 0; }
.y3d__stage canvas { display: block; width: 100% !important; height: 100% !important; outline: none; touch-action: none; }
.y3d__stage canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--c-navy, #1A1A1A); }
.y3d__labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; } /* CSS2DRenderer がラベルごとに z-index を振るため、パネルより下の重なり順に閉じ込める */
.y3d [hidden] { display: none !important; }
.y3d__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ラベル */
.y3d__label { font-size: 12px; line-height: 1.3; white-space: nowrap; padding: 2px 7px; border-radius: 3px; background: rgba(255,255,255,.9); color: var(--c-navy, #1A1A1A); border: 1px solid rgba(0,0,0,.08); }
.y3d__label--landmark { background: var(--c-navy, #1A1A1A); color: #fff; font-weight: 700; }
.y3d__label--town { background: rgba(255,255,255,.94); color: var(--c-navy, #1A1A1A); font-size: 14px; font-weight: 700; letter-spacing: .12em; padding: 4px 12px; border: 1px solid rgba(0,0,0,.2); }
.y3d__label--public { background: rgba(255,255,255,.7); color: #4d5c4a; font-size: 11px; }
.y3d__label--member { font-weight: 700; font-size: 11.5px; }
.y3d__label.is-hidden { opacity: 0; }

/* ツールバー */
.y3d__bar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; pointer-events: none; z-index: 5; }
.y3d__bar > * { pointer-events: auto; }
.y3d__search input { width: 220px; max-width: 60vw; padding: 9px 12px; border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 8px); background: rgba(255,255,255,.96); font: inherit; font-size: 14px; }
.y3d__search input:focus { outline: 2px solid var(--c-navy, #1A1A1A); outline-offset: 1px; }
.y3d__filters { display: flex; flex-wrap: wrap; gap: 6px; }
.y3d__chip, .y3d__btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--c-border, #ddd); border-radius: 999px; background: rgba(255,255,255,.96); font: inherit; font-size: 13px; color: var(--c-text, #222); cursor: pointer; }
.y3d__chip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.y3d__chip:hover, .y3d__btn:hover { border-color: var(--c-gold, #00904C); }
.y3d__chip.is-active { background: var(--c-navy, #1A1A1A); color: #fff; border-color: var(--c-navy, #1A1A1A); }
.y3d__chip:focus-visible, .y3d__btn:focus-visible, .y3d__list li:focus-visible { outline: 2px solid var(--c-navy, #1A1A1A); outline-offset: 2px; }
.y3d__reset { margin-left: auto; }

/* 検索候補 */
.y3d__search { position: relative; }
.y3d__suggest { position: absolute; top: calc(100% + 4px); left: 0; width: max(100%, 300px); max-width: calc(100vw - 40px); max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 8px); box-shadow: 0 8px 24px rgba(20,30,50,.16); z-index: 9; }
.y3d__suggest li[role="option"] { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.y3d__suggest li[role="option"].is-active { background: rgba(0,0,0,.06); }
.y3d__suggest li i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.y3d__sg-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y3d__sg-ind { font-size: 11px; color: var(--c-text-muted, #666); flex-shrink: 0; }
.y3d__suggest-empty { padding: 10px; font-size: 13px; color: var(--c-text-muted, #666); }

/* 出典 */
.y3d__credit { position: absolute; right: 64px; bottom: 14px; max-width: 320px; font-size: 10.5px; color: var(--c-text-muted, #666); background: rgba(255,255,255,.85); border-radius: 6px; padding: 3px 8px; z-index: 4; }
.y3d__credit summary { cursor: pointer; }
.y3d__credit p { margin: 4px 0 0; line-height: 1.5; }

/* 拡大・縮小 */
.y3d__zoom { position: absolute; right: 14px; bottom: 64px; display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.18); z-index: 4; }
.y3d__zoom-btn { width: 40px; height: 40px; border: 0; background: rgba(255,255,255,.95); color: var(--c-navy, #1A1A1A); font: inherit; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; }
.y3d__zoom-btn + .y3d__zoom-btn { border-top: 1px solid #E1E7ED; }
.y3d__zoom-btn:hover { background: #EEF6FC; }
.y3d__zoom-btn:focus-visible { outline: 2px solid var(--c-navy, #1A1A1A); outline-offset: -2px; }
/* 信号名（海側環状線の交差点＝団地への入口） */
.y3d__label--signal { background: var(--c-gold-dark, #007A40); color: #fff; font-size: 12.5px; font-weight: 700; padding: 3px 9px 3px 7px; display: inline-flex; align-items: center; gap: 6px; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.3); }
.y3d__label--signal::before { content: ""; width: 20px; height: 8px; border-radius: 4px; background: radial-gradient(circle at 4px 4px, #3CB44B 2.5px, transparent 3px), radial-gradient(circle at 10px 4px, #F5C542 2.5px, transparent 3px), radial-gradient(circle at 16px 4px, #E53935 2.5px, transparent 3px), #222; }

/* 方位 */
.y3d__compass { position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px; padding: 0; border: 0; cursor: pointer; font: inherit; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 1px 4px rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--c-navy, #1A1A1A); z-index: 4; transition: transform .1s linear; }
.y3d__compass::before { content: ""; position: absolute; top: 4px; left: 50%; width: 0; height: 0; border: 5px solid transparent; border-bottom: 9px solid var(--c-gold, #00904C); transform: translateX(-50%); }
.y3d__compass span { margin-top: 10px; font-size: 12px; font-weight: 700; }
.y3d__compass:hover { box-shadow: 0 0 0 2px var(--c-gold, #00904C); }
.y3d__compass:focus-visible { outline: 2px solid var(--c-navy, #1A1A1A); outline-offset: 2px; }

/* 企業一覧パネル */
.y3d__list { position: absolute; top: 62px; left: 12px; bottom: 12px; width: 280px; max-width: calc(100% - 24px); background: rgba(255,255,255,.97); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 8px); display: flex; flex-direction: column; z-index: 6; }
.y3d__list-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--c-border, #ddd); font-size: 14px; }
.y3d__count { color: var(--c-text-muted, #666); font-size: 12px; }
.y3d__close { margin-left: auto; width: 28px; height: 28px; border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--c-text-muted, #666); border-radius: 50%; }
.y3d__close:hover { background: rgba(0,0,0,.06); }
.y3d__list-items { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.y3d__list li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.y3d__list li:hover { background: rgba(0,0,0,.05); }
.y3d__list li.is-selected { background: rgba(227,162,59,.18); }
.y3d__list li i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.y3d__li-num { color: var(--c-text-muted, #666); font-size: 11px; min-width: 2em; text-align: right; font-variant-numeric: tabular-nums; }
.y3d__li-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y3d__empty { color: var(--c-text-muted, #666); padding: 12px; }

/* 情報パネル */
.y3d__info { position: absolute; top: 62px; right: 12px; width: 300px; max-width: calc(100% - 24px); max-height: calc(100% - 80px); overflow: auto; background: rgba(255,255,255,.97); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 8px); padding: 16px 18px; z-index: 6; box-shadow: 0 8px 28px rgba(20,30,50,.12); }
.y3d__info .y3d__close { position: absolute; top: 8px; right: 8px; }
.y3d__logo { max-height: 44px; max-width: 160px; display: block; margin-bottom: 8px; }
.y3d__info-num { font-size: 12px; color: var(--c-text-muted, #666); margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.y3d__tag { color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.y3d__info-name { font-size: 17px; font-weight: 700; margin: 0 0 10px; line-height: 1.4; }
.y3d__info-dl { margin: 0; font-size: 13px; line-height: 1.7; }
.y3d__info-dl dt { color: var(--c-text-muted, #666); font-size: 11.5px; margin-top: 6px; }
.y3d__info-dl dd { margin: 0; }
.y3d__info-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 0; font-size: 13px; }
.y3d__info-links a { color: var(--c-navy, #1A1A1A); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ツールチップ */
.y3d__tip { position: absolute; transform: translate(-50%, -100%); padding: 5px 10px; background: rgba(26,26,26,.9); color: #fff; font-size: 12px; border-radius: 4px; pointer-events: none; white-space: nowrap; z-index: 7; }

/* WebGL 非対応 */
.y3d__fallback { position: absolute; inset: 0; overflow: auto; padding: 20px; background: #fff; z-index: 8; }
.y3d__fallback img { max-width: 100%; height: auto; border: 1px solid var(--c-border, #ddd); }
.y3d__fallback-list { columns: 2; font-size: 13px; padding-left: 1.2em; }

/* スマホ: 一覧・情報は下からのシート */
@media (max-width: 767px) {
	.y3d__bar { top: 10px; left: 10px; right: 10px; gap: 6px; }
	.y3d__filters { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
	.y3d__chip { flex-shrink: 0; font-size: 12px; padding: 6px 10px; }
	.y3d__search input { width: 160px; }
	.y3d__list, .y3d__info { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: none; max-height: 55%; border-radius: 14px 14px 0 0; }
	.y3d__list { height: 55%; }
	.y3d__compass { bottom: auto; top: 96px; right: 10px; width: 34px; height: 34px; }
	.y3d__zoom { right: 10px; bottom: auto; top: 138px; }
	.y3d__credit { right: 10px; bottom: 14px; max-width: 70%; }
	.has-info .y3d__credit { display: none; }
	.y3d__fallback-list { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { .y3d__label, .y3d__compass { transition: none; } }
