/* フロアガイド（config.guide のツアーだけ）。展示場のブランドに合わせたモノトーン基調で、色はカテゴリーだけに使う */
.guide { --g-fg: #1d1d1f; --g-sub: #6b6b70; --g-line: #e3e3e6; --g-bg: #fff; --g-soft: #f5f5f7;
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: rgba(10, 10, 12, .55); backdrop-filter: blur(3px); color: var(--g-fg); }
.g-box { display: flex; flex-direction: column; width: min(1240px, 100%); height: min(860px, 100%); background: var(--g-bg);
  border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.guide svg { stroke-width: 2; }

.g-head { display: flex; align-items: center; gap: 18px; padding: 16px 20px 12px; border-bottom: 1px solid var(--g-line); }
.g-logo { height: 44px; width: auto; }
.g-heading { flex: 1; min-width: 0; }
.g-heading h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .04em; }
.g-heading p { margin: 2px 0 0; font-size: 13px; color: var(--g-sub); }
.g-loading { font-size: 12px; color: var(--g-sub); white-space: nowrap; }
.g-loading::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid var(--g-line); border-top-color: var(--g-fg); border-radius: 50%; animation: g-spin 1s linear infinite; }
@keyframes g-spin { to { transform: rotate(360deg); } }
.g-close { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 19px;
  background: var(--g-fg); color: #fff; font-size: 14px; white-space: nowrap; }
.g-close svg { width: 16px; height: 16px; }
.g-back { height: 38px; padding: 0 16px; border: 1px solid var(--g-fg); border-radius: 19px; font-size: 14px; white-space: nowrap; }
.g-back:hover { background: var(--g-soft); }

.g-cats { display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto; border-bottom: 1px solid var(--g-line); scrollbar-width: thin; }
.g-cats { --fl: 0px; --fr: 0px; mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%); }
.g-cats.more-l { --fl: 36px; }
.g-cats.more-r { --fr: 36px; }
.g-cats button { --c: var(--g-fg); flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr; column-gap: 7px; align-items: center;
  padding: 7px 14px 7px 11px; border: 1px solid var(--g-line); border-radius: 10px; text-align: left; background: var(--g-bg); }
