/*
 * @purpose Cobalt schema for Overwatch Control (CLAUDE_DESIGN.md; design-submissions/overwatch.md "Other changes" 1, 4).
 *   The rotated left rail becomes one glass bottom dock; the six control groups are a labelled horizontal chip row in a
 *   right glass module panel; the View select carries a visible label; the Space dreidel sits in the dock in the same
 *   place and with the same label as on the Overwatch map.
 * @owner Overwatch Control (jcom_v0bb_overwatch_control); claude_20261002_cobalt (sub-agent maps), 2026-10-03.
 * @inputs index.html markup (#targeting-rail as the dock, #targeting-panel, #control-chips), kit tokens and classes
 *   (cobalt/cobalt-tokens.css, cobalt/cobalt-ui.css). Loaded after module.css; presentation only.
 */
/* ---- dock (was the rotated rail) ---- */
#targeting-rail.c-dock { position: fixed; top: auto; z-index: 11; width: auto; max-height: none; flex-direction: row; align-items: center; gap: 6px; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; border-right: 1px solid var(--glass-line); border-radius: 10px; background: var(--glass); color: var(--ink); font: 400 11px/1 var(--font); box-shadow: 0 6px 20px rgba(17,26,45,.16); }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) { #targeting-rail.c-dock { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); } }
@media (prefers-reduced-transparency: reduce) { #targeting-rail.c-dock { background: var(--glass-strong); backdrop-filter: none; -webkit-backdrop-filter: none; } }
#targeting-rail.c-dock { left: calc(8px + var(--overlay-left)); right: calc(8px + var(--overlay-right)); bottom: calc(8px + var(--safe-b)); }
@media (min-width: 760px) { #targeting-rail.c-dock { right: auto; left: calc(50% + (var(--overlay-left) - var(--overlay-right)) / 2); transform: translateX(-50%); max-width: calc(100% - 16px - var(--overlay-left) - var(--overlay-right)); } }
#targeting-rail.c-dock > * { flex: none; }
#targeting-rail .cc-grp { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: var(--r-ctl); background: var(--card); overflow: hidden; }
#targeting-rail .cc-grp > * { height: var(--ctl); border: 0; border-left: 1px solid var(--rule); border-radius: 0; }
#targeting-rail .cc-grp > :first-child { border-left: 0; }
#targeting-rail .c-btn { min-height: 0; min-width: 0; color: var(--ink); font: 400 11px/1 var(--font); }
#targeting-rail .cc-dreidel { color: var(--cobalt); font-weight: 700; }
#targeting-rail .c-btn[aria-expanded="true"], #targeting-rail .c-btn[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-accent); font-weight: 700; }
#targeting-rail .targeting-rail-history, #targeting-rail .targeting-rail-info { align-self: auto; width: auto; aspect-ratio: auto; margin: 0; border-radius: var(--r-ctl); }
#targeting-rail .targeting-rail-history { border: 1px solid var(--rule); background: var(--card); color: var(--ink); }
#targeting-rail .targeting-rail-info { border: 0; background: transparent; color: var(--muted, #9aa3ad); }
#targeting-rail .targeting-rail-info[aria-pressed="true"] { background: var(--cobalt); color: var(--on-accent); }
#targeting-rail .cc-view { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 0 0 4px; }
#targeting-rail .cc-view .c-label { white-space: nowrap; }
#targeting-rail #view-choice { width: auto; min-width: 0; min-height: 0; height: var(--ctl); padding: 0 6px; border: 1px solid var(--rule); border-radius: var(--r-ctl); background: var(--card); color: var(--ink); font: 400 11px/1 var(--font); writing-mode: horizontal-tb; transform: none; box-shadow: none; text-align: left; }
#targeting-rail[data-collapsed] > * { display: inline-flex; }
body:not([data-view="WORLD"]):not([data-view="WORLD_INSET"]) #targeting-rail .cc-map { display: none; }
@media (max-width: 759px) { #targeting-rail .cc-wide, #targeting-rail .cc-view .c-label { display: none; } #targeting-rail .c-btn > span { display: none; } #targeting-rail .cc-dreidel > span { display: inline; } #targeting-rail .c-btn { padding: 0 8px; } }
@media (any-pointer: coarse) { #targeting-rail #view-choice { font-size: 16px; } }
/* F51: the phone dock still scrolls (overwatch.md), but a narrow View select keeps it to one short swipe. */
@media (max-width: 759px) { #targeting-rail #view-choice { width: 92px; } }
/* Sub-pixel rounding left the desktop dock 1-4px "scrollable", which shows a classic scrollbar on Windows. */
#targeting-rail.c-dock { scrollbar-width: none; }
#targeting-rail.c-dock::-webkit-scrollbar { display: none; }

/* Space dreidel menu (phone) */
.cc-dmenu { position: fixed; z-index: 14; left: 50%; transform: translateX(-50%); bottom: calc(64px + var(--safe-b)); width: 200px; padding: 4px 0; border-radius: var(--r-sheet); box-shadow: var(--shadow); color: var(--ink); font: 400 12.5px/1.3 var(--font); }
.cc-dmenu .c-label { padding: 6px 12px; }
.cc-dmenu .c-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; min-height: 44px; }
.cc-dmenu .c-row .c-ico { color: var(--cobalt); }

/* ---- module panel (right glass), the six groups as a chip row ---- */
#targeting-panel.targeting-drawer { top: calc(8px + env(safe-area-inset-top, 0px)); left: auto; right: calc(8px + var(--overlay-right)); width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 80px - env(safe-area-inset-top, 0px) - var(--safe-b)); border: 1px solid var(--glass-line); border-radius: var(--r-sheet); background: var(--glass); color: var(--ink); font: 400 12.5px/1.45 var(--font); box-shadow: var(--shadow); grid-template-rows: auto auto minmax(0, 1fr) auto; transition: right var(--dur) var(--ease); }
#targeting-panel > header.c-shd { min-height: 0; padding: 8px 12px 6px; border-bottom: 0; }
#targeting-panel h1.c-ttl { margin: 2px 0 0; color: var(--ink); font: 700 15px/1.25 var(--font); letter-spacing: 0; text-transform: none; }
#targeting-panel #drawer-state { display: block; max-width: none; margin: 1px 0 0; text-align: left; color: var(--muted); font: 400 11px/1.3 var(--font); }
#targeting-panel #control-chips { padding: 2px 12px 8px; border-bottom: 1px solid var(--line); }
/* F51: the six chips wrap inside the panel so Matrix and Flags are never scrolled out of sight (the row hides its scrollbar). */
#targeting-panel #control-chips.c-chips { flex-wrap: wrap; overflow: visible; }
/* Track (following) and Spin (spinning) show their state in the dock and the phone menu. */
#targeting-rail [data-dreidel][aria-pressed="true"], .cc-dmenu [data-dreidel][aria-pressed="true"] { background: var(--accent-subtle); color: var(--cobalt); }
#targeting-panel .c-chip { min-height: 0; min-width: 0; margin: 0; }
#targeting-panel .c-chip .targeting-rail-label { writing-mode: horizontal-tb; transform: none; padding: 0; }
#targeting-panel .targeting-panel-scroll { padding: 8px 12px; }
#targeting-panel .btn, #targeting-panel .field { font-size: 11.5px; min-height: 28px; border-radius: var(--r-ctl); }
#targeting-panel .field-row { grid-template-columns: minmax(0, 96px) minmax(0, 1fr); font-size: 12px; }
#targeting-panel .scope-note, #targeting-panel .availability-note { font-size: 11px; color: var(--muted); }
#targeting-panel #audio-status { display: block; color: var(--muted); font: 400 11px/1.4 var(--mono); }
#targeting-panel footer { display: flex; gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
#targeting-panel footer .btn { font-size: 11.5px; min-height: 28px; }
#info-options.targeting-drawer { top: auto; bottom: calc(64px + var(--safe-b)); left: auto; right: calc(8px + var(--overlay-right)); border-radius: var(--r-sheet); background: var(--glass-strong); font-size: 12px; }
#info-options h1 { font-size: 11px; }

/* ---- status line sits above the dock, never under it ---- */
#scene-readout { left: calc(8px + var(--overlay-left) + env(safe-area-inset-left, 0px)); bottom: calc(60px + var(--safe-b)); max-width: calc(100% - 16px); }
#scene-status { padding: 4px 8px; border-radius: var(--r-ctl); background: var(--glass); color: var(--ink); font: 400 11px/1.3 var(--mono); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
#director-stage.is-inset { bottom: calc(60px + var(--safe-b)); }
@media (prefers-reduced-motion: reduce) { #targeting-rail.c-dock, #targeting-panel.targeting-drawer { transition: none; } }

/* ---- load skeleton ---- */
.cc-skel { position: fixed; z-index: 12; left: 50%; top: 40%; transform: translate(-50%, -50%); width: min(300px, calc(100% - 32px)); padding: 12px 14px; border-radius: var(--r-sheet); box-shadow: var(--shadow); color: var(--ink); font: 400 12.5px/1.45 var(--font); }
.cc-skel .c-skel { height: 8px; margin-top: 8px; }
.cc-skel .cc-short { width: 62%; }
.cc-skel .cc-slow { margin: 6px 0 0; color: var(--muted); font-size: 11.5px; }
.cc-skel .c-btn { margin-top: 10px; }
#targeting-stage { background: radial-gradient(circle at 50% 45%, #16264a 0, #0b1324 55%, #070d1a 100%); }

/* ---- legacy rail rules (module.css) neutralised for the dock and the chip row ---- */
#targeting-rail #view-toolbar { width: auto; flex-direction: row; align-items: center; border-bottom: 0; background: transparent; }
#targeting-panel .c-chip.targeting-rail-tab { width: auto; min-width: 0; min-height: 0; height: 26px; flex: none; padding: 0 10px; border: 1px solid var(--rule); border-radius: 13px; background: var(--card); color: var(--ink); box-shadow: none; font: 400 11px/1 var(--font); letter-spacing: 0; text-transform: none; }
#targeting-panel .c-chip.targeting-rail-tab[aria-pressed="true"] { border-color: var(--cobalt); background: var(--accent-subtle); color: var(--cobalt); font-weight: 700; }
#targeting-panel .c-chip.targeting-rail-tab:hover { background: var(--accent-subtle); color: var(--cobalt); }
/* Close: a line icon, compact on a mouse, 44px on touch (no glyph in a circle). */
.cc-close { flex: none; color: var(--muted); }
.cc-close:hover { color: var(--ink); }
#targeting-panel #panel-close.cc-close, #info-options #info-options-close.cc-close { width: var(--ctl); height: var(--ctl); min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; }
@media (pointer: coarse) { #targeting-panel #panel-close.cc-close, #info-options #info-options-close.cc-close { width: var(--hit); height: var(--hit); } }
#targeting-panel .check-row { min-height: 32px; }
#targeting-panel .check-row input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--cobalt); }
@media (any-pointer: coarse) { #targeting-panel .check-row { min-height: 44px; } #targeting-panel .check-row input { width: 20px; height: 20px; flex-basis: 20px; } }
@media (max-width: 759px) { #scene-readout { top: calc(8px + env(safe-area-inset-top, 0px)); bottom: auto; max-width: calc(100% - 16px); } }

/* ---- contrast: surfaces over the map take surface AND text from one token pair, in both themes ----
 * Translucent --glass over the dark map pulled --muted under 4.5:1; module.css also paints panel text from --of-*.
 * Text-bearing surfaces use --glass-strong with --ink / --muted; filled and pressed controls keep --on-accent. */
#targeting-rail.c-dock, #targeting-panel.targeting-drawer, #info-options.targeting-drawer, .cc-dmenu, .cc-skel, #scene-status { background: var(--glass-strong) !important; color: var(--ink) !important; }
#targeting-panel .btn, #targeting-panel .field, #targeting-panel label, #targeting-panel .field-row, #targeting-panel .check-row, #targeting-panel h1, #info-options .btn { color: var(--ink); }
#targeting-panel .btn, #targeting-panel .field { background: var(--card); border-color: var(--rule); }
#targeting-panel .scope-note, #targeting-panel .availability-note, #targeting-panel #audio-status, #targeting-panel #drawer-state, #targeting-panel .c-label, #targeting-rail .c-label, .cc-dmenu .c-label, .cc-dmenu .c-sub, .cc-skel .cc-slow, #info-options .info-note { color: var(--muted) !important; }
#targeting-panel .btn-primary, #targeting-panel .btn-primary *, #targeting-rail .c-btn[aria-expanded="true"], #targeting-rail .c-btn[aria-expanded="true"] *, #targeting-rail .c-btn[aria-pressed="true"], #targeting-rail .c-btn[aria-pressed="true"] *, #targeting-rail .targeting-rail-info[aria-pressed="true"] { background-color: var(--cobalt); color: var(--on-accent) !important; }
#targeting-rail .c-btn[aria-expanded="true"] *, #targeting-rail .c-btn[aria-pressed="true"] *, #targeting-panel .btn-primary * { background-color: transparent; }
#targeting-panel .c-chip.targeting-rail-tab[aria-pressed="true"] { color: var(--cobalt) !important; }
#targeting-rail :focus, #targeting-panel :focus, .cc-dmenu :focus { outline: 0; box-shadow: none; }
#targeting-rail :focus-visible, #targeting-panel :focus-visible, .cc-dmenu :focus-visible, .cc-skel :focus-visible { outline: 2px solid var(--cobalt) !important; outline-offset: 2px; box-shadow: none !important; }
#targeting-panel .check-row input[type="checkbox"] { min-width: 0; min-height: 0; }
@media (max-width: 759px) { #targeting-panel.targeting-drawer { top: calc(48px + env(safe-area-inset-top, 0px)); max-height: calc(100dvh - 120px - env(safe-area-inset-top, 0px) - var(--safe-b)); } }

/* A grip and corner, without a title bar. Pointer capture also works over the canvas. */
#director-stage{min-width:220px;min-height:150px}
.director-grip,.director-resize{position:absolute;z-index:12;width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:color-mix(in srgb,var(--surface,#ddd) 65%,transparent);touch-action:none;user-select:none}
.director-grip{top:4px;left:4px;cursor:move}.director-resize{bottom:4px;right:4px;cursor:nwse-resize}

/* acx9: compact left drawers, inside the guest viewport; no title bars. */
#control-chips.c-chips{position:fixed;z-index:32;left:calc(8px + var(--overlay-left,0px));top:116px;display:flex;flex-direction:column;gap:3px;width:44px;padding:0;overflow:visible}
#control-chips .targeting-rail-tab{width:44px;min-height:44px;padding:2px;border:1px solid #90969b70;border-radius:5px;background:#343941bf;color:#fff;font:10px system-ui}
#control-chips .targeting-rail-label{writing-mode:horizontal-tb;transform:none;overflow:hidden;text-overflow:ellipsis}
#control-chips .targeting-rail-tab[aria-expanded=true]{background:#737a85e6}
#targeting-panel.targeting-drawer{left:calc(58px + var(--overlay-left,0px));right:auto;top:116px;width:min(264px,calc(75vw - 16px));max-height:calc(100dvh - 188px);grid-template-rows:minmax(0,1fr) auto;border-radius:7px;background:#343941bf!important;animation:drawer-enter .18s ease-out}
#targeting-panel>header,#targeting-panel .control-group>h2{display:none}
#targeting-panel .targeting-panel-scroll{padding:6px}
#targeting-panel .field-row{grid-template-columns:80px minmax(0,1fr);gap:4px;margin:4px 0}
#targeting-panel .btn,#targeting-panel .field,#targeting-panel .check-row{min-height:32px}
#targeting-panel footer{flex-wrap:wrap;padding:5px}
#scene-readout{top:auto!important;bottom:68px;pointer-events:none}
@keyframes drawer-enter{from{opacity:0;translate:-12px 0}to{opacity:1;translate:0 0}}
@media(max-width:600px){#targeting-panel .btn,#targeting-panel .field,#targeting-panel .check-row{min-height:44px}#director-stage.is-inset{min-width:0;min-height:0}}
@media(prefers-reduced-motion:reduce){#targeting-panel.targeting-drawer{animation:none}}
/* Share (the paper airplane): a 44px touch target (owner 2026-10-06). */
#cc-share::after{width:max(100%,44px);height:max(100%,44px)}
