/* 共通の枠（ヘッダー・開くメニュー・スマホのメニュー・下のタブ・フッター）。H2・2026-09-26
   見た目の正は design/common-frame.pen（design/exports/common-*.png）。色・角丸は solacom-tokens.css の変数だけで書く
   ダークはトークンが切り替えるので、ここに prefers-color-scheme を書かない。hover は面の色だけ（浮かせない・影なし）
   クラスの頭: hd-（ヘッダー）・tb-（下のタブ）・ft-（フッター） */
:root { --hd-h: 64px; --tb-h: 64px; }

/* ---------- ヘッダー ---------- */
.site-header { position: relative; z-index: 5000; background: var(--surface-card); color: var(--text-body); border-bottom: 1px solid var(--border-subtle); backdrop-filter: none; font-family: var(--font-body); }
.hd__in { display: flex; align-items: center; gap: 16px; height: var(--hd-h); padding: 0 48px; }
.hd__logo { display: inline-flex; align-items: center; flex: none; }
.hd__logo img { display: block; height: 36px; width: auto; }
.hd__nav { flex: 1; min-width: 0; }
.hd__links { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.hd__link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--r-md); color: var(--text-heading); font: 500 15px/1 var(--font-body); text-decoration: none; white-space: nowrap; background: none; border: 0; cursor: pointer; }
.hd__link:hover, .hd__link:focus-visible { background: var(--surface-sunken); color: var(--text-heading); text-decoration: none; }
.hd__link[aria-current="page"], .hd__link.is-current { background: var(--surface-sunken); font-weight: 700; }
.hd__chev { font-size: 11px; color: var(--text-muted); transition: transform var(--dur-fast, .12s); }
.hd-dd.is-open .hd__chev { transform: rotate(180deg); }
.hd__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: var(--text-on-accent); font: 700 12px/20px var(--font-num); text-align: center; }
.hd__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; }
.hd__right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.hd__search { width: 40px; height: 40px; border: 1px solid var(--border-default); border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; color: var(--text-heading); background: var(--surface-card); font-size: 15px; }
.hd__search:hover, .hd__search:focus-visible { background: var(--surface-sunken); color: var(--text-heading); text-decoration: none; }
.hd__login { color: var(--text-link); font: 600 15px/1 var(--font-body); padding: 0 6px; text-decoration: none; }
.hd__login:hover { color: var(--text-link-hover); }
.hd__reg { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: var(--r-pill); background: var(--accent); color: var(--text-on-accent); font: 700 14px/1 var(--font-body); white-space: nowrap; text-decoration: none; border: 1px solid transparent; }
.hd__reg:hover, .hd__reg:focus-visible { background: var(--accent-hover); color: var(--text-on-accent); text-decoration: none; }
.hd__reg--quiet { background: transparent; color: var(--text-link); border-color: var(--border-default); }
.hd__reg--quiet:hover, .hd__reg--quiet:focus-visible { background: var(--surface-sunken); color: var(--text-link); }
.hd__acct { height: 40px; padding: 0 12px 0 6px; border: 1px solid var(--border-default); border-radius: var(--r-pill); gap: 8px; font-weight: 600; max-width: 240px; }
.hd__acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd__avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font: 700 13px/28px var(--font-body); text-align: center; flex: none; }

/* 機能の色の四角いアイコン（メニューで共通） */
.hd-ico { width: 40px; height: 40px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; flex: none; }
.hd-ico--listing { background: var(--svc-used); }
.hd-ico--material { background: var(--green-600); }
.hd-ico--service { background: var(--svc-partner); }
.hd-ico--joint { background: var(--svc-group); }
.hd-ico--rights { background: var(--amber-600); }
.hd-ico--company { background: var(--neutral-500); }