.g-cats button i { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.g-cats button b { font-size: 13px; letter-spacing: .03em; }
.g-cats button small { font-size: 11px; color: var(--g-sub); }
.g-cats button[data-cat="all"] { grid-template-columns: 1fr; padding-left: 14px; }
.g-cats button:hover { border-color: var(--c); }
.g-cats button.on { background: var(--c); border-color: var(--c); color: #fff; }
.g-cats button.on small { color: rgba(255,255,255,.85); }
.g-cats button.on i { background: #fff; }

.g-tabs { display: none; }
.g-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); }

/* 画像と判定用SVGを同じ枠に重ねるので、枠ごと縦横比を保って収める（画像だけ contain にすると区画とずれる） */
.g-map { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 16px; background: var(--g-soft); min-height: 0; container-type: size; }
.g-map-inner { position: relative; width: min(100cqw, 100cqh * var(--ar)); aspect-ratio: var(--ar); margin: auto; }
.g-map-inner img { display: block; width: 100%; height: 100%; user-select: none; }
.g-map-inner svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-map polygon { --c: #888; fill: transparent; stroke: transparent; stroke-width: .35; vector-effect: non-scaling-stroke; cursor: pointer;
  transition: fill .15s, stroke .15s, opacity .15s; }
.g-map polygon:hover, .g-map polygon.hit { fill: color-mix(in srgb, var(--c) 22%, transparent); stroke: var(--c); stroke-width: 2px; }
.g-map polygon.lit { fill: color-mix(in srgb, var(--c) 30%, transparent); stroke: var(--c); stroke-width: 2px; }
.g-map polygon.sel { fill: color-mix(in srgb, var(--c) 42%, transparent); stroke: var(--c); stroke-width: 3px; }
.g-map polygon.dim { opacity: .35; }
.g-map polygon.here { stroke: var(--g-fg); stroke-width: 2px; stroke-dasharray: 4 3; }
/* 現在地: 赤い点＋視線の向きの扇（--a は上を0°とした時計回り）。要素自体は大きさ0の基準点 */
.g-here { position: absolute; width: 0; height: 0; pointer-events: none; }
.g-here i { position: absolute; left: -72px; top: -72px; width: 144px; height: 144px; border-radius: 50%;
  background: conic-gradient(from -28deg, rgba(230,0,18,.75) 0 56deg, transparent 0); transform: rotate(var(--a, 0deg));
  /* 地図アプリの向きの光のように、点から離れるほど薄くする */
  -webkit-mask: radial-gradient(closest-side, #000 10%, transparent); mask: radial-gradient(closest-side, #000 10%, transparent); }
.g-here::after { content: ""; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; box-sizing: border-box; border: 2px solid #fff;
  border-radius: 50%; background: #e60012; box-shadow: 0 0 0 0 rgba(230,0,18,.6); animation: g-pulse 1.8s infinite; }
.g-here b { position: absolute; left: 0; bottom: 12px; transform: translateX(-50%); padding: 2px 8px; border-radius: 10px;
  background: #e60012; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
@keyframes g-pulse { 70% { box-shadow: 0 0 0 10px rgba(230,0,18,0); } 100% { box-shadow: 0 0 0 0 rgba(230,0,18,0); } }
.g-zonebar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px; border-radius: 22px; background: var(--g-bg); box-shadow: 0 4px 16px rgba(0,0,0,.15); white-space: nowrap; font-size: 14px; }
.g-zonebar .g-x { width: 30px; height: 30px; border-radius: 50%; background: var(--g-soft); font-size: 16px; }

.g-go { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--g-fg); color: #fff; font-size: 13px; font-weight: 600; }
.g-go::after { content: "→"; margin-left: 6px; }
.g-go:hover { background: #000; }

.g-list { grid-area: 1 / 2; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--g-line); }
.g-list-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--g-line); }
.g-list-head b { font-size: 15px; }
.g-list-head span { font-size: 12px; color: var(--g-sub); }
.g-list-head button { margin-left: auto; font-size: 12px; color: var(--g-sub); text-decoration: underline; }
.g-list ul { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.g-list li { border-bottom: 1px solid var(--g-line); }
.g-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 16px; text-align: left; }
.g-item:hover, li.open .g-item { background: var(--g-soft); }
.g-item img, .g-noimg { flex: 0 0 auto; width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--g-soft); }
.g-name { min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.35; }
.g-name small { display: block; font-size: 11px; font-weight: 500; color: var(--g-sub); }
.g-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.g-tags em { --c: var(--g-sub); font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px;
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.g-tags em.z { color: var(--g-sub); border-color: var(--g-line); background: var(--g-bg); }
.g-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 2px 16px 14px 92px; background: var(--g-soft); font-size: 13px; }
.g-detail a { color: var(--g-fg); }
.g-link { font-size: 13px; text-decoration: underline; color: var(--g-fg); }

/* 公式サイトの iframe はMAPと同じグリッドのマスに重ねる（一覧は横に残す） */
.g-map, .g-frame { grid-area: 1 / 1; }
.g-frame { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 0; background: var(--g-bg); }
.g-frame[hidden] { display: none; }
.g-frame header { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--g-line); font-size: 14px; }
.g-frame header b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-frame header a { font-size: 12px; color: var(--g-sub); white-space: nowrap; }
.g-frame .g-x { width: 30px; height: 30px; border-radius: 50%; background: var(--g-soft); font-size: 16px; }
.g-frame iframe { flex: 1; width: 100%; border: 0; }
.g-none { color: var(--g-sub); }
.g-empty { padding: 24px 16px; color: var(--g-sub); font-size: 14px; border: 0 !important; }

