/* 潮止水門's own components on top of the standard shell (css/kit.css + theme.css + shell.css): the HUD extras (room name, ◆ marker, the pump's hold bar, lane cards),
   the opening, the locker / hood layers, the ending film, the papers and the tape, the panels at the gate (hands-on controls), the result card, the lists.
   Colours, radii and fonts come from the --gf-* tokens (css/theme-game.css sets this game's values); loaded as ext theme "tidegate" (js/ext/index.js). */

/* ---- HUD extras (each one has a place: hud-slots, rule U27) ---- */
.td-roomname { color: var(--gf-text); font: 700 14px/1.3 var(--gf-font); letter-spacing: 1px; background: var(--gf-hud-surface); border-bottom: 2px solid var(--gf-accent-2); padding: 4px 12px; border-radius: var(--gf-radius); opacity: 0; transition: opacity 0.4s; pointer-events: none; align-self: flex-start; }
.td-roomname small { display: block; font-size: 11px; font-weight: 400; color: var(--gf-text-dim); letter-spacing: 3px; }
.td-roomname.show { opacity: 1; }
.td-roomname:not(.show) { display: none; }
.td-marker { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: -14px 0 0 -60px; width: 120px; pointer-events: none; will-change: transform; }
.td-marker i { color: var(--gf-accent-2); font-style: normal; font-size: 18px; line-height: 1; text-shadow: 0 0 4px #000, 0 0 8px rgba(0, 0, 0, 0.8); }
.td-marker .mk-label { font-size: 11px; color: var(--gf-text); background: var(--gf-hud-surface); padding: 1px 7px; border-radius: 8px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.td-marker .mk-label:empty { display: none; }
.td-marker.edge .mk-label { opacity: 0.8; }
.td-hold { position: absolute; left: 50%; top: calc(50% + 70px); transform: translateX(-50%); width: min(260px, 70vw); text-align: center; pointer-events: none; }
.td-hold .hl { color: var(--gf-text); font-size: 13px; background: var(--gf-hud-surface); border-radius: 8px 8px 0 0; padding: 2px 10px; }
.td-hold .hb { /* pair-ok: no text */ height: 12px; background: var(--gf-surface-2); border: 1px solid var(--gf-border-strong); border-radius: 0 0 8px 8px; overflow: hidden; }
#hold-bar { /* pair-ok: no text */ height: 100%; width: 0; background: var(--gf-accent-2); }
.td-hold.hidden { display: none; }
.td-debug { position: absolute; right: 8px; bottom: 8px; font: 11px/1.4 ui-monospace, monospace; background: rgba(0, 0, 0, 0.7); padding: 6px 8px; border-radius: 4px; white-space: pre-wrap; color: #cfe; max-width: 52vw; margin: 0; display: none; }
html[data-gf-debug] .td-debug { display: block; }
.td-who { display: inline-block; font: 700 11px var(--gf-font); color: var(--gf-goal); border: 1px solid var(--gf-goal); border-radius: 3px; padding: 0 4px; margin-right: 8px; vertical-align: 2px; }
.td-who.me { color: var(--gf-text); border-color: var(--gf-border-strong); }
body[data-subs="large"] #say { font-size: 1.25em; }

/* ---- lane items of the game (the lane itself: kit css/shell.css .tl-*): pick-up / place / look-at cards, the side-job note, sound captions ---- */
.tl-pickup .tl-body, .tl-place .tl-body, .tl-look .tl-body { display: flex; align-items: center; gap: 10px; }
.tl-pickup .pk-img, .tl-look .lk-img { /* pair-ok: no text */ flex: none; width: 56px; height: 56px; border-radius: 6px; background: var(--gf-surface-2) center/cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.tl-place .pc-img { /* pair-ok: no text */ flex: none; width: 84px; aspect-ratio: 3 / 2; border-radius: 3px; background: var(--gf-surface-2) center/cover no-repeat; box-shadow: 0 0 0 2px var(--gf-border-strong); }
.tl-pickup small, .tl-place small { display: block; font-size: 11px; color: var(--gf-text-dim); letter-spacing: 2px; }
.tl-pickup b, .tl-look b { display: block; font-size: 14px; }
.tl-place b { font: 700 16px var(--gf-font-serif); }
.tl-pickup .pk-feel, .tl-look em { display: block; font-style: normal; font-size: 12px; color: var(--gf-text-dim); }
.tl-pickup span:not(.pk-feel), .tl-look span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--gf-text-dim); }
.tl-quest-note b { display: block; font-size: 14px; }
.tl-quest-note span { color: var(--gf-text-dim); }
.tl-caption { font-size: 13px; padding-top: 4px; padding-bottom: 4px; }

/* ---- fade / the layers of the locker and the hood (in the world, not a screen effect) ---- */
#fade { /* pair-ok: no text */ position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 15; transition: opacity 0.35s; }
#fade.on { opacity: 1; }
#death { position: fixed; inset: 0; z-index: 25; background: #000; color: #d8d0c0; display: flex; flex-direction: column; gap: 20px; padding: 24px; text-align: center; align-items: center; justify-content: center; }
#death.hidden { display: none; }
#death-text { font: 22px var(--gf-font-serif); letter-spacing: 4px; }
#death-note { max-width: 32em; font-size: 17px; line-height: 1.7; }
#death-go { min-height: 48px; padding: 10px 28px; color: #eee6d6; border-color: rgba(238, 230, 214, 0.6); background: rgba(0, 0, 0, 0.3); }
#vents { /* pair-ok: no text */ position: fixed; inset: 0; z-index: 4; pointer-events: none; background: repeating-linear-gradient(#050505 0 26px, transparent 26px 34px); box-shadow: inset 0 0 120px #000; }
#vents.hidden, #ending.hidden, #intro.hidden, #blind.hidden { display: none; }
.td-blind { /* pair-ok: no text on the bare black; the lines carry their own */ position: fixed; inset: 0; z-index: 5; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; color: #e6e2d4; text-align: center; }
#blind-text { font: 18px/1.9 var(--gf-font-serif); color: #e6e2d4; }
#blind-keys { font-size: 13px; color: #b4b0a2; }
body.blindmode #t-buttons button:not([data-k="KeyE"]):not([data-k="KeyQ"]) { display: none; }
#t-mask { pointer-events: auto; }

/* ---- the opening (一人語り): a picture behind, the thought on a strip of shadow ---- */
#intro { /* pair-ok: no text */ position: fixed; inset: 0; z-index: 22; background: #000; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px max(36px, var(--gf-safe-b, 0px)); }
#intro-bg, #intro-bg2 { /* pair-ok: no text */ position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transition: opacity 1.6s; filter: saturate(0.7) brightness(0.7); }
#intro-bg.on, #intro-bg2.on { opacity: 1; }
.intro-box { color: #f4ecdc; position: relative; width: min(680px, 100%); background: rgba(0, 0, 0, 0.7); padding: 14px 20px 10px; border-radius: 6px; cursor: pointer; }
.intro-head { display: flex; justify-content: space-between; font-size: 12px; color: #c8c2b2; margin-bottom: 8px; }
#intro-text { font: 19px/1.9 var(--gf-font-serif); color: #f4ecdc; min-height: 3.8em; }
#intro-text.in { animation: tdfade 0.6s; }
.intro-foot { display: flex; justify-content: space-between; font-size: 12px; color: #c8c2b2; margin-top: 6px; }
#intro-skip { color: #f4ecdc; position: absolute; right: max(14px, var(--gf-safe-r, 0px)); top: max(14px, var(--gf-safe-t, 0px)); padding: 7px 14px; border-radius: 6px; border: 1px solid #8a8e86; background: rgba(0, 0, 0, 0.6); cursor: pointer; font-size: 13px; min-height: 44px; }
@keyframes tdfade { from { opacity: 0; } to { opacity: 1; } }
@media (max-height: 460px) { #intro-text { font-size: 16px; line-height: 1.7; min-height: 3.4em; } .intro-box { padding: 10px 14px 6px; } }

/* ---- the ending film and the result card ---- */
#ending { /* pair-ok: no text */ position: fixed; inset: 0; z-index: 26; background: #000; }
#ending-img { /* pair-ok: no text */ position: absolute; inset: 0; }
#ending-img .epic { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
#ending-img::after { /* pair-ok: no text */ content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 7, 10, 0.2), rgba(5, 7, 10, 0.92) 78%); }
.ending-inner { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); width: min(88vw, 720px); text-align: center; z-index: 1; color: #f4eee0; }
#ending-title { font: 700 24px var(--gf-font-serif); color: #f4eee0; margin-bottom: 12px; letter-spacing: 3px; }
#ending-text { font: 18px/1.9 var(--gf-font-serif); text-shadow: 0 0 8px #000, 0 0 3px #000; color: #f4eee0; min-height: 8em; }
#ending-text p { margin: 0 0 6px; animation: tdfade 1s; }
#ending-text p.speech { color: #fff6d8; }
#ending-text p.after { font-size: 20px; }
#ending-text p.last { font-size: 15px; color: #d8d2c0; margin-top: 12px; }
#ending-next { color: #f4eee0; padding: 8px 18px; border-radius: 6px; border: 1px solid #8a8e86; background: rgba(0, 0, 0, 0.7); cursor: pointer; min-height: 44px; margin-top: 10px; }
.td-result { text-align: center; }
#result-img { /* pair-ok: no text */ height: min(34vw, 190px); margin: 0 0 10px; background: var(--gf-surface-2); border-radius: var(--gf-radius); overflow: hidden; }
#result-img .rimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-code { font-size: 13px; color: var(--gf-text-dim); letter-spacing: 2px; }
#result-title { font: 700 28px var(--gf-font-serif); margin: 6px 0; color: var(--gf-goal); }
.result-line { font: 16px var(--gf-font-serif); margin-bottom: 12px; color: var(--gf-text); }
.result-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin: 10px 0; }
.result-stats div { background: var(--gf-surface-2); color: var(--gf-text-dim); border-radius: 6px; padding: 8px 4px; font-size: 12px; }
.result-stats b { display: block; font-size: 15px; color: var(--gf-text); margin-top: 2px; }
#result-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
#result-list span { color: var(--gf-text-dim); background: var(--gf-surface-2); border: 1px dashed var(--gf-border-strong); border-radius: 12px; padding: 2px 10px; font-size: 12px; }
#result-list span.got { color: var(--gf-text); border-style: solid; }
#result-list span.now { color: var(--gf-accent-ink); background: var(--gf-accent); border-color: var(--gf-accent); }
.result-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.result-buttons .btn { min-height: 44px; }
.share-text { font-size: 13px; color: var(--gf-text-dim); margin: 6px 0; }
.share-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 6px; }
.share-buttons button { color: var(--gf-text); padding: 9px 6px; border-radius: 8px; border: 1px solid var(--gf-border); background: var(--gf-surface-2); cursor: pointer; min-height: 44px; }
.share-buttons .share-x { color: #fff; background: #000; border-color: #555; }
.share-buttons .share-fb { color: #fff; background: #1b4f9a; }
.share-buttons .share-line { color: #fff; background: #057a38; }
.share-buttons .share-ig { color: #1a0f0a; background: #f0a878; border: none; }
.share-note { font-size: 12px; color: var(--gf-text-dim); min-height: 1.4em; }
.egal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.eg { display: flex; flex-direction: column; gap: 4px; color: var(--gf-text-dim); font-size: 13px; }
.eg .egpic { /* pair-ok: no text */ aspect-ratio: 16 / 10; border-radius: 6px; background: var(--gf-surface-2) center/cover no-repeat; border: 1px solid var(--gf-border); }
.eg.got { color: var(--gf-text); }
.td-credits p { font-size: 14px; line-height: 1.8; }
.small { font-size: 12px; color: var(--gf-text-dim); line-height: 1.6; }
.dim { color: var(--gf-text-dim); }
.td-keyhint { font-size: 12px; color: var(--gf-text-dim); text-align: center; margin: 10px 0 0; }
.nopic { /* pair-ok: no text */ background: repeating-linear-gradient(135deg, var(--gf-surface-2) 0 8px, var(--gf-border) 8px 16px); }

/* ---- papers: a sheet of paper (tokens switch together: .gf-paper) ---- */
.paper { color: var(--gf-text); background: var(--gf-surface); padding: 16px 18px; border-radius: 3px; box-shadow: inset 0 0 30px rgba(140, 120, 80, 0.12), 0 2px 6px rgba(0, 0, 0, 0.15); font-size: 16px; line-height: 1.9; }
.paper.typed { font-family: var(--gf-font-serif); }
.paper.handwritten, .paper.memo { color: var(--gf-text); font-family: var(--gf-font-hand); font-size: 18px; background: repeating-linear-gradient(180deg, var(--gf-surface) 0 30px, var(--gf-border) 30px 31px); }
.paper.label { font-family: var(--gf-font); background: var(--gf-note-bg); color: var(--gf-note-text); border-left: 6px solid var(--gf-note-line); }
.paper.photo { color: var(--gf-text); font-family: var(--gf-font); background: var(--gf-surface-2); }
.tape { color: var(--gf-text); background: var(--gf-surface); font-family: var(--gf-font-serif); padding: 16px 18px; border-radius: 6px; line-height: 2; font-size: 16px; }
.dphotos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dphotos figure { margin: 0; flex: 1 1 200px; max-width: 340px; background: #fff; color: #444; padding: 6px 6px 3px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); transform: rotate(-0.6deg); }
.dphotos figure:nth-child(2) { transform: rotate(0.8deg); }
.dphotos .dph { width: 100%; aspect-ratio: 3 / 2; max-height: 24vh; object-fit: cover; display: block; }
.dphotos figcaption { font-size: 11px; color: #555; padding-top: 3px; }
.src { font-size: 12px; color: var(--gf-text-dim); margin: 8px 2px; }
.think-in { font-family: var(--gf-font-serif); font-size: 16px; color: var(--gf-voice-text); background: var(--gf-voice-bg); border-left: 3px solid var(--gf-voice-line); padding: 8px 10px; margin-top: 8px; }
.think-in .who { font-family: var(--gf-font); font-size: 11px; border: 1px solid var(--gf-voice-line); border-radius: 3px; padding: 0 4px; margin-right: 6px; color: var(--gf-voice-label); }
.bigphoto .bph { width: 100%; border-radius: 4px; display: block; }
.td-photoview { text-align: center; }
.td-photoview img { max-width: 100%; max-height: 50vh; border: 6px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.td-feel { font: 16px var(--gf-font-hand); color: var(--gf-voice-text); background: var(--gf-voice-bg); border-left: 3px solid var(--gf-voice-line); padding: 6px 10px; margin: 10px 0; text-align: left; }

/* ---- the panels at the gate (the standard window "term"): the work as something you do with your hands ---- */
.pgoal { color: var(--gf-text); display: flex; align-items: center; gap: 8px; background: var(--gf-surface-2); border: 1px solid var(--gf-border); border-left: 5px solid var(--gf-accent-2); border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.pgoal .lbl { font-size: 11px; background: var(--gf-accent-2); color: #1a1a14; border-radius: 4px; padding: 1px 6px; font-weight: 400; }
.helpb { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--gf-border-strong); background: var(--gf-surface); cursor: pointer; font-weight: 700; color: var(--gf-text); }
.phelp { color: var(--gf-note-text); background: var(--gf-note-bg); border: 1px solid var(--gf-note-line); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; line-height: 1.6; }
.phelp.hidden, .reldetail.hidden { display: none; }
.phelp p { margin: 2px 0; }
.panelpic { width: 100%; max-height: 210px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 8px; }
.plines p { margin: 4px 0; color: var(--gf-text); }
.ptoast { color: var(--gf-hint-text); background: var(--gf-hint-bg); border-left: 3px solid var(--gf-hint-line); padding: 6px 10px; margin: 6px 0; border-radius: 4px; }
.pbtns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pbtns .btn { min-height: 44px; }
.btn.danger { background: var(--gf-warn-bg); color: var(--gf-warn-text); border-color: var(--gf-warn-line); }
.btn .why { display: block; font-size: 11px; color: var(--gf-text-dim); }
.pbtns .btn:focus-visible, .cell:focus-visible { outline: 3px solid var(--gf-goal); outline-offset: 1px; }
.pbtnsw summary { cursor: pointer; font-size: 12px; color: var(--gf-text-dim); margin: 4px 0; }
.mg { position: relative; border-radius: 8px; min-height: 230px; background-color: var(--gf-mg-bg); color: var(--gf-mg-ink); background-size: cover; background-position: center; margin-bottom: 8px; overflow: hidden; user-select: none; touch-action: none; }
.mg::before { /* pair-ok: no text */ content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.55)); pointer-events: none; }
.mg > * { position: relative; }
.mg .none { color: var(--gf-mg-dim); font-size: 13px; }
.mg .card { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 86px; padding: 4px; border-radius: 8px; border: 1px solid var(--gf-mg-line); background: var(--gf-mg-bg-2); color: var(--gf-mg-ink); font-size: 11px; cursor: grab; touch-action: none; }
.mg .card img { width: 70px; height: 70px; object-fit: cover; border-radius: 5px; pointer-events: none; }
.mg .grab { cursor: grabbing; z-index: 5; }
.mg-p01 { display: flex; flex-direction: column; justify-content: space-between; padding: 12px; }
.mg-p01 .slots { color: var(--gf-mg-ink); display: flex; gap: 12px; justify-content: center; padding: 10px; border: 2px dashed var(--gf-mg-warn); border-radius: 10px; background: var(--gf-mg-bg-2); }
.mg-p01 .slot { width: 64px; height: 96px; border-radius: 6px; background: var(--gf-mg-btn); box-shadow: inset 0 0 8px #000; display: flex; align-items: center; justify-content: center; color: var(--gf-mg-dim); font-size: 20px; overflow: hidden; }
.mg-p01 .slot img { width: 100%; height: 100%; object-fit: cover; }
.mg-p01 .tray { display: flex; gap: 8px; justify-content: center; margin-top: 12px; min-height: 96px; align-items: center; }
.mg-p02 { padding: 10px; display: grid; grid-template-rows: auto 70px auto auto; gap: 6px; justify-items: center; }
.mg-p02 .gauges { display: flex; gap: 60px; font-size: 13px; }
.mg-p02 .gauges span { color: var(--gf-mg-ink); padding: 2px 10px; border-radius: 10px; background: var(--gf-mg-bg-2); border: 1px solid var(--gf-mg-line); }
.mg-p02 .gauges span.on { background: var(--gf-mg-warn); color: #1a1a14; }
.mg-p02 .arm { width: 160px; height: 70px; cursor: grab; touch-action: none; display: flex; justify-content: center; }
.mg-p02 .arm i { /* pair-ok: no text */ width: 120px; height: 46px; border-radius: 6px; background: linear-gradient(135deg, #f0d890, #a07a30 60%, #e8c870); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6); transform: perspective(300px) rotateY(var(--a)); transition: transform 0.15s; }
.mg-p02 .mirror { color: var(--gf-mg-ink); font-size: 14px; background: var(--gf-mg-bg-2); padding: 3px 12px; border-radius: 12px; }
.mg-p02 .mirror b { font-size: 22px; color: var(--gf-mg-warn); margin-left: 6px; }
.mg-p02 .dials { display: flex; gap: 12px; }
.mg .dial { width: 70px; height: 70px; border-radius: 50%; border: 3px solid #b8bcbc; background: radial-gradient(#f4f0e0, #c8c0a8); color: #1a1a14; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; touch-action: none; }
.mg .dial b { font-size: 20px; }
.mg .dial small { font-size: 10px; }
.mg .lever { position: absolute; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: 8px; border: 2px solid var(--gf-mg-warn); background: var(--gf-mg-btn); color: var(--gf-mg-ink); font-weight: 700; cursor: pointer; }
.mg .lever:disabled { color: var(--gf-mg-dim); border-style: dashed; border-color: var(--gf-mg-line); }
.mg-p04 { display: flex; align-items: center; justify-content: center; }
.mg-p04 .knobs { display: flex; gap: 34px; }
.knobw { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; color: var(--gf-mg-ink); }
.knob { /* pair-ok: no text */ width: 78px; height: 78px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #4a4e4e, #121414); box-shadow: 0 4px 12px #000, inset 0 0 0 3px #2a2c2c; cursor: grab; touch-action: none; position: relative; }
.knob i { /* pair-ok: no text */ position: absolute; left: 50%; top: 6px; width: 6px; height: 26px; margin-left: -3px; border-radius: 3px; background: #e8e0c8; }
.knob.on { transform: rotate(80deg); box-shadow: 0 0 0 3px var(--gf-mg-accent), 0 4px 12px #000; }
.mg-p06 { padding: 12px; }
.mg-p06.fuse { display: flex; gap: 30px; align-items: center; justify-content: center; }
.mg-p06 .socket { color: var(--gf-mg-ink); width: 120px; height: 60px; border: 2px dashed var(--gf-mg-warn); border-radius: 30px; display: flex; align-items: center; justify-content: center; background: var(--gf-mg-bg-2); }
.mg-p06 .faders { display: flex; gap: 22px; align-items: flex-end; justify-content: center; height: 210px; }
.fader { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--gf-mg-ink); }
.fader .track { /* pair-ok: no text */ position: relative; width: 34px; height: 150px; border-radius: 6px; background: var(--gf-mg-bg-2); border: 1px solid var(--gf-mg-line); cursor: ns-resize; touch-action: none; }
.fader .fill { /* pair-ok: no text */ position: absolute; left: 3px; right: 3px; bottom: 3px; background: linear-gradient(#6ad08a, #2e7a4a); border-radius: 3px; max-height: calc(100% - 6px); }
.fader .need { /* pair-ok: no text */ position: absolute; left: -6px; right: -6px; height: 2px; background: var(--gf-mg-warn); }
.fader .thumb { /* pair-ok: no text */ position: absolute; left: -8px; right: -8px; height: 12px; margin-bottom: -6px; border-radius: 4px; background: #d8dcd8; box-shadow: 0 2px 4px #000; }
.fader b { font-size: 16px; }
.mg-p06 .rest { color: var(--gf-mg-ink); background: var(--gf-mg-bg-2); padding: 2px 8px; border-radius: 6px; align-self: center; text-align: center; font-size: 12px; }
.mg-p06 .rest b { display: block; font-size: 22px; color: var(--gf-mg-warn); }
.mg-p06 .pull { color: var(--gf-mg-ink); align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: grab; touch-action: none; font-size: 12px; }
.mg-p06 .pull i { /* pair-ok: no text */ width: 22px; height: 60px; border-radius: 11px; background: linear-gradient(#c83a26, #7a1a10); box-shadow: 0 3px 6px #000; }
.mg-p06 .routed { align-self: center; color: var(--gf-mg-accent); background: var(--gf-mg-bg-2); padding: 2px 10px; border-radius: 6px; font-weight: 700; }
.mg-p07 { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px; }
.mg-p07 .pins { display: flex; gap: 26px; }
.pin { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: grab; touch-action: none; font-size: 12px; color: var(--gf-mg-ink); }
.pin i { /* pair-ok: no text */ width: 14px; height: 60px; border-radius: 4px; background: linear-gradient(90deg, #6a6e6e, #c8ccc8, #6a6e6e); box-shadow: 0 2px 6px #000; }
.pin.loose i { box-shadow: 0 0 0 3px var(--gf-mg-warn), 0 2px 6px #000; }
.pin.out i { transform: translateY(26px); opacity: 0.6; }
.rod { display: flex; flex-direction: column; align-items: center; cursor: grab; touch-action: none; font-size: 12px; color: var(--gf-mg-ink); }
.rod i { /* pair-ok: no text */ width: 40px; height: 40px; border-radius: 50%; border: 4px solid #8a8e8e; background: radial-gradient(#e8f0f4, #8aa0a8); }
.mg-shut { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.mg-shut .cover { width: 140px; height: 50px; border-radius: 8px; background: var(--gf-mg-warn); color: #1a1a14; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; font-weight: 700; }
.mg-shut .cover.up { height: 10px; opacity: 0.6; }
.mg-shut .red { /* pair-ok: no text */ width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f05040, #7a1008); box-shadow: 0 6px 16px #000; cursor: pointer; opacity: 0.5; }
.mg-shut .red.live { opacity: 1; }
.mg-shut .red.hold { transform: scale(0.94); box-shadow: 0 0 0 6px var(--gf-mg-warn), 0 6px 16px #000; transition: box-shadow 1s; }
.mg-shut .note { color: var(--gf-mg-ink); font-size: 13px; background: var(--gf-mg-bg-2); padding: 2px 10px; border-radius: 10px; }
.mg-phone { color: var(--gf-mg-ink); display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px; background: var(--gf-mg-bg-2); min-height: 200px; }
.mg-phone::before { display: none; }
.tray-col { color: var(--gf-mg-ink); background: var(--gf-mg-bg); border: 1px solid var(--gf-mg-line); border-radius: 6px; padding: 4px; min-height: 160px; }
.tray-col h5 { margin: 0 0 4px; font-size: 12px; color: var(--gf-mg-accent); text-align: center; }
.stc { background: #f4f2e8; color: #1f2a26; border-radius: 5px; padding: 5px; font-size: 11.5px; line-height: 1.4; margin-bottom: 4px; cursor: grab; touch-action: none; }
.stc small { display: block; color: #55605a; font-size: 10px; }
.mg [tabindex]:focus-visible, .mg button:focus-visible { outline: 3px solid var(--gf-mg-warn); outline-offset: 2px; }
.related { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 4px 0 8px; font-size: 12px; color: var(--gf-text-dim); }
.relc { display: flex; align-items: center; gap: 4px; border: 1px solid var(--gf-border); background: var(--gf-surface-2); border-radius: 6px; padding: 2px 6px 2px 2px; cursor: pointer; font-size: 12px; color: var(--gf-text); min-height: 44px; }
.relc .relpic { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.reldetail { position: absolute; inset: 44px 10px 10px; background: var(--gf-surface); color: var(--gf-text); border-radius: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); padding: 10px; overflow: auto; z-index: 5; }
.rdbox { display: flex; gap: 10px; flex-wrap: wrap; }
.rdbox .rdpic { width: min(320px, 100%); border-radius: 6px; object-fit: cover; }
.rdtext { flex: 1 1 220px; font-size: 14px; line-height: 1.7; }
.rdtext h4 { margin: 0 0 6px; }
.rdclose { margin-top: 8px; min-height: 44px; }
@media (max-width: 640px) {
  .mg-p02 .gauges { gap: 24px; }
  .mg-phone { grid-template-columns: repeat(2, 1fr); }
  .mg-p04 .knobs { gap: 16px; }
  .knob { width: 64px; height: 64px; }
}
@media (max-height: 460px) { .panelpic { max-height: 120px; } }

/* the title (standard shell.css) over the key picture: light text on the dark picture (rule U30) */
#title .gf-title-box { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85); }
#title .gf-note, #title .gf-info { color: var(--gf-title-dim); }
#title .gf-tagline { max-width: 40em; margin: 0 auto var(--gf-space-3, 12px); line-height: 1.9; font-family: var(--gf-font-serif); }
#title h1 { font-family: var(--gf-font-serif); }

/* ---- phone fixes (390 x 844 / 812 x 375): the thought line grows with its text, the tab bar fits, cards stay compact, short windows use their height ---- */
body #say { max-height: none; overflow: visible; }
.tm-tabs { overflow: hidden; }
.tm-tab { flex: 0 1 auto; min-width: 0; }
.tm-tab.on { flex: 0 1 auto; min-width: 0; }
.tm-tab .tm-lb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .tm-tab { padding: 0 8px; gap: 4px; }
  .tm-tab.on { font-size: 0.92em; }
  .tl-place .pc-img { width: 56px; }
  .tl-place b { font-size: 14px; }
  .tl-pickup .pk-img, .tl-look .lk-img { width: 44px; height: 44px; }
  .tl-pickup .pk-feel { display: none; }
  .tl-chapter .pc-txt small { letter-spacing: 0; }
}
@media (max-height: 520px) {
  .wm-head { min-height: 40px; padding-top: 2px; padding-bottom: 2px; }
  .wm-head .wm-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  .wm-body { padding-top: 6px; padding-bottom: 6px; }
  .wm-tab-menu .tm-tabs { padding-top: 2px; }
  .wm-tab-menu .tm-tab { min-height: 36px; }
  .wm-tab-menu .tm-content { padding: 6px 12px; }
  .wm-tab-menu .hb-tab, .wm-tab-menu .jn-chip { min-height: 34px; }
  .wm-tab-menu .iv-detail { padding: 6px 8px; gap: 4px; }
  .wm-tab-menu .iv-photocard { flex-direction: row; align-items: flex-start; gap: 8px; }
  .wm-tab-menu .iv-photo { flex: none; width: 38%; aspect-ratio: 4 / 3; max-height: none; }
  .mg { min-height: 150px; margin-bottom: 4px; }
  .mg-p01 { padding: 8px; }
  .mg-p01 .slots { padding: 6px; gap: 10px; }
  .mg-p01 .slot { height: 64px; }
  .mg-p01 .tray { margin-top: 6px; min-height: 70px; }
  .mg .card { width: 72px; }
  .mg .card img { width: 56px; height: 52px; }
}
