/* 壁紙着せ替えシミュレーション ― tokiwa.net の配色・書体に合わせたスタイル
   色: 本文 #333 / ブルー #0068B7 / 薄グレー #F4F5F7, #EDEFF2 / 罫線 #E6E6E6, #CCC / 補助文字 #8F8F8F
   書体: 游ゴシック系。角丸なし。 */
:root {
  --blue: #0068b7;
  --blue-dark: #00538f;
  --text: #333333;
  --muted: #8f8f8f;
  --bg: #ffffff;
  --gray-1: #f4f5f7;
  --gray-2: #edeff2;
  --line: #e6e6e6;
  --line-2: #cccccc;
  --font: "游ゴシック体", "Yu Gothic", YuGothic, "ヒラギノ角ゴシック Pro", "Hiragino Kaku Gothic Pro", "Hiragino Sans", "Noto Sans JP", メイリオ, Meiryo, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --max: 1200px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select { font-family: inherit; }

/* ---- ヘッダー(tokiwa.net 風: 白地、左にブランド、右に青いCTA) ---- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: var(--max); margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 0 max(16px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand__mark { font-weight: 800; font-size: 24px; letter-spacing: 0.06em; color: var(--blue); font-family: "Helvetica Neue", Arial, sans-serif; font-style: italic; }
.brand__sub { font-size: 12px; color: var(--muted); }
.site-nav { display: flex; gap: 0; margin-left: 8px; }
.site-nav a { color: var(--text); font-size: 13px; padding: 6px 18px; position: relative; }
.site-nav a + a::before { content: "/"; position: absolute; left: -3px; color: var(--line-2); }
.site-nav a:hover { color: var(--blue); text-decoration: none; }
.site-header__cta { margin-left: auto; }
@media (max-width: 860px) { .site-nav { display: none; } .site-header__inner { min-height: 56px; } .brand__mark { font-size: 20px; } }

/* ---- ボタン(角丸なし) ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; font-size: 13px; font-weight: 700; border: 1px solid transparent; cursor: pointer; white-space: nowrap; background: var(--gray-2); color: var(--text); }
.btn:hover { text-decoration: none; filter: brightness(0.97); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: #fff; border-color: var(--line-2); font-weight: 500; }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn:focus-visible, .tabs button:focus-visible, .swatch:focus-visible, .filters select:focus-visible, .filters input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* ---- ページ共通 ---- */
.page { max-width: var(--max); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 14px 48px; }
.crumbs { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.crumbs a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.crumbs a:hover { color: var(--blue); }
.sec-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-weight: 400; }
.sec-title__en { color: var(--blue); font-size: 22px; font-weight: 700; letter-spacing: 0.08em; font-family: "Helvetica Neue", Arial, sans-serif; }
.sec-title__ja { color: var(--text); font-size: 13px; }

/* ---- トップ: 部屋カード ---- */
.hero { background: var(--gray-1); }
.hero__inner { max-width: var(--max); margin: 0 auto; padding: 36px max(16px, env(safe-area-inset-left, 0px)) 32px; }
.hero h1 { margin: 0 0 8px; font-size: 24px; font-weight: 700; letter-spacing: 0.04em; text-wrap: balance; }
.hero p { margin: 0; max-width: 64ch; color: var(--text); }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.room-card { display: block; color: var(--text); border: 1px solid var(--line); background: #fff; transition: border-color .15s ease; min-width: 0; }
.room-card:hover { text-decoration: none; border-color: var(--blue); }
.room-card__img { display: block; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; object-fit: cover; background: var(--gray-2); }
.room-card__body { padding: 12px 14px 14px; }
.room-card__tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--blue); border: 1px solid var(--blue); padding: 1px 8px; margin-bottom: 6px; }
.room-card__name { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.room-card__desc { margin: 0; color: var(--muted); font-size: 12.5px; }
.room-card__go { margin-top: 10px; color: var(--blue); font-weight: 700; font-size: 13px; }
.howto { margin-top: 36px; }
.howto ol { margin: 0; padding-left: 1.4em; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 24px; }
.howto li { color: var(--text); }
.howto li b { display: block; }

/* ---- シミュレーター ---- */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
@media (max-width: 860px) { .app { grid-template-columns: minmax(0, 1fr); } }
.view { min-width: 0; }
.room-head { display: flex; align-items: center; gap: 10px 12px; margin-bottom: 10px; flex-wrap: wrap; }
.room-head__name { font-weight: 700; font-size: 17px; }
.room-head__variant { font-size: 11px; font-weight: 700; color: var(--blue); border: 1px solid var(--blue); padding: 1px 8px; }
.room-head__dims { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.room-head__back { padding: 6px 12px; }
.canvas-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; background: var(--gray-2); overflow: hidden; cursor: pointer; }
.canvas-wrap canvas { display: block; width: 100% !important; height: 100% !important; }
.hint { position: absolute; left: 0; bottom: 0; background: rgba(0, 104, 183, 0.9); color: #fff; font-size: 12px; padding: 5px 12px; pointer-events: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--gray-1); color: var(--muted); font-size: 13px; }

.selected { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sel { display: flex; gap: 10px; align-items: center; background: var(--gray-1); padding: 8px 10px; min-width: 0; }
.sel .chip { width: 44px; height: 44px; flex: none; background-size: cover; background-position: center; border: 1px solid var(--line-2); }
.sel .lab { font-size: 11px; color: var(--blue); font-weight: 700; letter-spacing: 0.06em; }
.sel .code { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.sel .rep { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel > div { min-width: 0; }
@media (max-width: 560px) { .selected { grid-template-columns: 1fr; } .sel .rep { white-space: normal; } }

.panel { background: #fff; border: 1px solid var(--line); min-width: 0; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--gray-2); }
.tabs button { appearance: none; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 500; padding: 12px 6px; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.panel-body { padding: 12px; }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel-row .count { color: var(--muted); font-size: 12px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.filters input { grid-column: 1 / -1; }
.filters select, .filters input { font-size: 12.5px; padding: 7px 8px; border: 1px solid var(--line-2); background: #fff; color: var(--text); min-width: 0; border-radius: 0; }
.filters input::placeholder { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 520px; overflow-y: auto; padding: 2px; }
@media (max-width: 420px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.grid .empty { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; padding: 12px 0; text-align: center; }
.swatch { appearance: none; border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--text); min-width: 0; }
.swatch .img { display: block; aspect-ratio: 1; width: 100%; border: 2px solid transparent; outline: 1px solid var(--line); outline-offset: -1px; background: var(--gray-1); }
.swatch .img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.swatch:hover .img { outline-color: var(--blue); }
.swatch[aria-pressed="true"] .img { border-color: var(--blue); outline: none; }
.swatch .code { display: block; font-family: var(--mono); font-size: 11px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatch .kind { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.3; }

.detail { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 12.5px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; font-variant-numeric: tabular-nums; }
.detail .detail__link { margin-top: 8px; font-size: 12px; }

.notes { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 24px; }
.notes__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; }
.note { font-size: 12.5px; color: var(--text); min-width: 0; }
.note b { display: block; margin-bottom: 2px; color: var(--blue); }

/* ---- フッター ---- */
.site-footer { background: var(--gray-1); border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer__inner { max-width: var(--max); margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 12px; }
.site-footer a { color: var(--text); }
.site-footer__copy { color: var(--muted); margin-left: auto; }
.site-footer__ver { color: var(--muted); font-family: var(--mono); font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .room-card { transition: none; } }