/* 3D上の「フロアガイド」ボタン（右下・ミニマップと同じ位置） */
.guide-open { position: absolute; right: 15px; bottom: calc(100% + 10px); display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px;
  border-radius: 22px; background: #fff; color: #1d1d1f; font-size: 15px; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.guide-open:hover { background: #f0f0f2; }
body.guide-shown .guide-open { visibility: hidden; }
.guide-open::before { content: "ここからいつでも開けます"; position: absolute; right: 0; bottom: calc(100% + 10px); padding: 8px 12px; border-radius: 8px;
  background: #1d1d1f; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.3);
  opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; pointer-events: none; }
.guide-open.hint::before { opacity: 1; transform: none; }

/* スマホ・縦長: 全画面にして「企業から探す / マップから探す」をタブで切り替える */
@media (max-width: 899px) {
  .guide { padding: 0; }
  .g-box { width: 100%; height: 100%; border-radius: 0; }
  .g-head { gap: 10px; padding: 10px 16px; flex-wrap: wrap; }
  .g-logo { height: 32px; }
  .g-heading h1 { font-size: 16px; }
  .g-heading p { display: none; }
  .g-loading { order: 5; width: 100%; }
  .g-close { height: 34px; padding: 0 12px; font-size: 13px; }
  .g-back { height: 34px; padding: 0 12px; font-size: 13px; }
  .g-cats { padding: 10px 16px; }
  .g-cats button { padding: 6px 11px 6px 9px; }
  .g-cats button small { display: none; }
  .g-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--g-line); }
  .g-tabs button { height: 42px; font-size: 14px; color: var(--g-sub); border-bottom: 2px solid transparent; }
  .g-tabs button.on { color: var(--g-fg); font-weight: 700; border-bottom-color: var(--g-fg); }
  .g-body { display: block; overflow: hidden; }
  .g-body[data-tab-on="list"] .g-map, .g-body[data-tab-on="map"] .g-list { display: none; }
  .g-map, .g-list { height: 100%; }
  .g-map { justify-content: flex-start; padding: 10px; overflow: auto; }
  .g-map-inner { margin: 0; }
  .g-list { border-left: 0; }
  .g-body { position: relative; }
  .g-frame { position: absolute; inset: 0; }
  .g-item { padding: 10px 16px; }
  .g-detail { padding-left: 16px; }
  .g-zonebar { bottom: 10px; font-size: 13px; }
  .guide-open { height: 40px; font-size: 14px; padding: 0 14px 0 12px; }
}

/* ?edit=1 の視点記録ボタン（運営の調整用。通常の閲覧では出ない） */
.g-capture { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 50; display: flex; gap: 8px; align-items: center;
  padding: 6px; border-radius: 24px; background: rgba(0,0,0,.6); color: #fff; font: 700 13px/1.3 sans-serif; max-width: calc(100vw - 32px); }
.g-capture button { padding: 9px 14px; border: 0; border-radius: 18px; background: #e60012; color: #fff; font: inherit; cursor: pointer; white-space: nowrap; }
.g-capture { flex-wrap: wrap; justify-content: center; border-radius: 20px; }
/* 削除は押し間違えると困るので色を変える */
.g-capture button[data-cap="remove"] { background: #555; }
.g-capture span:empty { display: none; }
.g-capture input { width: 14em; padding: 8px 12px; border: 0; border-radius: 18px; font: 400 16px/1.2 sans-serif; }
/* メッセージは別の行に出し、長くなってもボタンの位置をずらさない */
.g-capture span { flex-basis: 100%; padding: 0 8px 2px; text-align: center; }
/* タグを置く位置の目印（画面中央） */
.g-cross { position: fixed; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; z-index: 40; pointer-events: none;
  background: linear-gradient(#e60012, #e60012) center/2px 100% no-repeat, linear-gradient(#e60012, #e60012) center/100% 2px no-repeat; }
