/* style.css: P2 thumb dial. Colour tokens and the font come from ../core/theme.css. */

:root {
  --navy: var(--mec-navy);
  --blue: var(--mec-blue);
  --paper2: #e9eef5;          /* the table the wheel lies on */
  --ink: #0d1b33;
  --muted: #4d5b72;
  --line: #d9e0ea;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--mec-font);
  color: var(--ink);
  background: var(--paper2);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #ffbf3c; outline-offset: 1px; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app {
  position: relative;
  width: 100%;
  height: 100vh;               /* fallback */
  height: 100dvh;
  overflow: hidden;
  background: var(--paper2);
}
.boot { margin: 0; padding: 40vh 16px 0; text-align: center; color: var(--navy); font-weight: 600; }
.boot.is-error { color: var(--mec-red); }

/* ---- top bar ------------------------------------------------------------------------ */
.topbar {
  height: var(--top, 44px);
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px 0 12px;
  background: var(--navy); color: #fff;
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logos { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-who { height: 20px; width: auto; }
.logo-hrp { height: 24px; width: auto; }
.title { font-weight: 700; font-size: 16px; font-stretch: 87.5%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.01em; }
.chrome-b .topbar .logos, .chrome-c .topbar .logos { display: none; }
.gear { margin-left: auto; width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: none; border: 0; color: #fff; opacity: 0.85; }
@media (max-width: 350px) {
  .rail button { font-size: 11.5px; padding: 0 4px; }
  .rail-blankchip { display: none; }
}
@media (max-width: 340px) {
  .logo-who { height: 17px; } .logo-hrp { height: 21px; } .logos { gap: 7px; } .brand { gap: 8px; }
  .title { font-size: 14.5px; }
}

/* ---- phone ------------------------------------------------------------------------------ */
.mode-phone { display: grid; grid-template-rows: var(--top) minmax(0, 1fr); }
.mode-phone .main { display: grid; grid-template-rows: minmax(0, 1fr) var(--dial) var(--nav); min-height: 0; position: relative; }
.reader { min-height: 0; max-width: 560px; width: 100%; margin: 0 auto; touch-action: none; }

.col {
  height: 100%;
  display: grid;
  grid-template-rows: var(--group) var(--sub) minmax(0, 1fr) var(--rail, 0px);
  transition: transform 0.18s var(--ease);
  font-stretch: 75%;
}
.col-head { display: contents; }
.col-group {
  background: var(--navy); color: #fff;
  display: grid; place-items: center; padding: 0 10px;
  border-bottom: 1px solid #fff;
}
.col-group-t {
  display: block; width: 100%; max-height: calc(var(--group) - 2px); overflow: hidden;
  text-align: center; font-weight: 700; line-height: 1.08; letter-spacing: 0.03em;
}
.col-sub { background: var(--blue); color: var(--navy); display: grid; place-items: center; padding: 0 10px; border-bottom: 1px solid #fff; }
.col-sub-t { display: block; width: 100%; max-height: calc(var(--sub) - 4px); overflow: hidden; text-align: center; font-weight: 600; line-height: 1.1; }
.col.no-sub .col-group { grid-row: 1 / 3; }
.col.no-sub .col-group-t { max-height: calc(var(--group) + var(--sub) - 6px); }
.col.no-sub .col-sub { display: none; }
.col sup { font-size: 0.62em; line-height: 0; vertical-align: 0; position: relative; top: -0.55em; }
.fn {
  border: 0; background: none; padding: 0 2px 0 1px; margin: 0; font: inherit; color: inherit;
  text-decoration: underline dotted; text-underline-offset: 2px;
}

.col-rows { display: grid; grid-template-rows: repeat(8, minmax(0, 1fr)); min-height: 0; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--win) minmax(0, 1fr);
  border: 0; padding: 0; margin: 0; text-align: inherit; color: #fff;
  min-height: 0; transform-origin: 50% 100%;
}
.row.is-even { background: var(--navy); }
.row.is-odd { background: var(--blue); }
.row-name, .row-code { display: flex; align-items: center; min-width: 0; padding: 0 9px; }
.row-name { justify-content: flex-end; text-align: right; }
.row-code { justify-content: flex-start; text-align: left; }
.row-t { display: block; min-width: 0; max-width: 100%; max-height: calc(var(--row) - 3px); overflow: hidden; line-height: 1.07; }
.row-name .row-t { font-weight: 500; }
.row-code .row-t { font-weight: 700; }
.row-cell {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: var(--v-size, 24px); font-stretch: 87.5%;
  border-bottom: 1px solid #fff; border-left: 1px solid #fff; border-right: 1px solid #fff;
  line-height: 1; letter-spacing: 0.01em;
}
.row:last-child .row-cell { border-bottom: 0; }
.row-cell.is-green { background: var(--mec-green); }
.row-cell.is-amber { background: var(--mec-amber); }
.row-cell.is-red { background: var(--mec-red); }
.row-cell.is-blank { background: #fff; box-shadow: inset 0 0 0 1px #c8cfdb; }
.row-v { transition: opacity 0.12s linear; white-space: nowrap; }
.row-v sup { font-size: 0.56em; top: -0.62em; margin-left: 1px; font-weight: 600; }
.row:active .row-cell { filter: brightness(0.92); }
.row.is-open { position: relative; z-index: 60; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--navy); }
.is-moving .row-v { opacity: 0.55; }
.is-fast .row-v { opacity: 0.12; }

.rail {
  display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--chord) + 6px) minmax(0, 1fr);
  align-items: stretch; background: var(--paper2); color: var(--navy);
  font-stretch: 75%; position: relative; z-index: 1;
}
.rail button { border: 0; background: none; color: var(--navy); font-size: 13px; font-weight: 600; padding: 0 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-notes { text-align: right; }
.rail-notes:disabled { cursor: default; }
.rail-l { font-weight: 800; letter-spacing: 0.04em; }
.rail-chev { margin-left: 4px; font-weight: 800; }
.rail-none { color: var(--muted); font-weight: 500; }
.rail-blank { text-align: left; display: flex; align-items: center; gap: 5px; }
.rail-blankchip { width: 10px; height: 10px; background: #fff; box-shadow: inset 0 0 0 1px #9aa6b8; flex: none; }

.beam { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; }
.beam-fill { fill: rgba(0, 32, 92, 0.16); }
.beam-edge { fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; }

.dial-wrap { position: relative; overflow: hidden; background: var(--paper2); }
.dial-cam { position: absolute; inset: 0; }
.dial-cam svg { position: absolute; }
.hint {
  position: absolute; left: 0; right: 0; top: calc(-1 * var(--rail)); height: var(--rail); margin: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
}
.hint::before { content: '⟵  '; white-space: pre; }
.hint::after { content: '  ⟶'; white-space: pre; }
.dial-wrap .hint { position: absolute; }
.mode-phone .main > .dial-wrap { overflow: visible; }
.mode-phone .dial-cam { overflow: hidden; }

.bottombar {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--navy); color: #fff; position: relative; z-index: 3;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottombar button {
  border: 0; background: none; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 12px; font-weight: 600; font-stretch: 87.5%; min-width: 0; padding: 0 2px;
}
.bottombar button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottombar .is-find svg { width: 24px; height: 24px; }
.bottombar button:active { background: rgba(255, 255, 255, 0.12); }

/* ---- desktop ------------------------------------------------------------------------------ */
.mode-desktop { display: grid; grid-template-rows: var(--top) minmax(0, 1fr); }
.mode-desktop .topbar { padding: 0 8px 0 18px; gap: 14px; }
.mode-desktop .title { font-size: 18px; }
.desk-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.desk-nav button {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: #fff; font-size: 15px; font-weight: 600;
}
.desk-nav button:hover { background: rgba(255, 255, 255, 0.12); }
.desk-nav kbd { font: 600 12px var(--mec-font); border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 4px; padding: 0 5px; opacity: 0.8; }
.mode-desktop .gear { margin-left: 4px; }
.mode-desktop .main { position: relative; overflow: hidden; min-height: 0; }
.stage { position: absolute; inset: 0; overflow: hidden; }
.disc-cam { position: absolute; transform-origin: 50% 50%; transition: transform 0.7s var(--ease); }
.disc-cam svg { display: block; }
.disc-cam.is-flipping { animation: flip 0.42s ease-in forwards; }
@keyframes flip { to { transform: perspective(1600px) rotateY(88deg) scale(0.86); opacity: 0.35; } }
.stage-hint {
  position: absolute; left: 0; right: 0; bottom: 4px; margin: 0; text-align: center; pointer-events: none;
  color: rgba(255, 255, 255, 0.82); font-size: 13px; font-weight: 500; z-index: 2;
}
.legend-mode .stage-hint { display: none; }
.panel {
  position: absolute; right: 24px; top: 14px; bottom: 14px; width: 380px;
  background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 14px rgba(0, 32, 92, 0.16);
  display: flex; flex-direction: column;
}
.panel .col { height: auto; grid-template-rows: var(--group) var(--sub) calc(8 * var(--row)) auto; }
.panel .col-rows { grid-template-rows: repeat(8, var(--row)); }
.col-notes { padding: 10px 14px 14px; font-stretch: 87.5%; overflow: auto; font-size: 14px; line-height: 1.35; }
.col-notes h3 { margin: 0 0 6px; font-size: 13px; color: var(--navy); text-transform: uppercase; letter-spacing: 0.05em; }
.col-notes dl { margin: 0; }
.col-notes div { display: grid; grid-template-columns: 26px 1fr; gap: 6px; margin-bottom: 6px; }
.col-notes dd { margin: 0; }
.note-letter { border: 0; background: var(--navy); color: #fff; border-radius: 4px; width: 22px; height: 22px; font-weight: 700; }
.legend-mode .panel { display: none; }
.legend-card {
  position: absolute; top: 16px; right: 24px; bottom: 16px; overflow: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 4px 22px rgba(0, 32, 92, 0.18); padding: 0 18px 18px;
  animation: fadeIn 0.35s var(--ease) both 0.2s;
}
.legend-card header { position: sticky; top: 0; background: #fff; display: flex; align-items: center; padding-top: 6px; }
.legend-card h2 { flex: 1; margin: 0; font-size: 20px; color: var(--navy); }
@keyframes fadeIn { from { opacity: 0; transform: translateX(16px); } }

/* ---- overlays ------------------------------------------------------------------------------- */
.ov { position: fixed; inset: 0; z-index: 50; }
.ov-backdrop { position: absolute; inset: 0; background: rgba(0, 16, 46, 0.38); opacity: 0; transition: opacity 0.24s linear; }
.ov.is-open .ov-backdrop { opacity: 1; }
.ov-close { width: 44px; height: 44px; flex: none; border: 0; background: none; color: var(--navy); font-size: 28px; line-height: 1; display: grid; place-items: center; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 28px rgba(0, 16, 46, 0.25);
  display: flex; flex-direction: column; transform: translateY(105%); transition: transform 0.3s var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}
.ov.is-open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: #c3ccd9; margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 6px; padding: 2px 4px 6px 16px; flex: none; touch-action: none; }
.sheet-head h2 { flex: 1; margin: 10px 0 0; font-size: 16px; line-height: 1.3; color: var(--navy); font-stretch: 87.5%; }
.sheet-body { overflow: auto; padding: 0 16px 18px; font-size: 15px; line-height: 1.42; overscroll-behavior: contain; }
.sheet-body h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 0 6px; }
.sheet-body p { margin: 0 0 8px; }
.vs-method { font-weight: 800; }
.vs-dot { color: var(--muted); }
.vs-cond { font-weight: 600; }
.vs-cond sup, .sheet-head sup { font-size: 0.65em; }
.vs-val { vertical-align: 1px; }
.vs-long { color: var(--muted); font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 4px;
  border-radius: 4px; color: #fff; font-weight: 700; font-size: 13px; font-stretch: 87.5%; line-height: 1;
}
.chip sup { font-size: 0.7em; margin-left: 1px; position: relative; top: -0.3em; vertical-align: 0; }
.chip.is-green { background: var(--mec-green); }
.chip.is-amber { background: var(--mec-amber); }
.chip.is-red { background: var(--mec-red); }
.chip.is-blank { background: #fff; box-shadow: inset 0 0 0 1px #9aa6b8; color: var(--muted); }

.meaning { border-left: 5px solid var(--line); padding: 2px 0 2px 10px; margin: 6px 0 4px; }
.meaning.is-green { border-color: var(--mec-green); }
.meaning.is-amber { border-color: var(--mec-amber); }
.meaning.is-red { border-color: var(--mec-red); }
.meaning.is-blank { display: flex; gap: 10px; align-items: flex-start; border-color: #c8cfdb; }
.meaning-left { font-weight: 700; margin-bottom: 6px !important; }
.meaning dl, .legend dl, .fn-list { margin: 0; }
.meaning dl > div, .legend dl > div { display: grid; grid-template-columns: 34px 1fr; gap: 8px; margin-bottom: 6px; align-items: start; }
.meaning dd, .legend dd { margin: 0; }
.fn-list > div { display: grid; grid-template-columns: 22px 1fr; gap: 8px; margin-bottom: 8px; }
.fn-list dt { font-weight: 800; color: var(--navy); font-size: 16px; line-height: 1.3; }
.fn-list dd { margin: 0; }
.fn-where { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.link-btn { border: 0; background: none; color: var(--blue); font-weight: 700; padding: 8px 0; }
.elig-item { font-weight: 700; font-size: 17px; }

.legend-heads { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: 12px; padding-left: 16px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 4px 0 8px; }
.legend-group { border-left: 6px solid; padding: 4px 0 2px 10px; margin-bottom: 14px; display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: 12px; align-items: start; }
.legend-group dl > div { grid-template-columns: 30px 1fr; }
.legend-group.is-green { border-color: var(--mec-green); }
.legend-group.is-red { border-color: var(--mec-red); }
.legend-group.is-amber { border-color: var(--mec-amber); }
.legend-left { font-weight: 800; margin-bottom: 6px; }
.legend-blank { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; }
.legend-blank p { margin: 0; }
.legend-notes { margin: 8px 0 0; padding-left: 18px; color: var(--ink); }
.legend-notes li { margin-bottom: 5px; }

.ov-page, .ov-search, .ov-whole {
  background: #fff; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s var(--ease);
}
.ov-page.is-open, .ov-search.is-open, .ov-whole.is-open { transform: none; }
.page-head {
  height: 52px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 2px;
  background: var(--navy); color: #fff; padding-top: env(safe-area-inset-top);
}
.page-head h1 { flex: 1; margin: 0; font-size: 17px; font-stretch: 87.5%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head .ov-close { color: #fff; }
.head-btn { border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 8px; height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 13px; font-weight: 600; flex: none; }
.head-btn svg { width: 18px; height: 18px; }
.page-body { flex: 1; overflow: auto; padding: 16px 16px 40px; font-size: 16px; line-height: 1.5; overscroll-behavior: contain; }
.page-body > * { max-width: 680px; margin-left: auto; margin-right: auto; }
.page-body h2 { font-size: 19px; color: var(--navy); margin: 22px auto 8px; line-height: 1.25; }
.page-body h3 { font-size: 16px; color: var(--navy); margin: 18px auto 6px; }
.page-body p { margin-top: 0; margin-bottom: 12px; }
.page-body ul, .page-body ol { padding-left: 22px; }
.page-body li { margin-bottom: 6px; }
.page-logos { display: flex; gap: 22px; align-items: center; background: var(--navy); padding: 14px 16px; border-radius: 10px; margin-bottom: 16px; }
.page-logos .logo-who { height: 36px; } .page-logos .logo-hrp { height: 44px; }
.edition { color: var(--muted); font-size: 13px; }
.small { font-size: 13.5px; color: var(--muted); }
.lead { font-weight: 600; }
.deflist div { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.deflist dt { font-weight: 800; color: var(--navy); }
.deflist dd { margin: 0; }
.spr-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 auto 12px; }
.spr-card h3 { margin: 0 0 8px; font-size: 16px; }
.spr-card dl { margin: 0; }
.spr-card dl > div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid #eef1f5; font-size: 15px; }
.spr-card dt { font-weight: 700; color: var(--navy); }
.spr-card dd { margin: 0; }
.back-navy { background: var(--navy); color: #fff; border-radius: 12px; padding: 4px 16px 10px; }
.back-navy h2, .back-navy h3 { color: #fff; }
.back-navy h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.9; }
.refer { margin-top: 12px; }
.is-target { background: #fff3c4; color: var(--ink); border-radius: 4px; outline: 3px solid #fff3c4; }
.page-body .fn-list > div { grid-template-columns: 26px 1fr; padding: 4px 0; border-bottom: 1px solid #eef1f5; }
.abbr { padding-left: 18px; }
.menu { list-style: none; padding: 0; margin: 0 auto; }
.menu button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: none; border-bottom: 1px solid var(--line); padding: 15px 4px; font-size: 17px; font-weight: 600; color: var(--navy); }
.eff-tier { display: grid; grid-template-columns: 36px 1fr; gap: 10px; border-top: 1px solid var(--line); padding: 12px 0; }
.eff-rank { width: 30px; height: 30px; border-radius: 15px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; }
.eff-methods { font-weight: 700; color: var(--navy); }
.eff-tier h4 { margin: 4px 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.eff-end { color: var(--navy); }

/* search */
.search-list { flex: 1; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.res-list { list-style: none; margin: 0; padding: 0; }
.ov-search.is-filtered .res-list { margin-top: auto; }
.res { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 16px 10px; border-bottom: 1px solid var(--line); }
.res.is-current { background: #eaf3fb; box-shadow: inset 4px 0 0 var(--blue); }
.res-group { display: block; font-weight: 800; font-size: 13px; color: var(--navy); letter-spacing: 0.02em; font-stretch: 87.5%; }
.res-label { display: block; font-size: 16px; font-weight: 500; line-height: 1.25; }
.res-label sup { font-size: 0.65em; }
.res-note { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.res .chips { display: flex; gap: 3px; margin-top: 6px; flex-wrap: nowrap; }
.res .chip { min-width: 0; flex: 0 1 34px; height: 20px; font-size: 12px; padding: 0 2px; }
.res-head { position: sticky; top: 0; z-index: 1; background: var(--navy); color: #fff; font-weight: 800; font-size: 12.5px; padding: 6px 16px; letter-spacing: 0.03em; font-stretch: 87.5%; }
.res-head[aria-hidden="true"] { display: none; }
.search-empty { padding: 20px 16px; color: var(--muted); margin-top: auto; }
.search-bar { flex: none; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--paper2); border-top: 1px solid var(--line); }
.search-bar input { width: 100%; height: 48px; border: 2px solid var(--navy); border-radius: 10px; padding: 0 14px; font: 500 17px var(--mec-font); color: var(--ink); background: #fff; }

/* whole wheel */
.ov-whole { background: var(--paper2); }
.whole-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.whole-foot { flex: none; padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); text-align: center; }
.whole-foot p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.whole-read { border: 0; border-radius: 22px; background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; padding: 10px 18px; max-width: 100%; font-stretch: 87.5%; }
.whole-read sup { font-size: 0.65em; }

/* settings drawer */
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(380px, 94vw); background: #fff;
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s var(--ease);
  box-shadow: -6px 0 26px rgba(0, 16, 46, 0.22);
}
.ov.is-open .drawer { transform: none; }
.drawer-body { overflow: auto; padding: 0 16px 24px; font-size: 15px; }
.drawer fieldset { border: 0; border-top: 1px solid var(--line); padding: 10px 0 12px; margin: 0; }
.drawer legend { font-weight: 800; color: var(--navy); padding: 0; margin-bottom: 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.opt { display: flex; gap: 10px; align-items: center; padding: 7px 0; }
.opt input { width: 20px; height: 20px; accent-color: var(--navy); flex: none; }
.btn { display: block; width: 100%; margin-top: 8px; border: 0; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; padding: 11px; }
.btn-quiet { background: #eef1f5; color: var(--navy); }
.vp { font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0; }
.note { color: var(--muted); font-size: 13px; }
.drawer pre { font: 11px/1.35 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; background: #f4f6f9; padding: 8px; border-radius: 6px; }
.drawer summary { font-weight: 700; color: var(--navy); padding: 8px 0; }

/* ---- opening -------------------------------------------------------------------------------- */
#intro { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
#intro[hidden] { display: none; }
.intro-cam { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; will-change: transform, opacity; }
.intro-cam svg { display: block; }
.intro-logos {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 20px; background: var(--navy); border-radius: 12px; padding: 12px 18px;
}
.intro-logos .logo-who { height: 30px; } .intro-logos .logo-hrp { height: 38px; }
.intro-on .mec-cover { transition: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
.hint[hidden] { display: none; }

/* selection: our own outline (sub cell + column), not the core frame */
.mec-highlight { display: none; }
.p2-selected { fill: none; stroke: #fff; stroke-width: 2px; stroke-linejoin: round; pointer-events: none; }
.mec-wheel:focus-visible .p2-selected { stroke-width: 3px; }
.page-body .menu { padding: 0; }
.menu button svg { flex: none; }
