/* GLTool — 高級HF機のフロントパネル風
 * 筐体：黒鉛色の金属／区画は細い溝／差し色はアンバー・アイスブルー・グリーン（受信）に絞る
 */
:root {
  --ch-0: #0f1012;
  --ch-1: #16181b;
  --ch-2: #1c1f23;
  --ch-3: #24282d;
  --ch-4: #2e3238;
  --groove-d: #07080a;
  --groove-l: rgba(255, 255, 255, .055);

  --ink: #e7e9eb;
  --ink-2: #b3b9c0;
  --ink-3: #7d848c;
  --ink-4: #555b62;

  --ice: #8fd0f5;
  --ice-2: #5d9bc0;
  --amber: #ffb547;
  --amber-2: #b47b2b;
  --green: #5af08a;
  --red: #ff4b3e;

  --lcd: #05080b;
  --lcd-2: #0a1017;
  --lcd-line: rgba(143, 208, 245, .13);
  --lcd-ink: #dfe7ee;

  --f-num: 'B612 Mono', ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
  --f-label: 'Barlow Semi Condensed', 'Arial Narrow', 'Segoe UI', system-ui, sans-serif;
  --f-ja: system-ui, -apple-system, 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', 'Noto Sans JP', sans-serif;

  --r-key: 4px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0b0c0e;
  color: var(--ink);
  font: 13px/1.5 var(--f-ja);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ================= 筐体 ================= */
.chassis {
  position: relative;
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 330px;
  grid-template-rows: auto minmax(0, 1fr) 16px;
  grid-template-areas: "top top top" "left disp right" "foot foot foot";
  gap: 12px 16px;
  padding: 12px 24px 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.011) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #1d2024 0%, #17191c 40%, #131517 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 0 0 1px #050506;
}
.screw {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 44%, rgba(0,0,0,.75) 45% 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, rgba(0,0,0,.75) 45% 55%, transparent 56%),
    radial-gradient(circle at 35% 30%, #5b6068, #2a2d31 70%);
  box-shadow: 0 1px 0 rgba(255,255,255,.06), inset 0 0 0 1px rgba(0,0,0,.6);
  opacity: .8;
}
.s-tl { top: 7px; left: 7px; } .s-tr { top: 7px; right: 7px; }
.s-bl { bottom: 5px; left: 7px; } .s-br { bottom: 5px; right: 7px; }

/* 溝で区切った面 */
.groove { border: 1px solid var(--groove-d); box-shadow: 0 1px 0 var(--groove-l); }

