/* Inspector workspace — IW-01–IW-17. Atlas tokens remain authoritative. */
.iw { --iw-left: 224px; --iw-right: 288px; --iw-control: 36px; --iw-control-gap: 44px; min-height: 100dvh; container-type: inline-size; }
.iw [hidden] { display: none !important; }
.iw-topbar { min-height: 64px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 24px; position: sticky; top: 0; z-index: 20; }
.iw-topbar .brand { margin: 0; flex: 0 0 auto; }
.iw-breadcrumb { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; font-size: 13px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.iw-breadcrumb a { color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.iw-breadcrumb [aria-current] { color: var(--text); }
.iw-account { display: grid; gap: 2px; flex: 0 1 auto; min-width: 0; max-width: 220px; font-size: 12px; white-space: nowrap; }
.iw-identity { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--text); }
.iw-user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.iw-account > a { margin-left: 24px; width: fit-content; }
.ui-icon { display: inline-block; vertical-align: middle; width: 18px; height: 18px; flex: 0 0 18px; }
#iw-nav a, .iw-primary a, .iw .subtabs a, .iw-choices a { display: flex; align-items: center; gap: 8px; }
.iw-primary .ui-icon, .iw .subtabs .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
.iw-body { display: grid; grid-template-columns: var(--iw-left) minmax(0, 1fr) var(--iw-right); align-items: start; }
.iw[data-nav-open="false"] { --iw-left: 0px; }
.iw[data-details-open="false"] { --iw-right: 0px; }
.iw-panel { position: sticky; top: 64px; height: calc(100dvh - 64px); overflow-y: auto; padding: 16px; background: var(--surface); min-width: 0; }
.iw-navigation { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; grid-column: 1; }
.iw-details { border-left: 1px solid var(--line); grid-column: 3; }
.iw-center { grid-column: 2; max-width: none; min-width: 0; width: 100%; padding: 0 24px 32px; container-type: inline-size; }
.iw-content { min-width: 0; padding-top: 24px; }
.iw-content h1 { font-size: clamp(24px, 2.5vw, 32px); overflow-wrap: anywhere; }
.iw-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.iw-panel-head h2 { margin: 0; font-size: 15px; }
.iw-panel-head > span { font-size: 13px; color: var(--muted); }
.iw-icon { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font: 24px/1 system-ui, sans-serif; }
.iw-icon:hover { background: var(--raised); border-color: var(--rose); }
.iw-context-header { display: none; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); }
.iw[data-ready] .iw-context-header { display: flex; }
.iw-context { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; text-align: left; padding: 10px 6px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.iw-context:hover { background: var(--surface); }
.iw-context > span { flex: 1; min-width: 0; }
.iw-context strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.iw-context small { display: block; color: var(--muted); text-transform: capitalize; font-size: 12px; }
.iw-context > .ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
.iw-context-header > .iw-icon { border: 0; border-left: 1px solid var(--line); border-radius: 0; width: 33px; flex-basis: 33px; margin-right: 3px; color: var(--muted); }
.iw-context-header > .iw-icon:hover { background: var(--surface); color: var(--text); }
#iw-nav { display: flex; flex-direction: column; gap: 3px; }
#iw-nav a { color: var(--muted); padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
#iw-nav a:hover { background: var(--raised); color: var(--text); text-decoration: none; }
#iw-nav a.on { color: var(--rose); background: color-mix(in srgb, var(--rose) 16%, var(--surface)); border-color: color-mix(in srgb, var(--rose) 32%, var(--line)); font-weight: 600; }
.iw-panel-foot { margin-top: auto; padding-top: 20px; display: grid; gap: 12px; }
.iw-panel-foot small { color: var(--muted); overflow-wrap: anywhere; }
/* Zero-height overlay: launchers float in the working section, never in the global header.
   Only the entity heading leaves inline clearance; primary tabs span the content width. */
.iw-restores { position: sticky; top: 64px; height: 0; z-index: 12; pointer-events: none; }
.iw-restores .iw-icon { position: absolute; top: 0; transform: translateY(var(--iw-restore-y, 24px)); pointer-events: auto; background: var(--bg); border-color: transparent; }
.iw-restores .iw-icon:hover { background: var(--raised); border-color: var(--line); }
.iw-restores [data-iw-toggle="nav"] { left: 0; }
.iw-restores [data-iw-toggle="details"] { right: 0; }
.iw[data-details-open="false"] .iw-content :is(.pagehead:has(h1), h1:not(.pagehead h1)) { padding-right: var(--iw-control-gap); }
/* The strip keeps its full-width divider; its scrolling links leave slots for docked controls. */
.iw-primary { display: flex; align-items: center; gap: 8px; position: sticky; top: 64px; z-index: 10; margin: 0 0 24px; background: var(--bg); border-bottom: 1px solid var(--line); min-height: var(--iw-control); }
.iw-primary-links { flex: 1; min-width: 0; min-height: var(--iw-control); align-items: center; gap: 20px; margin: 0; border: 0; }
.iw[data-controls-in-tabs="true"] .iw-primary { padding-left: var(--iw-control-gap); }
.iw[data-controls-in-tabs="true"][data-details-open="false"] .iw-primary { padding-right: var(--iw-control-gap); }
.iw-primary a { background: none; border-radius: 0; padding: 10px 0 8px; font-size: 13px; line-height: 20px; border-bottom: 2px solid transparent; }
.iw-primary a.on { background: none; color: var(--text); border-bottom-color: var(--box-lit); }
.iw .subtabs { display: flex; width: fit-content; max-width: 100%; gap: 4px; padding: 4px; border: 0; border-radius: 8px; background: var(--raised); }
.iw .subtabs a { border: 0; margin: 0; padding: 6px 12px; border-radius: 5px; font-size: 13px; }
.iw .subtabs a.on { background: var(--line); color: var(--text); }
.iw-facts { margin: 0; font-size: 13px; }
.iw-facts dt { color: var(--muted); margin-top: 16px; }
.iw-facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.iw-details h3 { font-family: var(--body); font-size: 16px; overflow-wrap: anywhere; }
.iw-details #iw-selection { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.iw-switcher { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); padding: 20px; }
.iw-switcher::backdrop { background: rgb(0 0 0 / .6); }
.iw-switcher input { width: 100%; }
.iw-choices { display: grid; gap: 4px; padding-top: 12px; }
.iw-choices a { padding: 10px 12px; border-radius: 6px; color: var(--text); overflow-wrap: anywhere; }
.iw-choices a:hover { background: var(--raised); }
.iw-announcement { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px; }
.iw-announcement:empty { display: none; }
.iw-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .6); z-index: 40; }
.iw[data-compact="true"] .iw-body { grid-template-columns: minmax(0, 1fr); }
.iw[data-compact="true"] .iw-center { grid-column: 1; }
.iw[data-compact="true"] .iw-panel { position: fixed; top: 0; bottom: 0; height: 100dvh; z-index: 50; width: min(320px, calc(100vw - 44px)); }
.iw[data-compact="true"] .iw-navigation { left: 0; }
.iw[data-compact="true"] .iw-details { right: 0; }
@container (max-width: 1099px) {
  .iw-topbar { padding: 10px 12px; gap: 12px; }
  .iw-topbar .brand { flex: none; font-size: 16px; }
  .iw-topbar .brand img { height: 24px; }
  .iw-center { padding-inline: 16px; }
}
@container (max-width: 700px) {
  .iw-content .grid2, .iw-content .dash { grid-template-columns: minmax(0, 1fr); }
  .iw-content .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iw-content .tiles { grid-template-columns: minmax(0, 1fr); }
  .iw-content .panel, .iw-content .card { padding: 16px; overflow-x: auto; }
  .iw-content .pagehead { align-items: flex-start; }
  .iw-content .section-head { flex-wrap: wrap; }
}
@media (pointer: coarse), (max-width: 600px) {
  .iw { --iw-control: 44px; --iw-control-gap: 52px; }
  .iw-icon { min-width: 44px; width: 44px; height: 44px; flex-basis: 44px; }
  .iw-account { max-width: 108px; }
  .iw-topbar { gap: 8px; padding-block: 9px; }
  .iw-breadcrumb { gap: 6px; }
  .iw-topbar .brand { font-size: 0; }
}
/* Without scripting, one menu and readable facts remain available. */
.iw:not([data-ready]) .iw-body { grid-template-columns: 224px minmax(0, 1fr) 288px; }
@media (max-width: 1099px) {
  .iw:not([data-ready]) .iw-body { display: block; }
  .iw:not([data-ready]) .iw-panel { position: static; height: auto; }
  .iw:not([data-ready]) #iw-nav { flex-direction: row; flex-wrap: wrap; }
}
.iw-local-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.iw-local-controls .subtabs { margin: 0; }
.iw-local-controls form { flex-wrap: wrap; min-width: 0; }

