/* Shared workspace chrome; existing feature styles and controls remain intact. */
:root {
  --bg: #f4f6f8;
  --bg-2: #edf1f4;
  --card: #ffffff;
  --ink: #182b32;
  --muted: #5d6e76;
  --line: #dce3e7;
  --sidebar-width: 204px;
}
body.app { background: var(--bg); }
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #167baf;
  outline-offset: 3px;
}
.skip-link { position: fixed; top: -80px; left: 1rem; z-index: 100; padding: .8rem 1rem; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.workspace-brand, .nav-caption { display: none; }
.top { padding: 1.25rem 1.5rem; gap: 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.top h1, .top.snapshot-hero h1 { font-family: var(--mono); font-size: 1.55rem; font-weight: 600; letter-spacing: -.035em; }
.top .eyebrow { letter-spacing: .07em; font-size: .67rem; }
.top-meta { margin-left: auto; font-size: .78rem; max-width: 34rem; }
.workspace-tools { display: flex; gap: .7rem; align-items: center; }
.cmd-search-btn { display: flex; gap: 1.25rem; align-items: center; border-radius: 8px; padding: .65rem .8rem; font-weight: 500; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: .1rem .3rem; color: var(--muted); font: inherit; font-size: .7rem; white-space: nowrap; }
.density-control { display: grid; gap: .2rem; font-size: .65rem; color: var(--muted); }
.density-control select { min-height: 32px; padding: .2rem .4rem; font-size: .75rem; border: 1px solid var(--line); background: var(--card); border-radius: 6px; color: var(--ink); }
.workspace-location { display: flex; align-items: center; gap: .9rem; min-height: 48px; padding: .55rem 1.5rem; border-bottom: 1px solid var(--line); background: #fafbfc; font-size: .78rem; }
.workspace-back { background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--muted); padding: .35rem .6rem; cursor: pointer; }
#workspaceBreadcrumb { display: flex; align-items: center; gap: .65rem; }
#workspaceBreadcrumb button { padding: .2rem 0; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; }
#workspaceBreadcrumb [aria-current] { color: var(--ink); font-weight: 600; }
#workspaceStatus { margin-left: auto; color: var(--muted); font-size: .75rem; }
.sub-nav { padding: .55rem 1.5rem; gap: .35rem; background: var(--card); }
.sub-nav button { min-height: 36px; border-radius: 6px; font-size: .82rem; }
.sub-nav button.active { background: #e7f2ef; color: var(--accent); border-color: #c6dfd6; }
main { min-width: 0; padding: 1.25rem 1.5rem 5rem; }
main:focus { outline: none; }
.panel > .block:first-child { margin-top: 0; }
.block, .stat { border-radius: 10px; box-shadow: 0 1px 2px #182b3205; }
.block { padding: 1.1rem 1.2rem; }
.block h2 { font-family: var(--mono); font-size: 1rem; font-weight: 600; }
.stat .value { font-family: var(--mono); font-size: 1.65rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .label { font-size: .72rem; }
.field input, .field select, .field textarea { border-radius: 6px; }
.action { border-radius: 6px; }
.table-scroll { border-radius: 8px; max-height: min(70vh, 740px); overflow: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
table { font-variant-numeric: tabular-nums; }
thead th { background: #f5f7f9; color: #465c66; font-size: .73rem; font-weight: 600; line-height: 1.4; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; }
tbody td { line-height: 1.5; }
tbody tr:hover > td { background-color: #f0f6f5; }
.table-scroll:focus-within { outline: 2px solid #167baf; outline-offset: 2px; }
.mcard { border-radius: 8px; transition: border-color .12s, box-shadow .12s; }
.mcard:hover { box-shadow: 0 2px 8px #182b3210; }
.sticky-chrome { border-radius: 8px; }
@media (min-width: 761px) {
  .sticky-chrome { margin-left: -1.5rem; margin-right: -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; }
}
.foot { font-size: .72rem; padding: 1rem 1.5rem 5rem; color: var(--muted); }
body[data-density=compact] .block { padding: .75rem .9rem; }
body[data-density=compact] .stat { padding: .65rem .8rem; }
body[data-density=compact] :is(table, .cmp-table, .rank-table) :is(th, td) { padding-top: .35rem; padding-bottom: .35rem; }
body[data-density=compact] .grid { gap: .65rem; }
.cmd-palette-panel { padding: 1rem; border-radius: 12px; }
.cmd-row { border-radius: 6px; padding: .7rem; }
.cmd-row:focus, .cmd-row.cmd-selected { background: #e7f2ef; outline: 2px solid var(--accent); outline-offset: -2px; }
.cmd-palette-hint { padding: .4rem .2rem 0; }
@media (min-width: 1100px) {
  body.app { padding-left: var(--sidebar-width); }
  .top-nav { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; align-content: stretch; flex-wrap: nowrap; gap: .4rem; padding: 1.4rem .9rem; background: #fff; border-right: 1px solid var(--line); border-bottom: 0; z-index: 30; overflow-y: auto; }
  .workspace-brand { display: flex; align-items: center; gap: .7rem; padding: 0 .3rem 1.65rem; font-size: .9rem; font-weight: 600; }
  .workspace-brand small { display: block; font-size: .69rem; font-weight: 400; color: var(--muted); margin-top: .2rem; }
  .workspace-mark { display: grid; place-items: center; width: 35px; height: 35px; background: var(--accent); color: white; border-radius: 9px; font-size: .9rem; }
  .nav-caption { display: block; margin: 0 .7rem .35rem; font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
  .top-nav button { text-align: left; border-radius: 7px; padding: .75rem .8rem; font-size: .85rem; }
  .top-nav button.active { background: #e7f2ef; border-color: transparent; color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 var(--accent); }
  .top-nav button:hover { background: var(--bg); border-color: transparent; }
  .top-nav button.active:hover { background: #e0eeea; }
  .cmp-tray { left: calc(50% + var(--sidebar-width) / 2); max-width: calc(100vw - var(--sidebar-width) - 2rem); }
  .bottom-nav { display: none; }
  main { padding-bottom: 5rem; }
  .foot { padding-bottom: 1.25rem; }
}
@media (min-width: 761px) and (max-width: 1099px) {
  .top-nav { display: flex; position: static; }
  .bottom-nav { display: none; }
  .top-meta { display: none; }
}
@media (max-width: 760px) {
  .top { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 1rem; }
  .top h1 { font-size: 1.3rem; }
  .top-meta { order: 3; flex-basis: 100%; margin: 0; text-align: left; }
  .workspace-tools { margin-left: auto; }
  .density-control { display: none; }
  .cmd-search-btn { font-size: .75rem; gap: .5rem; }
  .cmd-search-btn kbd { display: none; }
  .sub-nav { flex-wrap: nowrap; overflow-x: auto; padding: .5rem 1rem; scrollbar-width: thin; }
  .sub-nav button { flex: 0 0 auto; }
  .workspace-location { padding: .55rem 1rem; gap: .6rem; }
  main { padding: 1rem 1rem 5.5rem; }
  .block { padding: .9rem; }
  .sticky-chrome { margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem; }
  .bottom-nav { padding-bottom: max(.3rem, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