/* 開くメニュー（PC）: 影は付けず線だけ */
.hd-dd { position: relative; }
.hd-dd__panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 5001; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 16px; width: 640px; max-width: calc(100vw - 32px); }
.hd-dd__panel[hidden] { display: none; }
.hd-dd--right .hd-dd__panel { left: auto; right: 0; width: 260px; padding: 8px; }
.hd-dd__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.hd-dd__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--text-heading); text-decoration: none; }
.hd-dd__item:hover, .hd-dd__item:focus-visible { background: var(--surface-sunken); text-decoration: none; color: var(--text-heading); }
.hd-dd__item.is-current { background: var(--surface-sunken); }
.hd-dd__tx { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; min-width: 0; }
.hd-dd__tx b { font-size: 15px; font-weight: 700; }
.hd-dd__tx small { font-size: 12px; color: var(--text-muted); }
.hd-dd__more { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.hd-dd__more a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-link); font: 600 14px/1 var(--font-body); padding: 8px 4px; text-decoration: none; }
.hd-dd__more a :is(i, svg) { font-size: 14px; color: var(--text-muted); }
.hd-dd__more a:hover { color: var(--text-link-hover); text-decoration: underline; text-underline-offset: .2em; }
.hd-dd__row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); color: var(--text-heading); font-size: 14px; text-decoration: none; }
.hd-dd__row :is(i, svg) { width: 16px; color: var(--text-muted); text-align: center; }
.hd-dd__row:hover, .hd-dd__row:focus-visible { background: var(--surface-sunken); color: var(--text-heading); text-decoration: none; }
.hd-dd__sep { height: 1px; background: var(--border-subtle); margin: 6px 4px; }

/* スマホのメニュー（PC では出さない） */
.hd__burger, .hd-backdrop, .hd-menu { display: none; }

@media (max-width: 1079px) {
  :root { --hd-h: 56px; }
  .hd__in { padding: 0 16px; gap: 12px; }
  .hd__logo img { height: 30px; }
  .hd__nav, .hd__login, .hd__acct-dd { display: none; }
  .hd__right { gap: 8px; }
  .hd__reg { height: 34px; padding: 0 14px; font-size: 13px; }
  .hd--guest .hd__search { display: none; }
  .hd__burger { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: -8px; background: none; border: 0; color: var(--text-heading); font-size: 22px; cursor: pointer; }
  .hd__burger .hd__burger-x, .hd__burger[aria-expanded="true"] .hd__burger-bars { display: none; }
  .hd__burger[aria-expanded="true"] .hd__burger-x { display: inline-block; }
  .hd-backdrop.open { display: block; position: fixed; top: var(--hd-h); left: 0; right: 0; bottom: 0; background: rgba(15, 30, 53, .4); z-index: 4990; }
  .hd-menu.open { display: block; position: fixed; top: var(--hd-h); left: 0; right: 0; bottom: 0; z-index: 4995; background: var(--surface-card); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .hd-menu__inner { min-height: calc(100% + 1px); padding: 16px 16px calc(var(--tb-h) + 16px + env(safe-area-inset-bottom, 0px)); }
  /* 開いている間は後ろを動かさない。iOS は overflow:hidden だけでは止まらず「引っ張って更新」も起きるので、body を固定して overscroll を切る */
  html.nav-open { overscroll-behavior-y: none; }
  body.nav-open { overflow: hidden; position: fixed; left: 0; right: 0; width: 100%; overscroll-behavior-y: none; }
  body.nav-open .site-header { position: fixed; top: 0; left: 0; right: 0; }
  .hd-menu__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle); }
  .hd-menu__btn { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface-card); color: var(--text-heading); font: 700 14px/1.3 var(--font-body); text-decoration: none; }
  .hd-menu__btn[aria-current="page"] { background: var(--surface-sunken); }
  .hd-menu__btn .hd-ico { width: 32px; height: 32px; font-size: 14px; border-radius: var(--r-sm); }
  .hd-menu__rows { display: flex; flex-direction: column; padding: 4px 0; }
  .hd-menu__row { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 4px; border-bottom: 1px solid var(--border-subtle); color: var(--text-heading); font: 600 15px/1.3 var(--font-body); text-decoration: none; }
  .hd-menu__row :is(i, svg) { color: var(--text-muted); font-size: 12px; }
  .hd-menu__h { margin: 16px 4px 2px; font: 600 12px/1.3 var(--font-body); color: var(--text-muted); }
  .hd-menu__login { display: flex; align-items: center; justify-content: center; height: 46px; margin-top: 16px; border: 1px solid var(--border-default); border-radius: var(--r-md); color: var(--text-link); font: 700 15px/1 var(--font-body); text-decoration: none; }
}