/* ================= 上段 ================= */
.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 22px;
  padding: 2px 6px 10px;
  border-bottom: 1px solid var(--groove-d);
  box-shadow: 0 1px 0 var(--groove-l);
}
.brand { display: flex; flex-direction: column; line-height: 1.05; min-width: 200px; }
.brand-main {
  font: 700 21px/1 var(--f-label); letter-spacing: .14em; color: #d9dde1;
  text-shadow: 0 -1px 0 rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.06);
  white-space: nowrap;
}
.brand-dash { color: var(--ice-2); margin: 0 .04em; }
a.key { text-decoration: none; }
.key.k-about { min-height: 30px; padding: 7px 11px 6px; font-size: 11.5px; align-self: center; }
.key.k-about .ja { font: 500 10.5px/1 var(--f-ja); letter-spacing: 0; color: var(--ice); }
.brand-sub { font: 600 9.5px/1.4 var(--f-label); letter-spacing: .24em; color: var(--ice-2); margin-top: 4px; }
.brand-logo { margin: 0; line-height: 0; }
.brand-logo img { display: block; height: 36px; width: auto; }
.topbar .brand-sub { letter-spacing: .04em; font-size: 10px; color: #7fa9c4; margin-top: 5px; white-space: nowrap; }
.brand-ver { font: 400 9px/1.3 var(--f-num); letter-spacing: .08em; color: var(--ink-4); margin-top: 2px; }

.bandbay {
  flex: 1; display: flex; align-items: center; gap: 12px; justify-content: center;
  padding: 7px 14px 7px; border-radius: 6px;
  background: linear-gradient(180deg, #111316, #181a1e);
  border: 1px solid var(--groove-d); box-shadow: 0 1px 0 var(--groove-l), inset 0 2px 5px rgba(0,0,0,.7);
  max-width: 620px;
}
.bay-label { font: 600 10px/1 var(--f-label); letter-spacing: .2em; color: var(--ice-2); white-space: nowrap; }
.bandkeys { display: flex; gap: 6px; flex-wrap: wrap; }

.lamps { display: flex; gap: 14px; margin-left: auto; }
.lamp { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 26px; }
.lamp i {
  width: 24px; height: 7px; border-radius: 2px;
  background: #15171a; border: 1px solid #050607;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.9), 0 1px 0 var(--groove-l);
  transition: background .08s, box-shadow .08s;
}
.lamp span { font: 600 10px/1 var(--f-label); letter-spacing: .16em; color: var(--ink-3); }
.lamp.on i { background: var(--green); box-shadow: 0 0 6px var(--green), 0 0 16px rgba(90,240,138,.45), inset 0 0 1px #fff; }
.lamp.red.on i { background: var(--red); box-shadow: 0 0 6px var(--red), 0 0 16px rgba(255,75,62,.45), inset 0 0 1px #fff; }
.lamp.amber.on i { background: var(--amber); box-shadow: 0 0 6px var(--amber), 0 0 14px rgba(255,181,71,.35), inset 0 0 1px #fff; }
.lamp.ice.on i { background: var(--ice); box-shadow: 0 0 6px var(--ice), 0 0 14px rgba(143,208,245,.35), inset 0 0 1px #fff; }
.lamp.on span { color: var(--ink-2); }

/* ================= キー ================= */
.key {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 7px 11px 6px;
  font: 600 12px/1 var(--f-label); letter-spacing: .1em; color: var(--ink);
  background: linear-gradient(180deg, #3b4046 0%, #2c3035 48%, #23262a 100%);
  border: 1px solid #090a0b; border-radius: var(--r-key);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), inset 0 -2px 0 rgba(0,0,0,.35),
              0 2px 0 #08090a, 0 3px 5px rgba(0,0,0,.55);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .05s, box-shadow .05s, background .1s;
  white-space: nowrap;
  touch-action: manipulation;
}
.key:hover { background: linear-gradient(180deg, #42474e 0%, #30353a 48%, #26292d 100%); }
.key:active, .key.pressed {
  transform: translateY(2px);
  background: linear-gradient(180deg, #24272b 0%, #2b2f34 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.7), inset 0 -1px 0 rgba(255,255,255,.04), 0 0 0 #08090a, 0 1px 1px rgba(0,0,0,.5);
}
.key:disabled { color: var(--ink-4); cursor: not-allowed; background: linear-gradient(180deg, #2a2d31, #202326); }
.key:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.key .led {
  position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
  width: 46%; max-width: 30px; height: 3px; border-radius: 1px;
  background: #121416; box-shadow: inset 0 1px 1px rgba(0,0,0,.9);
}
.key.led-key, .key.pill, .key.arc, .key.band { padding-top: 11px; }
.key[aria-pressed="true"] .led.green, .key.on .led.green { background: var(--green); box-shadow: 0 0 5px var(--green), 0 0 10px rgba(90,240,138,.5); }
.key[aria-pressed="true"] .led.amber, .key.on .led.amber { background: var(--amber); box-shadow: 0 0 5px var(--amber), 0 0 10px rgba(255,181,71,.45); }
.key[aria-pressed="true"] .led.ice, .key.on .led.ice { background: var(--ice); box-shadow: 0 0 5px var(--ice), 0 0 10px rgba(143,208,245,.45); }
.key[aria-pressed="true"] .led.red, .key.on .led.red { background: var(--red); box-shadow: 0 0 5px var(--red), 0 0 10px rgba(255,75,62,.45); }
.key.band { min-width: 62px; font-size: 12px; }
.key.k-ent { min-width: 54px; color: #fff; }
.key.k-copy { min-height: 24px; padding: 5px 7px 4px; font-size: 10px; letter-spacing: .12em; color: var(--ink-2); }
.key.k-copy.done { color: var(--green); }
.key.k-dim { color: var(--ink-2); }
.key.k-wide { flex: 1; }

/* ================= 左右のパネル ================= */
.panel {
  min-height: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: #33373d transparent;
  padding: 2px 4px 8px;
}
.p-left { grid-area: left; }
.p-right { grid-area: right; display: flex; flex-direction: column; gap: 8px; }
.sect { padding: 10px 2px 12px; border-bottom: 1px solid var(--groove-d); box-shadow: 0 1px 0 var(--groove-l); }
.sect:last-child { border-bottom: 0; box-shadow: none; }
.engr {
  margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px;
  font: 700 11.5px/1 var(--f-label); letter-spacing: .2em; color: var(--ink);
  text-shadow: 0 -1px 0 rgba(0,0,0,.8);
}
.engr .ja, .m-label .ja { font: 500 11px/1 var(--f-ja); letter-spacing: .04em; color: var(--ice-2); }
.entry { display: flex; gap: 8px; }
.lcd-input {
  flex: 1; min-width: 0; height: 38px; padding: 0 10px;
  font: 400 16px/1 var(--f-num); letter-spacing: .03em; color: var(--ice);
  background: var(--lcd); border: 1px solid #000; border-radius: 3px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.95), 0 1px 0 var(--groove-l);
  caret-color: var(--ice);
}
.lcd-input.amber { color: var(--amber); caret-color: var(--amber); }
.lcd-input::placeholder { color: #3d4650; font-size: 13px; letter-spacing: 0; }
.lcd-input:focus { outline: 1px solid var(--ice-2); outline-offset: 1px; }
.hint { margin: 7px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.55; }
.err { margin: 6px 0 0; min-height: 0; font-size: 12px; color: #ff8a80; }
.err:empty { display: none; }
.keyrow { display: flex; gap: 8px; margin-top: 10px; }
.saved { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }
.saved b { color: var(--amber); font-weight: 600; }

.lcd {
  background: linear-gradient(180deg, var(--lcd-2), var(--lcd));
  border: 1px solid #000; border-radius: 4px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.9), 0 1px 0 var(--groove-l), inset 0 0 0 1px rgba(143,208,245,.05);
}
.readout { padding: 10px 10px 8px; color: var(--lcd-ink); }
.readout .empty { color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.rrow { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 6px; min-height: 30px; }
.rk { font: 600 10.5px/1 var(--f-label); letter-spacing: .14em; color: var(--ice-2); }
.rv { font: 400 15px/1.2 var(--f-num); color: var(--lcd-ink); overflow-wrap: anywhere; }
.rv.small { font-size: 12.5px; }
.rv.gl { color: #fff; font-size: 17px; letter-spacing: .06em; }
.rv.na { color: var(--ink-4); font-size: 12px; font-family: var(--f-ja); }
.dms { margin: 2px 0 2px 64px; font: 400 11.5px/1.4 var(--f-num); color: var(--ink-3); }
.rule { height: 1px; margin: 8px 0 6px; background: var(--lcd-line); }
.sub-note { margin: 0 0 6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.55; }
.sub-note:empty { display: none; }
.sub-note b { color: var(--amber); font-weight: 600; }
.sub-note .ice { color: var(--ice); }

/* ================= 表示部 ================= */
.display-wrap { grid-area: disp; display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.bezel {
  flex: 1; min-height: 0; display: flex;
  padding: 9px; border-radius: 12px;
  background: linear-gradient(180deg, #0d0e10, #08090a);
  border: 1px solid #2b2f34;
  box-shadow: inset 0 0 0 1px #000, inset 0 3px 8px rgba(0,0,0,.95), 0 1px 0 rgba(255,255,255,.07), 0 10px 22px rgba(0,0,0,.35);
}
.glass {
  position: relative; flex: 1; min-height: 0; min-width: 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--lcd); border-radius: 5px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(143,208,245,.09);
}
.glass::after { /* ガラスのごく弱い映り込み（読みやすさを損なわない程度） */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: linear-gradient(172deg, rgba(255,255,255,.035) 0%, rgba(255,255,255,0) 22%);
}

/* VFO（GLの大きな数字） */
.lcd-top {
  display: grid; grid-template-columns: minmax(0,1fr) 28px minmax(0,1fr);
  align-items: center; padding: 8px 14px 9px;
  border-bottom: 1px solid var(--lcd-line);
  background: linear-gradient(180deg, #0b1219, #070b0f);
}
.vfo { display: grid; grid-template-columns: auto minmax(0,1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: baseline; min-width: 0; }
.vfo .tag { grid-row: 1 / span 2; align-self: center; }
.vfo-gl { font: 400 34px/1.05 var(--f-num); letter-spacing: .07em; color: #f4f7f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vfo-gl.empty { color: #2b3640; }
.vfo-sub { font: 400 12px/1.3 var(--f-num); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vfo-sub.ja { font-family: var(--f-ja); }
.vfo-dx { padding-left: 4px; }
.vfo-mid { text-align: center; color: #2f3c48; font-size: 13px; }
.tag {
  display: inline-block; padding: 3px 6px 2px; border-radius: 2px;
  font: 700 11px/1 var(--f-label); letter-spacing: .1em; color: #0a0c0e;
}
.tag.amber { background: var(--amber); }
.tag.ice { background: var(--ice); }
.tag.ghost { background: transparent; color: var(--ice); box-shadow: inset 0 0 0 1px var(--ice-2); }

.lcd-main { display: grid; grid-template-columns: minmax(0,1fr) 200px; min-height: 0; }
.mapbox { position: relative; min-height: 0; min-width: 0; background: #0b0f14; }
#map { position: absolute; inset: 0; }
#map canvas { transition: filter .2s; }
.map-chips { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; z-index: 3; pointer-events: none; }
.chip {
  padding: 4px 7px 3px; border-radius: 2px;
  font: 700 11px/1 var(--f-label); letter-spacing: .12em;
  background: rgba(5,8,11,.82); color: var(--ice); box-shadow: inset 0 0 0 1px rgba(143,208,245,.35);
}
.chip.my { color: #0a0c0e; background: var(--amber); box-shadow: none; }
.chip.ghost { color: var(--ink-2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.toast {
  position: absolute; left: 50%; bottom: 34px; transform: translate(-50%, 8px);
  padding: 7px 12px; border-radius: 3px; z-index: 6; pointer-events: none;
  font: 600 12px/1.3 var(--f-ja); color: var(--lcd-ink);
  background: rgba(5,8,11,.92); box-shadow: inset 0 0 0 1px rgba(143,208,245,.35);
  opacity: 0; transition: opacity .15s, transform .15s;
  max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.map-fail { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 20px; color: var(--ink-2); font-size: 13px; line-height: 1.8; z-index: 4; }

/* 計器（地図の右） */
.inst {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  border-left: 1px solid var(--lcd-line);
  background: linear-gradient(180deg, #081017, #05080b);
}
.meter { padding: 8px 10px 9px; border-bottom: 1px solid var(--lcd-line); }
.meter:last-child { border-bottom: 0; }
.m-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font: 700 10.5px/1 var(--f-label); letter-spacing: .18em; color: var(--ink-2); }
.m-label .ja { font-size: 10px; }
.dist-meter { display: block; width: 100%; height: auto; margin: 4px 0 0; }
.m-value { font: 400 24px/1.1 var(--f-num); color: var(--amber); text-align: right; letter-spacing: .02em; }
.m-value small { font-size: 12px; color: var(--amber-2); }
.m-subval { font-size: 11px; color: var(--ink-3); text-align: right; line-height: 1.4; }
.compass { display: block; width: 128px; height: 128px; margin: 4px auto 2px; }
.brg-rows { display: grid; gap: 3px; }
.brg { display: grid; grid-template-columns: 26px 1fr auto; align-items: baseline; gap: 6px; }
.bk { font: 700 10.5px/1 var(--f-label); letter-spacing: .1em; }
.bk.amber { color: var(--amber); } .bk.ice { color: var(--ice); }
.bv { font: 400 19px/1.1 var(--f-num); color: var(--lcd-ink); }
.bs { font: 400 11px/1.2 var(--f-num); color: var(--ink-3); text-align: right; }
.zone .zrow { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.zk { font: 700 11px/1 var(--f-label); letter-spacing: .14em; color: var(--ice-2); }
.zv { font: 400 21px/1.1 var(--f-num); color: var(--lcd-ink); }
.zv.cand { font-size: 15px; color: var(--amber); }
.zv.na { font: 500 12px/1.3 var(--f-ja); color: var(--ink-3); }
.zstat { margin-top: 5px; font-size: 10.5px; line-height: 1.5; color: var(--ink-3); }

/* スコープ（方位） */
.lcd-scope { border-top: 1px solid var(--lcd-line); background: #04070a; }
.scope-head {
  display: flex; justify-content: space-between; gap: 10px; padding: 4px 10px 0;
  font: 700 10px/1.4 var(--f-label); letter-spacing: .16em; color: var(--ink-3);
}
.scope-head .ja { font: 500 10px/1 var(--f-ja); letter-spacing: .04em; color: var(--ice-2); margin-left: 6px; }
.scope-key { display: flex; align-items: center; gap: 6px; font: 500 10px/1.4 var(--f-ja); letter-spacing: 0; color: var(--ink-3); }
.sw { display: inline-block; width: 10px; height: 2px; vertical-align: middle; }
.sw.amber { background: var(--amber); } .sw.ice { background: var(--ice); } .sw.dim { background: #3f7f6a; }
#scope { display: block; width: 100%; height: 104px; }

/* 表示部の下のキー列 */
.fkeys { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; padding: 0 4px 2px; }
.fkeys .key { width: 100%; }

/* ================= ダイヤル ================= */
.memlcd { padding: 8px 10px; }
.mem-top { display: flex; justify-content: space-between; align-items: center; }
.mem-ch { font: 400 13px/1 var(--f-num); color: var(--ice); }
.mem-main { margin-top: 6px; font: 400 13px/1.45 var(--f-num); color: var(--lcd-ink); min-height: 1.45em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem-main .ja { font-family: var(--f-ja); color: var(--ink-2); font-size: 12px; }

.dial-cluster { position: relative; height: 250px; flex: none; }
.dial-cluster::before { /* ノブ周りの点の地模様 */
  content: ""; position: absolute; inset: 30px 0 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.055) .8px, transparent 1.2px);
  background-size: 5px 5px;
  -webkit-mask-image: radial-gradient(circle at 50% 52%, #000 34%, transparent 66%);
          mask-image: radial-gradient(circle at 50% 52%, #000 34%, transparent 66%);
}
.key.pill {
  position: absolute; top: 2px; width: 104px; min-height: 30px;
  border-radius: 14px 14px 6px 6px; font-size: 12.5px;
}
.pill-l { left: 30px; } .pill-r { right: 30px; }
.key.arc { position: absolute; width: 60px; min-height: 34px; font-size: 11.5px; }
.a-l1 { left: 0; top: 84px; border-radius: 6px 4px 4px 14px; }
.a-l2 { left: 0; top: 172px; border-radius: 14px 4px 4px 6px; }
.a-r1 { right: 0; top: 84px; border-radius: 4px 6px 14px 4px; }
.a-r2 { right: 0; top: 172px; border-radius: 4px 14px 6px 4px; }

.dial {
  position: absolute; left: 50%; top: 52px; width: 182px; height: 182px; margin-left: -91px;
  border-radius: 50%; touch-action: none; cursor: grab;
}
.dial:active { cursor: grabbing; }
.dial:focus-visible { outline: 2px solid var(--ice); outline-offset: 16px; }
.dial-skirt { /* 外周の目盛り（1目盛り＝ダイヤルの1ステップ＝12°） */
  position: absolute; inset: -15px; border-radius: 50%;
  background: repeating-conic-gradient(from -1deg, rgba(214,220,226,.42) 0 2deg, transparent 2deg 12deg);
  -webkit-mask-image: radial-gradient(circle, transparent 0 calc(50% - 7px), #000 calc(50% - 6.5px) calc(50% - 3px), transparent calc(50% - 2.5px));
          mask-image: radial-gradient(circle, transparent 0 calc(50% - 7px), #000 calc(50% - 6.5px) calc(50% - 3px), transparent calc(50% - 2.5px));
}
.dial-index {
  position: absolute; left: 50%; top: -22px; width: 0; height: 0; margin-left: -5px;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid #d7dce1;
  filter: drop-shadow(0 1px 0 #000);
}
.dial-rot, .dial-rot2 { position: absolute; inset: 0; border-radius: 50%; will-change: transform; }
.dial-knurl { /* 外周のローレット（回る） */
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 80%, rgba(0,0,0,.0) 80%, rgba(0,0,0,.55) 100%),
    repeating-conic-gradient(#0f1012 0 1.5deg, #4a5058 1.5deg 2.4deg, #17191c 2.4deg 4deg);
  box-shadow: 0 8px 18px rgba(0,0,0,.7), 0 0 0 1px #000, inset 0 0 0 1px rgba(255,255,255,.05);
}
.dial-face { /* スピン加工の面（光の当たり方は回しても変わらない） */
  position: absolute; inset: 11%; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.028) 0 1px, rgba(0,0,0,.04) 1px 2.2px),
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 0 58%, rgba(0,0,0,.45) 100%),
    conic-gradient(from 18deg, #1a1d21, #565c64 11%, #22252a 24%, #3f454c 37%, #1a1d20 50%, #535960 62%, #212428 75%, #3d4248 88%, #1a1d21);
  box-shadow: 0 0 0 2px #0a0b0c, 0 0 0 3px rgba(255,255,255,.07), inset 0 1px 2px rgba(255,255,255,.12), inset 0 -3px 8px rgba(0,0,0,.6);
}
.dial-rot2 { inset: 11%; pointer-events: none; }
.dial-dimple { /* 指掛けのくぼみ（回る） */
  position: absolute; left: 50%; top: 62%; width: 30%; height: 30%; margin-left: -15%;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #0b0c0e 0%, #191b1f 45%, #2f3338 78%, #3c4148 100%);
  box-shadow: inset 0 3px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,255,255,.08), 0 -1px 0 rgba(0,0,0,.6);
}

/* 小ノブ */
.knobs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0 8px; border-bottom: 1px solid var(--groove-d); box-shadow: 0 1px 0 var(--groove-l); }
.knob-unit { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.knob-label { font: 700 10.5px/1 var(--f-label); letter-spacing: .18em; color: var(--ink); display: flex; gap: 6px; align-items: baseline; }
.knob-label .ja { font: 500 10px/1 var(--f-ja); letter-spacing: 0; color: var(--ice-2); }
.knob { position: relative; width: 62px; height: 62px; border-radius: 50%; touch-action: none; cursor: grab; }
.knob:focus-visible { outline: 2px solid var(--ice); outline-offset: 10px; }
.knob .scale { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); pointer-events: none; overflow: visible; }
.knob-cap {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(#121315 0 3deg, #2d3136 3deg 5deg, #16181b 5deg 8deg);
  box-shadow: 0 4px 9px rgba(0,0,0,.7), 0 0 0 1px #000;
  transition: transform .12s ease-out;
}
.knob-cap::after { /* 頂面 */
  content: ""; position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, #4b5057, #24272b 62%, #1a1c1f);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.12), 0 0 0 1px #0a0b0c;
}
.knob-mark { position: absolute; left: 50%; top: 9%; width: 3px; height: 26%; margin-left: -1.5px; border-radius: 2px; background: var(--amber); z-index: 1; box-shadow: 0 0 4px rgba(255,181,71,.6); }
.knob-val { font: 400 12px/1 var(--f-num); color: var(--ice); min-height: 12px; }

/* 日本の所在 */
.jp-row { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 6px; align-items: baseline; padding: 3px 0; }
.jp-k { font: 600 10.5px/1.3 var(--f-label); letter-spacing: .12em; color: var(--ice-2); }
.jp-v { font-size: 13.5px; color: var(--lcd-ink); overflow-wrap: anywhere; }
.jp-v .num { font-family: var(--f-num); color: #fff; font-size: 15px; margin-right: 6px; }
.jp-v .na { color: var(--ink-4); font-size: 12px; }
.jp-v small { color: var(--ink-3); font-size: 11px; }
.jp-status { display: inline-block; margin-bottom: 6px; padding: 3px 6px 2px; border-radius: 2px; font: 700 10.5px/1 var(--f-label); letter-spacing: .1em; }
.jp-status.ok { color: #06100a; background: var(--green); }
.jp-status.cand { color: #120c02; background: var(--amber); }
.jp-status.na { color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ink-4); }
.jp-cands { list-style: none; margin: 4px 0 0; padding: 0; }
.jp-cands li { padding: 6px 0; border-top: 1px solid var(--lcd-line); }
.jp-cands li:first-child { border-top: 0; }
.jp-name { font-size: 13.5px; color: var(--lcd-ink); }
.jp-name .mark { font: 700 9.5px/1 var(--f-label); letter-spacing: .1em; color: var(--ice); margin-left: 6px; }
.jp-codes { font: 400 12.5px/1.5 var(--f-num); color: var(--ink-2); }
.jp-codes b { color: #fff; font-weight: 400; }
.jp-foot { margin: 8px 0 0; font-size: 10.5px; line-height: 1.55; color: var(--ink-3); }

/* ================= 下端 ================= */
.foot { grid-area: foot; display: flex; align-items: center; justify-content: center; gap: 12px; }
.foot-line { flex: 0 1 90px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); }
.author { font: 600 8.5px/1 var(--f-label); letter-spacing: .5em; color: #5f666e; padding-left: .5em; text-shadow: 0 -1px 0 rgba(0,0,0,.9); }

/* ================= 地図の部品 ================= */
.maplibregl-ctrl-attrib.maplibregl-attrib-empty { display: block; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib {
  background: rgba(5,8,11,.8) !important; color: #b8c2cb; font: 10px/1.45 var(--f-ja);
  max-width: min(100%, 640px); border-radius: 3px 0 0 0; padding: 2px 6px;
}
.maplibregl-ctrl-attrib a { color: #9fd6f7 !important; }
.maplibregl-ctrl-scale { background: rgba(5,8,11,.75); color: #d3dae0; border-color: var(--ice-2); font: 10px/1.4 var(--f-num); }
.maplibregl-ctrl-group { background: rgba(10,14,18,.9); box-shadow: 0 0 0 1px rgba(143,208,245,.25) !important; }
.maplibregl-ctrl-group button + button { border-top-color: rgba(143,208,245,.18); }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(.88); }

.mk { position: relative; pointer-events: auto; }
.mk-my { width: 18px; height: 18px; cursor: default; }
.mk-my::before { content: ""; position: absolute; inset: 1px; transform: rotate(45deg); background: var(--amber); border: 2px solid #1a1206; box-shadow: 0 0 0 2px rgba(255,181,71,.35), 0 2px 6px rgba(0,0,0,.6); border-radius: 2px; }
.mk-dx { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ice); box-shadow: 0 0 0 2px rgba(0,0,0,.65), inset 0 0 0 2px rgba(0,0,0,.5), 0 0 10px rgba(143,208,245,.45); cursor: grab; background: rgba(143,208,245,.08); }
.mk-dx::before, .mk-dx::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--ice); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.mk-dx::before { width: 2px; height: 40px; margin: -20px 0 0 -1px; }
.mk-dx::after { width: 40px; height: 2px; margin: -1px 0 0 -20px; }
.mk-dx.grid { border-style: dashed; }
.mk-label {
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  padding: 2px 5px 1px; border-radius: 2px; white-space: nowrap;
  font: 700 10px/1.2 var(--f-label); letter-spacing: .1em; color: #0a0c0e; pointer-events: none;
}
.mk-my .mk-label { top: -22px; background: var(--amber); }
.mk-dx .mk-label { background: var(--ice); top: -24px; }

/* ================= 出典ダイアログ ================= */
dialog.sources {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid #000; border-radius: 8px; color: var(--ink);
  background: linear-gradient(180deg, #1d2024, #15171a);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 60px rgba(0,0,0,.7);
}
dialog.sources::backdrop { background: rgba(0,0,0,.6); }
dialog.sources form { padding: 18px 20px 16px; }
dialog.sources h2 { margin: 0 0 12px; font: 700 15px/1.3 var(--f-ja); }
dialog.sources h3 { margin: 14px 0 4px; font: 700 12px/1.3 var(--f-label); letter-spacing: .14em; color: var(--ice); }
dialog.sources p, dialog.sources li { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
dialog.sources ul { margin: 0; padding-left: 1.2em; }
dialog.sources a { color: var(--ice); }
.dlg-keys { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ================= 中くらいの幅（タブレット・小さいPC） ================= */
@media (max-width: 1180px) {
  body { overflow: auto; }
  .chassis {
    height: auto; min-height: 100dvh;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "top top" "disp disp" "left right" "foot foot";
  }
  .display-wrap { height: 78vh; min-height: 560px; }
  .panel { overflow: visible; }
}

/* ================= スマートフォン ================= */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .chassis { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 8px; }
  .screw { display: none; }
  .panel { display: contents; }
  .topbar { order: 0; flex-wrap: wrap; gap: 10px 12px; padding: 0 0 10px; }
  .brand { min-width: 0; }
  .brand-main { font-size: 18px; letter-spacing: .08em; }
  .brand-sub { font-size: 7.5px; letter-spacing: .12em; }
  .brand-logo img { height: 26px; }
  .topbar .brand-sub { display: none; }
  .topbar { flex-wrap: wrap; column-gap: 10px; }
  .topbar .lamps { gap: 6px; }
  .key.k-about { min-height: 34px; padding: 6px 8px 5px; font-size: 10.5px; flex-direction: column; gap: 2px; }
  .key.k-about .ja { font-size: 9.5px; }
  .lamps { gap: 8px; }
  .lamp { min-width: 22px; }
  .lamp i { width: 18px; }
  .bandbay { order: 3; flex: 1 1 100%; max-width: none; padding: 6px 8px; gap: 8px; justify-content: flex-start; }
  .bay-label { display: none; }
  .bandkeys { flex-wrap: nowrap; width: 100%; }
  .key.band { flex: 1; min-width: 0; padding-left: 4px; padding-right: 4px; }

  .sect-dx { order: 1; padding-top: 2px; }
  .display-wrap { order: 2; height: auto; min-height: 0; }
  .sect-point { order: 3; }
  .sect-jp { order: 4; }
  .sect-my { order: 5; }
  .memlcd { order: 6; }
  .dial-cluster { order: 7; }
  .knobs { order: 8; }
  .foot { order: 9; padding: 6px 0 2px; }

  .sect { padding: 10px 0 12px; }
  .sect-dx .hint { display: none; }
  .bezel { padding: 6px; border-radius: 9px; }
  .lcd-top { padding: 7px 10px 8px; grid-template-columns: minmax(0,1fr) 16px minmax(0,1fr); }
  .vfo { column-gap: 7px; }
  .vfo-gl { font-size: 21px; letter-spacing: .04em; }
  .vfo-sub { font-size: 10.5px; white-space: normal; line-height: 1.3; }
  .vfo-mid { font-size: 10px; }
  .lcd-main { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .mapbox { height: 54vh; min-height: 300px; max-height: 520px; }
  .inst { display: grid; grid-template-columns: 1fr 1fr 0.8fr; border-left: 0; border-top: 1px solid var(--lcd-line); }
  .meter { border-bottom: 0; border-right: 1px solid var(--lcd-line); padding: 7px 8px 8px; }
  .meter:last-child { border-right: 0; }
  .dist-meter, .compass { display: none; }
  .m-label { display: block; font-size: 10px; letter-spacing: .14em; }
  .m-label .ja { display: none; }
  .m-value { font-size: 20px; text-align: left; margin-top: 4px; }
  .m-subval { text-align: left; font-size: 10px; }
  .brg-rows { margin-top: 4px; }
  .brg { grid-template-columns: 20px 1fr; }
  .bs { display: none; }
  .bv { font-size: 17px; }
  .zv { font-size: 17px; }
  .zstat { font-size: 9.5px; }
  #scope { height: 96px; }
  .scope-key { display: none; }
  .fkeys { grid-template-columns: repeat(3, minmax(0,1fr)); padding: 0; }
  .fkeys .key { min-height: 40px; }
  .key { min-height: 40px; }
  .key.k-copy { min-height: 34px; padding: 6px 10px; }
  .rrow { min-height: 40px; }
  .dial-cluster { height: 268px; width: 100%; max-width: 360px; align-self: center; }
  .knobs { width: 100%; }
  .memlcd { width: 100%; }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib { font-size: 9px; }
}
@media (max-width: 380px) {
  .vfo-gl { font-size: 18px; }
  .tag { font-size: 10px; padding: 2px 4px 1px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