.iw:not([data-ready]) [data-iw-inspect] { display: none; }

.iw[data-nav-open="false"] .iw-content :is(.pagehead:has(h1), h1:not(.pagehead h1)) { padding-left: var(--iw-control-gap); }
.iw-breadcrumb .iw-home { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; border-radius: 6px; }
.iw-breadcrumb .iw-home:hover { background: var(--raised); color: var(--rose); }
@media (pointer: coarse), (max-width: 600px) {
  .iw-breadcrumb .iw-home { min-width: 44px; min-height: 44px; }
}

/* Directional buttons replace fades/scrollbars on primary navigation. */
.iw .iw-primary .iw-primary-links { mask-image: none; -webkit-mask-image: none; scrollbar-width: none; }
.iw-primary-links::-webkit-scrollbar { display: none; }
.iw-tab-arrow { border-color: transparent; }
.iw-tab-arrow:disabled { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .iw-primary-links { scroll-behavior: auto; }
}
/* Copy buttons beside long Details facts (path, SHA-256); the value itself stays selectable. */
.iw-facts .iw-fact-value { user-select: text; }
.iw-facts .iw-mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.iw-facts .iw-copy { display: inline-flex; margin: 6px 0 0; padding: 4px 10px; min-height: 30px; font-size: 12px; }
.iw-facts dd { display: flex; flex-direction: column; align-items: flex-start; }
dl .iw-copyable { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
dl .iw-copyable .iw-copy { padding: 4px 10px; min-height: 30px; font-size: 12px; }