/* ---------- スマホの下のタブ ---------- */
.tb { display: none; }
@media (max-width: 768px) {
  body { padding-bottom: calc(var(--tb-h) + env(safe-area-inset-bottom, 0px)); }
  body.no-tabbar { padding-bottom: 0; }
  body.no-tabbar .sc-actionbar { bottom: env(safe-area-inset-bottom, 0px); }
  .tb { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 4000; background: var(--surface-card); border-top: 1px solid var(--border-subtle); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tb__in { display: flex; height: var(--tb-h); }
  .tb__i { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); font: 500 10px/1.2 var(--font-body); text-decoration: none; }
  .tb__i:hover { color: var(--text-muted); text-decoration: none; }
  .tb__i[aria-current="page"] { color: var(--brand); font-weight: 700; }
  .tb__ico { position: relative; display: inline-flex; align-items: center; height: 24px; font-size: 22px; line-height: 1; }
  .tb__count { position: absolute; top: -6px; left: 55%; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-pill); background: var(--accent); color: var(--text-on-accent); font: 700 10px/17px var(--font-num); text-align: center; }
  .tb__dot { position: absolute; top: -3px; left: 65%; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface-card); }
}

/* ---------- フッター ---------- */
.ft { margin-top: 48px; border-top: 1px solid var(--border-subtle); background: var(--surface-card); font-family: var(--font-body); font-size: 14px; color: var(--text-body); }
.ft a { color: var(--text-heading); text-decoration: none; }
.ft a:hover { text-decoration: underline; text-underline-offset: .2em; }
.ft__in { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
.ft__trust { background: var(--surface-muted); border-bottom: 1px solid var(--border-subtle); }
.ft__trust .ft__in { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px 48px; min-height: 56px; }
.ft__trust span { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-heading); white-space: nowrap; }
.ft__trust span :is(i, svg) { font-size: 15px; color: var(--text-muted); }
.ft__body { display: grid; grid-template-columns: minmax(240px, 1.3fr) repeat(3, 1fr); gap: 32px; padding-top: 40px; padding-bottom: 40px; }
.ft__brand img { display: block; height: 36px; width: auto; }
.ft__tag { margin: 14px 0 0; font-size: 13px; color: var(--text-body); }
.ft__op { margin: 12px 0 0; font-size: 12px; line-height: 1.7; color: var(--text-muted); }
.ft__cols { display: contents; }
.ft__col__h { display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; background: none; text-align: left; font: 600 12px/1.3 var(--font-body); letter-spacing: .06em; color: var(--text-muted); cursor: default; }
.ft__col__h :is(i, svg) { display: none; }
.ft__links { display: flex; flex-direction: column; gap: 12px; }
.ft__links a { font-weight: 400; }
.ft__bottom { border-top: 1px solid var(--border-subtle); background: var(--surface-muted); }
.ft__bottom .ft__in { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 16px; min-height: 52px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 768px) {
  .ft { margin-top: 32px; }
  .ft__in { padding: 0 16px; }
  .ft__trust .ft__in { flex-direction: column; align-items: flex-start; gap: 8px; min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .ft__trust span { font-size: 13px; }
  .ft__trust span:nth-child(n+3) { display: none; }
  .ft__body { grid-template-columns: 1fr; gap: 0; padding-top: 20px; padding-bottom: 8px; }
  .ft__brand { padding-bottom: 8px; }
  .ft__brand img { height: 30px; }
  .ft__col { border-top: 1px solid var(--border-subtle); }
  .ft__col__h { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 14px 0; font: 700 15px/1.3 var(--font-body); letter-spacing: 0; color: var(--text-heading); cursor: pointer; }
  .ft__col__h :is(i, svg) { display: inline-block; font-size: 12px; color: var(--text-muted); transition: transform var(--dur-fast, .12s); }
  .ft__col.is-open .ft__col__h :is(i, svg) { transform: rotate(180deg); }
  .ft__col:not(.is-open) .ft__links { display: none; }
  .ft__links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 2px 0 18px; }
  .ft__bottom .ft__in { flex-direction: column; align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
}
