/* Iteration 5: graphite workbench.
   Inspiration target: calm dark graphite workspace, subtle depth, restrained translucency.
   Glass supports the hierarchy; it is no longer the visual thesis. */

:root {
  --paper: #1b1e22;
  --paper-deep: #171a1e;
  --paper-soft: #20242a;
  --ink: #f2f4f5;
  --muted: rgba(226,231,234,.60);

  --grid-minor: rgba(255,255,255,.022);
  --grid-major: rgba(255,255,255,.045);

  --panel: rgba(255,255,255,.0015);
  --panel-strong: rgba(255,255,255,.006);
  --panel-hover: rgba(255,255,255,.095);
  --panel-border: rgba(255,255,255,.10);
  --panel-border-soft: rgba(255,255,255,.065);

  --shadow: rgba(0,0,0,.34);
  --shadow-soft: rgba(0,0,0,.17);

  --purple: #6f93b3;
  --purple-soft: rgba(111,147,179,.16);
  --selection: rgba(111,147,179,.17);
  --selection-line: rgba(111,147,179,.36);
  --red: #e06a65;
  --cable: rgba(111,147,179,.66);
}

/* ATOM form chrome: keep browser-provided field UI in the active paper theme. */
.atom-shell,
.atom-shell input,
.atom-shell textarea,
.atom-shell select {
  color-scheme:dark;
}

.atom-shell[data-background="white"],
.atom-shell[data-background="white"] input,
.atom-shell[data-background="white"] textarea,
.atom-shell[data-background="white"] select {
  color-scheme:light;
}

.atom-shell option,
.atom-shell optgroup {
  color:var(--ink);
  background:var(--paper);
  font-size:max(10.5px,1em);
}

.atom-shell input:-webkit-autofill,
.atom-shell input:-webkit-autofill:hover,
.atom-shell input:-webkit-autofill:focus,
.atom-shell textarea:-webkit-autofill,
.atom-shell select:-webkit-autofill {
  -webkit-text-fill-color:var(--ink);
  caret-color:var(--ink);
  box-shadow:0 0 0 1000px color-mix(in srgb,var(--paper) 94%,var(--sem-blue) 6%) inset;
  transition:background-color 9999s ease-out 0s;
}

/* Neutral graphite drafting surface. No colorful mesh.
   A faint center lift keeps the background from reading flat-black. */
.atom-shell,
.workspace-page {
  color: var(--ink);
  background:
    radial-gradient(1200px 760px at 50% 38%, rgba(255,255,255,.018), transparent 68%),
    linear-gradient(180deg, var(--paper-soft) 0%, var(--paper) 42%, var(--paper-deep) 100%);
}

.workspace-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.012), transparent 18%, transparent 82%, rgba(0,0,0,.06));
}

/* Drafting grid: present when you look for it, absent when you are working. */
.paper-grid {
  opacity: 1;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.105) 1px, transparent 1.25px),
    radial-gradient(circle, rgba(255,255,255,.035) 1px, transparent 1.1px);
  background-size: 48px 48px, 12px 12px;
  background-position: 0 0, 0 0;
}

/* Workbench geometry. */
.widget[data-size="portrait"] {
  width: clamp(330px, calc((100vw - 144px) / 4), 520px);
  height: clamp(296px, calc((100vh - 258px) / 2), 410px);
}
.widget[data-size="landscape"] {
  width: clamp(684px, calc((100vw - 96px) / 2), 1064px);
  height: clamp(296px, calc((100vh - 258px) / 2), 410px);
}
.widget[data-size="utility"] {
  width: clamp(330px, calc((100vw - 144px) / 4), 520px);
  height: clamp(136px, calc((100vh - 286px) / 4), 193px);
}
.widget[data-size="large"] {
  width: min(calc(75vw - 42px), calc(100% - 56px));
  height: calc(100% - 118px);
}

/* Main container: smoked acrylic / graphite glass, not milky glass. */
.widget {
  position: absolute;
  overflow: visible;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 24px;
  background: rgba(255,255,255,.0015);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 0 0 1px rgba(255,255,255,.018),
    0 14px 30px rgba(0,0,0,.24),
    0 3px 8px rgba(0,0,0,.12);
  backdrop-filter: blur(1.5px) saturate(102%);
  -webkit-backdrop-filter: blur(1.5px) saturate(102%);
}

.widget::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 1px;
  border-radius: 22px;
  pointer-events: none;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.055),
    inset -1px -1px 0 rgba(0,0,0,.05);
}

/* Header plateau stays physical, but quieter than previous passes. */
.widget-header {
  width: 100%;
  min-height: 70px;
  margin: -5px 0 0;
  padding: 11px 13px;
  z-index: 3;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 24px 24px 16px 16px;
  background: rgba(255,255,255,.008);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 5px 12px rgba(0,0,0,.12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.widget-header::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.19), transparent);
}

.widget-body {
  position: relative;
  z-index: 2;
  padding: 18px 18px 10px;
}
.widget-footer {
  position: relative;
  z-index: 2;
  padding: 0 18px 12px;
  color: var(--muted);
}

/* Typography stays bright and clean against graphite. */
.widget-title strong,
.data-row strong,
.search input,
.summary-pill strong {
  color: var(--ink);
}
.widget-title small,
.data-row small,
.data-row em,
.table-head,
.pager,
.widget-footer,
.workspace-name,
.atom-dock small {
  color: var(--muted);
}

/* Internal surfaces should mostly disappear until interacted with. */
.widget-icon,
.size-control,
.plug,
.search,
.summary-pill,
.pinning-result,
.calc-screen,
.calc-grid button,
.pager button {
  color: inherit;
  border-color: var(--panel-border-soft);
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.widget-icon {
  background: rgba(255,255,255,.055);
}

.size-control:hover,
.plug:hover,
.data-row:hover,
.calc-grid button:hover {
  background: var(--panel-hover);
  border-color: rgba(255,255,255,.11);
}

.search input::placeholder {
  color: rgba(226,231,234,.30);
}

.summary-pill {
  border: 1px solid rgba(255,255,255,.055);
}


/* Crystal-pane experiment: only information-bearing areas receive a graphite backing. */
.widget-title > div,
.search,
.data-row,
.summary-pill,
.table-head,
.context-chip,
.pinning-result,
.calc-screen,
.widget-footer .context-status,
.widget-footer .size-label {
  background: rgba(31,35,40,.52);
  border: 1px solid rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.widget-title > div {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px 6px;
  border-radius: 8px;
}

.data-row {
  border-radius: 9px;
  padding-inline: 9px;
}

.table-head {
  border-radius: 8px;
  padding: 6px 8px;
}

.widget-footer .context-status,
.widget-footer .size-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 7px;
}

/* Selection is the one place where color is allowed to read clearly. */
.data-row.is-selected,
.context-chip {
  background: var(--selection);
  border-color: var(--selection-line);
}
.control.clear:not(:disabled) {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.07),
    0 0 0 3px var(--purple-soft);
}

/* Top rail: a thin graphite strip, not a bright glass capsule. */
.atom-rail {
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.085);
  background: rgba(30,34,39,.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 10px 24px rgba(0,0,0,.24);
  backdrop-filter: blur(7px) saturate(108%);
  -webkit-backdrop-filter: blur(7px) saturate(108%);
  border-radius: 15px;
}

/* Dock: visually stronger than rail, still neutral graphite. */
.atom-dock {
  color: var(--ink);
  min-height: 70px;
  padding: 8px 11px 9px;
  gap: 3px;
  overflow: visible;
  align-items: flex-end;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.010), rgba(255,255,255,.002)),
    rgba(31,35,40,.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.09),
    0 16px 32px rgba(0,0,0,.30);
  backdrop-filter: blur(7px) saturate(108%);
  -webkit-backdrop-filter: blur(7px) saturate(108%);
}

.atom-dock button {
  width: 54px;
  height: 52px;
  margin-inline: var(--dock-space, 0px);
  transform: translateY(var(--dock-lift, 0px)) scale(var(--dock-scale, 1));
  transform-origin: 50% 100%;
  transition:
    transform .105s cubic-bezier(.2,.78,.2,1),
    margin .105s cubic-bezier(.2,.78,.2,1),
    background .14s ease;
}

.atom-dock button:hover {
  background: rgba(255,255,255,.065);
}

.dock-glyph {
  width: 34px;
  height: 34px;
  display: grid !important;
  place-items: center;
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.060), rgba(255,255,255,.025)),
    #292d33;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 2px 5px rgba(0,0,0,.16);
}

/* Dotted semantic connections remain subtle graphite-blue traces. */
.cable-layer path {
  stroke: var(--cable);
  stroke-width: 3.1;
  stroke-dasharray: 2 9;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.28));
  opacity: .075;
}
.atom-shell.show-connections .cable-layer path:not(.preview) {
  opacity: .56;
  stroke-width: 3.35;
}
.atom-shell.connection-mode .cable-layer path:not(.preview) {
  opacity: .20;
}
.cable-layer path.preview {
  stroke-dasharray: 3 8;
  stroke-width: 4;
  opacity: .66;
}

/* Workspace navigation remains spatial and understated. */
.page-edge,
.page-create {
  border: 1px solid transparent;
  color: rgba(242,244,245,.42);
  background: transparent;
  transition: transform .16s ease, background .16s ease, color .16s ease, opacity .16s ease;
}
.page-edge {
  width: 48px;
  height: 48px;
}
.page-edge:hover:not(:disabled),
.page-create:hover {
  transform: scale(1.08);
  color: #fff;
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.065);
}
.page-edge:disabled {
  opacity: .10;
  cursor: default;
}
.page-create {
  position: absolute;
  z-index: 122;
  right: 67px;
  bottom: 27px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}
.page-create[hidden] { display: none; }

/* Alternate light material stays available for testing, but graphite is primary. */
.atom-shell[data-background="white"] {
  --paper: #e8ebed;
  --paper-deep: #dfe3e6;
  --paper-soft: #edf0f2;
  --ink: #1d2328;
  --muted: rgba(39,48,55,.58);
  --grid-minor: rgba(34,43,49,.025);
  --grid-major: rgba(34,43,49,.052);
  --panel: rgba(255,255,255,.012);
  --panel-strong: rgba(255,255,255,.035);
  --panel-hover: rgba(255,255,255,.11);
  --panel-border: rgba(255,255,255,.64);
  --panel-border-soft: rgba(53,65,72,.09);
  --shadow: rgba(42,52,58,.15);
  --shadow-soft: rgba(42,52,58,.07);
}

.atom-shell[data-background="white"],
.atom-shell[data-background="white"] .workspace-page {
  background:
    radial-gradient(1100px 700px at 50% 38%, rgba(255,255,255,.25), transparent 68%),
    linear-gradient(180deg, var(--paper-soft), var(--paper-deep));
}

.atom-shell[data-background="white"] .widget,
.atom-shell[data-background="white"] .atom-rail,
.atom-shell[data-background="white"] .atom-dock {
  color: var(--ink);
}


.atom-shell[data-background="white"] .widget-header {
  background:
    linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.025));
  border-color: rgba(255,255,255,.46);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.58),
    0 7px 16px rgba(42,52,58,.10);
}

.atom-shell[data-background="white"] .atom-rail {
  background: rgba(245,247,248,.11);
  border-color: rgba(255,255,255,.74);
}

.atom-shell[data-background="white"] .atom-dock {
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.012)),
    rgba(244,246,247,.10);
  border-color: rgba(255,255,255,.72);
}


.atom-shell[data-background="white"] .paper-grid {
  background-image:
    radial-gradient(circle, rgba(32,40,46,.12) 1px, transparent 1.25px),
    radial-gradient(circle, rgba(32,40,46,.040) 1px, transparent 1.1px);
}

.atom-shell[data-background="white"] .widget {
  background: rgba(255,255,255,.012);
  border-color: rgba(255,255,255,.70);
  backdrop-filter: blur(1.5px) saturate(101%);
  -webkit-backdrop-filter: blur(1.5px) saturate(101%);
}

.atom-shell[data-background="white"] .widget-title > div,
.atom-shell[data-background="white"] .search,
.atom-shell[data-background="white"] .data-row,
.atom-shell[data-background="white"] .summary-pill,
.atom-shell[data-background="white"] .table-head,
.atom-shell[data-background="white"] .context-chip,
.atom-shell[data-background="white"] .pinning-result,
.atom-shell[data-background="white"] .calc-screen,
.atom-shell[data-background="white"] .widget-footer .context-status,
.atom-shell[data-background="white"] .widget-footer .size-label {
  background: rgba(210,215,218,.62);
  border-color: rgba(57,67,73,.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38);
}

@media (max-width: 1100px) {
  .widget[data-size="portrait"] {
    width: min(420px, calc(50vw - 30px));
  }
  .widget[data-size="landscape"] {
    width: calc(100vw - 48px);
  }
  .page-create {
    right: 58px;
  }

  .widget,
  .atom-rail,
  .atom-dock {
    backdrop-filter: blur(1px) saturate(101%);
    -webkit-backdrop-filter: blur(1px) saturate(101%);
  }
}


/* =========================================================
   Iteration 6 — CRYSTAL PANE POLISH
   Baseline remains commit 3b503eb55cdd415a811a443a9db07f6278074f3f.
   This layer only sharpens the established visual language.
   ========================================================= */

/* Slightly finer dot rhythm: drafting texture, not decoration. */
.paper-grid {
  background-image:
    radial-gradient(circle, rgba(255,255,255,.090) .95px, transparent 1.18px),
    radial-gradient(circle, rgba(255,255,255,.028) .72px, transparent 1px);
  background-size: 48px 48px, 12px 12px;
}

/* Crystal pane: keep it empty, make the perimeter do the work. */
.widget {
  border-color: rgba(255,255,255,.185);
  border-radius: 24px;
  background: rgba(255,255,255,.001);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 1px 0 0 rgba(255,255,255,.050),
    inset -1px 0 0 rgba(0,0,0,.055),
    inset 0 -1px 0 rgba(0,0,0,.070),
    0 16px 34px rgba(0,0,0,.22),
    0 3px 8px rgba(0,0,0,.12);
  transition:
    width .28s cubic-bezier(.2,.7,.2,1),
    height .28s cubic-bezier(.2,.7,.2,1),
    border-color .16s ease,
    box-shadow .16s ease,
    opacity .2s ease;
}

.widget::before {
  inset: 1px;
  border-radius: 22px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.050),
    inset -1px -1px 0 rgba(0,0,0,.045);
}

.widget:hover {
  border-color: rgba(255,255,255,.23);
}

.widget.is-dragging {
  border-color: rgba(255,255,255,.31);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.24),
    inset 1px 0 0 rgba(255,255,255,.07),
    0 22px 44px rgba(0,0,0,.30),
    0 5px 12px rgba(0,0,0,.16);
}

/* Header is the thicker top edge of the same pane, not a filled card. */
.widget-header {
  min-height: 68px;
  margin-top: 0;
  margin-bottom: -8px;
  padding: 10px 12px;
  transform: translateY(-8px);
  border-color: rgba(255,255,255,.19);
  background: rgba(255,255,255,.004);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.045),
    0 5px 11px rgba(0,0,0,.105);
}

.widget-header::before {
  left: 8%;
  right: 8%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.26) 30%,
    rgba(255,255,255,.34) 50%,
    rgba(255,255,255,.26) 70%,
    transparent
  );
}

.widget.is-context-source .widget-header {
  border-color: rgba(177,148,222,.40);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 5px 11px rgba(0,0,0,.11),
    0 0 0 1px rgba(155,126,202,.15);
}

/* Header composition: tighter and more deliberate. */
.window-controls {
  gap: 8px;
}

.control {
  width: 12px;
  height: 12px;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.14),
    0 1px 1px rgba(0,0,0,.10);
}

.widget-title {
  gap: 9px;
}

.widget-title > div {
  padding: 5px 9px 6px;
  border-radius: 8px;
  background: rgba(31,35,40,.66);
  border-color: rgba(255,255,255,.060);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 1px 3px rgba(0,0,0,.09);
}

.widget-title small {
  font-size: 8.5px;
  line-height: 1.1;
  letter-spacing: .12em;
}

.widget-title strong {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.widget-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  border-color: rgba(255,255,255,.11);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.065),
    0 1px 2px rgba(0,0,0,.08);
  font-size: 8px;
  letter-spacing: .03em;
}

.size-control,
.plug {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,.018);
  border-color: rgba(255,255,255,.095);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.size-control:hover,
.plug:hover {
  background: rgba(255,255,255,.065);
  border-color: rgba(255,255,255,.16);
}

/* Give content a little more air without making the widgets larger. */
.widget-body {
  padding: 16px 16px 9px;
}

.widget-footer {
  min-height: 28px;
  padding: 0 16px 11px;
}

/* Graphite plates are the readability layer. Make them consistent and crisp. */
.search,
.data-row,
.summary-pill,
.table-head,
.context-chip,
.pinning-result,
.calc-screen,
.widget-footer .context-status,
.widget-footer .size-label {
  background: rgba(31,35,40,.60);
  border-color: rgba(255,255,255,.055);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.030),
    0 1px 2px rgba(0,0,0,.055);
}

.search {
  height: 36px;
  border-radius: 9px;
  padding-inline: 10px;
}

.search input {
  font-size: 11.5px;
  letter-spacing: .005em;
}

.rows {
  margin-top: 7px;
  gap: 4px;
}

.data-row {
  min-height: 40px;
  padding: 6px 9px;
  border-radius: 9px;
  transition:
    background .13s ease,
    border-color .13s ease,
    box-shadow .13s ease;
}

.data-row strong {
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: -.006em;
}

.data-row small,
.data-row em {
  font-size: 9px;
  line-height: 1.25;
}

.data-row:hover {
  background: rgba(42,47,53,.72);
  border-color: rgba(255,255,255,.09);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 2px 5px rgba(0,0,0,.08);
}

.data-row.is-selected {
  background: rgba(123,94,170,.30);
  border-color: rgba(186,155,231,.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 0 0 1px rgba(142,109,195,.08);
}

.summary-strip {
  gap: 6px;
}

.summary-pill {
  min-height: 44px;
  border-radius: 9px;
  padding: 7px 9px;
}

.summary-pill strong {
  font-size: 13px;
  line-height: 1;
}

.summary-pill small {
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: .08em;
}

.table-head {
  margin-top: 7px;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 8px;
  letter-spacing: .085em;
}

.context-chip {
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 8px;
}

.widget-footer .context-status,
.widget-footer .size-label {
  min-height: 19px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(31,35,40,.46);
  font-size: 8px;
}

/* Pager should feel like a quiet piece of instrumentation. */
.pager {
  margin-top: 6px;
  gap: 4px;
  font-size: 8px;
}

.pager button {
  width: 24px;
  height: 22px;
  border-radius: 7px;
  background: rgba(31,35,40,.50);
}

/* Cables: smaller true dots, clearer when explicitly revealed. */
.cable-layer path {
  stroke-width: 2.55;
  stroke-dasharray: 1 8;
  stroke-linecap: round;
  opacity: .075;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}

.atom-shell.show-connections .cable-layer path:not(.preview) {
  opacity: .60;
  stroke-width: 2.8;
  stroke-dasharray: 1.25 7.5;
}

.atom-shell.connection-mode .cable-layer path:not(.preview) {
  opacity: .22;
}

.cable-layer path.preview {
  stroke-width: 3.2;
  stroke-dasharray: 1.5 7;
  opacity: .72;
}

/* Rail remains nearly weightless; controls sharpen only on interaction. */
.atom-rail {
  border-color: rgba(255,255,255,.09);
  background: rgba(30,34,39,.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.075),
    0 8px 20px rgba(0,0,0,.19);
}

.rail-icon {
  transition: background .13s ease, border-color .13s ease, color .13s ease;
}

.rail-icon:hover,
.rail-icon[aria-pressed="true"] {
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}

/* Dock: crystal tray + graphite instruments. */
.atom-dock {
  border-color: rgba(255,255,255,.13);
  background: rgba(31,35,40,.115);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 14px 30px rgba(0,0,0,.27);
}

.atom-dock button {
  border-radius: 12px;
}

.dock-glyph {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  border-color: rgba(255,255,255,.085);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.012)),
    rgba(31,35,40,.90);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.075),
    0 2px 5px rgba(0,0,0,.16);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .025em;
}

.atom-dock small {
  margin-top: 2px;
  font-size: 7.5px;
  letter-spacing: .01em;
}

/* Crisp keyboard focus without polluting mouse interactions. */
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(178,148,222,.72);
  outline-offset: 2px;
}

/* LIGHT MATERIAL: same crystal-pane grammar, tuned for pale graphite. */
.atom-shell[data-background="white"] .paper-grid {
  background-image:
    radial-gradient(circle, rgba(32,40,46,.105) .95px, transparent 1.18px),
    radial-gradient(circle, rgba(32,40,46,.032) .72px, transparent 1px);
}

.atom-shell[data-background="white"] .widget {
  background: rgba(255,255,255,.006);
  border-color: rgba(255,255,255,.76);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.86),
    inset 1px 0 0 rgba(255,255,255,.28),
    inset -1px 0 0 rgba(80,90,96,.055),
    inset 0 -1px 0 rgba(80,90,96,.07),
    0 15px 31px rgba(53,62,67,.12),
    0 3px 8px rgba(53,62,67,.07);
}

.atom-shell[data-background="white"] .widget:hover {
  border-color: rgba(255,255,255,.90);
}

.atom-shell[data-background="white"] .widget-header {
  background: rgba(255,255,255,.012);
  border-color: rgba(255,255,255,.72);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.90),
    inset 0 -1px 0 rgba(79,88,94,.05),
    0 5px 11px rgba(52,61,67,.07);
}

.atom-shell[data-background="white"] .widget-title > div,
.atom-shell[data-background="white"] .search,
.atom-shell[data-background="white"] .data-row,
.atom-shell[data-background="white"] .summary-pill,
.atom-shell[data-background="white"] .table-head,
.atom-shell[data-background="white"] .context-chip,
.atom-shell[data-background="white"] .pinning-result,
.atom-shell[data-background="white"] .calc-screen,
.atom-shell[data-background="white"] .widget-footer .context-status,
.atom-shell[data-background="white"] .widget-footer .size-label {
  background: rgba(207,212,215,.72);
  border-color: rgba(58,68,74,.075);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.42),
    0 1px 2px rgba(54,63,69,.045);
}

.atom-shell[data-background="white"] .data-row:hover {
  background: rgba(197,203,207,.82);
  border-color: rgba(54,64,70,.095);
}

.atom-shell[data-background="white"] .data-row.is-selected,
.atom-shell[data-background="white"] .context-chip {
  background: rgba(180,161,209,.52);
  border-color: rgba(128,99,171,.30);
}

.atom-shell[data-background="white"] .widget-footer .context-status,
.atom-shell[data-background="white"] .widget-footer .size-label {
  background: rgba(207,212,215,.58);
}

.atom-shell[data-background="white"] .widget-icon,
.atom-shell[data-background="white"] .size-control,
.atom-shell[data-background="white"] .plug {
  background: rgba(255,255,255,.08);
  border-color: rgba(64,74,80,.075);
}

.atom-shell[data-background="white"] .atom-rail {
  background: rgba(245,247,248,.055);
  border-color: rgba(255,255,255,.82);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.88),
    0 8px 20px rgba(51,61,67,.08);
}

.atom-shell[data-background="white"] .atom-dock {
  background: rgba(244,246,247,.055);
  border-color: rgba(255,255,255,.78);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.84),
    0 14px 28px rgba(50,60,66,.11);
}

.atom-shell[data-background="white"] .dock-glyph {
  color: rgba(245,247,248,.95);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.012)),
    rgba(35,40,45,.94);
  border-color: rgba(255,255,255,.11);
}

.atom-shell[data-background="white"] .cable-layer path {
  stroke: rgba(111,87,151,.48);
}


/* =========================================================
   Iteration 7 — TOOL DRAWERS + SEMANTIC CONTAINERS
   Crystal-pane baseline is unchanged; this layer adds the new
   dock/tool architecture and independent-vs-connected filters.
   ========================================================= */

/* Dock group buttons stay reactive; open group gets a restrained blue cue. */
.atom-dock button[data-dock-group].is-open .dock-glyph {
  border-color: rgba(184,154,226,.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 0 0 1px rgba(142,111,193,.10),
    0 3px 8px rgba(0,0,0,.18);
}

.atom-dock button[data-dock-group].is-open small {
  color: rgba(226,211,247,.90);
}

/* The tool group rolls upward from the dock as a separate crystal drawer. */
.dock-tray {
  position: absolute;
  z-index: 119;
  left: 50%;
  bottom: max(94px, calc(env(safe-area-inset-bottom) + 94px));
  width: min(620px, calc(100vw - 44px));
  padding: 12px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 20px;
  background: rgba(31,35,40,.13);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 20px 42px rgba(0,0,0,.30),
    0 5px 12px rgba(0,0,0,.14);
  backdrop-filter: blur(8px) saturate(108%);
  -webkit-backdrop-filter: blur(8px) saturate(108%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px) scale(.96,.86);
  transform-origin: 50% 100%;
  transition:
    opacity .16s ease,
    transform .22s cubic-bezier(.18,.78,.2,1);
}

.dock-tray.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.dock-tray-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 4px 10px;
}

.dock-tray-head > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: baseline;
  column-gap: 9px;
  row-gap: 2px;
}

.dock-tray-head small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 7px;
  font-weight: 760;
  letter-spacing: .14em;
}

.dock-tray-head strong {
  font-size: 13px;
  letter-spacing: -.01em;
}

.dock-tray-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-tray-head > button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  background: rgba(31,35,40,.58);
  font-size: 16px;
}

.dock-tray-tools {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 7px;
}

.dock-tray-tools > button {
  min-width: 0;
  height: 66px;
  padding: 8px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  color: inherit;
  text-align: left;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 11px;
  background: rgba(31,35,40,.64);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  transition:
    transform .13s ease,
    background .13s ease,
    border-color .13s ease;
}

.dock-tray-tools > button:hover {
  transform: translateY(-2px);
  background: rgba(42,47,53,.78);
  border-color: rgba(255,255,255,.11);
}

.tray-glyph {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: rgba(244,246,247,.92);
  font-size: 8px;
  font-weight: 820;
  letter-spacing: .03em;
}

.dock-tray-tools > button > span:last-child {
  min-width: 0;
}

.dock-tray-tools strong,
.dock-tray-tools small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-tray-tools strong {
  font-size: 10px;
}

.dock-tray-tools small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7.5px;
}

/* Independent filtering lives inside a container but does not become a big card. */
.local-filter {
  margin-bottom: 8px;
  transition: opacity .16s ease, filter .16s ease;
}

.filter-mode {
  min-height: 18px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

.filter-mode span {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 6px;
  background: rgba(31,35,40,.40);
  color: rgba(226,231,234,.48);
  font-size: 6.8px;
  font-weight: 760;
  letter-spacing: .10em;
}

.filter-fields {
  display: flex;
  gap: 5px;
  min-width: 0;
}

.filter-fields label {
  min-width: 0;
  flex: 0 1 136px;
  display: grid;
  gap: 3px;
  padding: 5px 7px 6px;
  border: 1px solid rgba(255,255,255,.050);
  border-radius: 8px;
  background: rgba(31,35,40,.56);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.filter-fields label.local-search {
  flex: 1 1 150px;
}

.filter-fields label > span {
  color: var(--muted);
  font-size: 6.8px;
  font-weight: 730;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.filter-fields input,
.filter-fields select {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 9px;
}

.filter-fields select {
  cursor: pointer;
}

.filter-fields option {
  color: #1e2328;
}

.local-filter.is-driven {
  opacity: .30;
  filter: grayscale(.6);
}

.local-filter.is-driven .filter-mode span {
  color: rgba(212,192,238,.80);
  border-color: rgba(161,128,207,.15);
}

.local-filter.is-driven input,
.local-filter.is-driven select {
  cursor: not-allowed;
}

/* New data row shapes. */
.data-row.key-row,
.data-row.copy-row,
.data-row.person-row {
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
}

.data-row.copy-row > span:last-child {
  min-width: 84px;
  text-align: right;
}

.data-row.copy-row > span:last-child em {
  display: block;
  margin-top: 2px;
}

.data-row.person-row em {
  max-width: 145px;
  text-align: right;
}

/* SYSTEM TREE — portrait is a vertical nested tree. */
.system-tree {
  min-height: 0;
  color: var(--ink);
}

.portrait-tree {
  padding: 2px 2px 2px 4px;
}

.portrait-tree .tree-line {
  position: relative;
}

.portrait-tree .tree-line > .tree-line {
  margin-left: 17px;
  padding-left: 13px;
  border-left: 1px solid rgba(255,255,255,.10);
}

.portrait-tree .tree-line > .tree-line::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 17px;
  width: 11px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.tree-node {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  margin: 3px 0;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 8px;
  background: rgba(31,35,40,.60);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.028);
}

.tree-node button,
.tree-node span {
  max-width: 100%;
  padding: 6px 9px;
  color: inherit;
  border: 0;
  background: transparent;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node button {
  cursor: pointer;
}

.tree-node button:hover {
  color: rgba(229,213,247,.98);
}

.tree-node.system {
  border-color: rgba(111,147,179,.22);
}

.tree-node.branch {
  background: rgba(31,35,40,.45);
  color: var(--muted);
}

/* SYSTEM TREE — landscape becomes a top-down branching hierarchy. */
.landscape-tree {
  min-height: 150px;
  padding: 4px 8px 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.landscape-tree .tree-branch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
}

.landscape-tree .tree-children {
  position: relative;
  margin-top: 22px;
  padding-top: 14px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
}

.landscape-tree .tree-children::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  border-top: 1px solid rgba(255,255,255,.11);
}

.landscape-tree .tree-branch > .tree-children::after {
  content: "";
  position: absolute;
  top: -22px;
  left: 50%;
  height: 22px;
  border-left: 1px solid rgba(255,255,255,.11);
}

.landscape-tree .tree-children > .tree-branch::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  height: 14px;
  border-left: 1px solid rgba(255,255,255,.11);
}

.landscape-tree .tree-node {
  margin: 0;
  max-width: 150px;
}

/* In landscape, local filters compress to leave more room for hierarchy/data. */
.widget[data-size="landscape"] .filter-fields label {
  flex-basis: 150px;
}

.widget[data-size="large"] .filter-fields,
.widget[data-size="full"] .filter-fields {
  max-width: 680px;
}

/* Light mode keeps the same hierarchy and connected-filter signal. */
.atom-shell[data-background="white"] .dock-tray {
  color: var(--ink);
  border-color: rgba(255,255,255,.80);
  background: rgba(244,246,247,.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.88),
    0 18px 38px rgba(51,61,67,.12);
}

.atom-shell[data-background="white"] .dock-tray-tools > button,
.atom-shell[data-background="white"] .dock-tray-head > button,
.atom-shell[data-background="white"] .filter-fields label,
.atom-shell[data-background="white"] .filter-mode span,
.atom-shell[data-background="white"] .tree-node {
  background: rgba(207,212,215,.72);
  border-color: rgba(58,68,74,.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.40);
}

.atom-shell[data-background="white"] .tray-glyph {
  color: #273038;
  background: rgba(255,255,255,.12);
  border-color: rgba(58,68,74,.09);
}

.atom-shell[data-background="white"] .filter-fields input,
.atom-shell[data-background="white"] .filter-fields select {
  color: var(--ink);
}

.atom-shell[data-background="white"] .portrait-tree .tree-line > .tree-line,
.atom-shell[data-background="white"] .portrait-tree .tree-line > .tree-line::before,
.atom-shell[data-background="white"] .landscape-tree .tree-children::before,
.atom-shell[data-background="white"] .landscape-tree .tree-branch > .tree-children::after,
.atom-shell[data-background="white"] .landscape-tree .tree-children > .tree-branch::before {
  border-color: rgba(50,61,68,.16);
}

@media (max-width: 900px) {
  .dock-tray-tools {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .filter-fields {
    flex-wrap: wrap;
  }

  .filter-fields label,
  .filter-fields label.local-search {
    flex: 1 1 calc(50% - 5px);
  }
}


/* =========================================================
   Iteration 8 — DATA-FIRST CRYSTAL WORKBENCH
   The crystal-pane material remains the baseline. This pass
   changes geometry and information density, not the identity.
   ========================================================= */

/* Taller data instruments: four can still fit across, but a portrait is now
   tall enough to be useful for real institutional datasets. */
.widget[data-size="portrait"],
.widget[data-size="landscape"] {
  height: clamp(560px, calc(100vh - 270px), 720px);
}

/* The header is now physically mounted ABOVE the pane rather than translated
   inside its flex layout. The pane border begins below the header plateau. */
.widget {
  padding-top: 48px;
}

.widget-header {
  position: absolute;
  top: -20px;
  left: -1px;
  right: -1px;
  width: calc(100% + 2px);
  min-height: 66px;
  margin: 0;
  transform: none;
  z-index: 6;
}

.widget-body {
  padding: 10px 14px 8px;
}

.widget-footer {
  padding: 0 14px 10px;
}

/* Compact top tool strip. Filtering no longer behaves like a sidebar/card. */
.local-filter.filter-strip {
  min-height: 30px;
  margin: 0 0 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-strip .filter-mode {
  flex: 0 0 auto;
  min-height: 28px;
  margin: 0;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 8px;
  background: rgba(31,35,40,.38);
}

.filter-strip .filter-mode i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(151,124,197,.72);
  box-shadow: 0 0 0 2px rgba(151,124,197,.08);
}

.filter-strip .filter-mode span {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 6.5px;
  letter-spacing: .11em;
}

.filter-strip .filter-fields {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-strip .filter-fields label {
  position: relative;
  flex: 0 1 92px;
  min-width: 68px;
  height: 28px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.050);
  border-radius: 8px;
  background: rgba(31,35,40,.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.filter-strip .filter-fields label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.filter-strip .filter-fields label.local-search {
  flex: 1 1 120px;
  gap: 5px;
}

.filter-strip .local-search b {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.filter-strip .filter-fields input,
.filter-strip .filter-fields select {
  height: 26px;
  font-size: 8.5px;
}

.filter-strip .filter-fields select {
  padding-right: 2px;
}

.filter-strip.is-driven .filter-mode i {
  background: rgba(190,159,231,.95);
}

/* Data rows trade a little type size for dramatically more useful density. */
.rows {
  margin-top: 5px;
  gap: 3px;
}

.data-row {
  min-height: 33px;
  padding: 4px 8px;
  border-radius: 8px;
}

.data-row strong {
  font-size: 10.4px;
  line-height: 1.15;
}

.data-row small,
.data-row em {
  font-size: 8.1px;
  line-height: 1.18;
}

.pager {
  margin-top: 5px;
  font-size: 7.6px;
}

.context-chips:not(:empty) {
  margin-bottom: 5px;
}

/* The roll-up tool drawer is now a slim secondary dock: icon above, name below. */
.dock-tray {
  width: max-content;
  max-width: calc(100vw - 44px);
  min-width: 0;
  padding: 7px 9px 8px;
  bottom: max(90px, calc(env(safe-area-inset-bottom) + 90px));
  border-radius: 18px;
  background: rgba(31,35,40,.105);
  transform: translate(-50%, 22px) scaleY(.54);
  transform-origin: 50% 100%;
  transition:
    opacity .14s ease,
    transform .24s cubic-bezier(.16,.82,.18,1);
}

.dock-tray.is-open {
  transform: translate(-50%, 0) scaleY(1);
}

.dock-tray-tools {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.dock-tray-tools > button {
  width: 58px;
  height: 54px;
  padding: 4px 3px 3px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 34px 12px;
  place-items: center;
  gap: 1px;
  text-align: center;
  border-radius: 11px;
  background: transparent;
}

.dock-tray-tools > button:hover {
  transform: translateY(-3px) scale(1.06);
  background: rgba(255,255,255,.050);
}

.tray-glyph {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 8px;
}

.dock-tray-tools > button > small {
  display: block;
  width: 54px;
  margin: 0;
  color: var(--muted);
  font-size: 6.8px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-tray-head,
.dock-tray-tools > button > span:last-child:not(.tray-glyph) {
  display: none;
}

/* Light mode uses the exact same data-first structure. */
.atom-shell[data-background="white"] .filter-strip .filter-mode,
.atom-shell[data-background="white"] .filter-strip .filter-fields label {
  background: rgba(207,212,215,.66);
  border-color: rgba(58,68,74,.07);
}

.atom-shell[data-background="white"] .dock-tray {
  background: rgba(244,246,247,.055);
}

.atom-shell[data-background="white"] .dock-tray-tools > button {
  background: transparent;
}

.atom-shell[data-background="white"] .dock-tray-tools > button:hover {
  background: rgba(80,90,96,.07);
}

/* At narrower widths the filters remain a TOP strip; they may wrap instead of
   becoming a vertical sidebar. */
@media (max-width: 900px) {
  .widget[data-size="portrait"],
  .widget[data-size="landscape"] {
    height: min(640px, calc(100% - 96px));
  }

  .filter-strip .filter-fields {
    flex-wrap: wrap;
  }

  .filter-strip .filter-fields label,
  .filter-strip .filter-fields label.local-search {
    flex: 1 1 88px;
  }

  .dock-tray-tools {
    display: flex;
    grid-template-columns: none;
  }
}


/* =========================================================
   Iteration 9 — HEADERLESS DATA CANVAS + FOOTER FILTER
   One crystal pane. Controls and title float directly on it.
   Filtering lives in the footer, never in the data viewport.
   ========================================================= */

.widget {
  padding-top: 44px;
}

/* No header object: this is only a transparent positioning layer now. */
.widget-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 7px 10px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none;
  z-index: 6;
}

.widget-header::before,
.widget-header::after {
  display: none !important;
}

.window-controls {
  justify-self: start;
  align-self: center;
  height: 30px;
}

.widget-actions {
  justify-self: end;
  align-self: start;
}

.widget-title {
  justify-self: center;
  align-self: center;
  min-width: 0;
  display: block;
  padding-top: 6px;
}

.widget-title > div,
.widget-title .widget-icon,
.widget-icon {
  display: none !important;
}

.widget-title strong {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 12px;
  font-weight: 670;
  line-height: 1;
  letter-spacing: .005em;
  white-space: nowrap;
  text-align: center;
}

.size-control,
.plug {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.control {
  width: 11px;
  height: 11px;
}

/* Data begins directly beneath the clean title line. */
.widget-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 14px 8px;
  overflow: hidden;
}

/* Footer is a three-part instrument strip: context | filter | size. */
.widget-footer {
  position: relative;
  z-index: 8;
  flex: 0 0 30px;
  min-height: 30px;
  padding: 2px 12px 8px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: end;
  gap: 8px;
  overflow: visible;
}

.widget-footer .context-status,
.widget-footer .size-label {
  min-height: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 20px;
  white-space: nowrap;
}

.widget-footer .context-status {
  justify-self: start;
}

.widget-footer .size-label {
  justify-self: end;
  text-transform: capitalize;
}

.footer-filter-slot {
  position: relative;
  justify-self: center;
  min-width: 0;
}

.footer-filter {
  position: relative;
}

.footer-filter-toggle {
  min-width: 78px;
  height: 22px;
  padding: 0 8px 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 8px;
  background: rgba(31,35,40,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  font-size: 7.5px;
}

.footer-filter-toggle b {
  font-size: 9px;
  font-weight: 500;
  transition: transform .15s ease;
}

.footer-filter.is-open .footer-filter-toggle b {
  transform: rotate(180deg);
}

.footer-filter-toggle:hover {
  color: var(--ink);
  border-color: rgba(255,255,255,.10);
  background: rgba(42,47,53,.62);
}

.footer-filter.is-driven .footer-filter-toggle {
  color: rgba(204,184,232,.70);
}

.footer-filter-menu {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 7px);
  width: 230px;
  max-height: 280px;
  padding: 7px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 12px;
  background: rgba(29,33,38,.94);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    0 14px 30px rgba(0,0,0,.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%,7px) scale(.97);
  transform-origin: 50% 100%;
  transition: opacity .13s ease, transform .16s cubic-bezier(.2,.78,.2,1);
  overflow: auto;
}

.footer-filter.is-open .footer-filter-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%,0) scale(1);
}

.footer-filter-menu > label {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0,1fr);
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 8px;
  background: rgba(255,255,255,.022);
}

.footer-filter-menu > label > span {
  color: var(--muted);
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.footer-filter-menu input,
.footer-filter-menu select {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 9px;
}

.footer-filter-menu select option {
  color: #1e2328;
}

.footer-filter-search {
  grid-template-columns: 14px minmax(0,1fr) !important;
}

.footer-filter-search > span {
  font-size: 10px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.footer-filter-options {
  display: grid;
  gap: 4px;
}

.footer-filter-options > button {
  min-height: 38px;
  padding: 6px 8px;
  display: grid;
  gap: 2px;
  color: inherit;
  text-align: left;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 8px;
  background: rgba(255,255,255,.020);
}

.footer-filter-options > button:hover,
.footer-filter-options > button.is-selected {
  background: rgba(123,94,170,.22);
  border-color: rgba(111,147,179,.22);
}

.footer-filter-options strong,
.footer-filter-options small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-filter-options strong {
  font-size: 9px;
}

.footer-filter-options small {
  color: var(--muted);
  font-size: 7.5px;
}

/* All old in-body filter architecture is retired. */
.local-filter,
.tree-filter,
.filter-strip {
  display: none !important;
}

/* System Tree gets the full data canvas. */
.widget[data-kind="systemTree"] .widget-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.widget[data-kind="systemTree"] .context-chips {
  flex: 0 0 auto;
}

.system-tree {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.landscape-tree {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: 18px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.landscape-tree > .tree-branch {
  width: 100%;
}

.landscape-tree .tree-children {
  width: 100%;
  margin-top: 34px;
  padding-top: 20px;
  gap: 28px;
}

.landscape-tree .tree-node {
  min-height: 34px;
  max-width: 180px;
  border-radius: 9px;
}

.landscape-tree .tree-node button,
.landscape-tree .tree-node span {
  padding: 8px 12px;
  font-size: 10px;
}

.landscape-tree .tree-branch > .tree-children::after {
  top: -34px;
  height: 34px;
}

.landscape-tree .tree-children > .tree-branch::before {
  top: -20px;
  height: 20px;
}

.portrait-tree {
  flex: 1 1 auto;
  padding: 12px 8px 8px;
  overflow: hidden;
}

.portrait-tree .tree-node {
  min-height: 32px;
}

.portrait-tree .tree-node button,
.portrait-tree .tree-node span {
  padding: 7px 10px;
  font-size: 9.5px;
}

/* Light mode: same clean title/footer structure. */
.atom-shell[data-background="white"] .widget-header {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.atom-shell[data-background="white"] .widget-title strong {
  color: var(--ink);
  background: transparent !important;
}

.atom-shell[data-background="white"] .widget-footer .context-status,
.atom-shell[data-background="white"] .widget-footer .size-label {
  background: transparent !important;
  border: 0 !important;
}

.atom-shell[data-background="white"] .footer-filter-toggle {
  color: var(--muted);
  border-color: rgba(62,72,78,.09);
  background: rgba(207,212,215,.48);
}

.atom-shell[data-background="white"] .footer-filter-menu {
  color: var(--ink);
  border-color: rgba(58,68,74,.11);
  background: rgba(231,234,236,.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.60),
    0 12px 26px rgba(54,63,69,.14);
}

.atom-shell[data-background="white"] .footer-filter-menu > label,
.atom-shell[data-background="white"] .footer-filter-options > button {
  border-color: rgba(58,68,74,.07);
  background: rgba(255,255,255,.24);
}

.atom-shell[data-background="white"] .footer-filter-options > button:hover,
.atom-shell[data-background="white"] .footer-filter-options > button.is-selected {
  background: rgba(180,161,209,.42);
  border-color: rgba(128,99,171,.22);
}


/* =========================================================
   Iteration 10 — LOCKED HIERARCHY + AUX CONNECTION + SLIDE DRAWER
   ========================================================= */

/* Header content sits as high as practical without becoming detached from pane. */
.widget {
  padding-top: 36px;
}

.widget-header {
  height: 36px;
  min-height: 36px;
  padding: 3px 8px 0;
  align-items: start;
}

.window-controls {
  height: 28px;
  align-self: start;
  padding-top: 5px;
}

.widget-actions {
  align-self: start;
}

.widget-title {
  align-self: start;
  padding-top: 7px;
}

.widget-title strong {
  font-size: 12px;
  line-height: 1;
}

.size-control,
.plug {
  width: 27px;
  height: 27px;
}

/* AUX-cord connection symbol, rotated 45 degrees inside the existing square control. */
.plug::before,
.plug::after,
.plug-glyph::before,
.plug-glyph::after {
  content: "";
}

.plug::before {
  display: none;
}

.plug-glyph {
  position: relative;
  width: 17px;
  height: 7px;
  display: block;
  border: 0;
  border-radius: 0;
  transform: rotate(45deg);
  transform-origin: center;
}

.plug-glyph::before {
  position: absolute;
  left: 0;
  top: 2px;
  width: 10px;
  height: 3px;
  border: 1.4px solid currentColor;
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: transparent;
  box-sizing: border-box;
}

.plug-glyph::after {
  position: absolute;
  right: 0;
  top: 1px;
  width: 6px;
  height: 5px;
  border: 1.4px solid currentColor;
  border-radius: 2px 3px 3px 2px;
  background:
    linear-gradient(90deg, transparent 0 35%, currentColor 35% 48%, transparent 48% 68%, currentColor 68% 80%, transparent 80%);
  box-sizing: border-box;
}

.plug.is-target .plug-glyph {
  opacity: 0;
}

/* Footer becomes a clearer control strip. */
.widget-footer {
  flex: 0 0 38px;
  min-height: 38px;
  padding: 3px 12px 8px;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  gap: 10px;
}

.widget-footer .context-status,
.widget-footer .size-label {
  font-size: 8px;
  line-height: 28px;
}

.footer-filter-toggle {
  min-width: 132px;
  height: 29px;
  padding: 0 12px 0 13px;
  border-radius: 9px;
  font-size: 8.5px;
  font-weight: 650;
}

.footer-filter-toggle b {
  font-size: 10px;
}

.footer-filter-menu {
  width: 268px;
  max-height: 320px;
  padding: 8px;
}

.footer-filter-menu > label {
  min-height: 34px;
}

.footer-filter-options > button {
  min-height: 42px;
}

/* Parent filter is one searchable picker: text narrows the parent list. */
.parent-footer-filter .footer-filter-search {
  position: sticky;
  top: 0;
  z-index: 2;
}

.root-footer-filter .footer-filter-menu {
  width: 240px;
}

/* Portrait-only System Tree uses the full pane vertically and horizontally. */
.widget[data-kind="systemTree"] .widget-body {
  padding-top: 2px;
}

.widget[data-kind="systemTree"] .portrait-tree {
  width: 100%;
  height: 100%;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.widget[data-kind="systemTree"] .portrait-tree > .tree-line {
  width: 100%;
}

.widget[data-kind="systemTree"] .tree-node {
  max-width: calc(100% - 6px);
}

/* Dock group tray is a literal slide-UP drawer from behind the dock. */
.dock-tray {
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px));
  opacity: 0;
  transform: translate(-50%, 74px);
  clip-path: inset(100% 0 0 0 round 18px);
  transition:
    opacity .12s ease,
    transform .28s cubic-bezier(.18,.84,.2,1),
    clip-path .28s cubic-bezier(.18,.84,.2,1);
}

.dock-tray.is-open {
  opacity: 1;
  transform: translate(-50%, 0);
  clip-path: inset(0 0 0 0 round 18px);
}

.dock-tray-tools > button {
  transform: translateY(8px);
  opacity: 0;
  transition:
    transform .22s cubic-bezier(.2,.78,.2,1),
    opacity .14s ease,
    background .13s ease;
}

.dock-tray.is-open .dock-tray-tools > button {
  transform: translateY(0);
  opacity: 1;
}

.dock-tray.is-open .dock-tray-tools > button:nth-child(2) { transition-delay: .025s; }
.dock-tray.is-open .dock-tray-tools > button:nth-child(3) { transition-delay: .05s; }
.dock-tray.is-open .dock-tray-tools > button:nth-child(4) { transition-delay: .075s; }

/* Light-mode equivalents. */
.atom-shell[data-background="white"] .footer-filter-toggle {
  background: rgba(207,212,215,.56);
  border-color: rgba(58,68,74,.09);
}

.atom-shell[data-background="white"] .plug-glyph::after {
  background:
    linear-gradient(90deg, transparent 0 35%, currentColor 35% 48%, transparent 48% 68%, currentColor 68% 80%, transparent 80%);
}


/* =========================================================
   Iteration 11 — UNIVERSAL SEARCH + HIERARCHICAL SCOPE
   Minimal collapsed footer; full independent power in its drawer.
   ========================================================= */

.footer-filter-menu {
  width: 310px;
  max-height: 390px;
  gap: 8px;
  padding: 9px;
  overflow: visible;
}

.universal-filter-search {
  position: relative;
  z-index: 4;
  min-height: 38px !important;
  display: grid !important;
  grid-template-columns: 16px minmax(0,1fr) !important;
  align-items: center;
  gap: 6px;
  padding: 5px 9px !important;
  border-color: rgba(255,255,255,.075) !important;
  background: rgba(255,255,255,.032) !important;
}

.universal-filter-search > span {
  color: var(--muted);
  font-size: 11px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.universal-filter-search input {
  height: 27px;
  font-size: 9.5px;
}

.scope-stack {
  min-height: 0;
  max-height: 305px;
  display: grid;
  gap: 6px;
  overflow: visible;
}

.scope-field {
  position: relative;
  display: grid;
  grid-template-columns: 78px minmax(0,1fr);
  align-items: center;
  gap: 7px;
  min-height: 36px;
}

.scope-field-label {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.scope-field-label > span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 720;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.scope-field-label > b {
  width: fit-content;
  color: rgba(201,181,229,.76);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.scope-combo {
  position: relative;
  min-width: 0;
}

.scope-combo > input {
  width: 100%;
  height: 32px;
  padding: 0 29px 0 9px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 8px;
  outline: 0;
  background: rgba(255,255,255,.025);
  font-size: 9px;
}

.scope-combo > input:focus {
  border-color: rgba(111,147,179,.30);
  background: rgba(255,255,255,.04);
}

.scope-field.is-locked .scope-combo > input {
  color: rgba(214,196,238,.82);
  border-color: rgba(159,128,205,.15);
  background: rgba(126,96,172,.10);
  cursor: default;
}

.scope-clear {
  position: absolute;
  z-index: 4;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
}

.scope-clear:hover {
  color: var(--ink);
  background: rgba(255,255,255,.055);
}

.scope-options {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 180px;
  padding: 5px;
  display: none;
  gap: 3px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 9px;
  background: rgba(27,31,36,.97);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 12px 24px rgba(0,0,0,.32);
}

.scope-field:not(.is-locked):focus-within .scope-options,
.scope-field:not(.is-locked).is-active .scope-options {
  display: grid;
}

.scope-options > button {
  min-height: 36px;
  padding: 6px 7px;
  display: grid;
  gap: 2px;
  color: inherit;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}

.scope-options > button:hover,
.scope-options > button.is-selected {
  border-color: rgba(111,147,179,.18);
  background: rgba(123,94,170,.20);
}

.scope-options strong,
.scope-options small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-options strong {
  font-size: 8.7px;
}

.scope-options small {
  color: var(--muted);
  font-size: 7.2px;
}

/* A menu with several ancestor controls may scroll, but data never does just
   because filtering exists. */
.footer-filter.is-open .footer-filter-menu {
  overflow: visible;
}

.widget[data-kind="doors"] .footer-filter-menu,
.widget[data-kind="keyCopies"] .footer-filter-menu {
  width: 330px;
}

/* Connected context locks only the known scope field; remaining filters stay live. */
.footer-filter-toggle:disabled {
  opacity: 1;
}

/* Light mode hierarchy. */
.atom-shell[data-background="white"] .universal-filter-search,
.atom-shell[data-background="white"] .scope-combo > input {
  color: var(--ink);
  border-color: rgba(58,68,74,.085) !important;
  background: rgba(255,255,255,.28) !important;
}

.atom-shell[data-background="white"] .scope-field.is-locked .scope-combo > input {
  color: rgba(84,60,118,.82);
  border-color: rgba(126,98,167,.16) !important;
  background: rgba(180,161,209,.28) !important;
}

.atom-shell[data-background="white"] .scope-options {
  color: var(--ink);
  border-color: rgba(58,68,74,.10);
  background: rgba(232,235,237,.98);
  box-shadow: 0 10px 22px rgba(54,63,69,.14);
}

.atom-shell[data-background="white"] .scope-options > button:hover,
.atom-shell[data-background="white"] .scope-options > button.is-selected {
  background: rgba(180,161,209,.34);
  border-color: rgba(128,99,171,.18);
}


/* Iteration 12 — ATOM-native key/building tool icons */
.dock-glyph,
.tray-glyph {
  color: rgba(245,247,248,.94);
}
.dock-glyph svg,
.tray-glyph svg {
  width: 23px;
  height: 23px;
  display: block;
  overflow: visible;
}
.tray-glyph svg {
  width: 21px;
  height: 21px;
}
.dock-glyph svg *,
.tray-glyph svg * {
  vector-effect: non-scaling-stroke;
}
.atom-shell[data-background="white"] .dock-glyph,
.atom-shell[data-background="white"] .tray-glyph {
  color: rgba(35,43,49,.90);
}
.atom-dock button[data-dock-group].is-open .dock-glyph {
  color: rgba(222,205,245,.98);
}


/* =========================================================
   Iteration 13 — SHARED HIERARCHY LANGUAGE
   Key Systems keeps its distinct branching icon.
   Actual tree containers share one familiar org-chart symbol.
   ========================================================= */

.widget[data-kind="buildingTree"] .widget-body,
.widget[data-kind="organizationTree"] .widget-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 2px;
}

.widget[data-kind="buildingTree"] .context-chips,
.widget[data-kind="organizationTree"] .context-chips {
  flex: 0 0 auto;
}

.widget[data-kind="buildingTree"] .portrait-tree,
.widget[data-kind="organizationTree"] .portrait-tree {
  width: 100%;
  height: 100%;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hierarchy-tree > .tree-line {
  width: 100%;
}

.hierarchy-tree .hierarchy-node {
  max-width: calc(100% - 6px);
}

.hierarchy-tree .hierarchy-root {
  border-color: rgba(111,147,179,.24);
}

.hierarchy-tree .hierarchy-group {
  background: rgba(31,35,40,.48);
}

.hierarchy-tree .hierarchy-leaf {
  background: rgba(31,35,40,.58);
}

.atom-shell[data-background="white"] .hierarchy-tree .hierarchy-group,
.atom-shell[data-background="white"] .hierarchy-tree .hierarchy-leaf {
  background: rgba(207,212,215,.70);
}

/* The tree icon should read consistently at both dock sizes. */
.dock-glyph svg,
.tray-glyph svg {
  stroke-width: 2.05;
}

.dock-tray-tools button[data-tray-kind="systemTree"] .tray-glyph svg,
.dock-tray-tools button[data-tray-kind="buildingTree"] .tray-glyph svg,
.dock-tray-tools button[data-tray-kind="organizationTree"] .tray-glyph svg {
  width: 22px;
  height: 22px;
}


/* =========================================================
   Iteration 14 — TETHERED VERTICAL TOOL DRAWERS
   Parent tools open a narrow drawer directly upward from the clicked dock item.
   ========================================================= */

.dock-tray {
  left: var(--drawer-x, 50%);
  bottom: var(--drawer-bottom, 84px);
  width: 68px;
  max-width: 68px;
  min-width: 68px;
  padding: 7px 5px 8px;
  border-radius: 17px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 48px);
  clip-path: inset(100% 0 0 0 round 17px);
  transform-origin: 50% 100%;
  transition:
    opacity .12s ease,
    transform .30s cubic-bezier(.17,.84,.2,1),
    clip-path .30s cubic-bezier(.17,.84,.2,1);
}

.dock-tray.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  clip-path: inset(0 0 0 0 round 17px);
}

.dock-tray-tools {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
}

.dock-tray-tools > button {
  width: 58px;
  min-width: 58px;
  height: 57px;
  padding: 4px 2px 3px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 38px 11px;
  place-items: center;
  gap: 1px;
  text-align: center;
  border-radius: 11px;
  background: transparent;
  transform: translateY(14px);
  opacity: 0;
  transition:
    transform .22s cubic-bezier(.2,.78,.2,1),
    opacity .14s ease,
    background .13s ease,
    border-color .13s ease;
}

.dock-tray.is-open .dock-tray-tools > button {
  transform: translateY(0);
  opacity: 1;
}

.dock-tray.is-open .dock-tray-tools > button:nth-child(1) { transition-delay: .10s; }
.dock-tray.is-open .dock-tray-tools > button:nth-child(2) { transition-delay: .075s; }
.dock-tray.is-open .dock-tray-tools > button:nth-child(3) { transition-delay: .05s; }
.dock-tray.is-open .dock-tray-tools > button:nth-child(4) { transition-delay: .025s; }
.dock-tray.is-open .dock-tray-tools > button:nth-child(5) { transition-delay: 0s; }

.dock-tray-tools > button:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.050);
  border-color: rgba(255,255,255,.085);
}

.dock-tray-tools > button > small {
  display: block;
  width: 54px;
  margin: 0;
  color: var(--muted);
  font-size: 6.5px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The icon tile stays the same physical size, but the artwork now fills it. */
.dock-glyph svg {
  width: 29px;
  height: 29px;
}

.tray-glyph {
  width: 36px;
  height: 36px;
}

.tray-glyph svg {
  width: 29px;
  height: 29px;
}

/* Thinner ATOM-native line work; preserve clean scaling at magnified dock sizes. */
.dock-glyph svg,
.tray-glyph svg {
  stroke-width: 1.50 !important;
}

.dock-glyph svg *,
.tray-glyph svg * {
  vector-effect: non-scaling-stroke;
}

/* Tree icons get the same fill ratio as every other tool icon. */
.dock-tray-tools button[data-tray-kind="systemTree"] .tray-glyph svg,
.dock-tray-tools button[data-tray-kind="buildingTree"] .tray-glyph svg,
.dock-tray-tools button[data-tray-kind="organizationTree"] .tray-glyph svg {
  width: 29px;
  height: 29px;
}

/* Light mode keeps identical geometry. */
.atom-shell[data-background="white"] .dock-tray-tools > button:hover {
  background: rgba(80,90,96,.065);
  border-color: rgba(58,68,74,.08);
}


/* =========================================================
   Iteration 15 — HEADER CONTROLS, TRUE DROP-UPS, BACKGROUND PALETTE
   ========================================================= */

/* Header is just a clean control/title line at the very top of the pane. */
.widget {
  padding-top: 32px;
}

.widget-header {
  height: 32px;
  min-height: 32px;
  padding: 2px 8px 0;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}

.window-controls {
  height: auto;
  padding-top: 4px;
  gap: 7px;
  align-self: start;
}

.widget-actions {
  padding-top: 4px;
  align-self: start;
}

.widget-title {
  padding-top: 2px;
  align-self: start;
  min-height: 20px;
}

.widget-title strong {
  display: block;
  margin: 0;
  padding: 0 7px 2px;
  font-size: 12px;
  font-weight: 670;
  line-height: 17px;
  overflow: visible;
  text-overflow: clip;
}

/* macOS-like colored controls: close / clear / size. */
.control,
.size-control,
.plug {
  width: 13px;
  min-width: 13px;
  height: 13px;
  min-height: 13px;
  padding: 0;
  border: 0 !important;
  border-radius: 50% !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.13) !important;
}

.control.close {
  background: #df6964;
}

.control.clear {
  background: #d69a49;
  opacity: .34;
}

.control.clear:not(:disabled) {
  opacity: 1;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.12),
    0 0 0 3px rgba(214,154,73,.11) !important;
}

.size-control {
  background: #4f9f9c !important;
  color: transparent !important;
  font-size: 0 !important;
}

.size-control:hover {
  background: #63b1ae !important;
}

.plug {
  position: relative;
  overflow: visible;
  background: #6f93b3 !important;
  color: transparent !important;
  font-size: 0 !important;
}

.plug:hover {
  background: #7f9fba !important;
}

.plug::before,
.plug::after,
.plug-glyph {
  display: none !important;
}

.plug.is-source {
  background: #9b83ca !important;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 0 0 4px rgba(111,147,179,.16) !important;
}

.plug.is-target::after {
  content: "";
  display: block !important;
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(111,147,179,.58);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 3px rgba(111,147,179,.10);
}

/* Footer filtering is always a DROP-UP. Scope pickers also open upward. */
.footer-filter-menu {
  top: auto !important;
  bottom: calc(100% + 8px) !important;
  transform-origin: 50% 100% !important;
  z-index: 60;
}

.scope-options {
  top: auto !important;
  bottom: calc(100% + 4px) !important;
  transform-origin: 50% 100%;
}

/* Main rail background palette. */
.rail-actions {
  position: relative;
}

.background-picker-wrap {
  position: relative;
}

.palette-icon {
  width: 18px;
  height: 18px;
  display: grid;
  grid-template-columns: repeat(2,5px);
  grid-template-rows: repeat(2,5px);
  place-content: center;
  gap: 2px;
}

.palette-icon i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .82;
}

.palette-icon i:nth-child(2) { opacity: .58; }
.palette-icon i:nth-child(3) { opacity: .42; }
.palette-icon i:nth-child(4) { opacity: .68; }

.background-palette {
  position: absolute;
  z-index: 180;
  top: calc(100% + 8px);
  right: 0;
  width: 164px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 5px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 13px;
  background: rgba(28,32,37,.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    0 14px 30px rgba(0,0,0,.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px) scale(.97);
  transform-origin: 100% 0;
  transition: opacity .13s ease, transform .15s ease;
}

.background-palette.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.background-palette > button {
  min-width: 0;
  height: 43px;
  padding: 5px 3px 4px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.background-palette > button:hover,
.background-palette > button.is-selected {
  color: var(--ink);
  border-color: rgba(255,255,255,.075);
  background: rgba(255,255,255,.045);
}

.background-palette > button.is-selected {
  box-shadow: inset 0 0 0 1px rgba(151,124,197,.16);
}

.background-palette > button span {
  font-size: 7px;
}

.background-swatch {
  width: 22px;
  height: 16px;
  display: block;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.swatch-dark   { background: #1b1e22; }
.swatch-white  { background: #e8ebed; border-color: rgba(25,32,38,.14); }
.swatch-grey   { background: #292d31; }
.swatch-blue   { background: #23303b; }
.swatch-green  { background: #24312b; }
.swatch-pink   { background: #332831; }
.swatch-red    { background: #332422; }
.swatch-purple { background: #2d2738; }
.swatch-orange { background: #342b21; }

/* Muted drafting-surface palettes. Crystal panes remain unchanged. */
.atom-shell[data-background="dark"] {
  --paper: #1b1e22;
  --paper-deep: #171a1e;
  --paper-soft: #20242a;
}

.atom-shell[data-background="grey"] {
  --paper: #292d31;
  --paper-deep: #22262a;
  --paper-soft: #30353a;
}

.atom-shell[data-background="blue"] {
  --paper: #23303b;
  --paper-deep: #1c2730;
  --paper-soft: #2a3945;
}

.atom-shell[data-background="green"] {
  --paper: #24312b;
  --paper-deep: #1d2823;
  --paper-soft: #2b3a32;
}

.atom-shell[data-background="pink"] {
  --paper: #332831;
  --paper-deep: #2a2028;
  --paper-soft: #3b2f39;
}

.atom-shell[data-background="red"] {
  --paper: #332422;
  --paper-deep: #2a1d1c;
  --paper-soft: #3b2a27;
}

.atom-shell[data-background="purple"] {
  --paper: #2d2738;
  --paper-deep: #241f2d;
  --paper-soft: #352e42;
}

.atom-shell[data-background="orange"] {
  --paper: #342b21;
  --paper-deep: #2a221b;
  --paper-soft: #3d3327;
}

/* Light is still the existing light crystal treatment. */
.atom-shell[data-background="white"] {
  --paper: #e8ebed;
  --paper-deep: #dfe3e6;
  --paper-soft: #edf0f2;
}

/* Palette itself follows light mode without becoming bright white. */
.atom-shell[data-background="white"] .background-palette {
  color: var(--ink);
  border-color: rgba(53,65,72,.10);
  background: rgba(232,235,237,.97);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.68),
    0 12px 26px rgba(54,63,69,.14);
}

.atom-shell[data-background="white"] .background-palette > button:hover,
.atom-shell[data-background="white"] .background-palette > button.is-selected {
  border-color: rgba(53,65,72,.08);
  background: rgba(80,90,96,.07);
}



/* =========================================================
   Iteration 16 — SINGLE MATERIAL + CONTROL LEGEND
   Appearance is now one crystal system over selectable workbench colors.
   ========================================================= */

/* Give the hardware controls breathing room from the crystal edge. */
.widget {
  padding-top: 38px;
}

.widget-header {
  height: 38px;
  min-height: 38px;
  padding: 6px 12px 0;
}

.window-controls {
  padding-top: 3px;
  gap: 8px;
}

.widget-actions {
  padding-top: 3px;
}

.widget-title {
  padding-top: 3px;
  min-height: 23px;
}

.widget-title strong {
  padding-bottom: 3px;
  line-height: 18px;
}

/* Persistent color language legend in the app rail. */
.control-legend {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  color: var(--muted);
  white-space: nowrap;
}

.control-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: .015em;
}

.legend-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}

.legend-close   { background: #df6964; }
.legend-clear   { background: #d69a49; }
.legend-size    { background: #4f9f9c; }
.legend-connect { background: #6f93b3; }

/* There is no second theme/material mode anymore. */
#themeToggle {
  display: none !important;
}

/* White is simply another workbench background. It adapts contrast while the
   crystal construction remains the same material system. */
.atom-shell[data-background="white"] {
  --paper: #f0f1f1;
  --paper-deep: #e4e6e7;
  --paper-soft: #f6f7f7;
  --ink: #20262b;
  --muted: rgba(40,49,55,.60);
  --cable: rgba(108,86,143,.58);
  --selection: rgba(118,89,168,.12);
  --selection-line: rgba(118,89,168,.30);
}

.atom-shell[data-background="white"],
.atom-shell[data-background="white"] .workspace-page {
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 50% 38%, rgba(255,255,255,.30), transparent 68%),
    linear-gradient(180deg, var(--paper-soft), var(--paper-deep));
}

.atom-shell[data-background="white"] .paper-grid {
  background-image:
    radial-gradient(circle, rgba(32,40,46,.10) .95px, transparent 1.18px),
    radial-gradient(circle, rgba(32,40,46,.030) .72px, transparent 1px);
}

.atom-shell[data-background="white"] .widget {
  background: rgba(255,255,255,.006);
  border-color: rgba(255,255,255,.82);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    inset 1px 0 0 rgba(255,255,255,.34),
    inset -1px 0 0 rgba(70,80,86,.055),
    inset 0 -1px 0 rgba(70,80,86,.07),
    0 15px 31px rgba(53,62,67,.11),
    0 3px 8px rgba(53,62,67,.06);
}

.atom-shell[data-background="white"] .data-row,
.atom-shell[data-background="white"] .summary-pill,
.atom-shell[data-background="white"] .table-head,
.atom-shell[data-background="white"] .context-chip,
.atom-shell[data-background="white"] .pinning-result,
.atom-shell[data-background="white"] .calc-screen {
  background: rgba(207,212,215,.70);
  border-color: rgba(58,68,74,.07);
  color: var(--ink);
}

.atom-shell[data-background="white"] .data-row:hover {
  background: rgba(196,202,206,.82);
}

.atom-shell[data-background="white"] .data-row.is-selected,
.atom-shell[data-background="white"] .context-chip {
  background: rgba(180,161,209,.48);
  border-color: rgba(128,99,171,.26);
}

.atom-shell[data-background="white"] .atom-rail,
.atom-shell[data-background="white"] .atom-dock,
.atom-shell[data-background="white"] .dock-tray {
  color: var(--ink);
}

.atom-shell[data-background="white"] .atom-rail {
  background: rgba(244,246,247,.17);
  border-color: rgba(255,255,255,.80);
}

.atom-shell[data-background="white"] .atom-dock,
.atom-shell[data-background="white"] .dock-tray {
  background: rgba(244,246,247,.12);
  border-color: rgba(255,255,255,.76);
}

.atom-shell[data-background="white"] .dock-glyph,
.atom-shell[data-background="white"] .tray-glyph {
  color: rgba(35,43,49,.90);
}

.atom-shell[data-background="white"] .background-palette {
  color: var(--ink);
  border-color: rgba(53,65,72,.10);
  background: rgba(232,235,237,.97);
}

/* Background palette naming after removal of the theme toggle. */
.swatch-white {
  background: #f0f1f1;
  border-color: rgba(25,32,38,.14);
}

/* Rail legend yields gracefully before crowding the app controls. */
@media (max-width: 1120px) {
  .control-legend {
    gap: 8px;
  }
  .control-legend > span {
    font-size: 0;
    gap: 0;
  }
  .legend-dot {
    width: 9px;
    height: 9px;
  }
}

@media (max-width: 760px) {
  .control-legend {
    display: none;
  }
}


/* =========================================================
   Iteration 17 — MOUSE AUTHORITY + ANCHORED RESIZE + SOFT PASTELS
   ========================================================= */

/* The visible dots stay compact, but the clickable target is generous.
   This makes controls decisively win over the drag surface. */
.control,
.size-control,
.plug {
  position: relative;
  width: 23px !important;
  min-width: 23px !important;
  height: 23px !important;
  min-height: 23px !important;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  touch-action: manipulation;
}

.control::before,
.size-control::before,
.plug::before {
  content: "";
  display: block !important;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.13);
}

.control.close::before {
  background: #df6964;
}

.control.clear::before {
  background: #d69a49;
  opacity: .34;
}

.control.clear:not(:disabled)::before {
  opacity: 1;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.12),
    0 0 0 3px rgba(214,154,73,.11);
}

.size-control::before {
  background: #4f9f9c;
}

.size-control:hover::before {
  background: #63b1ae;
}

.plug::before {
  background: #6f93b3;
}

.plug:hover::before {
  background: #7f9fba;
}

.plug.is-source::before {
  background: #9b83ca;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 0 0 4px rgba(111,147,179,.16);
}

.plug.is-target::after {
  inset: 0 !important;
}

/* Slightly rebalance the header around the larger invisible hit targets. */
.widget-header {
  padding-inline: 9px;
}

.window-controls {
  gap: 1px;
  margin-left: 0;
}

.widget-actions {
  margin-right: 0;
}

/* Resize stays anchored at top-left. Only overflow correction moves the pane,
   and left/top move with the same easing as the size itself. */
.widget.is-resizing {
  transition:
    width .30s cubic-bezier(.2,.74,.2,1),
    height .30s cubic-bezier(.2,.74,.2,1),
    left .30s cubic-bezier(.2,.74,.2,1),
    top .30s cubic-bezier(.2,.74,.2,1),
    border-color .16s ease,
    box-shadow .16s ease !important;
}

.widget.is-dragging {
  transition: box-shadow .12s ease !important;
}

/* Larger, readable legend. */
.control-legend {
  gap: 18px;
}

.control-legend > span {
  gap: 7px;
  font-size: 10px;
  font-weight: 680;
}

.legend-dot {
  width: 11px;
  height: 11px;
}

/* Vertical slide-up drawer gets dock-like pointer magnification. */
.dock-tray-tools > button {
  --tray-scale: 1;
  --tray-shift: 0px;
}

.dock-tray.is-open .dock-tray-tools > button {
  transform: translateX(var(--tray-shift)) scale(var(--tray-scale));
  transform-origin: 50% 50%;
  transition:
    transform .115s cubic-bezier(.2,.78,.2,1),
    opacity .14s ease,
    background .13s ease,
    border-color .13s ease;
}

.dock-tray.is-open .dock-tray-tools > button:hover {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.09);
}

.dock-tray .tray-glyph,
.dock-tray .tray-glyph svg {
  transform-origin: center;
}

/* Shadowed pastel workbench colors — softer and less brown/burnt. */
.swatch-grey   { background: #59616a; }
.swatch-blue   { background: #5b7185; }
.swatch-green  { background: #5c7467; }
.swatch-pink   { background: #786675; }
.swatch-red    { background: #7b6260; }
.swatch-purple { background: #6b627d; }
.swatch-orange { background: #7d6d59; }

.atom-shell[data-background="grey"] {
  --paper: #505860;
  --paper-deep: #3d444a;
  --paper-soft: #68717a;
}

.atom-shell[data-background="blue"] {
  --paper: #526a7e;
  --paper-deep: #3f5364;
  --paper-soft: #6c8498;
}

.atom-shell[data-background="green"] {
  --paper: #536b5e;
  --paper-deep: #405448;
  --paper-soft: #6c8475;
}

.atom-shell[data-background="pink"] {
  --paper: #705e6c;
  --paper-deep: #574a54;
  --paper-soft: #897482;
}

.atom-shell[data-background="red"] {
  --paper: #735a58;
  --paper-deep: #5a4644;
  --paper-soft: #8b716e;
}

.atom-shell[data-background="purple"] {
  --paper: #625a75;
  --paper-deep: #4d475c;
  --paper-soft: #7b728d;
}

.atom-shell[data-background="orange"] {
  --paper: #74634f;
  --paper-deep: #594c3d;
  --paper-soft: #8e7a62;
}

/* Keep the pastel surfaces in shadow rather than turning them into flat color. */
.atom-shell:not([data-background="dark"]):not([data-background="white"]),
.atom-shell:not([data-background="dark"]):not([data-background="white"]) .workspace-page {
  background:
    radial-gradient(1200px 760px at 48% 32%, rgba(255,255,255,.075), transparent 62%),
    radial-gradient(900px 600px at 72% 78%, rgba(0,0,0,.10), transparent 68%),
    linear-gradient(180deg, var(--paper-soft) 0%, var(--paper) 48%, var(--paper-deep) 100%);
}

@media (max-width: 1120px) {
  .control-legend {
    gap: 12px;
  }
  .control-legend > span {
    font-size: 9px;
    gap: 5px;
  }
  .legend-dot {
    width: 10px;
    height: 10px;
  }
}


/* =========================================================
   Iteration 18 — ATOM SEMANTIC WORKBENCH LANGUAGE
   Global lock, readable data density, spreadsheet containers,
   focused modal transactions, and contextual dock stack.
   ========================================================= */

:root {
  --sem-green: #6ca77c;
  --sem-red: #df6964;
  --sem-amber: #d69a49;
  --sem-purple: #6f93b3;
  --sem-blue: #6f93b3;
  --sem-teal: #4f9f9c;
  --sem-grey: #7d848a;
}

/* ---------- main rail: global workspace lock + density ---------- */

.workspace-lock {
  width: 54px;
  height: 28px;
  padding: 2px;
  border: 0;
  color: var(--ink);
  background: transparent;
  border-radius: 999px;
}

.lock-track {
  position: relative;
  width: 48px;
  height: 24px;
  display: block;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.15);
}

.lock-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  box-shadow: 0 1px 4px rgba(0,0,0,.20);
  transition: transform .24s cubic-bezier(.2,.78,.2,1), background .18s ease;
}

.padlock-icon {
  position: absolute;
  z-index: 2;
  left: 7px;
  top: 8px;
  width: 8px;
  height: 7px;
  border: 1.4px solid currentColor;
  border-radius: 1.5px;
  opacity: .76;
  transition: transform .24s cubic-bezier(.2,.78,.2,1), opacity .18s ease;
}

.padlock-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -6px;
  width: 4px;
  height: 5px;
  border: 1.4px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  transform-origin: 0 100%;
  transition: transform .20s ease, translate .20s ease;
}

.workspace-lock[data-locked="true"] .lock-thumb,
.workspace-lock[data-locked="true"] .padlock-icon {
  transform: translateX(25px);
}

.workspace-lock[data-locked="true"] .lock-thumb {
  background: rgba(125,132,138,.35);
}

.workspace-lock[data-locked="false"] .padlock-icon::before {
  transform: translate(3px,-1px) rotate(24deg);
}

.workspace-lock:hover .lock-track {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.055);
}

.workspace-lock.attention {
  animation: lockWiggle .48s cubic-bezier(.36,.07,.19,.97);
}

@keyframes lockWiggle {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-3px) rotate(-2deg); }
  40% { transform: translateX(3px) rotate(2deg); }
  60% { transform: translateX(-2px) rotate(-1deg); }
  80% { transform: translateX(2px) rotate(1deg); }
}

.density-glyph {
  width: 19px;
  height: 17px;
  display: grid;
  align-content: space-between;
}

.density-glyph i {
  height: 1px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  opacity: .76;
  transition: height .16s ease, transform .16s ease, opacity .16s ease;
}

.density-control[data-density="standard"] .density-glyph i {
  height: 2px;
}

.density-control[data-density="comfortable"] .density-glyph i {
  height: 3px;
  opacity: .88;
}

/* ---------- reactive semantic legend ---------- */

.control-legend {
  transition: opacity .11s ease, transform .16s ease;
}

.control-legend > span {
  transition: transform .18s cubic-bezier(.2,.78,.2,1), opacity .12s ease;
}

.control-legend .legend-label {
  font: inherit;
  color: inherit;
  opacity: 1;
  transition: opacity .12s ease .05s;
}

.control-legend.is-leaving > span {
  transform: translateX(-20px);
  opacity: 0;
}

.control-legend.is-leaving .legend-label {
  opacity: 0;
}

.control-legend.is-entering > span {
  animation: legendEnter .22s cubic-bezier(.2,.78,.2,1);
}

@keyframes legendEnter {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.legend-red,
.legend-close { background: var(--sem-red); }
.legend-amber,
.legend-clear { background: var(--sem-amber); }
.legend-green { background: var(--sem-green); }
.legend-purple,
.legend-connect { background: var(--sem-purple); }
.legend-blue { background: var(--sem-blue); }
.legend-teal,
.legend-size { background: var(--sem-teal); }
.legend-grey { background: var(--sem-grey); }

/* ---------- universal semantic color language ---------- */

.semantic-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .88em;
  font-weight: 680;
  line-height: 1;
  white-space: nowrap;
}

.semantic-good {
  color: color-mix(in srgb,var(--sem-green) 88%,white);
  background: color-mix(in srgb,var(--sem-green) 14%,transparent);
  border-color: color-mix(in srgb,var(--sem-green) 30%,transparent);
}

.semantic-bad {
  color: color-mix(in srgb,var(--sem-red) 90%,white);
  background: color-mix(in srgb,var(--sem-red) 14%,transparent);
  border-color: color-mix(in srgb,var(--sem-red) 30%,transparent);
}

.semantic-warning {
  color: color-mix(in srgb,var(--sem-amber) 92%,white);
  background: color-mix(in srgb,var(--sem-amber) 14%,transparent);
  border-color: color-mix(in srgb,var(--sem-amber) 30%,transparent);
}

.semantic-info {
  color: color-mix(in srgb,var(--sem-blue) 90%,white);
  background: color-mix(in srgb,var(--sem-blue) 14%,transparent);
  border-color: color-mix(in srgb,var(--sem-blue) 30%,transparent);
}

.semantic-inactive {
  color: color-mix(in srgb,var(--sem-grey) 86%,white);
  background: color-mix(in srgb,var(--sem-grey) 14%,transparent);
  border-color: color-mix(in srgb,var(--sem-grey) 28%,transparent);
}

/* ---------- workspace lock ---------- */

.workspace-locked .widget .control.close::before,
.workspace-locked .widget .size-control::before,
.workspace-locked .widget .plug::before {
  filter: saturate(.52);
  opacity: .48;
}

.workspace-locked .atom-dock .dock-apps > button,
.workspace-locked .dock-tray-tools > button,
.workspace-locked .page-create,
.workspace-locked .background-picker-wrap {
  opacity: .58;
}

.workspace-locked .widget .control.clear:not(:disabled)::before,
.workspace-locked .widget .footer-filter-slot,
.workspace-locked .widget .column-editor-slot {
  filter: none;
  opacity: 1;
}

.widget.locked-bounce {
  animation: lockedWidgetBounce .42s cubic-bezier(.36,.07,.19,.97);
}

@keyframes lockedWidgetBounce {
  0%,100% { transform: translateX(0); }
  28% { transform: translateX(-5px); }
  55% { transform: translateX(3px); }
  76% { transform: translateX(-1px); }
}

/* ---------- dock app tray + modal stack mode ---------- */

.atom-dock {
  overflow: visible !important;
}

.dock-apps {
  display: flex;
  align-items: center;
  gap: 5px;
  transition:
    transform .26s cubic-bezier(.2,.78,.2,1),
    opacity .18s ease,
    filter .18s ease;
}

.dock-stack {
  position: absolute;
  inset: 6px 10px;
  min-width: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(34px);
  transition:
    opacity .18s ease,
    transform .26s cubic-bezier(.2,.78,.2,1);
}

.dock-stack-item {
  max-width: 150px;
  padding: 7px 9px;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 46%,transparent);
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dock-stack-item.is-active {
  color: var(--ink);
  border-color: rgba(255,255,255,.09);
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.dock-stack > i {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  color: var(--muted);
  background: transparent !important;
  font-size: 11px;
  font-style: normal;
}

.atom-dock.modal-active .dock-apps {
  transform: translateY(62px);
  opacity: 0;
  pointer-events: none;
  filter: blur(3px);
}

.atom-dock.modal-active .dock-stack {
  opacity: 1;
  transform: translateY(0);
}

.has-modal .dock-tray {
  opacity: 0 !important;
  pointer-events: none !important;
}

.has-modal .page-edge,
.has-modal .page-create,
.has-modal .page-dots {
  pointer-events: none;
  opacity: .22;
}

/* ---------- sheet/table data view ---------- */

.sheet-table {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  overflow: hidden;
}

.sheet-head,
.sheet-row {
  display: grid;
  grid-template-columns: var(--sheet-columns);
  min-width: 0;
}

.sheet-head {
  min-height: 28px;
  align-items: stretch;
  border-bottom: 1px solid rgba(255,255,255,.075);
  background: rgba(255,255,255,.018);
}

.sheet-head-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,.045);
}

.sheet-head-cell > button {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  overflow: hidden;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: var(--data-head-size,12px);
  font-weight: var(--data-head-weight,690);
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sheet-details-head {
  justify-content: center;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .12em;
}

.sheet-rows {
  min-height: 0;
  overflow: hidden;
}

.sheet-row {
  min-height: var(--data-row-height,38px);
  align-items: stretch;
  color: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.045);
  background: rgba(255,255,255,.008);
  cursor: default;
  transition:
    background .12s ease,
    border-color .12s ease,
    box-shadow .12s ease;
}

.sheet-row:hover {
  background: rgba(255,255,255,.035);
}

.sheet-row.is-selected {
  background: color-mix(in srgb,var(--sem-purple) 17%,transparent);
  border-color: color-mix(in srgb,var(--sem-purple) 28%,transparent);
  box-shadow: inset 3px 0 0 color-mix(in srgb,var(--sem-purple) 72%,transparent);
}

.sheet-row.is-inactive {
  color: color-mix(in srgb,var(--ink) 48%,transparent);
  background: color-mix(in srgb,var(--sem-grey) 8%,transparent);
}

.sheet-row.is-inactive.is-selected {
  background: color-mix(in srgb,var(--sem-grey) 19%,transparent);
  border-color: color-mix(in srgb,var(--sem-grey) 30%,transparent);
  box-shadow: inset 3px 0 0 color-mix(in srgb,var(--sem-grey) 72%,transparent);
}

.sheet-row.is-invalid,
.sheet-row.is-invalid.is-selected {
  background: color-mix(in srgb,var(--sem-red) 17%,transparent);
  border-color: color-mix(in srgb,var(--sem-red) 30%,transparent);
  box-shadow: inset 3px 0 0 color-mix(in srgb,var(--sem-red) 76%,transparent);
}

.sheet-cell {
  min-width: 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.032);
  font-size: var(--data-font-size,14px);
  font-weight: var(--data-font-weight,610);
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sheet-cell > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-cell strong {
  font-weight: calc(var(--data-font-weight,610) + 65);
}

.sheet-details-cell {
  justify-content: center;
  padding: 0;
}

.details-button {
  width: 30px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  letter-spacing: .08em;
}

.details-button:hover {
  color: var(--ink);
  background: rgba(255,255,255,.055);
}

.cell-link,
.detail-relation,
.relation-picker,
.inventory-button {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: color-mix(in srgb,var(--sem-magenta) 86%,white);
  background: transparent;
  font: inherit;
  font-weight: 680;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cell-link:hover,
.detail-relation:hover,
.relation-picker:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cell-muted {
  color: var(--muted);
}

.inventory-button {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,255,255,.035);
  text-align: center;
}

.inventory-button:hover {
  background: rgba(255,255,255,.065);
}

/* Site-wide density affects data view text and the row height needed for it.
   Header/footer chrome remains unchanged. */
.atom-shell[data-density="compact"] {
  --data-font-size: 12.5px;
  --data-font-weight: 600;
  --data-head-size: 12px;
  --data-head-weight: 670;
  --data-row-height: 30px;
}

.atom-shell[data-density="standard"] {
  --data-font-size: 14px;
  --data-font-weight: 620;
  --data-head-size: 13.5px;
  --data-head-weight: 700;
  --data-row-height: 38px;
}

.atom-shell[data-density="comfortable"] {
  --data-font-size: 16px;
  --data-font-weight: 650;
  --data-head-size: 15.5px;
  --data-head-weight: 720;
  --data-row-height: 46px;
}

.atom-shell[data-density] .tree-node,
.atom-shell[data-density] .hierarchy-group,
.atom-shell[data-density] .hierarchy-leaf {
  font-size: var(--data-font-size) !important;
  font-weight: var(--data-font-weight);
  line-height: 1.2;
}

/* ---------- column editor ---------- */

.column-editor-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.column-editor {
  position: relative;
}

.column-editor-toggle {
  min-width: 52px;
  height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 8px;
  font-weight: 650;
}

.column-editor-toggle:hover {
  color: var(--ink);
  background: rgba(255,255,255,.05);
}

.column-editor-menu {
  position: absolute;
  z-index: 85;
  right: 0;
  bottom: calc(100% + 8px);
  width: 284px;
  max-height: 330px;
  padding: 8px;
  overflow-y: auto;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 13px;
  background: rgba(28,32,37,.97);
  box-shadow: 0 16px 34px rgba(0,0,0,.32);
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px) scale(.97);
  transform-origin: 100% 100%;
  transition: opacity .13s ease, transform .15s ease;
}

.column-editor.is-open .column-editor-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.column-editor-meta {
  margin-bottom: 6px;
  padding: 2px 3px 7px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 8px;
}

.column-editor-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.column-choice {
  min-height: 31px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,.035);
}

.column-choice label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 10px;
}

.column-choice input {
  accent-color: var(--sem-magenta);
}

.column-local-controls {
  display: flex;
  gap: 2px;
}

.column-local-controls button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}

.column-local-controls button:hover {
  color: var(--ink);
  background: rgba(255,255,255,.055);
}

/* ---------- focused modal stack ---------- */

.focus-modal-layer {
  position: absolute;
  z-index: calc(300 + var(--modal-depth) * 10);
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: auto;
}

.focus-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,10,12,.46);
  backdrop-filter: blur(3px) grayscale(.16);
  -webkit-backdrop-filter: blur(3px) grayscale(.16);
}

.focus-modal-layer.is-suspended {
  pointer-events: none;
}

.focus-modal-layer.is-suspended .focus-modal-card {
  filter: grayscale(.70) brightness(.66);
  opacity: .56;
  transform: scale(.985);
}

.focus-modal-card {
  position: relative;
  width: var(--modal-width,var(--modal-size,80%));
  height: var(--modal-height,var(--modal-size,80%));
  min-width: min(560px,calc(100% - 34px));
  min-height: min(380px,calc(100% - 34px));
  max-width: calc(100% - 34px);
  max-height: calc(100% - 34px);
  display: grid;
  grid-template-rows: 44px minmax(0,1fr);
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 26px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.012)),
    rgba(27,31,36,.95);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.11),
    0 28px 70px rgba(0,0,0,.42);
  transition:
    width .22s ease,
    height .22s ease,
    filter .18s ease,
    opacity .18s ease,
    transform .18s ease;
}

.focus-modal-card.needs-attention {
  animation: modalAttention .38s cubic-bezier(.36,.07,.19,.97);
}

@keyframes modalAttention {
  0%,100% { transform: scale(1) translateX(0); }
  24% { transform: scale(1.006) translateX(-5px); }
  50% { transform: scale(1.006) translateX(4px); }
  74% { transform: scale(1.003) translateX(-2px); }
}

.focus-modal-header {
  min-height: 44px;
  padding: 6px 13px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  border-bottom: 1px solid rgba(255,255,255,.045);
}

.focus-modal-title {
  padding-top: 5px;
  text-align: center;
}

.focus-modal-title strong {
  font-size: 12px;
  font-weight: 690;
  white-space: nowrap;
}

.focus-controls,
.focus-modal-actions {
  display: flex;
  align-items: center;
  min-height: 27px;
}

.focus-modal-actions {
  justify-content: flex-end;
}

.primary-slider {
  position: relative;
  width: 48px;
  height: 26px;
  display: block;
}

.modal-primary,
.modal-cancel,
.modal-edit {
  position: absolute;
  top: 2px;
  width: 23px;
  height: 23px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.modal-primary::before,
.modal-cancel::before,
.modal-edit::before {
  content: "";
  width: 13px;
  height: 13px;
  display: block;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.14);
}

.modal-primary {
  left: 0;
  transition: transform .28s cubic-bezier(.2,.78,.2,1);
}

.modal-primary.is-save::before {
  background: var(--sem-green);
}

.modal-primary.is-close::before {
  background: var(--sem-red);
}

.modal-primary.is-after-save {
  transform: translateX(22px);
}

.modal-primary:disabled {
  opacity: .28;
}

.modal-cancel {
  left: 49px;
}

.modal-cancel::before {
  background: var(--sem-amber);
}

.modal-edit {
  position: relative;
  top: 0;
  right: 0;
}

.modal-edit::before {
  background: var(--sem-magenta);
}

.modal-edit.is-active::before {
  background: transparent;
  border: 2px solid var(--sem-magenta);
  box-shadow:
    0 0 0 3px color-mix(in srgb,var(--sem-magenta) 12%,transparent),
    inset 0 0 0 2px color-mix(in srgb,var(--sem-magenta) 32%,transparent);
}

.focus-modal-body {
  min-height: 0;
  padding: 18px 20px 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Density affects all record-data presentation inside focused views,
   but never modal header/footer chrome. */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px 16px;
}

.detail-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}

.detail-field > label {
  color: var(--muted);
  font-size: calc(var(--data-font-size) * .80);
  font-weight: var(--data-head-weight);
}

.detail-value,
.detail-field > input,
.detail-field > select,
.relation-picker,
.boolean-control {
  width: 100%;
  min-height: var(--data-row-height);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  font-size: var(--data-font-size);
  font-weight: var(--data-font-weight);
}

.detail-field > input,
.detail-field > select {
  outline: none;
}

.detail-field > input:focus,
.detail-field > select:focus,
.relation-picker:focus {
  border-color: color-mix(in srgb,var(--sem-magenta) 46%,transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--sem-magenta) 10%,transparent);
}

.detail-field.has-error > input,
.detail-field.has-error > select,
.detail-field.has-error .relation-picker {
  border-color: color-mix(in srgb,var(--sem-red) 65%,transparent);
}

.detail-field.has-warning > input,
.detail-field.has-warning > select,
.detail-field.has-warning .relation-picker {
  border-color: color-mix(in srgb,var(--sem-amber) 55%,transparent);
}

.field-error,
.field-warning {
  padding-left: 2px;
  font-size: calc(var(--data-font-size) * .75);
  font-weight: 620;
}

.field-error { color: var(--sem-red); }
.field-warning { color: var(--sem-amber); }

.error-pulse {
  animation: fieldPulse .48s ease;
}

@keyframes fieldPulse {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
}

.boolean-control {
  gap: 8px;
}

.boolean-control input {
  accent-color: var(--sem-green);
}

.detail-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.detail-section h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sensitive-value {
  letter-spacing: .04em;
}

.component-list,
.inventory-list {
  display: grid;
  gap: 6px;
}

.component-list > button,
.inventory-list > button {
  min-height: var(--data-row-height);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.4fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(255,255,255,.018);
  font-size: var(--data-font-size);
  text-align: left;
}

.component-list > button:hover,
.inventory-list > button:hover {
  background: rgba(255,255,255,.04);
}

.component-list span,
.inventory-list span,
.inventory-list em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.record-actions {
  margin-top: 28px;
  padding-top: 14px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255,255,255,.05);
}

.delete-record {
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb,var(--sem-red) 24%,transparent);
  border-radius: 8px;
  color: var(--sem-red);
  background: color-mix(in srgb,var(--sem-red) 7%,transparent);
  font-size: 9px;
  font-weight: 700;
}

.delete-record:hover {
  background: color-mix(in srgb,var(--sem-red) 13%,transparent);
}

.delete-blockers {
  margin-top: 9px;
  display: grid;
  gap: 4px;
  color: var(--sem-red);
  font-size: calc(var(--data-font-size) * .78);
}

.delete-blockers:empty {
  display: none;
}

/* ---------- selection/collection child pop-ups ---------- */

.selection-table {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  overflow: hidden;
}

.selection-head,
.selection-row,
.collection-row {
  display: grid;
  grid-template-columns: var(--selection-cols);
  min-width: 0;
}

.selection-head {
  min-height: 32px;
  align-items: center;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,.075);
  font-size: var(--data-head-size);
  font-weight: var(--data-head-weight);
}

.selection-head > span,
.selection-row > span,
.collection-row > span {
  min-width: 0;
  padding: 0 9px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.selection-rows {
  min-height: 0;
  overflow-y: auto;
}

.selection-rows.atom-scroll-has-y-v21 {
  width: calc(100% - 18px);
}

.selection-table:has(.selection-rows.atom-scroll-has-y-v21) .selection-head {
  margin-right: 18px;
}

.selection-row,
.collection-row {
  position: relative;
  min-height: var(--data-row-height);
  align-items: center;
  color: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.045);
  background: rgba(255,255,255,.008);
  font-size: var(--data-font-size);
  font-weight: var(--data-font-weight);
}

.selection-row {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.selection-row:hover,
.collection-row:hover {
  background: rgba(255,255,255,.035);
}

.selection-row.is-selected {
  background: color-mix(in srgb,var(--sem-green) 18%,transparent);
  border-color: color-mix(in srgb,var(--sem-green) 30%,transparent);
  box-shadow: inset 3px 0 0 color-mix(in srgb,var(--sem-green) 76%,transparent);
}

.selection-row.is-inactive,
.selection-row.is-inactive.is-selected {
  color: color-mix(in srgb,var(--ink) 48%,transparent);
  background: color-mix(in srgb,var(--sem-grey) 19%,transparent);
  border-color: color-mix(in srgb,var(--sem-grey) 30%,transparent);
  box-shadow: inset 3px 0 0 color-mix(in srgb,var(--sem-grey) 72%,transparent);
}

.collection-row {
  grid-template-columns: var(--selection-cols) 42px;
}

.collection-row .details-button {
  justify-self: center;
}

/* ---------- inventory focused views ---------- */

.inventory-summary {
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: var(--data-font-size);
}

.inventory-summary strong {
  color: var(--ink);
  font-size: calc(var(--data-font-size) * 1.05);
}

.keybox-grid {
  display: grid;
  grid-template-columns: repeat(8,minmax(0,1fr));
  gap: 7px;
}

.keybox-peg {
  aspect-ratio: 1 / .88;
  min-width: 0;
  padding: 7px 5px;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  gap: 5px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255,255,255,.015);
  text-align: left;
}

.keybox-peg b {
  color: var(--muted);
  font-size: 8px;
}

.keybox-peg span {
  overflow: hidden;
  color: var(--muted);
  font-size: calc(var(--data-font-size) * .72);
  line-height: 1.15;
  text-overflow: ellipsis;
}

.keybox-peg.is-used {
  border-color: color-mix(in srgb,var(--sem-green) 24%,transparent);
  background: color-mix(in srgb,var(--sem-green) 7%,transparent);
}

.keybox-peg.is-used b,
.keybox-peg.is-used span {
  color: var(--ink);
}

.inventory-pager {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.inventory-pager button {
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255,255,255,.025);
}

.stock-view {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  gap: 8px;
}

.stock-total,
.stock-row {
  min-height: var(--data-row-height);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 9px;
  background: rgba(255,255,255,.018);
  font-size: var(--data-font-size);
}

.stock-total strong {
  color: var(--sem-green);
  font-size: calc(var(--data-font-size) * 1.18);
}

.stock-note {
  padding: 8px 2px;
  color: var(--muted);
  font-size: calc(var(--data-font-size) * .82);
}

/* ---------- pointer-local destructive confirmation ---------- */

.pointer-confirm {
  position: absolute;
  z-index: 500;
  width: 182px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(28,32,37,.98);
  box-shadow: 0 14px 34px rgba(0,0,0,.38);
}

.pointer-confirm > span {
  grid-column: 1 / -1;
  padding: 2px 3px 5px;
  font-size: 9px;
  font-weight: 650;
}

.pointer-confirm button {
  height: 29px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
}

.confirm-cancel {
  color: var(--sem-amber);
  border: 1px solid color-mix(in srgb,var(--sem-amber) 25%,transparent);
  background: color-mix(in srgb,var(--sem-amber) 7%,transparent);
}

.confirm-delete {
  color: var(--sem-red);
  border: 1px solid color-mix(in srgb,var(--sem-red) 25%,transparent);
  background: color-mix(in srgb,var(--sem-red) 7%,transparent);
}

/* ---------- semantic control colors remain intentional ---------- */

.control.close::before { background: var(--sem-red); }
.control.clear::before { background: var(--sem-amber); }
.size-control::before { background: var(--sem-teal); }
.plug::before { background: var(--sem-purple); }

/* ---------- light workbench adjustments ---------- */

.atom-shell[data-background="white"] .sheet-head,
.atom-shell[data-background="white"] .sheet-row,
.atom-shell[data-background="white"] .detail-value,
.atom-shell[data-background="white"] .detail-field > input,
.atom-shell[data-background="white"] .detail-field > select,
.atom-shell[data-background="white"] .relation-picker,
.atom-shell[data-background="white"] .selection-row,
.atom-shell[data-background="white"] .collection-row,
.atom-shell[data-background="white"] .keybox-peg,
.atom-shell[data-background="white"] .stock-row,
.atom-shell[data-background="white"] .stock-total {
  border-color: rgba(58,68,74,.075);
  background: rgba(207,212,215,.50);
}

.atom-shell[data-background="white"] .focus-modal-card,
.atom-shell[data-background="white"] .column-editor-menu,
.atom-shell[data-background="white"] .pointer-confirm {
  color: var(--ink);
  border-color: rgba(53,65,72,.12);
  background: rgba(238,241,242,.97);
  box-shadow: 0 22px 54px rgba(54,63,69,.20);
}

.atom-shell[data-background="white"] .focus-backdrop {
  background: rgba(62,69,74,.24);
}

/* ---------- responsive focused views ---------- */

@media (max-width: 900px) {
  .focus-modal-card {
    min-width: calc(100% - 22px);
    max-width: calc(100% - 22px);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .keybox-grid {
    gap: 5px;
  }

  .keybox-peg {
    padding: 5px 3px;
  }

  .dock-stack-item {
    max-width: 92px;
  }
}

@media (max-width: 700px) {
  .workspace-lock {
    width: 50px;
  }

  .control-legend {
    display: none;
  }

  .keybox-grid {
    grid-template-columns: repeat(8,minmax(32px,1fr));
    overflow-x: auto;
  }
}


/* Iteration 18.1 — final interaction polish from workbench review. */

/* The Save → Close control is visibly one slider, not two unrelated dots. */
.primary-slider::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 13px;
  width: 23px;
  height: 1px;
  background: rgba(255,255,255,.10);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
}

/* Inventory and Details share the narrow action rail without widening data. */
.sheet-details-cell {
  gap: 2px;
}

.inventory-quick {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  line-height: 1;
}

.inventory-quick:hover {
  color: var(--ink);
  background: rgba(255,255,255,.055);
}

.relation-list {
  flex-wrap: wrap;
  gap: 5px 7px;
  white-space: normal;
}

.relation-list > i {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

/* During a focused task the rail remains visible for context/legend, but
   application actions cannot become a back door around the top modal. */
.has-modal .atom-rail .rail-actions {
  pointer-events: none;
  opacity: .42;
  filter: grayscale(.45);
}

/* Data-density changes text; semantic chips keep a stable physical footprint. */
.semantic-tag {
  min-height: 18px;
  padding-block: 2px;
  font-size: 9px;
  line-height: 1;
}

/* Keep the modal stack legible without making it navigational. */
.atom-dock.modal-active {
  min-width: min(620px,calc(100vw - 120px));
}

.atom-dock.modal-active .dock-stack {
  white-space: nowrap;
  overflow: hidden;
}

.atom-dock.modal-active .dock-stack-item {
  flex: 0 1 auto;
}

/* Disabled/locked customization dots remain recognizable but quiet. */
.workspace-locked .widget .control.close,
.workspace-locked .widget .size-control,
.workspace-locked .widget .plug {
  cursor: not-allowed;
}

/* Small destructive confirmation is truly pointer-local. */
.pointer-confirm {
  transform-origin: 50% 50%;
  animation: pointerConfirmIn .12s ease-out;
}

@keyframes pointerConfirmIn {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}


/* =========================================================
   Iteration 19 — TRUE GEL-GLASS DATA SURFACES
   Data rows/columns do not carry their own grey tiles. The crystal pane is
   the surface; only separators and intentional semantic states remain.
   ========================================================= */

.sheet-head,
.sheet-row,
.selection-head,
.selection-row,
.collection-row,
.table-head,
.data-row {
  background: transparent !important;
}

.sheet-row:hover,
.selection-row:hover,
.collection-row:hover,
.data-row:hover {
  background: transparent !important;
  border-color: rgba(255,255,255,.10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
}

/* Semantic state still earns color. Selection is blue, selector choice is
   green, inactive is grey, and invalid is red. */
.sheet-row.is-selected {
  background: color-mix(in srgb,var(--sem-purple) 15%,transparent) !important;
}

.sheet-row.is-inactive,
.sheet-row.is-inactive.is-selected {
  background: color-mix(in srgb,var(--sem-grey) 12%,transparent) !important;
}

.sheet-row.is-invalid,
.sheet-row.is-invalid.is-selected {
  background: color-mix(in srgb,var(--sem-red) 15%,transparent) !important;
}

.selection-row.is-selected {
  background: color-mix(in srgb,var(--sem-green) 15%,transparent) !important;
}

.selection-row.is-inactive,
.selection-row.is-inactive.is-selected {
  background: color-mix(in srgb,var(--sem-grey) 12%,transparent) !important;
}

/* White workbench gets the same transparent data treatment. Do not paint
   grey slabs behind the spreadsheet just because the drafting surface is light. */
.atom-shell[data-background="white"] .sheet-head,
.atom-shell[data-background="white"] .sheet-row,
.atom-shell[data-background="white"] .selection-head,
.atom-shell[data-background="white"] .selection-row,
.atom-shell[data-background="white"] .collection-row,
.atom-shell[data-background="white"] .table-head,
.atom-shell[data-background="white"] .data-row {
  background: transparent !important;
}

.atom-shell[data-background="white"] .sheet-row:hover,
.atom-shell[data-background="white"] .selection-row:hover,
.atom-shell[data-background="white"] .collection-row:hover,
.atom-shell[data-background="white"] .data-row:hover {
  background: transparent !important;
  border-color: rgba(58,68,74,.11);
  box-shadow: inset 0 0 0 1px rgba(58,68,74,.035);
}

.atom-shell[data-background="white"] .sheet-row.is-selected {
  background: color-mix(in srgb,var(--sem-purple) 13%,transparent) !important;
}

.atom-shell[data-background="white"] .sheet-row.is-inactive,
.atom-shell[data-background="white"] .sheet-row.is-inactive.is-selected {
  background: color-mix(in srgb,var(--sem-grey) 10%,transparent) !important;
}

.atom-shell[data-background="white"] .sheet-row.is-invalid,
.atom-shell[data-background="white"] .sheet-row.is-invalid.is-selected {
  background: color-mix(in srgb,var(--sem-red) 13%,transparent) !important;
}

.atom-shell[data-background="white"] .selection-row.is-selected {
  background: color-mix(in srgb,var(--sem-green) 13%,transparent) !important;
}

.atom-shell[data-background="white"] .selection-row.is-inactive,
.atom-shell[data-background="white"] .selection-row.is-inactive.is-selected {
  background: color-mix(in srgb,var(--sem-grey) 10%,transparent) !important;
}


/* =========================================================
   Iteration 20 — HEADER EDIT + FULL-SCREEN ESCAPE + FILTER SANDWICH
   The locked gel-glass material remains untouched. This pass only changes
   control placement, semantic edit color, sizing escape hatches, and filter
   geometry.
   ========================================================= */

:root {
  --sem-magenta: #8b72bd;
}

.legend-magenta { background: var(--sem-magenta); }

.widget-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
}

.edit-control {
  position: relative;
  width: 23px;
  min-width: 23px;
  height: 23px;
  min-height: 23px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
}

.edit-control::before {
  content: "";
  width: 13px;
  height: 13px;
  display: block;
  border-radius: 50%;
  background: var(--sem-magenta);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.13);
}

.edit-control:hover::before {
  background: color-mix(in srgb,var(--sem-magenta) 86%,white);
}

.edit-control[aria-pressed="true"]::before {
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 0 0 4px color-mix(in srgb,var(--sem-magenta) 16%,transparent);
}

.edit-control[hidden] {
  display: none !important;
}

.workspace-locked .widget .edit-control {
  opacity: 1;
  cursor: pointer;
}

.modal-edit::before {
  background: var(--sem-magenta);
}

.modal-edit.is-active::before {
  background: transparent;
  border: 2px solid var(--sem-magenta);
  box-shadow:
    0 0 0 3px color-mix(in srgb,var(--sem-magenta) 12%,transparent),
    inset 0 0 0 2px color-mix(in srgb,var(--sem-magenta) 32%,transparent);
}

.column-choice input {
  accent-color: var(--sem-magenta);
}

.widget-footer {
  min-height: 31px;
  flex: 0 0 31px;
  padding: 0 12px 7px;
  display: block;
}

.footer-filter-slot,
.footer-filter {
  width: 100%;
  min-width: 0;
  display: block;
}

.footer-filter-toggle {
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0;
  gap: 6px;
  color: var(--muted);
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 8.5px;
  font-weight: 670;
  letter-spacing: .025em;
}

.footer-filter-toggle:hover {
  color: var(--ink);
  background: transparent !important;
}

.footer-filter-toggle b {
  font-size: 10px;
}

.footer-filter-menu {
  left: 0 !important;
  right: 0 !important;
  bottom: calc(100% + 5px) !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: minmax(150px,.9fr) minmax(0,2.6fr);
  align-items: end;
  gap: 9px;
  overflow: visible !important;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 15px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.006)),
    rgba(22,26,31,.76);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 16px 34px rgba(0,0,0,.30);
  backdrop-filter: blur(18px) saturate(116%);
  -webkit-backdrop-filter: blur(18px) saturate(116%);
  transform: translateY(7px) scale(.985) !important;
  transform-origin: 50% 100% !important;
}

.footer-filter.is-open .footer-filter-menu {
  transform: translateY(0) scale(1) !important;
}

.footer-filter-menu > .universal-filter-search:only-child {
  grid-column: 1 / -1;
}

.universal-filter-search {
  min-height: 34px !important;
  margin: 0;
}

.scope-stack {
  min-height: 0;
  max-height: none;
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(128px,1fr));
  align-items: end;
  gap: 8px;
  overflow: visible;
}

.scope-field {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 4px;
}

.scope-field-label {
  min-height: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.scope-field-label > b {
  margin-left: auto;
}

.widget[data-size="portrait"] .footer-filter-menu {
  grid-template-columns: 1fr;
}

.widget[data-size="portrait"] .scope-stack {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.widget[data-size="landscape"] .scope-stack {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.widget[data-size="full"] .footer-filter-menu {
  grid-template-columns: minmax(220px,.75fr) minmax(0,3.25fr);
}

.widget[data-size="full"] .scope-stack {
  grid-template-columns: repeat(4,minmax(0,1fr));
}

.column-editor-host {
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
}

.column-editor-slot,
.column-editor-toggle {
  display: none !important;
}

.column-editor {
  position: absolute;
  z-index: 90;
  top: 24px;
  right: -23px;
  width: 0;
  height: 0;
}

.column-editor-menu {
  top: 8px;
  right: 0;
  bottom: auto;
  width: 300px;
  max-height: min(430px,calc(100vh - 150px));
  transform: translateY(-6px) scale(.97);
  transform-origin: 100% 0;
}

.column-editor.is-open .column-editor-menu {
  transform: translateY(0) scale(1);
}

.sheet-cell {
  min-width: 0;
}

.sheet-table,
.sheet-head,
.sheet-row {
  max-width: 100%;
}

.atom-shell[data-background="white"] .footer-filter-menu {
  border-color: rgba(53,65,72,.10);
  background:
    linear-gradient(180deg,rgba(255,255,255,.24),rgba(255,255,255,.08)),
    rgba(237,240,241,.80);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 14px 30px rgba(54,63,69,.16);
}

@media (max-width: 760px) {
  .footer-filter-menu,
  .widget[data-size="full"] .footer-filter-menu {
    grid-template-columns: 1fr;
  }

  .scope-stack,
  .widget[data-size="landscape"] .scope-stack,
  .widget[data-size="full"] .scope-stack {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .column-editor-menu {
    width: min(300px,calc(100vw - 44px));
  }
}


/* =========================================================
   Iteration 21 — CROSS-WORKSPACE GRAPH + UTILITY INSTRUMENTS
   Keeps the established crystal-pane material unchanged.
   ========================================================= */

/* Utility sizing: every utility uses Portrait width. Small is a little under
   one-third of Portrait height; Medium is the two-small instrument footprint. */
.widget[data-size="utility-small"],
.widget[data-size="utility-medium"] {
  width: clamp(330px, calc((100vw - 144px) / 4), 520px);
}

.widget[data-size="utility-small"] {
  height: clamp(90px, calc((100vh - 306px) / 6), 124px);
}

.widget[data-size="utility-medium"] {
  height: clamp(192px, calc((100vh - 282px) / 3), 260px);
}

.utility-widget {
  padding-top: 32px;
}

.utility-widget .utility-minimal-header {
  height: 32px;
  min-height: 32px;
  padding-top: 5px;
}

.utility-widget .widget-body {
  min-height: 0;
  height: 100%;
  padding: 5px 14px 12px;
}

.utility-widget .widget-title strong {
  font-size: 10px;
  font-weight: 660;
  color: var(--muted);
}

/* Heartbeat is instrumentation, not a dashboard. Only Close and Connect live
   in its invisible header; the body itself never accepts interaction. */
.heartbeat-widget {
  overflow: visible;
}

.heartbeat-widget .widget-body {
  pointer-events: none;
  display: grid;
  align-items: stretch;
}

.heartbeat-instrument {
  --heartbeat-speed: 3.8s;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  align-items: center;
  gap: 1px;
  color: var(--sem-blue);
}

.heartbeat-instrument.is-blue {
  --heartbeat-speed: 3.8s;
  color: var(--sem-blue);
}

.heartbeat-instrument.is-amber {
  --heartbeat-speed: 2.05s;
  color: var(--sem-amber);
}

.heartbeat-instrument.is-red {
  --heartbeat-speed: 1.05s;
  color: var(--sem-red);
}

.heartbeat-instrument.is-flat {
  color: color-mix(in srgb,var(--sem-grey) 64%,transparent);
}

.heartbeat-wave {
  width: 100%;
  height: 100%;
  min-height: 38px;
  overflow: visible;
}

.heartbeat-wave path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.heartbeat-trace {
  stroke-dasharray: 176 22;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 3px color-mix(in srgb,currentColor 24%,transparent));
  animation: atomHeartbeatTrace var(--heartbeat-speed) linear infinite;
}

.heartbeat-flatline {
  opacity: .56;
}

@keyframes atomHeartbeatTrace {
  from { stroke-dashoffset: 198; }
  to { stroke-dashoffset: 0; }
}

.heartbeat-instrument small {
  min-width: 0;
  padding: 0 5px;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 48%,transparent);
  font-size: 8px;
  font-weight: 570;
  line-height: 1.2;
  letter-spacing: .012em;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.heartbeat-instrument.is-flat small {
  color: color-mix(in srgb,var(--ink) 34%,transparent);
}

/* Small utilities keep their visual payload large enough to read without
   growing container chrome. */
.widget[data-kind="clock"] .utility-display,
.widget[data-kind="weather"] .utility-display {
  min-height: 100%;
  display: grid;
  place-items: center;
}

.widget[data-kind="clock"] .utility-display strong,
.widget[data-kind="weather"] .utility-display strong {
  font-size: clamp(24px,2.2vw,34px);
}

.widget[data-kind="clock"] .utility-display small,
.widget[data-kind="weather"] .utility-display small {
  font-size: 8px;
}

/* Cross-workspace cables literally continue through the workspace boundary. */
.cable-layer path.cross-workspace {
  stroke: color-mix(in srgb,var(--sem-purple) 72%,transparent);
  stroke-width: 2.1;
  opacity: .78;
}

.stage {
  position: relative;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  z-index: 108;
  top: 14px;
  bottom: 72px;
  width: 30px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity .16s ease,
    transform .20s cubic-bezier(.2,.78,.2,1),
    filter .16s ease;
}

.stage::before {
  left: 0;
  transform: translateX(-12px) scaleX(.72);
}

.stage::after {
  right: 0;
  transform: translateX(12px) scaleX(.72);
}

.stage.connection-edge-portal-left::before,
.stage.connection-edge-portal-right::after {
  opacity: 1;
  transform: translateX(0) scaleX(1);
  background: linear-gradient(
    90deg,
    color-mix(in srgb,var(--sem-purple) 18%,transparent),
    color-mix(in srgb,var(--sem-purple) 5%,transparent),
    transparent
  );
  border-inline-start: 1px solid color-mix(in srgb,var(--sem-purple) 54%,transparent);
  filter: drop-shadow(0 0 10px color-mix(in srgb,var(--sem-purple) 18%,transparent));
}

.stage.connection-edge-portal-right::after {
  background: linear-gradient(
    270deg,
    color-mix(in srgb,var(--sem-purple) 18%,transparent),
    color-mix(in srgb,var(--sem-purple) 5%,transparent),
    transparent
  );
  border-inline-start: 0;
  border-inline-end: 1px solid color-mix(in srgb,var(--sem-purple) 54%,transparent);
}

.stage.drag-edge-portal-left::before,
.stage.drag-edge-portal-right::after {
  opacity: .72;
  transform: translateX(0) scaleX(1);
  background: linear-gradient(90deg,rgba(255,255,255,.09),rgba(255,255,255,.025),transparent);
  border-inline-start: 1px solid rgba(255,255,255,.19);
}

.stage.drag-edge-portal-right::after {
  background: linear-gradient(270deg,rgba(255,255,255,.09),rgba(255,255,255,.025),transparent);
  border-inline-start: 0;
  border-inline-end: 1px solid rgba(255,255,255,.19);
}

/* Dock: labels must be readable before hover. Glyphs remain neutral because
   semantic color belongs to controls, cables, selections and state. */
.atom-dock small {
  margin-top: 2px;
  font-size: 9px !important;
  font-weight: 660;
  letter-spacing: .006em;
}

.dock-glyph,
.tray-glyph {
  color: rgb(137 142 150) !important;
  border-color: rgba(255,255,255,.11) !important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.018)),
    rgba(126,132,140,.10) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 0 0 1px rgba(255,255,255,.018),
    0 2px 5px rgba(0,0,0,.12) !important;
}

.dock-glyph svg {
  width: 23px;
  height: 23px;
  shape-rendering: geometricPrecision;
}

.tray-glyph svg {
  width: 22px;
  height: 22px;
  shape-rendering: geometricPrecision;
}

.atom-shell[data-background="white"] .dock-glyph,
.atom-shell[data-background="white"] .tray-glyph {
  color: rgb(116 122 130) !important;
  border-color: rgba(68,77,84,.10) !important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.48),rgba(255,255,255,.16)),
    rgba(126,132,140,.10) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.64),
    inset 0 0 0 1px rgba(67,76,83,.018),
    0 2px 5px rgba(54,63,69,.08) !important;
}

/* Opening a drawer is navigation state, not connection blue. */
.atom-dock button[data-dock-group].is-open .dock-glyph {
  color: rgb(137 142 150) !important;
  border-color: rgba(255,255,255,.15) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 3px 8px rgba(0,0,0,.16) !important;
}

.atom-dock button[data-dock-group].is-open small {
  color: var(--ink) !important;
}

/* Door codes reveal softly rather than appearing abruptly. */
.reveal-sensitive {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  font-size: 9px;
  font-weight: 650;
}

.reveal-sensitive:hover {
  color: var(--ink);
  border-color: rgba(255,255,255,.13);
  background: rgba(255,255,255,.045);
}

.sensitive-reveal {
  opacity: 0;
  transform: translateY(4px);
}

.sensitive-reveal.is-visible {
  animation: sensitiveRevealIn .22s ease forwards;
}

@keyframes sensitiveRevealIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .widget[data-size="utility-small"],
  .widget[data-size="utility-medium"] {
    width: min(420px, calc(100vw - 48px));
  }
}


/* =========================================================
   Iteration 22 — GLASS SELECTION + CONTEXTUAL BULK ACTIONS
   + APPLE-LAYOUT GEL CALCULATOR
   ========================================================= */

/* Selection is geometry, not semantic color. The record itself remains
   transparent; the selected block is described by a crystal perimeter. */
.sheet-row {
  position: relative;
}

.sheet-row.is-selected,
.sheet-row.is-selected:hover {
  background: transparent !important;
  border-color: rgba(255,255,255,.045) !important;
  box-shadow: none !important;
}

/* Selection itself is neutral glass. Independent semantic states still keep
   their meaning underneath that glass perimeter. */
.sheet-row.is-inactive.is-selected {
  background: color-mix(in srgb,var(--sem-grey) 12%,transparent) !important;
}

.sheet-row.is-invalid.is-selected {
  background: color-mix(in srgb,var(--sem-red) 15%,transparent) !important;
}

.sheet-row.is-selected::after {
  content: "";
  position: absolute;
  z-index: 4;
  left: -1px;
  right: -1px;
  top: 0;
  bottom: 0;
  pointer-events: none;
  border-left: 1px solid rgba(255,255,255,.27);
  border-right: 1px solid rgba(255,255,255,.27);
  background: transparent;
  box-shadow:
    inset 1px 0 0 rgba(255,255,255,.035),
    inset -1px 0 0 rgba(0,0,0,.04);
  transition:
    border-radius .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.sheet-row.is-selection-start::after {
  top: -1px;
  border-top: 1px solid rgba(255,255,255,.34);
  border-radius: 11px 11px 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 1px 0 0 rgba(255,255,255,.035),
    inset -1px 0 0 rgba(0,0,0,.04);
}

.sheet-row.is-selection-middle::after {
  border-radius: 0;
}

.sheet-row.is-selection-end::after {
  bottom: -1px;
  border-bottom: 1px solid rgba(255,255,255,.25);
  border-radius: 0 0 11px 11px;
  box-shadow:
    inset 0 -1px 0 rgba(0,0,0,.05),
    inset 1px 0 0 rgba(255,255,255,.035),
    inset -1px 0 0 rgba(0,0,0,.04);
}

.sheet-row.is-selection-single::after {
  top: -1px;
  bottom: -1px;
  border-top: 1px solid rgba(255,255,255,.34);
  border-bottom: 1px solid rgba(255,255,255,.25);
  border-radius: 11px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.05),
    inset 1px 0 0 rgba(255,255,255,.035),
    inset -1px 0 0 rgba(0,0,0,.04),
    0 4px 12px rgba(0,0,0,.08);
}

.atom-shell[data-background="white"] .sheet-row.is-selected::after {
  border-left-color: rgba(70,80,88,.22);
  border-right-color: rgba(70,80,88,.22);
  box-shadow:
    inset 1px 0 0 rgba(255,255,255,.55),
    inset -1px 0 0 rgba(70,80,88,.035);
}

.atom-shell[data-background="white"] .sheet-row.is-selection-start::after,
.atom-shell[data-background="white"] .sheet-row.is-selection-single::after {
  border-top-color: rgba(70,80,88,.24);
}

.atom-shell[data-background="white"] .sheet-row.is-selection-end::after,
.atom-shell[data-background="white"] .sheet-row.is-selection-single::after {
  border-bottom-color: rgba(70,80,88,.18);
}

/* Pointer-local contextual menu. Minimal actions; no toolbar duplication. */
.record-context-menu {
  position: absolute;
  z-index: 360;
  width: 176px;
  padding: 7px;
  display: grid;
  gap: 4px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.008)),
    rgba(24,28,33,.76);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 18px 34px rgba(0,0,0,.30),
    0 4px 10px rgba(0,0,0,.14);
  backdrop-filter: blur(18px) saturate(112%);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
  transform-origin: 12px 12px;
  animation: recordContextIn .14s cubic-bezier(.2,.78,.2,1);
}

@keyframes recordContextIn {
  from { opacity: 0; transform: translateY(4px) scale(.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.record-context-meta {
  min-height: 34px;
  padding: 3px 7px 6px;
  display: grid;
  align-content: center;
  gap: 1px;
  border-bottom: 1px solid rgba(255,255,255,.055);
}

.record-context-meta strong {
  font-size: 10px;
  font-weight: 700;
}

.record-context-meta span {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-context-menu > button {
  width: 100%;
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 630;
  text-align: left;
}

.record-context-menu > button:hover {
  background: rgba(255,255,255,.055);
}

.record-context-menu > button.is-destructive {
  color: color-mix(in srgb,var(--sem-red) 82%,var(--ink));
}

.atom-shell[data-background="white"] .record-context-menu {
  border-color: rgba(64,73,80,.12);
  background:
    linear-gradient(180deg,rgba(255,255,255,.36),rgba(255,255,255,.12)),
    rgba(235,238,240,.86);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 18px 34px rgba(55,64,70,.16);
}

/* Destructive confirmation can offer Deactivate without inventing a separate
   retirement concept. */
.bulk-delete-confirm {
  position: absolute;
  z-index: 380;
  width: min(350px,calc(100vw - 24px));
  padding: 14px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.008)),
    rgba(24,28,33,.84);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 22px 42px rgba(0,0,0,.34);
  backdrop-filter: blur(20px) saturate(112%);
  -webkit-backdrop-filter: blur(20px) saturate(112%);
  animation: recordContextIn .14s cubic-bezier(.2,.78,.2,1);
}

.bulk-delete-confirm > strong {
  display: block;
  font-size: 13px;
  font-weight: 720;
}

.bulk-delete-confirm > p {
  margin: 7px 0 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.bulk-delete-confirm > small {
  display: block;
  max-height: 42px;
  overflow: hidden;
  color: color-mix(in srgb,var(--sem-amber) 66%,var(--muted));
  font-size: 8px;
  line-height: 1.35;
}

.bulk-delete-confirm > div {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.bulk-delete-confirm button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  font-size: 9px;
  font-weight: 650;
}

.bulk-delete-confirm button:hover {
  background: rgba(255,255,255,.055);
}

.bulk-delete-confirm button.is-destructive {
  color: color-mix(in srgb,var(--sem-red) 86%,var(--ink));
  border-color: color-mix(in srgb,var(--sem-red) 26%,transparent);
}

/* Bulk-edit mixed values are intentionally static skeleton glass — no shimmer,
   no disabled-grey field, and no false implication that data is loading. */
.bulk-edit-summary {
  margin: 0 0 14px;
  padding: 0 2px 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.055);
}

.bulk-edit-summary strong {
  font-size: 12px;
}

.bulk-edit-summary span {
  color: var(--muted);
  font-size: 9px;
}

.is-mixed-field {
  opacity: 1 !important;
}

.mixed-value-skeleton {
  min-height: 34px;
  padding: 8px 10px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 9px;
  background: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.mixed-value-skeleton i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.085);
}

.mixed-value-skeleton i:first-child { width: 68%; }
.mixed-value-skeleton i:last-child { width: 42%; opacity: .68; }

.atom-shell[data-background="white"] .mixed-value-skeleton {
  border-color: rgba(64,73,80,.085);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.62);
}

.atom-shell[data-background="white"] .mixed-value-skeleton i {
  background: rgba(64,73,80,.09);
}

/* Familiar Apple calculator geometry, but translated into ATOM's neutral
   gel-glass language so color keeps its semantic meaning elsewhere. */
.widget[data-kind="calculator"] .widget-body {
  padding: 4px 12px 12px;
}

.apple-calculator {
  height: 100%;
  display: grid !important;
  grid-template-columns: repeat(4,minmax(0,1fr));
  grid-template-rows: minmax(44px,.85fr) repeat(5,minmax(34px,1fr));
  gap: 7px;
}

.apple-calculator .calc-screen {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 0 8px 4px;
  display: flex;
  align-items: end;
  justify-content: flex-end;
  overflow: hidden;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink);
  font-size: clamp(29px,3vw,42px);
  font-weight: 420;
  line-height: 1;
  letter-spacing: -.035em;
  white-space: nowrap;
  text-overflow: clip;
}

.apple-calculator .calc-key {
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 999px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.012)),
    rgba(255,255,255,.025);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 2px 5px rgba(0,0,0,.08);
  font-size: 15px;
  font-weight: 540;
  transition:
    transform .08s ease,
    background .10s ease,
    border-color .10s ease;
}

.apple-calculator .calc-key:hover {
  background:
    linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.025)),
    rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
}

.apple-calculator .calc-key:active {
  transform: scale(.94);
}

.apple-calculator .calc-key.function {
  background:
    linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.018)),
    rgba(255,255,255,.045);
  font-weight: 620;
}

.apple-calculator .calc-key.operator {
  border-color: rgba(255,255,255,.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.085),
    inset 0 0 0 1px rgba(255,255,255,.016),
    0 2px 5px rgba(0,0,0,.08);
  font-size: 17px;
}

.apple-calculator .calc-key.zero {
  grid-column: span 2;
  justify-items: start;
  padding-left: 24%;
}

.atom-shell[data-background="white"] .apple-calculator .calc-key {
  color: rgba(44,50,55,.92);
  border-color: rgba(64,73,80,.085);
  background:
    linear-gradient(180deg,rgba(255,255,255,.58),rgba(255,255,255,.18)),
    rgba(110,118,125,.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    0 2px 5px rgba(54,63,69,.07);
}

@media (max-width: 760px) {
  .record-context-menu {
    width: 164px;
  }

  .bulk-delete-confirm {
    width: min(340px,calc(100vw - 18px));
  }
}


/* =========================================================
   Iteration 23 — SELECTION MEMBRANE FIT + NARROW UTILITIES
   ========================================================= */

/* The data surface is an application selection surface, not a browser text
   document. Prevent native browser text-drag highlighting from competing with
   ATOM's own row selection language. */
.sheet-table,
.sheet-head,
.sheet-rows,
.sheet-row,
.sheet-cell,
.sheet-head-cell {
  -webkit-user-select: none;
  user-select: none;
}

/* Pull the crystal selection membrane inward so all four rounded edges remain
   visible inside the clipped data viewport. Contiguous rows still read as one
   morphing envelope. */
.sheet-row.is-selected::after {
  left: 3px !important;
  right: 3px !important;
  top: 0;
  bottom: 0;
}

.sheet-row.is-selection-start::after {
  top: 2px !important;
  border-radius: 10px 10px 0 0;
}

.sheet-row.is-selection-middle::after {
  top: 0 !important;
  bottom: 0 !important;
  border-radius: 0;
}

.sheet-row.is-selection-end::after {
  bottom: 2px !important;
  border-radius: 0 0 10px 10px;
}

.sheet-row.is-selection-single::after {
  top: 2px !important;
  bottom: 2px !important;
  border-radius: 10px;
}

/* Utility Small is intentionally much narrower than a data container:
   exactly half the current Portrait-width formula. Utility Medium keeps that
   narrow width and is vertically equivalent to three Utility Small widgets
   plus two small stacking gaps. */
.widget[data-size="utility-small"],
.widget[data-size="utility-medium"] {
  width: clamp(165px, calc((100vw - 144px) / 8), 260px) !important;
}

.widget[data-size="utility-small"] {
  height: clamp(90px, calc((100vh - 306px) / 6), 124px) !important;
}

.widget[data-size="utility-medium"] {
  height: clamp(286px, calc((100vh - 306px) / 2 + 16px), 388px) !important;
}

/* The narrower instrument footprint needs slightly tighter internal breathing
   room, without changing the glass material itself. */
.utility-widget .widget-body {
  padding-left: 9px;
  padding-right: 9px;
}

.widget[data-kind="calculator"] .widget-body {
  padding-left: 8px;
  padding-right: 8px;
}

.apple-calculator {
  gap: 6px;
}

.apple-calculator .calc-key {
  font-size: 14px;
}

@media (max-width: 760px) {
  .widget[data-size="utility-small"],
  .widget[data-size="utility-medium"] {
    width: min(210px, calc((100vw - 48px) / 2)) !important;
  }
}


/* =========================================================
   Iteration 24 — DOCK LABEL LEGIBILITY
   Short labels carry the scan; full names stay in hover titles.
   ========================================================= */

.atom-dock small {
  font-size: 10.5px !important;
  font-weight: 690 !important;
  line-height: 1.05;
  letter-spacing: 0 !important;
  white-space: nowrap;
}

.dock-tray-tools small {
  margin-top: 4px;
  font-size: 9.75px !important;
  font-weight: 670;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.dock-tray-tools > button {
  min-width: 58px;
}


/* =========================================================
   Iteration 25 — DOCK DRAWER BREATHING ROOM
   Slightly larger tethered drawer so readable labels and glyphs do not truncate.
   ========================================================= */

.dock-tray {
  width: 84px !important;
  max-width: 84px !important;
  min-width: 84px !important;
  padding-left: 5px;
  padding-right: 5px;
}

.dock-tray-tools > button {
  width: 74px !important;
  min-width: 74px !important;
  height: 62px;
  grid-template-rows: 41px 13px;
}

.dock-tray-tools > button > small {
  width: 70px !important;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray-glyph {
  width: 40px !important;
  height: 40px !important;
}

.tray-glyph svg {
  width: 32px !important;
  height: 32px !important;
}

.dock-tray-tools button[data-tray-kind="systemTree"] .tray-glyph svg,
.dock-tray-tools button[data-tray-kind="buildingTree"] .tray-glyph svg,
.dock-tray-tools button[data-tray-kind="organizationTree"] .tray-glyph svg {
  width: 25px !important;
  height: 25px !important;
}


/* =========================================================
   Iteration 26 — SITE-WIDE TABBED DETAILS
   Rich record information without turning the 80% focus surface into one wall.
   ========================================================= */

.detail-tabs {
  width: 100%;
  min-width: 0;
  margin: 0 0 14px;
  padding: 0 2px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid rgba(255,255,255,.055);
  scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar {
  display: none;
}

.detail-header-states {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.detail-state-separator {
  color: color-mix(in srgb,var(--ink) 24%,transparent);
  font-size: 9px;
  font-style: normal;
  line-height: 1;
}

.detail-status-slider {
  width: 78px;
  height: 30px;
  flex: 0 0 78px;
  position: relative;
  display: block;
}

.detail-status-control {
  width: 100%;
  height: 30px;
  padding: 0 19px;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 9.5px;
  font-weight: 670;
  white-space: nowrap;
  cursor: pointer;
}

.detail-status-control::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 1px;
  background: color-mix(in srgb,var(--ink) 22%,transparent);
  transform: translateY(-50%);
}

.detail-status-control::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--sem-green);
  transform: translate3d(0,-50%,0);
  transition:
    transform .28s cubic-bezier(.2,.78,.2,1),
    background .18s ease;
}

.detail-status-control.is-inactive::before {
  background: var(--sem-red);
  transform: translate3d(55px,-50%,0);
}

.detail-status-control > span {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.detail-tabs > button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  color: color-mix(in srgb,var(--ink) 48%,transparent);
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-size: 9.5px;
  font-weight: 670;
  letter-spacing: .004em;
  white-space: nowrap;
  transition:
    color .13s ease,
    background .13s ease,
    border-color .13s ease,
    transform .10s ease;
}

.detail-tabs > button:hover {
  color: color-mix(in srgb,var(--ink) 76%,transparent);
  background: rgba(255,255,255,.025);
}

.detail-tabs > button:active {
  transform: scale(.97);
}

.detail-tabs > button.is-active {
  color: var(--ink);
  border-color: rgba(255,255,255,.095);
  background:
    linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.012)),
    rgba(255,255,255,.018);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055);
}

.atom-shell[data-background="white"] .detail-tabs {
  border-bottom-color: rgba(65,74,81,.075);
}

.atom-shell[data-background="white"] .detail-tabs > button.is-active {
  border-color: rgba(65,74,81,.095);
  background:
    linear-gradient(180deg,rgba(255,255,255,.58),rgba(255,255,255,.18)),
    rgba(90,99,106,.035);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.detail-tab-panel {
  min-width: 0;
  animation: detailTabIn .16s ease;
}

@keyframes detailTabIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-identity {
  margin: 0 0 12px;
  padding: 0 2px 9px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.045);
}

.detail-identity span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 620;
}

.detail-identity strong {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 82%,transparent);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-tab-section {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.05);
}

.detail-tab-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.detail-tab-section > h3 {
  margin: 0 0 8px;
  color: color-mix(in srgb,var(--ink) 67%,transparent);
  font-size: 9px;
  font-weight: 710;
  letter-spacing: .01em;
}

.detail-fact-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 7px;
}

.detail-fact {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 11px;
  background: rgba(255,255,255,.008);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.detail-fact label {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 610;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-fact strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 690;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-related-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
}

.detail-related-list > button {
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  transition:
    background .12s ease,
    border-color .12s ease,
    transform .10s ease;
}

.detail-related-list > button:hover {
  background: rgba(255,255,255,.025);
  border-color: rgba(255,255,255,.085);
}

.detail-related-list > button:active {
  transform: scale(.985);
}

.detail-related-list > button strong,
.detail-related-list > button span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-related-list > button strong {
  font-size: 9.5px;
  font-weight: 690;
}

.detail-related-list > button span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 560;
}

.detail-tab-empty {
  min-height: 48px;
  padding: 10px;
  display: grid;
  place-items: center start;
  color: color-mix(in srgb,var(--ink) 34%,transparent);
  border: 1px dashed rgba(255,255,255,.055);
  border-radius: 10px;
  font-size: 8.5px;
  font-weight: 570;
}

.detail-inventory-open {
  min-height: 34px;
  margin: 10px 0 0;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255,255,255,.018);
  font-size: 9px;
  font-weight: 660;
}

.detail-inventory-open:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
}

.atom-shell[data-background="white"] .detail-fact,
.atom-shell[data-background="white"] .detail-related-list > button,
.atom-shell[data-background="white"] .detail-inventory-open {
  border-color: rgba(65,74,81,.075);
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.64);
}

.atom-shell[data-background="white"] .detail-tab-empty {
  border-color: rgba(65,74,81,.075);
}

@media (max-width: 760px) {
  .detail-tabs {
    gap: 3px;
  }

  .detail-tabs > button {
    padding: 0 8px;
    font-size: 9px;
  }

  .detail-fact-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .detail-related-list {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Iteration 27 — GEL-GLASS FOCUSED POPUPS
   Focused Details / nested modal surfaces now use the same transparent
   perimeter-led crystal material as the workbench widgets.
   ========================================================= */

.focus-backdrop {
  background: rgba(8,10,12,.18) !important;
  backdrop-filter: blur(2px) saturate(102%) !important;
  -webkit-backdrop-filter: blur(2px) saturate(102%) !important;
}

.focus-modal-card {
  border-color: rgba(255,255,255,.19) !important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.018),rgba(255,255,255,.002)),
    rgba(31,35,40,.10) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.20),
    inset 1px 0 0 rgba(255,255,255,.055),
    inset -1px 0 0 rgba(0,0,0,.055),
    inset 0 -1px 0 rgba(0,0,0,.075),
    0 24px 54px rgba(0,0,0,.27),
    0 5px 13px rgba(0,0,0,.14) !important;
  backdrop-filter: blur(10px) saturate(108%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(108%) !important;
}

/* The modal header is only the top edge of the same pane. */
.focus-modal-header {
  background: rgba(255,255,255,.002) !important;
  border-bottom-color: rgba(255,255,255,.065) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

/* Keep the data surface itself clear; fields use edge definition rather than
   opaque cards so the gel pane remains visually continuous. */
.focus-modal-card .detail-value,
.focus-modal-card .detail-field > input,
.focus-modal-card .detail-field > select,
.focus-modal-card .relation-picker,
.focus-modal-card .boolean-control,
.focus-modal-card .detail-fact,
.focus-modal-card .detail-related-list > button,
.focus-modal-card .component-list > button,
.focus-modal-card .inventory-list > button,
.focus-modal-card .detail-inventory-open,
.focus-modal-card .selection-row,
.focus-modal-card .collection-row,
.focus-modal-card .stock-row,
.focus-modal-card .stock-total,
.focus-modal-card .keybox-peg {
  background: rgba(255,255,255,.006) !important;
  border-color: rgba(255,255,255,.075) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.028),
    inset 0 0 0 1px rgba(255,255,255,.006) !important;
}

.focus-modal-card .detail-related-list > button:hover,
.focus-modal-card .component-list > button:hover,
.focus-modal-card .inventory-list > button:hover,
.focus-modal-card .detail-inventory-open:hover,
.focus-modal-card .selection-row:hover,
.focus-modal-card .collection-row:hover {
  background: rgba(255,255,255,.018) !important;
  border-color: rgba(255,255,255,.11) !important;
}

/* Tabs stay embedded in the same glass instead of becoming mini tiles. */
.focus-modal-card .detail-tabs > button {
  background: transparent !important;
}

.focus-modal-card .detail-tabs > button.is-active {
  border-color: rgba(255,255,255,.105) !important;
  background: rgba(255,255,255,.012) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 2px 8px rgba(0,0,0,.045) !important;
}

/* White workbench: same crystal grammar, not an opaque white dialog. */
.atom-shell[data-background="white"] .focus-backdrop {
  background: rgba(62,69,74,.10) !important;
}

.atom-shell[data-background="white"] .focus-modal-card {
  color: var(--ink);
  border-color: rgba(255,255,255,.80) !important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.012)),
    rgba(244,246,247,.10) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.90),
    inset 1px 0 0 rgba(255,255,255,.30),
    inset -1px 0 0 rgba(70,80,86,.055),
    inset 0 -1px 0 rgba(70,80,86,.07),
    0 22px 48px rgba(53,62,67,.15),
    0 4px 10px rgba(53,62,67,.07) !important;
}

.atom-shell[data-background="white"] .focus-modal-header {
  background: rgba(255,255,255,.008) !important;
  border-bottom-color: rgba(70,80,86,.075) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.40);
}

.atom-shell[data-background="white"] .focus-modal-card .detail-value,
.atom-shell[data-background="white"] .focus-modal-card .detail-field > input,
.atom-shell[data-background="white"] .focus-modal-card .detail-field > select,
.atom-shell[data-background="white"] .focus-modal-card .relation-picker,
.atom-shell[data-background="white"] .focus-modal-card .boolean-control,
.atom-shell[data-background="white"] .focus-modal-card .detail-fact,
.atom-shell[data-background="white"] .focus-modal-card .detail-related-list > button,
.atom-shell[data-background="white"] .focus-modal-card .component-list > button,
.atom-shell[data-background="white"] .focus-modal-card .inventory-list > button,
.atom-shell[data-background="white"] .focus-modal-card .detail-inventory-open,
.atom-shell[data-background="white"] .focus-modal-card .selection-row,
.atom-shell[data-background="white"] .focus-modal-card .collection-row,
.atom-shell[data-background="white"] .focus-modal-card .stock-row,
.atom-shell[data-background="white"] .focus-modal-card .stock-total,
.atom-shell[data-background="white"] .focus-modal-card .keybox-peg {
  background: rgba(255,255,255,.014) !important;
  border-color: rgba(70,80,86,.075) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34) !important;
}

.atom-shell[data-background="white"] .focus-modal-card .detail-tabs > button.is-active {
  border-color: rgba(70,80,86,.09) !important;
  background: rgba(255,255,255,.035) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55) !important;
}


/* =========================================================
   Iteration 28 — FULL-SIZE FLOOR PLAN GLASS RENDERER
   Clean SVG in → sanitized ATOM-themed derivative linked to a Floor.
   ========================================================= */

.widget[data-kind="floorPlan"] {
  overflow: visible;
}

.widget[data-kind="floorPlan"][data-size="full"] {
  width: calc(100% - 48px) !important;
  height: calc(100% - 118px) !important;
}

.widget[data-kind="floorPlan"] .widget-body {
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 8px 14px 10px;
}

.widget[data-kind="floorPlan"] .widget-footer {
  position: relative;
  z-index: 12;
}

.floor-plan-message,
.floor-plan-empty,
.floor-plan-loading,
.floor-plan-error {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.floor-plan-message {
  gap: 6px;
}

.floor-plan-message strong,
.floor-plan-empty strong,
.floor-plan-loading strong,
.floor-plan-error strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.floor-plan-message span,
.floor-plan-empty small,
.floor-plan-loading span,
.floor-plan-error span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 560;
}

.floor-plan-empty {
  gap: 10px;
}

.floor-plan-empty > p {
  max-width: 500px;
  margin: 2px 0 0;
  color: color-mix(in srgb,var(--ink) 38%,transparent);
  font-size: 8.5px;
  line-height: 1.45;
}

.floor-plan-dropzone {
  width: min(520px,72%);
  min-height: 250px;
  padding: 26px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--ink);
  border: 1px dashed rgba(255,255,255,.13);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 42%,rgba(255,255,255,.016),transparent 55%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    inset 1px 0 0 rgba(255,255,255,.018);
  transition:
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
}

.floor-plan-dropzone:hover,
.floor-plan-dropzone.is-drag-over {
  border-color: rgba(255,255,255,.25);
  background:
    radial-gradient(circle at 50% 42%,rgba(255,255,255,.032),transparent 58%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 12px 26px rgba(0,0,0,.09);
}

.floor-plan-dropzone.is-drag-over {
  transform: scale(1.01);
}

.floor-plan-dropzone > em {
  margin-top: 3px;
  color: color-mix(in srgb,var(--ink) 44%,transparent);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 600;
}

.floor-plan-plus {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 7px;
  display: block;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.018),rgba(255,255,255,.003)),
    rgba(255,255,255,.003);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 1px 0 0 rgba(255,255,255,.018),
    0 8px 20px rgba(0,0,0,.08);
}

.floor-plan-plus::before,
.floor-plan-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 25px;
  height: 1px;
  border-radius: 999px;
  background: color-mix(in srgb,var(--ink) 58%,transparent);
  box-shadow: 0 0 7px rgba(255,255,255,.025);
  transform: translate(-50%,-50%);
}

.floor-plan-plus::after {
  transform: translate(-50%,-50%) rotate(90deg);
}

/* Cached derivative view */
.floor-plan-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 26px minmax(0,1fr) 30px;
  gap: 5px;
}

.floor-plan-meta,
.floor-plan-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 590;
}

.floor-plan-meta {
  justify-content: space-between;
}

.floor-plan-meta > span,
.floor-plan-meta > small,
.floor-plan-actions > span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.floor-plan-meta > small {
  color: color-mix(in srgb,var(--ink) 36%,transparent);
}

.floor-plan-actions {
  justify-content: flex-end;
}

.floor-plan-actions > button {
  min-height: 24px;
  padding: 0 9px;
  color: color-mix(in srgb,var(--ink) 62%,transparent);
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 8px;
  background: rgba(255,255,255,.004);
  font-size: 8.5px;
  font-weight: 640;
}

.floor-plan-actions > button:hover {
  color: var(--ink);
  border-color: rgba(255,255,255,.095);
  background: rgba(255,255,255,.014);
}

.floor-plan-canvas {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 46%,rgba(255,255,255,.010),transparent 58%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    inset 1px 0 0 rgba(255,255,255,.008);
}

.floor-plan-canvas.is-drag-over {
  border-color: rgba(255,255,255,.18);
  background:
    radial-gradient(circle at 50% 46%,rgba(255,255,255,.022),transparent 58%);
}

.floor-plan-canvas > svg {
  width: calc(100% - 28px) !important;
  height: calc(100% - 28px) !important;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}

/* ATOM floor-plan derivative: the canvas is transparent, while structural
   geometry reads as an etched technical drawing inside the glass. */
.atom-floorplan-svg {
  color: color-mix(in srgb,var(--ink) 78%,transparent);
  background: transparent !important;
}

.atom-floorplan-svg .atom-plan-background {
  fill: transparent !important;
  stroke: color-mix(in srgb,var(--ink) 48%,transparent) !important;
}

.atom-floorplan-svg .atom-plan-line {
  fill: none !important;
  stroke: color-mix(in srgb,var(--ink) 64%,transparent) !important;
  stroke-width: 1.15 !important;
  vector-effect: non-scaling-stroke;
  opacity: .92;
}

.atom-floorplan-svg .atom-plan-area {
  fill: color-mix(in srgb,var(--ink) 4.5%,transparent) !important;
  stroke: color-mix(in srgb,var(--ink) 38%,transparent) !important;
  stroke-width: .9 !important;
  vector-effect: non-scaling-stroke;
  opacity: .92;
}

.atom-floorplan-svg .atom-plan-text {
  fill: color-mix(in srgb,var(--ink) 48%,transparent) !important;
  stroke: none !important;
  font-family: inherit !important;
  opacity: .80;
}

/* Conversion progress keeps the browser responsive and makes slow SVGs feel
   intentional instead of frozen. */
.floor-plan-loading {
  gap: 7px;
}

.floor-plan-loading > p {
  max-width: 520px;
  margin: 4px 0 0;
  color: color-mix(in srgb,var(--ink) 34%,transparent);
  font-size: 8.5px;
  line-height: 1.45;
}

.floor-plan-loader-mark {
  width: 70px;
  height: 38px;
  margin-bottom: 5px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
}

.floor-plan-loader-mark i {
  width: 3px;
  border-radius: 999px;
  background: color-mix(in srgb,var(--ink) 42%,transparent);
  animation: floorPlanLoader 1.1s ease-in-out infinite;
}

.floor-plan-loader-mark i:nth-child(1) { height: 12px; animation-delay: -.22s; }
.floor-plan-loader-mark i:nth-child(2) { height: 24px; }
.floor-plan-loader-mark i:nth-child(3) { height: 17px; animation-delay: -.11s; }

@keyframes floorPlanLoader {
  0%,100% { opacity: .35; transform: scaleY(.70); }
  50% { opacity: .85; transform: scaleY(1.10); }
}

.floor-plan-progress {
  width: min(520px,70%);
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.14);
}

.floor-plan-progress-fill {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb,var(--ink) 48%,transparent);
  box-shadow: 0 0 10px rgba(255,255,255,.04);
  transition: width .18s ease;
}

.floor-plan-progress-copy {
  width: min(520px,70%);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 8.5px;
}

.floor-plan-progress-copy b {
  color: color-mix(in srgb,var(--ink) 58%,transparent);
  font-weight: 680;
}

.floor-plan-error {
  gap: 8px;
}

.floor-plan-error > button {
  min-height: 32px;
  margin-top: 4px;
  padding: 0 11px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 9px;
  background: rgba(255,255,255,.008);
  font-size: 9px;
  font-weight: 650;
}

.floor-plan-filter-menu {
  grid-template-columns: 1fr !important;
}

.widget[data-kind="floorPlan"] .scope-stack {
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
}

/* White background is still crystal, not a paper plan. */
.atom-shell[data-background="white"] .floor-plan-dropzone,
.atom-shell[data-background="white"] .floor-plan-canvas {
  border-color: rgba(70,80,86,.09);
  background:
    radial-gradient(circle at 50% 46%,rgba(255,255,255,.18),transparent 58%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.52),
    inset 1px 0 0 rgba(255,255,255,.16);
}

.atom-shell[data-background="white"] .floor-plan-plus {
  border-color: rgba(70,80,86,.09);
  background: rgba(255,255,255,.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.64),
    0 8px 20px rgba(55,64,70,.06);
}

.atom-shell[data-background="white"] .atom-floorplan-svg .atom-plan-line {
  stroke: rgba(42,50,56,.66) !important;
}

.atom-shell[data-background="white"] .atom-floorplan-svg .atom-plan-area {
  fill: rgba(42,50,56,.035) !important;
  stroke: rgba(42,50,56,.36) !important;
}

.atom-shell[data-background="white"] .atom-floorplan-svg .atom-plan-text {
  fill: rgba(42,50,56,.54) !important;
}

@media (max-width: 760px) {
  .widget[data-kind="floorPlan"][data-size="full"] {
    width: calc(100% - 24px) !important;
    height: calc(100% - 112px) !important;
    left: 12px !important;
    top: 12px !important;
  }

  .floor-plan-dropzone {
    width: min(460px,88%);
    min-height: 220px;
  }

  .floor-plan-progress,
  .floor-plan-progress-copy {
    width: min(460px,84%);
  }
}


/* =========================================================
   Iteration 29 — FLOOR PLAN STABILIZATION
   Preserve CAD knockouts, ignore artboards during fitting, and retain
   source line-weight hierarchy while keeping the drawing etched into ATOM.
   ========================================================= */

.widget[data-kind="floorPlan"] .control.clear,
.widget[data-kind="floorPlan"] .edit-control {
  display: none !important;
}

.floor-plan-filter-menu .scope-stack {
  max-width: 760px;
  margin-inline: auto;
}

.floor-plan-canvas > .atom-floorplan-svg {
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.atom-floorplan-svg .atom-plan-artboard {
  display: none !important;
}

.atom-floorplan-svg .atom-plan-knockout {
  fill: var(--paper) !important;
  stroke: none !important;
  opacity: 1 !important;
  pointer-events: none;
}

.atom-floorplan-svg .atom-plan-line.atom-plan-weight-fine {
  stroke-width: .82 !important;
  stroke-opacity: .58 !important;
}

.atom-floorplan-svg .atom-plan-line.atom-plan-weight-medium {
  stroke-width: 1.12 !important;
  stroke-opacity: .76 !important;
}

.atom-floorplan-svg .atom-plan-line.atom-plan-weight-heavy {
  stroke-width: 1.58 !important;
  stroke-opacity: .92 !important;
}

.floor-plan-actions > span {
  margin-right: auto;
}

.floor-plan-actions > button[data-floor-plan-remove] {
  color: color-mix(in srgb,var(--red) 72%,var(--ink));
}

.floor-plan-actions > button[data-floor-plan-remove]:hover {
  border-color: color-mix(in srgb,var(--red) 34%,transparent);
  background: color-mix(in srgb,var(--red) 8%,transparent);
}

.atom-shell[data-background="white"] .atom-floorplan-svg .atom-plan-knockout {
  fill: var(--paper) !important;
}


/* =========================================================
   Iteration 29 — KEY SYSTEM / SYMBOL / COPY DETAIL WORKBOOK
   ========================================================= */

.association-transfer {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 42px minmax(0,1fr);
  gap: 10px;
  align-items: stretch;
}

.assoc-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 34px minmax(0,1fr);
  gap: 7px;
}

.assoc-column > label,
.assoc-building-filter > label {
  color: color-mix(in srgb,var(--ink) 58%,transparent);
  font-size: 8.5px;
  font-weight: 690;
}

.assoc-column > input,
.assoc-building-filter > select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 9px;
  background: rgba(255,255,255,.006);
  font-size: 9px;
  outline: none;
}

.assoc-list {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 12px;
  background: rgba(255,255,255,.002);
}

.assoc-list > button {
  width: 100%;
  min-height: 44px;
  padding: 7px 9px;
  display: grid;
  align-content: center;
  gap: 2px;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  background: transparent;
  text-align: left;
}

.assoc-list > button:last-child {
  border-bottom: 0;
}

.assoc-list > button:hover {
  background: rgba(255,255,255,.018);
}

.assoc-list > button.is-selected {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
  background: rgba(255,255,255,.018);
}

.assoc-list > button strong,
.assoc-list > button small {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.assoc-list > button strong {
  font-size: 9.5px;
  font-weight: 680;
}

.assoc-list > button small {
  color: var(--muted);
  font-size: 8px;
}

.assoc-arrows {
  display: grid;
  place-content: center;
  gap: 8px;
}

.assoc-arrows > button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb,var(--ink) 64%,transparent);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 50%;
  background: rgba(255,255,255,.004);
  font-size: 14px;
}

.assoc-arrows > button:hover {
  color: var(--ink);
  border-color: rgba(255,255,255,.13);
  background: rgba(255,255,255,.018);
}

.association-context-note {
  margin: 9px 2px 0;
  color: color-mix(in srgb,var(--ink) 34%,transparent);
  font-size: 8px;
  line-height: 1.4;
}

.assoc-building-filter {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 130px minmax(180px,320px);
  align-items: center;
  gap: 10px;
}

.history-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.history-list {
  display: grid;
  gap: 5px;
}

.history-row {
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 88px 120px minmax(0,1fr) 100px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(255,255,255,.045);
}

.history-row time,
.history-row small {
  color: var(--muted);
  font-size: 8px;
}

.history-row strong {
  font-size: 9.5px;
  font-weight: 690;
}

.history-row span {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 72%,transparent);
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notes-workspace {
  min-height: 390px;
  display: grid;
  grid-template-columns: 145px 190px minmax(0,1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 14px;
  background: rgba(255,255,255,.001);
}

.notes-folders,
.notes-list-pane,
.notes-editor {
  min-width: 0;
  min-height: 0;
}

.notes-folders {
  padding: 10px 8px;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  gap: 7px;
  border-right: 1px solid rgba(255,255,255,.05);
}

.notes-folders > strong {
  padding: 0 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.notes-folders > div {
  overflow: auto;
}

.notes-folders button,
.notes-list button {
  width: 100%;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.notes-folders button {
  min-height: 30px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 8.5px;
}

.notes-folders button:hover,
.notes-folders button.is-active {
  background: rgba(255,255,255,.025);
}

.notes-folders > button {
  color: color-mix(in srgb,var(--ink) 54%,transparent);
  border: 1px solid rgba(255,255,255,.055);
}

.notes-list-pane {
  padding: 9px 8px;
  display: grid;
  grid-template-rows: 32px minmax(0,1fr);
  gap: 7px;
  border-right: 1px solid rgba(255,255,255,.05);
}

.notes-list-pane > input,
.note-title-input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  background: rgba(255,255,255,.004);
  font-size: 8.5px;
  outline: none;
}

.notes-list {
  min-height: 0;
  overflow: auto;
}

.notes-list button {
  min-height: 45px;
  padding: 7px 8px;
  display: grid;
  gap: 2px;
  border-bottom: 1px solid rgba(255,255,255,.035);
}

.notes-list button.is-active,
.notes-list button:hover {
  background: rgba(255,255,255,.018);
}

.notes-list strong {
  font-size: 9px;
}

.notes-list small {
  color: var(--muted);
  font-size: 7.5px;
}

.notes-editor {
  padding: 8px;
  display: grid;
  grid-template-rows: 30px 34px minmax(0,1fr);
  gap: 7px;
}

.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.notes-toolbar > span {
  flex: 1;
}

.notes-toolbar button {
  min-height: 26px;
  padding: 0 8px;
  color: color-mix(in srgb,var(--ink) 60%,transparent);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 7px;
  background: transparent;
  font-size: 8px;
}

.notes-toolbar button:hover {
  color: var(--ink);
  background: rgba(255,255,255,.018);
}

.notes-toolbar .note-delete {
  width: 26px;
  padding: 0;
  color: var(--sem-red);
  font-size: 12px;
}

.notes-editor textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  padding: 10px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 10px;
  background: rgba(255,255,255,.003);
  font: inherit;
  font-size: 9px;
  line-height: 1.5;
  outline: none;
}

.note-empty {
  grid-row: 2 / -1;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
}

.note-empty strong {
  font-size: 10px;
}

.note-empty span {
  color: var(--muted);
  font-size: 8px;
}

.detail-fact small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 540;
}

.atom-shell[data-background="white"] .assoc-list,
.atom-shell[data-background="white"] .notes-workspace,
.atom-shell[data-background="white"] .assoc-column > input,
.atom-shell[data-background="white"] .assoc-building-filter > select,
.atom-shell[data-background="white"] .notes-list-pane > input,
.atom-shell[data-background="white"] .note-title-input,
.atom-shell[data-background="white"] .notes-editor textarea {
  border-color: rgba(65,74,81,.075);
  background: rgba(255,255,255,.025);
}

@media (max-width: 900px) {
  .association-transfer {
    grid-template-columns: 1fr 36px 1fr;
  }

  .notes-workspace {
    grid-template-columns: 120px 155px minmax(0,1fr);
  }
}

@media (max-width: 700px) {
  .association-transfer {
    grid-template-columns: 1fr;
  }

  .assoc-arrows {
    grid-template-columns: 1fr 1fr;
    justify-self: center;
  }

  .notes-workspace {
    grid-template-columns: 1fr;
    min-height: 540px;
  }

  .notes-folders,
  .notes-list-pane {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
  }
}


/* =========================================================
   Iteration 30 — CABLE-SCOPED ASSOCIATIONS + RICH NOTES
   ========================================================= */

.association-scope-bar {
  min-height: 38px;
  margin: 0 0 9px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 8px auto minmax(0,1fr);
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb,var(--purple) 18%,rgba(255,255,255,.045));
  border-radius: 10px;
  background:
    linear-gradient(110deg,color-mix(in srgb,var(--purple) 5%,transparent),transparent 56%),
    rgba(255,255,255,.003);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.association-scope-dot,
.cable-scope-readout > span {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 10px color-mix(in srgb,var(--purple) 42%,transparent);
}

.association-scope-bar strong {
  min-width: 0;
  color: color-mix(in srgb,var(--ink) 84%,transparent);
  font-size: 8.5px;
  font-weight: 720;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.association-scope-bar small {
  min-width: 0;
  color: color-mix(in srgb,var(--ink) 38%,transparent);
  font-size: 7.5px;
  text-align: right;
}

.association-transfer[data-cable-scoped="true"] .assoc-column > input {
  border-color: color-mix(in srgb,var(--purple) 14%,rgba(255,255,255,.06));
  background:
    linear-gradient(110deg,color-mix(in srgb,var(--purple) 3.5%,transparent),transparent 60%),
    rgba(255,255,255,.004);
}

.assoc-empty {
  min-height: 96px;
  padding: 16px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb,var(--ink) 28%,transparent);
  font-size: 8px;
  text-align: center;
}

.assoc-building-filter.is-cable-locked {
  grid-template-columns: 112px minmax(0,1fr);
}

.cable-scope-readout {
  min-height: 34px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 8px minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb,var(--purple) 16%,rgba(255,255,255,.05));
  border-radius: 9px;
  background: rgba(255,255,255,.003);
}

.cable-scope-readout strong {
  min-width: 0;
  color: color-mix(in srgb,var(--ink) 78%,transparent);
  font-size: 8.5px;
  font-weight: 680;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cable-scope-readout small {
  color: color-mix(in srgb,var(--purple) 68%,var(--muted));
  font-size: 7px;
  font-weight: 680;
}

/* Rich Notes keeps the same three-pane information architecture,
   but replaces the plain textarea with a document surface. */

.rich-notes-workspace {
  min-height: 420px;
  background:
    radial-gradient(circle at 84% 18%,rgba(255,255,255,.009),transparent 30%),
    rgba(255,255,255,.001);
}

.rich-notes-workspace .notes-folders button {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 6px;
}

.rich-notes-workspace .notes-folders button > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rich-notes-workspace .notes-folders button > small {
  color: color-mix(in srgb,var(--ink) 28%,transparent);
  font-size: 7px;
  font-weight: 650;
}

.rich-notes-workspace .notes-list button {
  min-height: 58px;
  align-content: center;
}

.rich-notes-workspace .notes-list button > span {
  min-width: 0;
  color: color-mix(in srgb,var(--ink) 43%,transparent);
  font-size: 7.5px;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rich-note-editor {
  grid-template-rows: 34px 34px minmax(0,1fr);
}

.rich-note-toolbar {
  min-width: 0;
  padding: 3px;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 9px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.012),rgba(255,255,255,.002)),
    rgba(255,255,255,.002);
}

.rich-note-toolbar::-webkit-scrollbar {
  display: none;
}

.rich-note-toolbar button,
.rich-note-toolbar select {
  flex: 0 0 auto;
  height: 26px;
  min-height: 26px;
  color: color-mix(in srgb,var(--ink) 58%,transparent);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 8px;
  outline: none;
}

.rich-note-toolbar button {
  min-width: 27px;
  padding: 0 7px;
  display: grid;
  place-items: center;
}

.rich-note-toolbar select {
  width: 74px;
  padding: 0 6px;
  border-color: rgba(255,255,255,.035);
  background: rgba(255,255,255,.004);
}

.rich-note-toolbar button:hover,
.rich-note-toolbar button:focus-visible,
.rich-note-toolbar select:hover,
.rich-note-toolbar select:focus-visible {
  color: var(--ink);
  border-color: rgba(255,255,255,.075);
  background: rgba(255,255,255,.018);
}

.rich-note-toolbar .note-delete {
  min-width: 27px;
  color: var(--sem-red);
}

.rich-note-toolbar .note-new {
  min-width: 54px;
  color: color-mix(in srgb,var(--green) 72%,var(--ink));
  border-color: color-mix(in srgb,var(--green) 10%,rgba(255,255,255,.035));
}

.note-toolbar-separator {
  width: 1px;
  height: 15px;
  flex: 0 0 1px !important;
  margin: 0 2px;
  background: rgba(255,255,255,.055);
}

.note-toolbar-spacer {
  min-width: 4px;
  flex: 1 1 auto !important;
}

.rich-note-surface {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 14px 15px 28px;
  overflow: auto;
  color: color-mix(in srgb,var(--ink) 90%,transparent);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.006),transparent 38%),
    rgba(255,255,255,.002);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.016),
    inset 0 0 28px rgba(255,255,255,.002);
  font-size: 9px;
  line-height: 1.62;
  outline: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rich-note-surface:focus {
  border-color: color-mix(in srgb,var(--purple) 17%,rgba(255,255,255,.06));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.02),
    0 0 0 2px color-mix(in srgb,var(--purple) 4%,transparent);
}

.rich-note-surface:empty::before {
  content: attr(data-placeholder);
  color: color-mix(in srgb,var(--ink) 25%,transparent);
  pointer-events: none;
}

.rich-note-surface p,
.rich-note-surface div {
  margin: 0 0 .72em;
}

.rich-note-surface h1,
.rich-note-surface h2,
.rich-note-surface h3 {
  margin: .9em 0 .38em;
  color: var(--ink);
  line-height: 1.2;
  font-weight: 730;
}

.rich-note-surface h1 {
  font-size: 15px;
}

.rich-note-surface h2 {
  font-size: 13px;
}

.rich-note-surface h3 {
  font-size: 11px;
}

.rich-note-surface ul,
.rich-note-surface ol {
  margin: .4em 0 .8em;
  padding-left: 20px;
}

.rich-note-surface li {
  margin: .22em 0;
}

.rich-note-surface blockquote {
  margin: .75em 0;
  padding: 7px 10px;
  color: color-mix(in srgb,var(--ink) 67%,transparent);
  border-left: 2px solid color-mix(in srgb,var(--purple) 45%,transparent);
  background: color-mix(in srgb,var(--purple) 3%,transparent);
  border-radius: 0 7px 7px 0;
}

.rich-note-surface a {
  color: color-mix(in srgb,var(--blue) 78%,var(--ink));
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb,var(--blue) 35%,transparent);
  text-underline-offset: 2px;
}

.rich-note-surface strong,
.rich-note-surface b {
  font-weight: 760;
}

.note-title-input:focus,
.notes-list-pane > input:focus {
  border-color: color-mix(in srgb,var(--purple) 14%,rgba(255,255,255,.06));
}

.atom-shell[data-background="white"] .association-scope-bar,
.atom-shell[data-background="white"] .cable-scope-readout,
.atom-shell[data-background="white"] .rich-note-toolbar,
.atom-shell[data-background="white"] .rich-note-surface {
  border-color: rgba(65,74,81,.08);
  background-color: rgba(255,255,255,.16);
}

@media (max-width: 900px) {
  .association-scope-bar {
    grid-template-columns: 8px minmax(0,1fr);
  }

  .association-scope-bar small {
    grid-column: 2;
    text-align: left;
  }

  .rich-notes-workspace {
    grid-template-columns: 110px 150px minmax(0,1fr);
  }
}

@media (max-width: 700px) {
  .assoc-building-filter.is-cable-locked,
  .assoc-building-filter {
    grid-template-columns: 1fr;
  }

  .rich-notes-workspace {
    min-height: 620px;
  }

  .rich-note-editor {
    min-height: 300px;
  }

  .rich-note-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .rich-note-surface {
    min-height: 240px;
  }
}


/* =========================================================
   Iteration 31 — NOTES MASTER UTILITY + UTILITY LARGE
   ========================================================= */

/* Third utility footprint: landscape width, Utility Medium height. */
.widget[data-size="utility-large"] {
  width: clamp(684px, calc((100vw - 96px) / 2), 1064px) !important;
  height: clamp(286px, calc((100vh - 306px) / 2 + 16px), 388px) !important;
}

/* Notes is a utility by placement and sizing, but keeps the normal ATOM
   header because it is a working surface rather than a passive instrument. */
.notes-utility-widget .widget-body {
  min-height: 0;
  padding: 4px 10px 8px;
  overflow: hidden;
}

.notes-utility-widget .widget-footer {
  min-height: 24px;
  flex-basis: 24px;
  padding-bottom: 5px;
}

.notes-master-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  gap: 6px;
}

.notes-master-context {
  min-height: 24px;
  padding: 0 7px;
  display: grid;
  grid-template-columns: 7px auto minmax(0,1fr);
  align-items: center;
  gap: 6px;
  color: color-mix(in srgb,var(--ink) 58%,transparent);
  border: 1px solid color-mix(in srgb,var(--purple) 12%,rgba(255,255,255,.035));
  border-radius: 8px;
  background:
    linear-gradient(100deg,color-mix(in srgb,var(--purple) 3%,transparent),transparent 58%),
    rgba(255,255,255,.002);
}

.notes-master-context > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px color-mix(in srgb,var(--purple) 34%,transparent);
}

.notes-master-context.is-independent > span {
  background: color-mix(in srgb,var(--ink) 40%,transparent);
  box-shadow: none;
}

.notes-master-context strong {
  font-size: 7.5px;
  font-weight: 700;
}

.notes-master-context small {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 33%,transparent);
  font-size: 7px;
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notes-master-workspace {
  min-height: 0 !important;
  height: 100%;
  grid-template-columns: 190px 180px minmax(0,1fr);
}

.notes-master-folders {
  padding-top: 7px;
}

.notes-master-folders > strong {
  padding-left: 5px;
}

.note-master-tree {
  min-height: 0;
  overflow: auto;
  padding: 1px 1px 8px;
}

.note-master-tree-empty {
  min-height: 84px;
  padding: 14px 8px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb,var(--ink) 28%,transparent);
  font-size: 7.5px;
  text-align: center;
}

.note-tree-category + .note-tree-category {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.035);
}

.note-tree-category-label,
.note-tree-record-label {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 5px;
}

.note-tree-category-label {
  min-height: 25px;
  padding: 0 6px;
}

.note-tree-category-label strong {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 68%,transparent);
  font-size: 8px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-tree-category-label small,
.note-tree-record-label small {
  color: color-mix(in srgb,var(--ink) 28%,transparent);
  font-size: 6.5px;
  font-weight: 680;
}

.note-tree-record {
  margin: 1px 0 4px;
}

.note-tree-record-label {
  min-height: 23px;
  margin-left: 9px;
  padding: 0 6px 0 8px;
  border-left: 1px solid rgba(255,255,255,.05);
}

.note-tree-record-label > span {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 50%,transparent);
  font-size: 7.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-tree-folders {
  margin-left: 19px;
  padding-left: 5px;
  display: grid;
  gap: 1px;
  border-left: 1px solid rgba(255,255,255,.04);
}

.note-tree-folders > button {
  width: 100%;
  min-height: 25px;
  padding: 0 6px 0 8px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 5px;
  color: color-mix(in srgb,var(--ink) 48%,transparent);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.note-tree-folders > button:hover {
  color: color-mix(in srgb,var(--ink) 72%,transparent);
  background: rgba(255,255,255,.014);
}

.note-tree-folders > button.is-active {
  color: var(--ink);
  border-color: rgba(255,255,255,.06);
  background:
    linear-gradient(100deg,color-mix(in srgb,var(--purple) 5%,transparent),transparent 70%),
    rgba(255,255,255,.014);
}

.note-tree-folders > button > span {
  min-width: 0;
  overflow: hidden;
  font-size: 7.5px;
  font-weight: 630;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-tree-folders > button > small {
  color: color-mix(in srgb,var(--ink) 27%,transparent);
  font-size: 6.5px;
}

.notes-master-workspace .notes-list-pane {
  padding: 7px 7px;
  gap: 5px;
}

.notes-master-workspace .notes-list-pane > input {
  height: 29px;
}

.notes-master-workspace .notes-list button {
  min-height: 48px;
  padding: 6px 7px;
}

.notes-master-workspace .notes-list button > span {
  font-size: 7px;
}

.notes-master-workspace .rich-note-editor {
  padding: 6px;
  grid-template-rows: 30px 30px minmax(0,1fr);
  gap: 5px;
}

.notes-master-workspace .rich-note-toolbar {
  min-height: 30px;
}

.notes-master-workspace .rich-note-toolbar button,
.notes-master-workspace .rich-note-toolbar select {
  height: 24px;
  min-height: 24px;
}

.notes-master-workspace .note-title-input {
  height: 30px;
}

.notes-master-workspace .rich-note-surface {
  min-height: 0;
  padding: 9px 10px 18px;
  font-size: 8.5px;
  line-height: 1.55;
}

/* Full-screen Notes preserves the same interface, just lets the tree/editor
   breathe rather than changing its information architecture. */
.notes-utility-widget[data-size="full"] .notes-master-workspace {
  grid-template-columns: 220px 230px minmax(0,1fr);
}

.notes-utility-widget[data-size="full"] .notes-master-context {
  min-height: 28px;
}

.notes-utility-widget[data-size="full"] .rich-note-surface {
  padding: 14px 15px 28px;
  font-size: 9px;
  line-height: 1.62;
}

.atom-shell[data-background="white"] .notes-master-context,
.atom-shell[data-background="white"] .note-tree-folders > button.is-active {
  border-color: rgba(65,74,81,.07);
}

.atom-shell[data-background="white"] .note-tree-record-label,
.atom-shell[data-background="white"] .note-tree-folders {
  border-left-color: rgba(65,74,81,.07);
}

@media (max-width: 900px) {
  .widget[data-size="utility-large"] {
    width: calc(100vw - 48px) !important;
  }

  .notes-master-workspace {
    grid-template-columns: 160px 160px minmax(0,1fr);
  }
}

@media (max-width: 700px) {
  .widget[data-size="utility-large"] {
    width: calc(100vw - 48px) !important;
  }

  .notes-master-context {
    grid-template-columns: 7px minmax(0,1fr);
  }

  .notes-master-context small {
    grid-column: 2;
    text-align: left;
  }

  .notes-master-workspace,
  .notes-utility-widget[data-size="full"] .notes-master-workspace {
    grid-template-columns: 1fr;
    min-height: 0 !important;
    overflow: auto;
  }

  .notes-master-folders,
  .notes-master-workspace .notes-list-pane {
    min-height: 170px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
  }

  .notes-master-workspace .rich-note-editor {
    min-height: 300px;
  }

  .notes-master-workspace .rich-note-surface {
    min-height: 230px;
  }
}


/* =========================================================
   Iteration 32 — CHROME ALIGNMENT + MOVABLE FOCUS SURFACES
   Screenshot-driven cleanup: dock labels, semantic-dot geometry,
   cable target centering, focus placement, and dock layering.
   ========================================================= */

/* Dock and its drawer are application chrome. They must remain visually and
   interactively above focus backdrops instead of being blurred with workspace data. */
.atom-dock {
  z-index: 2200 !important;
}

.dock-tray {
  z-index: 2190 !important;
}

.atom-dock,
.dock-tray,
.dock-stack {
  isolation: isolate;
}

/* Give drawer icons and their labels a little more vertical breathing room.
   Descenders such as the "g" in Key Rings must never clip. */
.dock-tray-tools {
  gap: 6px !important;
}

.dock-tray-tools > button {
  height: 68px !important;
  min-height: 68px !important;
  padding-top: 4px !important;
  padding-bottom: 6px !important;
  grid-template-rows: 42px 16px !important;
  row-gap: 2px !important;
  overflow: visible !important;
}

.dock-tray-tools > button > small,
.dock-tray-tools small {
  height: auto !important;
  min-height: 13px;
  margin-top: 2px !important;
  padding-bottom: 1px;
  line-height: 1.2 !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Every widget-header semantic control uses one 23px hitbox and one exact
   13px visual center. Left and right groups share the same vertical origin. */
.widget-header .window-controls,
.widget-header .widget-actions {
  height: 23px !important;
  min-height: 23px !important;
  padding-top: 0 !important;
  margin-top: 4px !important;
  align-self: start !important;
  align-items: center !important;
}

.widget-header .window-controls {
  gap: 1px !important;
}

.widget-header .widget-actions {
  gap: 1px !important;
}

.widget-header .control,
.widget-header .size-control,
.widget-header .plug,
.widget-header .edit-control {
  position: relative !important;
  width: 23px !important;
  min-width: 23px !important;
  height: 23px !important;
  min-height: 23px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  line-height: 0 !important;
  transform: none;
}

.widget-header .control::before,
.widget-header .size-control::before,
.widget-header .plug::before,
.widget-header .edit-control::before {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 13px !important;
  height: 13px !important;
  margin: 0 !important;
  transform: translate(-50%,-50%) !important;
  box-sizing: border-box;
}

/* The connection target outline and its solid center now use the exact same
   center point. No independent inset geometry. */
.widget-header .plug.is-target::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: auto !important;
  left: 50% !important;
  top: 50% !important;
  width: 21px !important;
  height: 21px !important;
  box-sizing: border-box;
  border: 1px solid rgba(111,147,179,.62) !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: 0 0 0 3px rgba(111,147,179,.10) !important;
  transform: translate(-50%,-50%) !important;
}

/* Focus surfaces start higher in the workspace, stay below the persistent dock,
   and accept bounded dragging through their header. */
.focus-modal-layer {
  box-sizing: border-box;
  place-items: start center !important;
  padding: 32px 14px 88px !important;
}

.focus-backdrop {
  z-index: 0;
}

.focus-modal-card {
  z-index: 1;
  left: var(--modal-drag-x,0px);
  top: var(--modal-drag-y,0px);
}

.focus-modal-header {
  position: relative;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.focus-modal-card.is-modal-dragging .focus-modal-header {
  cursor: grabbing;
}

/* Popup semantic dots use the same centerline as widget header dots.
   Cancel becomes a normal flex sibling instead of relying on a separate
   absolute positioning context. */
.focus-controls,
.focus-modal-actions {
  position: relative;
  height: 23px !important;
  min-height: 23px !important;
  margin-top: 4px;
  align-items: center !important;
}

.primary-slider {
  width: 48px !important;
  height: 23px !important;
  flex: 0 0 48px;
}

.modal-primary,
.modal-cancel,
.modal-edit {
  width: 23px !important;
  min-width: 23px !important;
  height: 23px !important;
  min-height: 23px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  line-height: 0 !important;
}

.modal-primary {
  top: 0 !important;
}

.modal-cancel {
  position: relative !important;
  left: auto !important;
  top: 0 !important;
  margin-left: 1px !important;
}

.modal-edit {
  position: relative !important;
  right: auto !important;
  top: 0 !important;
}

.modal-primary::before,
.modal-cancel::before,
.modal-edit::before {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 13px !important;
  height: 13px !important;
  margin: 0 !important;
  box-sizing: border-box;
  transform: translate(-50%,-50%) !important;
}

.focus-modal-header button {
  cursor: pointer;
  touch-action: manipulation;
}

@media (max-width: 760px) {
  .focus-modal-layer {
    padding: 22px 10px 82px !important;
  }

  .dock-tray-tools > button {
    height: 66px !important;
    min-height: 66px !important;
  }
}


/* =========================================================
   Iteration 33 — GRID GEOMETRY + READABLE TYPE SCALE
   Utility Small is the geometry unit. Dock-label size becomes
   the minimum readable caption/body size for utility and Notes UI.
   ========================================================= */

:root {
  --atom-readable-text: 10.5px;
}

/* All working sizes now resolve from JS-calculated 12px-grid dimensions. */
.widget[data-size="utility-small"] {
  width: var(--atom-utility-small-w) !important;
  height: var(--atom-utility-small-h) !important;
}

.widget[data-size="utility-medium"] {
  width: var(--atom-utility-small-w) !important;
  height: var(--atom-utility-medium-h) !important;
}

.widget[data-size="portrait"] {
  width: var(--atom-portrait-w) !important;
  height: var(--atom-portrait-h) !important;
}

.widget[data-size="landscape"] {
  width: var(--atom-landscape-w) !important;
  height: var(--atom-landscape-h) !important;
}

.widget[data-size="utility-large"] {
  width: var(--atom-landscape-w) !important;
  height: var(--atom-utility-medium-h) !important;
}

/* Full remains the escape hatch and is intentionally not tied to the modular grid. */

/* Dock labels establish the minimum readable UI-caption standard. */
.atom-dock small,
.dock-tray-tools small {
  font-size: var(--atom-readable-text) !important;
  line-height: 1.2 !important;
}

/* Every container footer and the entire filter surface share that standard. */
.widget-footer,
.widget-footer *,
.footer-filter,
.footer-filter button,
.footer-filter input,
.footer-filter select,
.footer-filter label,
.footer-filter span,
.footer-filter small,
.footer-filter b,
.footer-filter-toggle,
.scope-field,
.scope-field button,
.scope-field input,
.scope-field select,
.scope-field label,
.scope-field span,
.scope-field small,
.universal-filter-search,
.universal-filter-search input {
  font-size: var(--atom-readable-text) !important;
  line-height: 1.25;
}

.widget-footer {
  min-height: 34px;
}

.footer-filter-toggle {
  min-height: 28px;
}

/* Utility bottom captions all use one text scale. */
.heartbeat-instrument small,
.widget[data-kind="clock"] .utility-display small,
.widget[data-kind="weather"] .utility-display small {
  font-size: var(--atom-readable-text) !important;
  line-height: 1.2 !important;
  font-weight: 570;
}

/* Give the utility captions enough physical room after the type increase. */
.heartbeat-instrument {
  gap: 3px;
}

.heartbeat-instrument small {
  min-height: 13px;
  padding-inline: 4px;
}

.widget[data-kind="clock"] .utility-display small,
.widget[data-kind="weather"] .utility-display small {
  display: block;
  margin-top: 2px;
  min-height: 13px;
}

/* Notes uses the same dock-label baseline throughout its visible UI.
   Larger hierarchy/editor headings remain larger by intent. */
.rich-notes-workspace,
.rich-notes-workspace strong,
.rich-notes-workspace button,
.rich-notes-workspace input,
.rich-notes-workspace select,
.rich-notes-workspace textarea,
.rich-notes-workspace label,
.rich-notes-workspace small,
.rich-notes-workspace span,
.notes-master-context,
.notes-master-context strong,
.notes-master-context small,
.note-tree-category-label,
.note-tree-category-label strong,
.note-tree-category-label small,
.note-tree-record-label,
.note-tree-record-label > span,
.note-tree-record-label small,
.note-tree-folders > button,
.note-tree-folders > button > span,
.note-tree-folders > button > small,
.notes-list-pane,
.notes-list-pane > input,
.notes-list button,
.notes-list button > strong,
.notes-list button > span,
.notes-list button > small,
.rich-note-toolbar,
.rich-note-toolbar button,
.rich-note-toolbar select,
.note-title-input,
.rich-note-surface {
  font-size: var(--atom-readable-text) !important;
}

.notes-master-context {
  min-height: 30px;
}

.notes-master-context strong,
.note-tree-category-label strong,
.notes-list button > strong {
  font-weight: 700;
}

.notes-master-context small,
.note-tree-category-label small,
.note-tree-record-label small,
.note-tree-folders > button > small,
.notes-list button > small,
.notes-list button > span {
  line-height: 1.25;
}

.note-tree-category-label,
.note-tree-record-label,
.note-tree-folders > button {
  min-height: 30px;
}

.notes-list-pane > input,
.note-title-input {
  height: 34px !important;
  min-height: 34px;
}

.notes-list button,
.notes-master-workspace .notes-list button {
  min-height: 58px;
  padding-block: 8px;
}

.rich-note-toolbar,
.notes-master-workspace .rich-note-toolbar {
  min-height: 34px;
}

.rich-note-toolbar button,
.rich-note-toolbar select,
.notes-master-workspace .rich-note-toolbar button,
.notes-master-workspace .rich-note-toolbar select {
  height: 28px !important;
  min-height: 28px !important;
}

.rich-note-surface,
.notes-master-workspace .rich-note-surface,
.notes-utility-widget[data-size="full"] .rich-note-surface {
  font-size: var(--atom-readable-text) !important;
  line-height: 1.58;
}

/* Notes headings can lead the baseline rather than shrinking with it. */
.rich-note-surface h1 {
  font-size: 16px !important;
}

.rich-note-surface h2 {
  font-size: 14px !important;
}

.rich-note-surface h3 {
  font-size: 12px !important;
}

/* Keep modular sizing authoritative on narrower desktop/tablet widths too.
   Only Full breaks out of the module system. */
@media (max-width: 1100px) {
  .widget[data-size="portrait"] {
    width: min(var(--atom-portrait-w), calc(100vw - 48px)) !important;
    height: var(--atom-portrait-h) !important;
  }

  .widget[data-size="landscape"] {
    width: min(var(--atom-landscape-w), calc(100vw - 48px)) !important;
    height: var(--atom-landscape-h) !important;
  }

  .widget[data-size="utility-small"],
  .widget[data-size="utility-medium"] {
    width: var(--atom-utility-small-w) !important;
  }

  .widget[data-size="utility-large"] {
    width: min(var(--atom-landscape-w), calc(100vw - 48px)) !important;
    height: var(--atom-utility-medium-h) !important;
  }
}


/* =========================================================
   Iteration 34 — TWO-SIDED DOCK NOTIFICATION BOARD
   One physical glass object:
   front = toolbox, back = notification + next action.
   ========================================================= */

.atom-dock {
  --dock-board-width: min(430px,calc(100vw - 96px));
  --dock-board-height: 76px;
  width: var(--dock-board-width) !important;
  min-width: 0 !important;
  max-width: var(--dock-board-width) !important;
  height: var(--dock-board-height) !important;
  min-height: var(--dock-board-height) !important;
  padding: 0 !important;
  display: block !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 22px;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.dock-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  transform: rotateY(0deg);
  transition:
    transform .72s cubic-bezier(.18,.74,.18,1),
    filter .34s ease;
  will-change: transform;
}

.atom-dock.is-flipped .dock-flipper,
.atom-dock.modal-active .dock-flipper {
  transform: rotateY(180deg);
}

.dock-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.009)),
    rgba(25,29,34,.48);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.11),
    inset 1px 0 0 rgba(255,255,255,.035),
    inset -1px 0 0 rgba(0,0,0,.08),
    0 12px 28px rgba(0,0,0,.27);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.dock-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(105deg,
      transparent 0 24%,
      rgba(255,255,255,.055) 42%,
      rgba(255,255,255,.018) 52%,
      transparent 70%);
  opacity: .46;
  transform: translateZ(1px);
}

.dock-face-front {
  transform: rotateY(0deg) translateZ(1px);
}

.dock-face-back {
  transform: rotateY(180deg) translateZ(1px);
}

.atom-dock:not(.is-flipped):not(.modal-active) .dock-face-front {
  pointer-events: auto;
}

.atom-dock:not(.is-flipped):not(.modal-active) .dock-face-back {
  pointer-events: none;
}

.atom-dock.is-flipped .dock-face-front,
.atom-dock.modal-active .dock-face-front {
  pointer-events: none;
}

.atom-dock.is-flipped .dock-face-back,
.atom-dock.modal-active .dock-face-back {
  pointer-events: auto;
}

/* Front face stays visually identical to the dock language already established. */
.dock-face-front .dock-apps {
  width: 100%;
  height: 100%;
  padding: 6px 12px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

.atom-dock.modal-active .dock-apps {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

/* The old stack transition is replaced by the physical backside. */
.dock-face-back .dock-stack,
.atom-dock.modal-active .dock-stack,
.atom-dock.is-flipped .dock-stack {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  height: 100%;
  min-width: 0 !important;
  padding: 7px 12px;
  display: block !important;
  overflow: hidden !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  white-space: normal !important;
}

/* Notification board: deliberately larger than ordinary dock labels. */
.dock-board {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-content: center;
  gap: 2px;
}

.dock-board-context {
  position: absolute;
  top: -1px;
  right: 1px;
  max-width: 46%;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 36%,transparent);
  font-size: 9.5px;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dock-board-row {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 54px minmax(0,1fr);
  align-items: center;
  gap: 8px;
}

.dock-board-row > span {
  color: color-mix(in srgb,var(--ink) 40%,transparent);
  font-size: 10.5px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.dock-board-row > strong {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 92%,transparent);
  font-size: 13.5px;
  font-weight: 680;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dock-board-next {
  border-top: 1px solid rgba(255,255,255,.045);
}

.dock-board-next > span {
  color: color-mix(in srgb,var(--sem-purple) 72%,var(--ink));
}

.dock-board-next > strong {
  color: color-mix(in srgb,var(--ink) 82%,transparent);
  font-size: 12.5px;
  font-weight: 625;
}

/* The old floating status pill remains an aria-live region only. */
.mode-toast {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.mode-toast.is-visible {
  opacity: 0 !important;
}

/* During the flip, a restrained depth change keeps the object from reading
   like two divs cross-fading. */
.atom-dock.is-flipped,
.atom-dock.modal-active {
  filter: drop-shadow(0 13px 24px rgba(0,0,0,.18));
}

.atom-shell[data-background="white"] .dock-face {
  border-color: rgba(56,66,72,.12);
  background:
    linear-gradient(180deg,rgba(255,255,255,.38),rgba(255,255,255,.12)),
    rgba(238,241,242,.50);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.70),
    inset 1px 0 0 rgba(255,255,255,.30),
    0 10px 25px rgba(54,63,69,.15);
}

@media (max-width: 720px) {
  .atom-dock {
    --dock-board-width: calc(100vw - 48px);
    --dock-board-height: 78px;
    width: var(--dock-board-width) !important;
    max-width: var(--dock-board-width) !important;
    overflow: visible !important;
  }

  .dock-face-front .dock-apps {
    padding-inline: 7px;
    gap: 2px;
  }

  .dock-board-row {
    grid-template-columns: 48px minmax(0,1fr);
    gap: 6px;
  }

  .dock-board-row > strong {
    font-size: 12.5px;
  }

  .dock-board-next > strong {
    font-size: 11.5px;
  }

  .dock-board-context {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dock-flipper {
    transition-duration: .001ms !important;
  }
}


/* =========================================================
   Iteration 35 — MODULAR STACKING + DOCK OVERFLOW FIX
   Two Landscapes stack to one Portrait height. Dock magnification
   may rise outside the front face; the notification board gets
   enough vertical room for the larger readable text.
   ========================================================= */

/* The JS geometry remains authoritative; these rules simply document the
   intended relationship at the presentation layer. */
.widget[data-size="portrait"] {
  width: var(--atom-portrait-w) !important;
  height: var(--atom-portrait-h) !important;
}

.widget[data-size="landscape"] {
  width: var(--atom-landscape-w) !important;
  height: var(--atom-landscape-h) !important;
}

/* Front-side icon magnification must be allowed to escape the glass face.
   The face still paints its rounded border/background; only child overflow
   is released so the iMac-style hover lift is never visually guillotined. */
.atom-dock {
  --dock-board-height: 88px;
  overflow: visible !important;
}

.dock-flipper {
  overflow: visible !important;
}

.dock-face-front {
  overflow: visible !important;
}

.dock-face-front .dock-apps {
  position: relative;
  z-index: 3;
  overflow: visible !important;
  padding-top: 9px;
  padding-bottom: 8px;
}

.dock-face-front .dock-apps > button {
  position: relative;
  z-index: 4;
}

/* Keep only the notification face clipped to its own rounded glass.
   It now has enough height that larger Notice / Next text does not
   collide with the lower edge during the flip. */
.dock-face-back {
  overflow: hidden !important;
}

.dock-face-back .dock-stack,
.atom-dock.modal-active .dock-stack,
.atom-dock.is-flipped .dock-stack {
  padding: 8px 14px 10px !important;
}

.dock-board {
  grid-template-rows: repeat(2,minmax(32px,1fr)) !important;
  gap: 1px !important;
  align-content: stretch !important;
}

.dock-board-row {
  min-height: 32px;
}

.dock-board-row > span {
  line-height: 1.15 !important;
}

.dock-board-row > strong {
  line-height: 1.22 !important;
  padding-bottom: 1px;
}

.dock-board-next {
  padding-top: 2px;
  padding-bottom: 1px;
}

.dock-board-context {
  top: 1px;
}

@media (max-width: 720px) {
  .atom-dock {
    --dock-board-height: 90px;
  }

  .dock-face-front .dock-apps {
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .dock-face-back .dock-stack,
  .atom-dock.modal-active .dock-stack,
  .atom-dock.is-flipped .dock-stack {
    padding: 9px 12px 10px !important;
  }
}


/* =========================================================
   Iteration 36 — PURPLE POPUP / EDIT SEMANTIC
   Purple means: clicking this affordance opens a focused popup
   or enters an edit/select surface. Blue remains connection-only.
   ========================================================= */

:root {
  --popup-edit: var(--sem-magenta);
  --popup-edit-soft: color-mix(in srgb,var(--sem-magenta) 12%,transparent);
  --popup-edit-line: color-mix(in srgb,var(--sem-magenta) 32%,transparent);
}

/* Text links and relationship values that launch focused views. */
.cell-link,
.detail-relation,
.relation-picker,
[data-open-details-kind],
[data-related-kind],
[data-open-stock],
[data-open-set-components],
[data-open-inventory-kind],
[data-modal-select-field] {
  color: color-mix(in srgb,var(--popup-edit) 88%,white) !important;
  cursor: pointer;
}

.cell-link:hover,
.detail-relation:hover,
.relation-picker:hover,
[data-open-details-kind]:hover,
[data-related-kind]:hover,
[data-open-stock]:hover,
[data-open-set-components]:hover,
[data-open-inventory-kind]:hover,
[data-modal-select-field]:hover {
  color: color-mix(in srgb,var(--popup-edit) 78%,white) !important;
  text-decoration-color: color-mix(in srgb,var(--popup-edit) 72%,transparent);
}

/* Ellipsis/detail affordances are popup affordances too. */
.details-button,
.inventory-quick {
  color: var(--popup-edit) !important;
}

.details-button:hover,
.inventory-quick:hover {
  color: color-mix(in srgb,var(--popup-edit) 82%,white) !important;
  background: var(--popup-edit-soft) !important;
  box-shadow: inset 0 0 0 1px var(--popup-edit-line);
}

/* Buttons that read more like actions keep their glass button shape,
   but the popup/edit semantic owns the foreground and border. */
.inventory-button,
.detail-inventory-open,
.detail-related-list > button,
.component-list > button,
.inventory-list > button {
  color: color-mix(in srgb,var(--popup-edit) 86%,white) !important;
  border-color: color-mix(in srgb,var(--popup-edit) 20%,rgba(255,255,255,.06)) !important;
}

.inventory-button:hover,
.detail-inventory-open:hover,
.detail-related-list > button:hover,
.component-list > button:hover,
.inventory-list > button:hover {
  color: color-mix(in srgb,var(--popup-edit) 76%,white) !important;
  border-color: var(--popup-edit-line) !important;
  background: var(--popup-edit-soft) !important;
}

/* Relationship pickers inside edit forms open a second focused selector,
   so the purple cue remains even while the parent popup is already open. */
.focus-modal-card .relation-picker,
.focus-modal-card [data-modal-select-field] {
  border-color: color-mix(in srgb,var(--popup-edit) 20%,rgba(255,255,255,.07)) !important;
}

.focus-modal-card .relation-picker:hover,
.focus-modal-card [data-modal-select-field]:hover {
  border-color: var(--popup-edit-line) !important;
  background: var(--popup-edit-soft) !important;
}

/* Popup/edit focus rings are purple; connection focus stays blue. */
.details-button:focus-visible,
.inventory-quick:focus-visible,
.cell-link:focus-visible,
.detail-relation:focus-visible,
.relation-picker:focus-visible,
.inventory-button:focus-visible,
[data-open-details-kind]:focus-visible,
[data-related-kind]:focus-visible,
[data-open-stock]:focus-visible,
[data-open-set-components]:focus-visible,
[data-open-inventory-kind]:focus-visible,
[data-modal-select-field]:focus-visible {
  outline: 2px solid color-mix(in srgb,var(--popup-edit) 76%,white) !important;
  outline-offset: 2px;
}

/* White workspace keeps the same semantic, just with enough contrast. */
.atom-shell[data-background="white"] .cell-link,
.atom-shell[data-background="white"] .detail-relation,
.atom-shell[data-background="white"] .relation-picker,
.atom-shell[data-background="white"] [data-open-details-kind],
.atom-shell[data-background="white"] [data-related-kind],
.atom-shell[data-background="white"] [data-open-stock],
.atom-shell[data-background="white"] [data-open-set-components],
.atom-shell[data-background="white"] [data-open-inventory-kind],
.atom-shell[data-background="white"] [data-modal-select-field] {
  color: color-mix(in srgb,var(--popup-edit) 78%,#332b33) !important;
}


/* =========================================================
   Iteration 37 — DESKTOP MODULE + COMPACT DOCK
   Preserve readable utility content without inflating the containers.
   ========================================================= */

/* The two-sided dock stays compact; its back-face layout must fit the object,
   not force the object to grow. */
.atom-dock {
  --dock-board-height: 74px !important;
  height: var(--dock-board-height) !important;
  min-height: var(--dock-board-height) !important;
  border-radius: 20px;
}

.dock-face {
  border-radius: 20px;
}

.dock-face-front .dock-apps {
  padding: 4px 12px 5px !important;
}

.dock-face-back .dock-stack,
.atom-dock.modal-active .dock-stack,
.atom-dock.is-flipped .dock-stack {
  padding: 5px 12px 6px !important;
}

.dock-board {
  grid-template-rows: repeat(2,minmax(27px,1fr)) !important;
  gap: 0 !important;
}

.dock-board-row {
  min-height: 27px !important;
}

.dock-board-row > strong {
  line-height: 1.12 !important;
  padding-bottom: 0 !important;
}

.dock-board-next {
  padding-top: 1px !important;
  padding-bottom: 0 !important;
}

.dock-board-context {
  top: 0;
  font-size: 8.5px;
}

/* A Utility Small has a 32px mini-header. The old 17px body padding consumed
   too much of the remaining 64px at the intended 96px height, clipping the
   readable bottom caption. Keep the type; recover the space instead. */
.utility-widget .widget-body {
  padding: 2px 12px 6px !important;
  overflow: visible !important;
}

.widget[data-size="utility-small"] .widget-body {
  min-height: 0;
}

.widget[data-kind="clock"] .utility-display,
.widget[data-kind="weather"] .utility-display {
  height: 100%;
  min-height: 0 !important;
  align-content: center;
  padding-bottom: 2px;
  box-sizing: border-box;
}

.widget[data-kind="clock"] .utility-display > div,
.widget[data-kind="weather"] .utility-display > div {
  min-height: 0;
  padding-bottom: 1px;
}

.widget[data-kind="clock"] .utility-display small,
.widget[data-kind="weather"] .utility-display small {
  margin-top: 1px !important;
  min-height: 12px !important;
  line-height: 1.12 !important;
  overflow: visible;
}

.heartbeat-instrument {
  min-height: 0;
  gap: 1px !important;
  padding-bottom: 1px;
}

.heartbeat-wave {
  min-height: 32px;
}

.heartbeat-instrument small {
  min-height: 12px !important;
  line-height: 1.12 !important;
  overflow: visible;
}

/* Keep dock hover magnification free above the smaller face. */
.dock-face-front,
.dock-face-front .dock-apps {
  overflow: visible !important;
}

@media (max-width: 720px) {
  .atom-dock {
    --dock-board-height: 76px !important;
  }

  .dock-face-front .dock-apps {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  .dock-face-back .dock-stack,
  .atom-dock.modal-active .dock-stack,
  .atom-dock.is-flipped .dock-stack {
    padding: 5px 10px 6px !important;
  }
}


/* =========================================================
   Iteration 38 — FULL-WORKSPACE FIT + UTILITY CAPTIONS
   Screenshot acceptance: larger working surfaces, single-line
   utility captions, and a little more dock icon/label breathing room.
   ========================================================= */

/* Utility captions stay readable but are no longer promoted to the larger
   dock-label baseline. They are compact instrumentation captions and should
   remain a single line inside a 192px utility. */
.heartbeat-instrument small,
.widget[data-kind="clock"] .utility-display small,
.widget[data-kind="weather"] .utility-display small {
  font-size: 9px !important;
  line-height: 1.08 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
  letter-spacing: .008em;
}

.widget[data-kind="clock"] .utility-display small,
.widget[data-kind="weather"] .utility-display small {
  margin-top: 1px !important;
  min-height: 10px !important;
}

.heartbeat-instrument small {
  min-height: 10px !important;
  padding-inline: 3px;
}

/* Use the wider desktop utility footprint without wasting its body width. */
.utility-widget .widget-body {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

/* Dock label spacing: preserve the compact dock height, but stop the text
   from visually touching the icon tile. */
.dock-face-front .dock-apps > button {
  row-gap: 4px !important;
}

.dock-face-front .dock-apps > button > small,
.atom-dock small {
  margin-top: 4px !important;
}

/* The hover-lift face remains free to grow outside the glass shell. */
.dock-face-front,
.dock-face-front .dock-apps,
.dock-face-front .dock-apps > button {
  overflow: visible !important;
}


/* =========================================================
   Iteration 39 — SELECTION GUARD + CONNECTION STATE DOTS
   Workspace canvas is drag-first, not browser-text-selection-first.
   Blue connection dot now communicates real connection state.
   ========================================================= */

/* Prevent accidental browser selection while dragging through the workspace.
   Restore selection only where text editing/selection is intentionally useful. */
.workspace-page,
.workspace-page .widget,
.workspace-page .widget * {
  -webkit-user-select: none;
  user-select: none;
}

.workspace-page input,
.workspace-page textarea,
.workspace-page select,
.workspace-page [contenteditable="true"],
.workspace-page .rich-note-surface {
  -webkit-user-select: text;
  user-select: text;
}

/* Connection semantic:
   unconnected = dark center + blue outline
   connected   = solid blue
   connection-mode source/target keeps its extra halo treatment. */
.widget-header .plug::before {
  background: rgba(13,16,20,.96) !important;
  border: 1.5px solid #6f93b3 !important;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.22),
    0 0 0 1px rgba(111,147,179,.05) !important;
}

.widget-header .plug:hover::before {
  background: rgba(20,22,27,.98) !important;
  border-color: #86a8c5 !important;
}

.widget-header .plug.is-connected::before,
.widget-header .plug.is-source::before {
  background: #6f93b3 !important;
  border-color: #6f93b3 !important;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 0 0 3px rgba(111,147,179,.10) !important;
}

.widget-header .plug.is-connected:hover::before,
.widget-header .plug.is-source:hover::before {
  background: #7f9fba !important;
  border-color: #7f9fba !important;
}

/* During target selection the normal outlined center remains visible and the
   larger target halo grows from that same center point. */
.widget-header .plug.is-target::before {
  background: rgba(13,16,20,.96) !important;
  border-color: #7f9fba !important;
}

.widget-header .plug.is-target::after {
  border-color: rgba(111,147,179,.72) !important;
}


/* =========================================================
   Iteration 40 — UNIVERSAL VIEWPORT SIZE MODEL
   U/H are derived from the active usable workspace.
   ========================================================= */

/*
  BASE RATIOS
  Utility   = 1U × 1H
  Portrait  = 2U × 8H
  Landscape = 4U × 4H

  TEAL SIZE CYCLES
  Landscape: standard → double-height → double-width → standard
  Portrait:  standard → double-width → standard
  Notes:     utility-large → landscape → full workspace → utility-large
*/

.widget[data-size="utility-small"] {
  width: var(--atom-utility-small-w) !important;
  height: var(--atom-utility-small-h) !important;
}

.widget[data-size="utility-medium"] {
  width: var(--atom-utility-small-w) !important;
  height: var(--atom-utility-medium-h) !important;
}

.widget[data-size="utility-large"] {
  width: var(--atom-landscape-w) !important;
  height: var(--atom-utility-medium-h) !important;
}

.widget[data-size="portrait"] {
  width: var(--atom-portrait-w) !important;
  height: var(--atom-portrait-h) !important;
}

.widget[data-size="portrait-wide"] {
  width: var(--atom-landscape-w) !important;
  height: var(--atom-portrait-h) !important;
}

.widget[data-size="landscape"] {
  width: var(--atom-landscape-w) !important;
  height: var(--atom-landscape-h) !important;
}

.widget[data-size="landscape-tall"] {
  width: var(--atom-landscape-w) !important;
  height: var(--atom-portrait-h) !important;
}

.widget[data-size="landscape-wide"] {
  width: calc(var(--atom-landscape-w) * 2) !important;
  height: var(--atom-landscape-h) !important;
}

.widget[data-size="full"] {
  width: var(--atom-workspace-w) !important;
  height: var(--atom-workspace-h) !important;
  max-width: none !important;
  max-height: none !important;
}

/* New semantic size states inherit the same pane internals as their family. */
.widget[data-size="portrait-wide"] .scope-stack {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.widget[data-size="landscape-tall"] .scope-stack,
.widget[data-size="landscape-wide"] .scope-stack {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

/* Viewport-relative geometry stays authoritative on tablets as well.
   Older responsive clamps must not shrink the module independently. */
@media (max-width: 1100px) {
  .widget[data-size="portrait"],
  .widget[data-size="portrait-wide"],
  .widget[data-size="landscape"],
  .widget[data-size="landscape-tall"],
  .widget[data-size="landscape-wide"],
  .widget[data-size="utility-small"],
  .widget[data-size="utility-medium"],
  .widget[data-size="utility-large"] {
    max-width: none !important;
    max-height: none !important;
  }

  .widget[data-size="portrait"] {
    width: var(--atom-portrait-w) !important;
    height: var(--atom-portrait-h) !important;
  }

  .widget[data-size="portrait-wide"] {
    width: var(--atom-landscape-w) !important;
    height: var(--atom-portrait-h) !important;
  }

  .widget[data-size="landscape"] {
    width: var(--atom-landscape-w) !important;
    height: var(--atom-landscape-h) !important;
  }

  .widget[data-size="landscape-tall"] {
    width: var(--atom-landscape-w) !important;
    height: var(--atom-portrait-h) !important;
  }

  .widget[data-size="landscape-wide"] {
    width: calc(var(--atom-landscape-w) * 2) !important;
    height: var(--atom-landscape-h) !important;
  }

  .widget[data-size="utility-large"] {
    width: var(--atom-landscape-w) !important;
    height: var(--atom-utility-medium-h) !important;
  }
}


/* =========================================================
   Iteration 41 — INSTRUMENTS + EXCEL TABLE CHROME
   Base viewport geometry is intentionally untouched.
   ========================================================= */

/* ---------- new teal size states ---------- */

.widget[data-size="landscape-both"] {
  width: calc(var(--atom-landscape-w) * 2) !important;
  height: calc(var(--atom-landscape-h) * 2) !important;
}

.widget[data-size="utility-2x2"] {
  width: calc(var(--atom-utility-small-w) * 2) !important;
  height: calc(var(--atom-utility-small-h) * 2) !important;
}

/* Notes now has only two states: Landscape ↔ actual workspace Full. */
.notes-utility-widget[data-size="landscape"] .notes-master-workspace,
.notes-utility-widget[data-size="full"] .notes-master-workspace {
  grid-template-columns: 220px 230px minmax(0,1fr);
}

/* ---------- connector centering ---------- */

.widget-header .plug {
  position: relative !important;
  width: 23px !important;
  height: 23px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.widget-header .plug::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 13px !important;
  height: 13px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border: 1.5px solid #6f93b3 !important;
  border-radius: 50% !important;
  background: rgba(13,16,20,.96) !important;
  transform: translate(-50%,-50%) !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.20) !important;
}

.widget-header .plug:hover::before,
.widget-header .plug.is-connected::before,
.widget-header .plug.is-source::before {
  background: #6f93b3 !important;
  border-color: #6f93b3 !important;
}

.widget-header .plug:hover::before {
  background: #7f9fba !important;
  border-color: #7f9fba !important;
}

.widget-header .plug.is-target::before {
  background: rgba(13,16,20,.96) !important;
  border-color: #7f9fba !important;
}

.widget-header .plug.is-target::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: auto !important;
  left: 50% !important;
  top: 50% !important;
  width: 21px !important;
  height: 21px !important;
  margin: 0 !important;
  box-sizing: border-box;
  border: 1px solid rgba(111,147,179,.74) !important;
  border-radius: 50% !important;
  background: transparent !important;
  transform: translate(-50%,-50%) !important;
  box-shadow: 0 0 0 3px rgba(111,147,179,.10) !important;
}

/* ---------- adaptive dock width ---------- */

.atom-dock {
  transition:
    width .44s cubic-bezier(.18,.78,.18,1),
    max-width .44s cubic-bezier(.18,.78,.18,1),
    filter .30s ease !important;
}

.dock-flipper,
.dock-face {
  width: 100%;
  transition:
    transform .72s cubic-bezier(.18,.74,.18,1),
    border-radius .25s ease;
}

.dock-board-row > strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-identity[role="button"] {
  cursor: pointer;
  border-radius: 9px;
  outline: none;
}

.rail-identity[role="button"]:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb,var(--sem-teal,#63b1ae) 55%,transparent);
}

/* ---------- Weather: icon | degrees ---------- */

.widget[data-kind="weather"] .widget-body {
  display: grid;
  place-items: stretch;
  padding: 1px 8px 5px !important;
}

.weather-instrument-v16 {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 5px;
}

.atom-weather-icon {
  width: 100%;
  height: min(48px,88%);
  min-width: 0;
  color: color-mix(in srgb,var(--sem-teal,#63b1ae) 80%,var(--ink));
  overflow: visible;
}

.weather-degrees-v16 {
  color: var(--ink);
  font-size: clamp(22px,2.3vw,34px);
  font-weight: 730;
  line-height: .95;
  letter-spacing: -.03em;
  white-space: nowrap;
}

/* ---------- Analog clock ---------- */

.widget[data-kind="clock"] .utility-minimal-header .window-controls {
  gap: 1px !important;
}

.widget[data-kind="clock"] .widget-body {
  padding: 1px 5px 5px !important;
  display: grid;
  place-items: center;
}

.analog-clock-wrap-v16 {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.atom-analog-clock {
  width: 100%;
  height: 100%;
  max-width: min(100%,220px);
  max-height: min(100%,220px);
  overflow: visible;
}

.clock-ring-v16 {
  fill: none;
  stroke: color-mix(in srgb,var(--ink) 76%,transparent);
  stroke-width: 1.25;
}

.clock-numerals-v16 {
  fill: color-mix(in srgb,var(--ink) 82%,transparent);
  font-size: 7px;
  font-family: inherit;
  font-weight: 560;
  text-anchor: middle;
}

.clock-hand-v16 {
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.clock-hour-v16 {
  stroke: var(--ink);
  stroke-width: 3.1;
}

.clock-minute-v16 {
  stroke: color-mix(in srgb,var(--ink) 88%,transparent);
  stroke-width: 2.1;
}

.clock-second-v16 {
  stroke: var(--sem-teal,#63b1ae);
  stroke-width: 1.05;
}

.clock-pin-v16 {
  fill: var(--sem-teal,#63b1ae);
  stroke: var(--paper-deep,#15191d);
  stroke-width: 1;
}

.widget[data-kind="clock"][data-size="utility-small"] .clock-numerals-v16 {
  font-size: 6.3px;
}

/* ---------- Spreadsheet table: vertical + horizontal ATOM scroll ---------- */

.widget-body:has(> .sheet-table),
.widget-body:has(> .context-chip + .sheet-table) {
  min-height: 0;
}

.sheet-table.atom-scroll-surface {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto !important;
  position: relative;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sheet-head,
.sheet-row {
  width: max(100%,var(--sheet-total-width));
  min-width: var(--sheet-total-width);
  grid-template-columns: var(--sheet-columns) !important;
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background:
    linear-gradient(180deg,rgba(31,36,41,.98),rgba(31,36,41,.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sheet-rows {
  min-width: var(--sheet-total-width);
}

.sheet-head-cell {
  position: relative;
  min-width: 0;
  overflow: visible !important;
}

.sheet-head-cell > button {
  width: calc(100% - 4px);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.column-resize-handle {
  position: absolute;
  z-index: 8;
  top: 3px;
  right: -4px;
  width: 8px;
  height: calc(100% - 6px);
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 15%;
  bottom: 15%;
  width: 1px;
  border-radius: 1px;
  background: rgba(255,255,255,.075);
  transform: translateX(-50%);
  transition: background .10s ease,box-shadow .10s ease;
}

.column-resize-handle:hover::before,
.widget.is-column-resizing .column-resize-handle::before {
  background: var(--sem-teal,#63b1ae);
  box-shadow: 0 0 7px color-mix(in srgb,var(--sem-teal,#63b1ae) 35%,transparent);
}

/* ---------- Column editor: visibility + order only ---------- */

.column-editor-menu-v16 {
  width: 292px !important;
  max-height: min(470px,calc(100vh - 150px));
  overflow: auto !important;
}

.column-editor-menu-v16 .column-editor-meta {
  position: sticky;
  top: 0;
  z-index: 3;
}

.column-choice-v16 {
  min-height: 38px;
  padding: 4px 5px;
  display: grid !important;
  grid-template-columns: 22px minmax(0,1fr) auto;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color .10s ease,background .10s ease,opacity .10s ease;
}

.column-choice-v16:hover {
  border-color: rgba(255,255,255,.055);
  background: rgba(255,255,255,.018);
}

.column-choice-v16.is-column-dragging {
  opacity: .45;
}

.column-drag-grip {
  color: color-mix(in srgb,var(--ink) 32%,transparent);
  font-size: 15px;
  line-height: 1;
  cursor: grab;
  text-align: center;
}

.column-choice-v16:active .column-drag-grip {
  cursor: grabbing;
}

.column-choice-v16 > label {
  min-width: 0;
  display: grid;
  grid-template-columns: 16px minmax(0,1fr);
  align-items: center;
  gap: 6px;
}

.column-choice-v16 > label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-order-controls {
  display: flex;
  gap: 2px;
}

.column-order-controls > button {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb,var(--ink) 58%,transparent);
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 6px;
  background: rgba(255,255,255,.006);
}

.column-order-controls > button:hover:not(:disabled) {
  color: var(--ink);
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.025);
}

.column-order-controls > button:disabled {
  opacity: .20;
}

/* ---------- ATOM scrollbars ---------- */

.atom-scroll-surface,
.column-editor-menu-v16,
.focus-modal-body,
.note-master-tree,
.notes-list,
.rich-note-surface,
.dock-tray-tools {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb,var(--sem-teal,#63b1ae) 72%,transparent) transparent;
}

.atom-scroll-surface::-webkit-scrollbar,
.column-editor-menu-v16::-webkit-scrollbar,
.focus-modal-body::-webkit-scrollbar,
.note-master-tree::-webkit-scrollbar,
.notes-list::-webkit-scrollbar,
.rich-note-surface::-webkit-scrollbar,
.dock-tray-tools::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.atom-scroll-surface::-webkit-scrollbar-track,
.column-editor-menu-v16::-webkit-scrollbar-track,
.focus-modal-body::-webkit-scrollbar-track,
.note-master-tree::-webkit-scrollbar-track,
.notes-list::-webkit-scrollbar-track,
.rich-note-surface::-webkit-scrollbar-track,
.dock-tray-tools::-webkit-scrollbar-track {
  background: transparent;
}

.atom-scroll-surface::-webkit-scrollbar-thumb,
.column-editor-menu-v16::-webkit-scrollbar-thumb,
.focus-modal-body::-webkit-scrollbar-thumb,
.note-master-tree::-webkit-scrollbar-thumb,
.notes-list::-webkit-scrollbar-thumb,
.rich-note-surface::-webkit-scrollbar-thumb,
.dock-tray-tools::-webkit-scrollbar-thumb {
  min-height: 34px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb,var(--sem-teal,#63b1ae) 76%,transparent);
  background-clip: content-box;
}

.atom-scroll-surface::-webkit-scrollbar-thumb:hover,
.column-editor-menu-v16::-webkit-scrollbar-thumb:hover,
.focus-modal-body::-webkit-scrollbar-thumb:hover,
.note-master-tree::-webkit-scrollbar-thumb:hover,
.notes-list::-webkit-scrollbar-thumb:hover,
.rich-note-surface::-webkit-scrollbar-thumb:hover,
.dock-tray-tools::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb,var(--sem-teal,#63b1ae) 92%,white 4%);
  background-clip: content-box;
}

.atom-scroll-surface::-webkit-scrollbar-corner,
.column-editor-menu-v16::-webkit-scrollbar-corner,
.focus-modal-body::-webkit-scrollbar-corner {
  background: transparent;
}

@media (max-width: 760px) {
  .weather-degrees-v16 {
    font-size: 24px;
  }

  .column-editor-menu-v16 {
    width: min(292px,calc(100vw - 44px)) !important;
  }
}


/* =========================================================
   Iteration 42 — SEMANTIC COLOR DISCIPLINE
   Color is reserved for established semantic actions/states.
   Everything else stays neutral gel/glass.
   ========================================================= */

/* Calculator is intentionally the only size change in this pass:
   one Utility wide × four Utility heights tall. */
.widget[data-size="utility-calc"],
.widget[data-kind="calculator"] {
  width: var(--atom-utility-small-w) !important;
  height: calc(var(--atom-utility-small-h) * 4) !important;
}

/* ---------- Weather: neutral dock-icon language + bottom caption ---------- */

.widget[data-kind="weather"] .widget-body {
  padding: 0 8px 5px !important;
  display: block !important;
  overflow: hidden;
}

.weather-instrument-v16 {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid !important;
  grid-template-rows: minmax(0,1fr) 12px;
  align-items: stretch;
  gap: 0;
}

.weather-main-v17 {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 5px;
  padding-inline: 5px;
}

.atom-weather-icon {
  width: min(100%,58px) !important;
  height: min(100%,43px) !important;
  justify-self: end;
  color: color-mix(in srgb,var(--ink) 92%,transparent) !important;
  overflow: visible;
}

.weather-degrees-v16 {
  justify-self: start;
  color: var(--ink);
  font-size: clamp(23px,2.2vw,32px);
  font-weight: 720;
  line-height: 1;
}

.weather-caption-v17 {
  min-width: 0;
  align-self: end;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 560;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Clock: Digital standard, Analog only at 2×2 ---------- */

.widget[data-kind="clock"] .widget-body {
  min-width: 0;
  min-height: 0;
  padding: 0 7px 5px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden;
}

.clock-digital-v17 {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
}

.clock-digital-v17 > strong {
  color: var(--ink);
  font-size: clamp(25px,2.5vw,34px);
  font-weight: 720;
  line-height: .98;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.clock-digital-v17 > small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 560;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .035em;
  white-space: nowrap;
}

.widget[data-kind="clock"][data-size="utility-2x2"] .widget-body {
  padding: 2px 8px 8px !important;
}

.analog-clock-wrap-v16 {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.atom-analog-clock {
  width: min(78%,calc(var(--atom-utility-small-h) * 1.58)) !important;
  height: auto !important;
  max-width: none !important;
  max-height: calc(100% - 2px) !important;
  aspect-ratio: 1 / 1;
  overflow: visible;
}

.clock-ring-v16 {
  stroke: color-mix(in srgb,var(--ink) 74%,transparent) !important;
}

.clock-numerals-v16 {
  fill: color-mix(in srgb,var(--ink) 76%,transparent) !important;
}

.clock-hour-v16 {
  stroke: var(--ink) !important;
}

.clock-minute-v16 {
  stroke: color-mix(in srgb,var(--ink) 88%,transparent) !important;
}

.clock-second-v16 {
  stroke: color-mix(in srgb,var(--ink) 54%,transparent) !important;
}

.clock-pin-v16 {
  fill: color-mix(in srgb,var(--ink) 76%,transparent) !important;
  stroke: var(--paper-deep,#15191d) !important;
}

/* ---------- Column ordering controls: circular neutral gel ---------- */

.column-order-controls {
  gap: 4px !important;
}

.column-order-controls > button {
  width: 27px !important;
  height: 27px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  color: color-mix(in srgb,var(--ink) 66%,transparent) !important;
  border: 1px solid rgba(255,255,255,.072) !important;
  border-radius: 50% !important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.012)),
    rgba(255,255,255,.025) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 2px 5px rgba(0,0,0,.075);
  font-size: 12px;
  line-height: 1;
}

.column-order-controls > button:hover:not(:disabled) {
  color: var(--ink) !important;
  border-color: rgba(255,255,255,.115) !important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.022)),
    rgba(255,255,255,.040) !important;
}

.column-order-controls > button:active:not(:disabled) {
  transform: scale(.92);
}

.column-choice-v16 input[type="checkbox"] {
  accent-color: #737b82;
}

/* ---------- Table: remove final action-column ghost ---------- */

.sheet-details-head,
.sheet-details-cell {
  display: none !important;
}

.sheet-head-cell:last-child,
.sheet-cell:last-child {
  border-right: 0 !important;
}

/* Let the live data viewport dictate the default column fill.
   User-resized columns may overflow and expose the horizontal pill. */
.widget-body:has(.sheet-table.atom-scroll-surface) {
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
}

.sheet-table.atom-scroll-surface {
  flex: 1 1 auto;
  width: 100%;
  height: auto !important;
  min-height: 0;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: auto !important;
}

.sheet-head,
.sheet-row {
  width: max(100%,var(--sheet-total-width));
}

.sheet-rows {
  min-height: max-content;
  min-width: var(--sheet-total-width);
  overflow: visible !important;
}

/* ---------- Neutral pill scroll indicators ---------- */

:root {
  --atom-scroll-thumb: rgba(76,83,90,.62);
  --atom-scroll-thumb-hover: rgba(92,100,108,.74);
}

.atom-scroll-surface,
.column-editor-menu-v16,
.focus-modal-body,
.note-master-tree,
.notes-list,
.rich-note-surface,
.dock-tray-tools {
  scrollbar-width: thin !important;
  scrollbar-color: var(--atom-scroll-thumb) transparent !important;
}

.atom-scroll-surface::-webkit-scrollbar,
.column-editor-menu-v16::-webkit-scrollbar,
.focus-modal-body::-webkit-scrollbar,
.note-master-tree::-webkit-scrollbar,
.notes-list::-webkit-scrollbar,
.rich-note-surface::-webkit-scrollbar,
.dock-tray-tools::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
  background: transparent !important;
}

.atom-scroll-surface::-webkit-scrollbar-track,
.column-editor-menu-v16::-webkit-scrollbar-track,
.focus-modal-body::-webkit-scrollbar-track,
.note-master-tree::-webkit-scrollbar-track,
.notes-list::-webkit-scrollbar-track,
.rich-note-surface::-webkit-scrollbar-track,
.dock-tray-tools::-webkit-scrollbar-track {
  background: transparent !important;
  box-shadow: none !important;
}

.atom-scroll-surface::-webkit-scrollbar-thumb,
.column-editor-menu-v16::-webkit-scrollbar-thumb,
.focus-modal-body::-webkit-scrollbar-thumb,
.note-master-tree::-webkit-scrollbar-thumb,
.notes-list::-webkit-scrollbar-thumb,
.rich-note-surface::-webkit-scrollbar-thumb,
.dock-tray-tools::-webkit-scrollbar-thumb {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  background: var(--atom-scroll-thumb) !important;
  background-clip: padding-box !important;
  box-shadow: none !important;
}

.atom-scroll-surface::-webkit-scrollbar-thumb:hover,
.column-editor-menu-v16::-webkit-scrollbar-thumb:hover,
.focus-modal-body::-webkit-scrollbar-thumb:hover,
.note-master-tree::-webkit-scrollbar-thumb:hover,
.notes-list::-webkit-scrollbar-thumb:hover,
.rich-note-surface::-webkit-scrollbar-thumb:hover,
.dock-tray-tools::-webkit-scrollbar-thumb:hover {
  background: var(--atom-scroll-thumb-hover) !important;
}

.atom-scroll-surface::-webkit-scrollbar-button,
.column-editor-menu-v16::-webkit-scrollbar-button,
.focus-modal-body::-webkit-scrollbar-button,
.note-master-tree::-webkit-scrollbar-button,
.notes-list::-webkit-scrollbar-button,
.rich-note-surface::-webkit-scrollbar-button,
.dock-tray-tools::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.atom-scroll-surface::-webkit-scrollbar-corner,
.column-editor-menu-v16::-webkit-scrollbar-corner,
.focus-modal-body::-webkit-scrollbar-corner {
  background: transparent !important;
}

/* Navigation is neutral; teal remains reserved for Size semantics. */
.rail-identity[role="button"]:focus-visible {
  box-shadow: 0 0 0 2px rgba(255,255,255,.14) !important;
}

@media (max-width: 760px) {
  .widget[data-size="utility-calc"],
  .widget[data-kind="calculator"] {
    width: var(--atom-utility-small-w) !important;
    height: calc(var(--atom-utility-small-h) * 4) !important;
  }

  .atom-analog-clock {
    width: min(82%,calc(var(--atom-utility-small-h) * 1.52)) !important;
  }
}

/* =========================================================
   CALCULATOR — APPROVED CALC2 PROMOTION
   Calc2 is now the one canonical Calculator.
   ========================================================= */

.widget[data-kind="calculator"] {
  width: var(--atom-utility-small-w) !important;
  height: var(--atom-utility-medium-h) !important;
  padding-top: 32px !important;
}

.widget[data-kind="calculator"] .utility-minimal-header {
  height: 32px !important;
  min-height: 32px !important;
  padding-top: 5px !important;
}

.widget[data-kind="calculator"] .widget-title strong {
  font-size: 10px !important;
  font-weight: 660 !important;
  color: var(--muted) !important;
}

.widget[data-kind="calculator"] .widget-body {
  min-height: 0 !important;
  height: 100% !important;
  padding: 4px 8px 12px !important;
  overflow: hidden !important;
}

.widget[data-kind="calculator"] .calculator-grid-approved {
  height: 100%;
  display: grid !important;
  grid-template-columns: repeat(4,minmax(0,1fr));
  grid-template-rows: minmax(44px,.85fr) repeat(5,minmax(34px,1fr));
  gap: 6px;
}

.widget[data-kind="calculator"] .calculator-screen-approved {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 0 8px 4px;
  display: flex;
  align-items: end;
  justify-content: flex-end;
  overflow: hidden;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink);
  font-size: clamp(29px,3vw,42px);
  font-weight: 420;
  line-height: 1;
  letter-spacing: -.035em;
  white-space: nowrap;
  text-overflow: clip;
}

.widget[data-kind="calculator"] .calculator-key-approved {
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.19) !important;
  border-radius: 999px;
  background: transparent !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    0 1px 3px rgba(0,0,0,.08) !important;
  font-size: 14px;
  font-weight: 540;
  transition:
    transform .08s ease,
    background .10s ease,
    border-color .10s ease;
}

.widget[data-kind="calculator"] .calculator-key-approved.function,
.widget[data-kind="calculator"] .calculator-key-approved.operator {
  background: transparent !important;
  color: var(--ink) !important;
}

.widget[data-kind="calculator"] .calculator-key-approved.function {
  font-weight: 620;
}

.widget[data-kind="calculator"] .calculator-key-approved.operator {
  border-color: rgba(255,255,255,.23) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.065),
    0 1px 3px rgba(0,0,0,.08) !important;
  font-size: 17px;
}

.widget[data-kind="calculator"] .calculator-key-approved:hover {
  border-color: rgba(255,255,255,.32) !important;
  background: rgba(255,255,255,.018) !important;
}

.widget[data-kind="calculator"] .calculator-key-approved:active {
  background: rgba(255,255,255,.035) !important;
  transform: scale(.94);
}

.widget[data-kind="calculator"] .calculator-back-icon {
  width: 17px;
  height: 17px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.atom-shell[data-background="white"] .widget[data-kind="calculator"] .calculator-key-approved {
  color: var(--ink) !important;
  border-color: rgba(44,50,55,.20) !important;
  background: transparent !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.56),
    0 1px 3px rgba(54,63,69,.055) !important;
}

.atom-shell[data-background="white"] .widget[data-kind="calculator"] .calculator-key-approved:hover {
  border-color: rgba(44,50,55,.31) !important;
  background: rgba(255,255,255,.08) !important;
}

@media (max-width: 760px) {
  .widget[data-kind="calculator"] {
    width: var(--atom-utility-small-w) !important;
    height: var(--atom-utility-medium-h) !important;
  }
}

/* =========================================================
   CLOCK — 1×2 ANALOG STATE + CONTINUOUS FACE TRANSITION
   Analog clock artwork is unchanged; only its container state
   and the digital/analog handoff are refined.
   ========================================================= */

/* Analog state is one Utility wide and exactly two Utilities tall. */
.widget[data-size="utility-1x2"] {
  width: var(--atom-utility-small-w) !important;
  height: calc(var(--atom-utility-small-h) * 2) !important;
}

.widget[data-kind="clock"][data-size="utility-1x2"] .widget-body {
  padding: 2px 8px 8px !important;
}

/* Both clock faces occupy the same canvas so the mode change can interpolate
   while the glass container itself is resizing. */
.widget[data-kind="clock"] .clock-face-stage-v18 {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.widget[data-kind="clock"] .clock-face-v18 {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.965);
  transform-origin: center;
  pointer-events: none;
  transition:
    opacity .24s ease,
    transform .34s cubic-bezier(.2,.74,.2,1);
  will-change: opacity,transform;
}

.widget[data-kind="clock"][data-size="utility-small"] .clock-digital-face-v18 {
  opacity: 1;
  transform: scale(1);
}

.widget[data-kind="clock"][data-size="utility-1x2"] .clock-analog-face-v18 {
  opacity: 1;
  transform: scale(1);
}

/* The outgoing face lingers briefly while the pane begins moving, avoiding
   the old snap-to-new-content effect. */
.widget[data-kind="clock"].is-clock-transitioning .clock-face-v18 {
  transition:
    opacity .28s ease,
    transform .38s cubic-bezier(.18,.78,.18,1);
}

/* Match the face handoff to the physical pane resize without changing the
   clock's glass, numerals, hands, or other visual design. */
.widget[data-kind="clock"].is-resizing {
  transition:
    width .38s cubic-bezier(.18,.78,.18,1),
    height .38s cubic-bezier(.18,.78,.18,1),
    left .38s cubic-bezier(.18,.78,.18,1),
    top .38s cubic-bezier(.18,.78,.18,1),
    border-color .16s ease,
    box-shadow .16s ease !important;
}

/* =========================================================
   WEATHER — CENTERED ICON + DEGREES / BOTTOM CAPTION
   Keep the existing ATOM weather SVG family; fix only layout.
   ========================================================= */

.widget[data-kind="weather"] .widget-body {
  padding: 0 8px 5px !important;
  overflow: hidden !important;
}

.widget[data-kind="weather"] .weather-instrument-v16 {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid !important;
  grid-template-rows: minmax(0,1fr) 13px !important;
  align-items: stretch !important;
  gap: 0 !important;
}

.widget[data-kind="weather"] .weather-main-v17 {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 0 !important;
}

.widget[data-kind="weather"] .atom-weather-icon {
  flex: 0 0 auto !important;
  width: 42px !important;
  height: 32px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  justify-self: auto !important;
  color: color-mix(in srgb,var(--ink) 92%,transparent) !important;
  overflow: visible !important;
}

.widget[data-kind="weather"] .weather-degrees-v16 {
  flex: 0 0 auto !important;
  justify-self: auto !important;
  margin: 0 !important;
  color: var(--ink) !important;
  font-size: clamp(23px,2.2vw,32px) !important;
  font-weight: 720 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.widget[data-kind="weather"] .weather-caption-v17 {
  width: 100%;
  min-width: 0;
  align-self: end !important;
  justify-self: stretch !important;
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 10.5px !important;
  font-weight: 560 !important;
  line-height: 13px !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Weather layout correction: older V16 rules left a two-column parent grid
   active, which forced the caption beside the readout. Explicitly restore
   one-column / two-row utility composition. */
.widget[data-kind="weather"] .weather-instrument-v16 {
  grid-template-columns: minmax(0,1fr) !important;
  grid-template-rows: minmax(0,1fr) 13px !important;
}

.widget[data-kind="weather"] .weather-main-v17 {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
}

.widget[data-kind="weather"] .weather-caption-v17 {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

/* Weather proportion polish: keep the approved two-row composition,
   enlarge the glyph to visually balance the temperature and open the pair. */
.widget[data-kind="weather"] .weather-main-v17 {
  gap: 11px !important;
}

.widget[data-kind="weather"] .atom-weather-icon {
  width: 50px !important;
  height: 38px !important;
  min-width: 50px !important;
  max-width: 50px !important;
}

/* Approved Weather glyphs are optically centered in their viewBoxes. */
.widget[data-kind="weather"] .atom-weather-icon {
  transform: none !important;
}

/* =========================================================
   WEATHER — FIVE-DAY LANDSCAPE RESIZE STATE
   Compact Weather above remains the approved 1×1 treatment.
   ========================================================= */

.widget[data-kind="weather"][data-size="utility-weather-wide"] {
  width: var(--atom-landscape-w) !important;
  height: var(--atom-utility-small-h) !important;
}

.widget[data-kind="weather"][data-size="utility-weather-wide"] .widget-body {
  padding: 0 12px 6px !important;
  overflow: hidden !important;
}

.widget[data-kind="weather"] .weather-five-day-v19 {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  align-items: stretch;
}

.widget[data-kind="weather"] .weather-day-v19 {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 13px minmax(0,1fr) 15px;
  place-items: center;
  padding: 0 8px;
  position: relative;
}

.widget[data-kind="weather"] .weather-day-v19 + .weather-day-v19::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 5px;
  width: 1px;
  background: rgba(255,255,255,.07);
}

.widget[data-kind="weather"] .weather-day-name-v19 {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 13px;
  white-space: nowrap;
}

.widget[data-kind="weather"] .weather-day-v19 .atom-weather-icon {
  width: 36px !important;
  height: 27px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  transform: none !important;
  color: color-mix(in srgb,var(--ink) 90%,transparent) !important;
}

.widget[data-kind="weather"] .weather-day-temps-v19 {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.widget[data-kind="weather"] .weather-day-temps-v19 strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 710;
  line-height: 1;
}

.widget[data-kind="weather"] .weather-day-temps-v19 span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 570;
  line-height: 1;
}

/* Keep the standard ATOM pane resize easing for the horizontal expansion. */
.widget[data-kind="weather"].is-resizing {
  transition:
    width .34s cubic-bezier(.2,.74,.2,1),
    height .34s cubic-bezier(.2,.74,.2,1),
    left .34s cubic-bezier(.2,.74,.2,1),
    top .34s cubic-bezier(.2,.74,.2,1),
    border-color .16s ease,
    box-shadow .16s ease !important;
}

.atom-shell[data-background="white"] .widget[data-kind="weather"] .weather-day-v19 + .weather-day-v19::before {
  background: rgba(44,50,55,.10);
}

/* =========================================================
   ATOM SCROLLBARS — CUSTOM FLOATING PILL / NO TRACK
   Native chrome is fully hidden. JS positions a fixed-size
   pill and open-circle end cues over the scroll surface.
   ========================================================= */

:root {
  --atom-scroll-thumb: rgba(139,143,147,.88);
  --atom-scroll-thumb-hover: rgba(160,164,168,.94);
  --atom-scroll-edge: rgba(156,160,164,.66);
}

/* Hide browser scrollbar chrome in Firefox, WebKit, and Blink. */
.atom-scroll-surface,
.column-editor-menu-v16,
.focus-modal-body,
.note-master-tree,
.notes-list,
.rich-note-surface,
.dock-tray-tools {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.atom-scroll-surface::-webkit-scrollbar,
.column-editor-menu-v16::-webkit-scrollbar,
.focus-modal-body::-webkit-scrollbar,
.note-master-tree::-webkit-scrollbar,
.notes-list::-webkit-scrollbar,
.rich-note-surface::-webkit-scrollbar,
.dock-tray-tools::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.atom-scroll-overlay-host-v21 {
  position: relative !important;
}

.atom-scroll-overlay-v21 {
  position: absolute;
  z-index: 18;
  pointer-events: none;
  overflow: visible;
}

.atom-overlay-scrollbar-v21 {
  position: absolute;
  pointer-events: none;
}

.atom-overlay-scrollbar-v21[hidden] {
  display: none !important;
}

.atom-overlay-scrollbar-v21.is-x {
  left: 2px;
  right: 2px;
  bottom: 1px;
  height: 14px;
}

.atom-scroll-overlay-v21.has-y .atom-overlay-scrollbar-v21.is-x {
  right: 18px;
}

.atom-overlay-scrollbar-v21.is-y {
  top: 2px;
  right: 1px;
  bottom: 2px;
  width: 14px;
}

.atom-scroll-overlay-v21.has-x .atom-overlay-scrollbar-v21.is-y {
  bottom: 18px;
}

.atom-scroll-thumb-v21 {
  position: absolute;
  left: 0;
  top: 1px;
  width: var(--atom-scroll-thumb-length,54px);
  height: 12px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 999px;
  background: var(--atom-scroll-thumb) !important;
  box-shadow: none !important;
  appearance: none;
  pointer-events: auto;
  cursor: grab;
  transition: background .12s ease;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-thumb-v21 {
  left: 1px;
  top: 0;
  width: 12px;
  height: var(--atom-scroll-thumb-length,54px);
}

.atom-scroll-thumb-v21:hover,
.atom-scroll-thumb-v21.is-dragging {
  background: var(--atom-scroll-thumb-hover) !important;
}

.atom-scroll-thumb-v21.is-dragging {
  cursor: grabbing;
}

/* Open-circle end markers from the reference. They are decorative only;
   there is intentionally no line/track connecting them. */
.atom-scroll-end-v21 {
  position: absolute;
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border: 2px solid var(--atom-scroll-edge);
  border-radius: 50%;
  opacity: .72;
  pointer-events: none;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21 {
  top: 2px;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21.is-start {
  left: 0;
  border-right-color: transparent;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21.is-end {
  right: 0;
  border-left-color: transparent;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21 {
  left: 2px;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21.is-start {
  top: 0;
  border-bottom-color: transparent;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21.is-end {
  bottom: 0;
  border-top-color: transparent;
}

.atom-shell[data-background="white"] {
  --atom-scroll-thumb: rgba(133,137,141,.82);
  --atom-scroll-thumb-hover: rgba(109,113,117,.91);
  --atom-scroll-edge: rgba(139,143,147,.58);
}

/* =========================================================
   ATOM SCROLLBAR GUTTERS + SEATED BORDER TIPS
   Data stays clear of the scrollbar; the pill docks into open caps.
   ========================================================= */

/* Reserve real space outside spreadsheet data instead of painting over cells. */
.sheet-table.atom-scroll-surface {
  box-sizing: border-box !important;
}

.sheet-table.atom-scroll-surface.atom-scroll-has-y-v21 {
  width: calc(100% - 18px) !important;
}

.sheet-table.atom-scroll-surface.atom-scroll-has-x-v21 {
  margin-bottom: 18px !important;
}

/* The overlay grows into the reserved gutter; these bars therefore sit
   beside/below the data viewport rather than on top of it. */
.atom-scroll-overlay-v21.is-sheet-scroll-v21 .atom-overlay-scrollbar-v21.is-x {
  bottom: 1px;
}

.atom-scroll-overlay-v21.is-sheet-scroll-v21 .atom-overlay-scrollbar-v21.is-y {
  right: 1px;
}

/* End pieces are not buttons or containers. They are only the curved tips
   of the invisible scrollbar boundary: ( pill ). */
.atom-scroll-end-v21 {
  width: 10px !important;
  height: 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  opacity: .72 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21 {
  top: 0 !important;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21.is-start {
  left: 0 !important;
  border-top: 2px solid var(--atom-scroll-edge) !important;
  border-bottom: 2px solid var(--atom-scroll-edge) !important;
  border-left: 2px solid var(--atom-scroll-edge) !important;
  border-radius: 999px 0 0 999px !important;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21.is-end {
  right: 0 !important;
  border-top: 2px solid var(--atom-scroll-edge) !important;
  border-bottom: 2px solid var(--atom-scroll-edge) !important;
  border-right: 2px solid var(--atom-scroll-edge) !important;
  border-radius: 0 999px 999px 0 !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21 {
  left: 0 !important;
  width: 14px !important;
  height: 10px !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21.is-start {
  top: 0 !important;
  border-top: 2px solid var(--atom-scroll-edge) !important;
  border-left: 2px solid var(--atom-scroll-edge) !important;
  border-right: 2px solid var(--atom-scroll-edge) !important;
  border-radius: 999px 999px 0 0 !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21.is-end {
  bottom: 0 !important;
  border-bottom: 2px solid var(--atom-scroll-edge) !important;
  border-left: 2px solid var(--atom-scroll-edge) !important;
  border-right: 2px solid var(--atom-scroll-edge) !important;
  border-radius: 0 0 999px 999px !important;
}

/* Keep the pill slightly inset so its rounded cap visually nests inside
   the open border tip rather than touching its outside edge. */
.atom-scroll-thumb-v21 {
  height: 11px !important;
  top: 1.5px !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-thumb-v21 {
  width: 11px !important;
  height: var(--atom-scroll-thumb-length,54px) !important;
  left: 1.5px !important;
  top: 0 !important;
}

/* =========================================================
   ATOM SCROLLBAR CAP SOCKET REFINEMENT
   The thumb now travels underneath a deeper open cap so its
   rounded end visually seats inside the boundary tip.
   ========================================================= */

.atom-scroll-thumb-v21 {
  z-index: 1 !important;
}

.atom-scroll-end-v21 {
  z-index: 2 !important;
}

/* Horizontal sockets: deeper C-shapes wrapping the pill end. */
.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21 {
  width: 14px !important;
  height: 15px !important;
  top: -.5px !important;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21.is-start {
  left: 0 !important;
  border-top: 2px solid var(--atom-scroll-edge) !important;
  border-bottom: 2px solid var(--atom-scroll-edge) !important;
  border-left: 2px solid var(--atom-scroll-edge) !important;
  border-radius: 999px 0 0 999px !important;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21.is-end {
  right: 0 !important;
  border-top: 2px solid var(--atom-scroll-edge) !important;
  border-bottom: 2px solid var(--atom-scroll-edge) !important;
  border-right: 2px solid var(--atom-scroll-edge) !important;
  border-radius: 0 999px 999px 0 !important;
}

/* Vertical sockets use the same relationship rotated 90 degrees. */
.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21 {
  width: 15px !important;
  height: 14px !important;
  left: -.5px !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21.is-start {
  top: 0 !important;
  border-top: 2px solid var(--atom-scroll-edge) !important;
  border-left: 2px solid var(--atom-scroll-edge) !important;
  border-right: 2px solid var(--atom-scroll-edge) !important;
  border-radius: 999px 999px 0 0 !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21.is-end {
  bottom: 0 !important;
  border-bottom: 2px solid var(--atom-scroll-edge) !important;
  border-left: 2px solid var(--atom-scroll-edge) !important;
  border-right: 2px solid var(--atom-scroll-edge) !important;
  border-radius: 0 0 999px 999px !important;
}

/* =========================================================
   SCROLLBAR SOFTENING + TABLE HEADER CLIP
   ========================================================= */

/* Slightly quieter than the first approved pass; still visible without
   becoming a dominant control. */
:root {
  --atom-scroll-thumb: rgba(139,143,147,.64);
  --atom-scroll-thumb-hover: rgba(160,164,168,.76);
  --atom-scroll-edge: rgba(156,160,164,.50);
}

.atom-scroll-end-v21 {
  opacity: .58 !important;
}

/* Rows may physically continue beneath a sticky header, but they should never
   be visible there. Give the header an opaque graphite mask matching ATOM's
   data surface while retaining the subtle glass edge treatment. */
.sheet-table.atom-scroll-surface .sheet-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 12 !important;
  isolation: isolate;
  background: rgb(30,34,39) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,.065),
    0 3px 5px rgba(18,21,24,.10) !important;
}

/* Keep header cells themselves transparent so the mask reads as one clean
   continuous header plane rather than separate filled boxes. */
.sheet-table.atom-scroll-surface .sheet-head-cell,
.sheet-table.atom-scroll-surface .sheet-head-cell > button {
  background: transparent !important;
}

.atom-shell[data-background="white"] {
  --atom-scroll-thumb: rgba(128,132,136,.60);
  --atom-scroll-thumb-hover: rgba(104,108,112,.74);
  --atom-scroll-edge: rgba(128,132,136,.46);
}

.atom-shell[data-background="white"] .sheet-table.atom-scroll-surface .sheet-head {
  background: rgb(244,245,246) !important;
  box-shadow:
    0 1px 0 rgba(44,50,55,.08),
    0 3px 5px rgba(44,50,55,.045) !important;
}

/* =========================================================
   TABLE SCROLL STRUCTURE V22 — TRANSPARENT / NO HEADER PAINT
   Header is outside the vertical scroller. Rows cannot pass
   behind it, so no background mask or color change is needed.
   ========================================================= */

.widget-body:has(.sheet-scroll-region-v22.atom-scroll-surface) {
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
}

.sheet-table:has(.sheet-scroll-region-v22) {
  flex: 1 1 auto;
  width: 100%;
  height: auto !important;
  min-height: 0;
  display: grid !important;
  grid-template-rows: auto minmax(0,1fr) !important;
  overflow: hidden !important;
  background: transparent !important;
}

.sheet-head-viewport-v22 {
  min-width: 0;
  overflow: hidden !important;
  background: transparent !important;
}

.sheet-table:has(.sheet-scroll-region-v22) .sheet-head {
  position: relative !important;
  top: auto !important;
  z-index: 1 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  will-change: transform;
}

.sheet-table:has(.sheet-scroll-region-v22) .sheet-head-cell,
.sheet-table:has(.sheet-scroll-region-v22) .sheet-head-cell > button {
  background: transparent !important;
}

.sheet-scroll-region-v22.atom-scroll-surface {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: auto !important;
  position: relative;
  overscroll-behavior: contain;
  background: transparent !important;
}

.sheet-scroll-region-v22 .sheet-rows {
  min-width: var(--sheet-total-width);
  min-height: max-content;
  overflow: visible !important;
}

/* The external scrollbar gutter now belongs to the row viewport only. */
.sheet-scroll-region-v22.atom-scroll-has-y-v21 {
  width: calc(100% - 18px) !important;
}

.sheet-table:has(.sheet-scroll-region-v22.atom-scroll-has-y-v21) .sheet-head-viewport-v22 {
  margin-right: 18px;
}

.sheet-scroll-region-v22.atom-scroll-has-x-v21 {
  margin-bottom: 18px !important;
}

/* Preserve the softened scrollbar treatment without changing any container. */
:root {
  --atom-scroll-thumb: rgba(139,143,147,.64);
  --atom-scroll-thumb-hover: rgba(160,164,168,.76);
  --atom-scroll-edge: rgba(156,160,164,.50);
}

.atom-scroll-end-v21 {
  opacity: .58 !important;
}

.atom-shell[data-background="white"] {
  --atom-scroll-thumb: rgba(128,132,136,.60);
  --atom-scroll-thumb-hover: rgba(104,108,112,.74);
  --atom-scroll-edge: rgba(128,132,136,.46);
}

/* =========================================================
   ATOM SCROLLBAR POLISH V23
   Slimmer, quieter, and symmetrical socket seating.
   ========================================================= */

:root {
  --atom-scroll-thumb: rgba(139,143,147,.42);
  --atom-scroll-thumb-hover: rgba(160,164,168,.58);
  --atom-scroll-edge: rgba(156,160,164,.34);
}

.atom-scroll-end-v21 {
  opacity: .46 !important;
}

/* Reduce visual weight of the pill. */
.atom-scroll-thumb-v21 {
  height: 7px !important;
  top: 4px !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-thumb-v21 {
  width: 7px !important;
  height: var(--atom-scroll-thumb-length,54px) !important;
  left: 4px !important;
  top: 0 !important;
}

/* Slimmer sockets to match the reduced pill thickness. */
.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21 {
  width: 11px !important;
  height: 11px !important;
  top: 2px !important;
}

.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21.is-start {
  border-top-width: 1.5px !important;
  border-bottom-width: 1.5px !important;
  border-left-width: 1.5px !important;
}

/* Pull the far socket inward so the pill seats underneath it just like
   the starting socket instead of finishing beside it. */
.atom-overlay-scrollbar-v21.is-x .atom-scroll-end-v21.is-end {
  right: 4px !important;
  border-top-width: 1.5px !important;
  border-bottom-width: 1.5px !important;
  border-right-width: 1.5px !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21 {
  width: 11px !important;
  height: 11px !important;
  left: 2px !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21.is-start {
  border-top-width: 1.5px !important;
  border-left-width: 1.5px !important;
  border-right-width: 1.5px !important;
}

.atom-overlay-scrollbar-v21.is-y .atom-scroll-end-v21.is-end {
  bottom: 4px !important;
  border-bottom-width: 1.5px !important;
  border-left-width: 1.5px !important;
  border-right-width: 1.5px !important;
}

.atom-shell[data-background="white"] {
  --atom-scroll-thumb: rgba(128,132,136,.40);
  --atom-scroll-thumb-hover: rgba(104,108,112,.56);
  --atom-scroll-edge: rgba(128,132,136,.32);
}
/* CHECKPOINT — pre filter-popup gel tint baseline. No visual effect. */

/* =========================================================
   FILTER POPUP — BACKGROUND-AWARE GEL GLASS
   Scoped ONLY to the footer Filter popup. The main widget glass
   material remains untouched. Uses the active paper palette so
   every workbench color carries through automatically.
   Rollback checkpoint: 0c7f362dd914ebae6e194a1b4b8853d2773a49c3
   ========================================================= */

.atom-shell .footer-filter-menu {
  --filter-gel-base: var(--paper);
  --filter-gel-soft: var(--paper-soft);
  --filter-gel-deep: var(--paper-deep);

  color: var(--ink);
  border-color: color-mix(in srgb,var(--ink) 14%,transparent) !important;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,var(--filter-gel-soft) 78%,rgba(255,255,255,.10)),
      color-mix(in srgb,var(--filter-gel-base) 82%,transparent)
    ) !important;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,white 18%,transparent),
    inset 1px 0 0 color-mix(in srgb,white 7%,transparent),
    inset -1px 0 0 color-mix(in srgb,var(--ink) 5%,transparent),
    inset 0 -1px 0 color-mix(in srgb,var(--ink) 6%,transparent),
    0 16px 34px rgba(0,0,0,.18) !important;
  backdrop-filter: blur(26px) saturate(124%) !important;
  -webkit-backdrop-filter: blur(26px) saturate(124%) !important;
}

/* Filter-owned controls use lighter layers of the exact same workbench tint.
   No old charcoal/shaded-glass blocks remain inside this popup. */
.atom-shell .footer-filter-menu .universal-filter-search,
.atom-shell .footer-filter-menu .scope-combo > input {
  color: var(--ink) !important;
  border-color: color-mix(in srgb,var(--ink) 10%,transparent) !important;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,white 7%,transparent),
      transparent
    ),
    color-mix(in srgb,var(--filter-gel-soft) 38%,transparent) !important;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,white 8%,transparent) !important;
}

.atom-shell .footer-filter-menu .universal-filter-search:focus-within,
.atom-shell .footer-filter-menu .scope-combo > input:focus {
  border-color: color-mix(in srgb,var(--sem-magenta,#8b72bd) 34%,var(--ink) 7%) !important;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,white 9%,transparent),
      transparent
    ),
    color-mix(in srgb,var(--filter-gel-soft) 48%,transparent) !important;
}

.atom-shell .footer-filter-menu .scope-field.is-locked .scope-combo > input {
  color: color-mix(in srgb,var(--sem-magenta,#8b72bd) 62%,var(--ink)) !important;
  border-color: color-mix(in srgb,var(--sem-magenta,#8b72bd) 20%,transparent) !important;
  background:
    color-mix(in srgb,var(--sem-magenta,#8b72bd) 9%,var(--filter-gel-soft) 32%) !important;
}

/* The scope dropdown belongs to the Filter popup and therefore follows its
   gel tint too instead of falling back to the legacy near-black menu. */
.atom-shell .footer-filter-menu .scope-options {
  color: var(--ink);
  border-color: color-mix(in srgb,var(--ink) 13%,transparent) !important;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,var(--filter-gel-soft) 90%,rgba(255,255,255,.08)),
      color-mix(in srgb,var(--filter-gel-base) 92%,transparent)
    ) !important;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,white 13%,transparent),
    0 12px 24px rgba(0,0,0,.16) !important;
  backdrop-filter: blur(22px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(120%) !important;
}

.atom-shell .footer-filter-menu .scope-options > button:hover,
.atom-shell .footer-filter-menu .scope-options > button.is-selected {
  border-color: color-mix(in srgb,var(--sem-magenta,#8b72bd) 24%,transparent) !important;
  background:
    color-mix(in srgb,var(--sem-magenta,#8b72bd) 14%,var(--filter-gel-soft) 20%) !important;
}

/* White is not a separate material; these tiny contrast adjustments keep the
   same gel construction legible over the light paper palette. */
.atom-shell[data-background="white"] .footer-filter-menu {
  border-color: color-mix(in srgb,var(--ink) 12%,transparent) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    inset 1px 0 0 rgba(255,255,255,.24),
    inset -1px 0 0 rgba(45,54,60,.04),
    inset 0 -1px 0 rgba(45,54,60,.055),
    0 15px 31px rgba(53,62,67,.10) !important;
}

/* =========================================================
   FILTER GEL READABILITY POLISH
   Same approved color-aware gel; slightly less transparent so
   underlying table data recedes without returning to shaded glass.
   ========================================================= */

.atom-shell .footer-filter-menu {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,var(--filter-gel-soft) 88%,rgba(255,255,255,.10)),
      color-mix(in srgb,var(--filter-gel-base) 91%,transparent)
    ) !important;
  backdrop-filter: blur(28px) saturate(122%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(122%) !important;
}

.atom-shell .footer-filter-menu .universal-filter-search,
.atom-shell .footer-filter-menu .scope-combo > input {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,white 7%,transparent),
      transparent
    ),
    color-mix(in srgb,var(--filter-gel-soft) 52%,transparent) !important;
}

.atom-shell .footer-filter-menu .scope-options {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,var(--filter-gel-soft) 94%,rgba(255,255,255,.07)),
      color-mix(in srgb,var(--filter-gel-base) 95%,transparent)
    ) !important;
}

/* =========================================================
   UNIVERSAL ATOM SCROLLBAR + FILTER LAYOUT V24
   ========================================================= */

/* Any surface discovered by the runtime scrollability pass loses native
   browser chrome and receives the ATOM pill/socket overlay instead. */
.atom-custom-scroll-v24 {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.atom-custom-scroll-v24::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* Filter dropdown scrollbars are appended at widget level; raise only those
   overlays so they sit above the gel popup and its nested option list. */
.atom-scroll-overlay-v21.is-filter-scroll-v24 {
  z-index: 110 !important;
}

/* Filter geometry:
   search-only      = full width
   search + 1 scope = wider search, compact scope near center
   search + 2/3     = readable search, scopes share remaining width */
.footer-filter-menu > .universal-filter-search:only-child {
  grid-column: 1 / -1 !important;
}

.footer-filter-menu:has(.scope-stack > .scope-field:only-child) {
  grid-template-columns: minmax(250px,320px) minmax(0,1fr) !important;
}

.footer-filter-menu:has(.scope-stack > .scope-field:nth-child(2)) {
  grid-template-columns: minmax(220px,280px) minmax(0,1fr) !important;
}

.footer-filter-menu .universal-filter-search {
  min-width: 0 !important;
  width: 100% !important;
}

.footer-filter-menu .universal-filter-search input {
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Do not reserve phantom columns for filters that only have one or two scope
   fields. Let the actual number of controls determine the layout. */
.footer-filter-menu .scope-stack {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(auto-fit,minmax(132px,1fr)) !important;
}

/* A single scope field should stay compact instead of stretching across the
   entire right side. Its left edge now lands near the visual center. */
.footer-filter-menu:has(.scope-stack > .scope-field:only-child) .scope-stack {
  width: min(220px,100%);
  max-width: 220px;
  justify-self: start;
}

/* Scope-only filters such as Floor Plan use the full popup width. */
.footer-filter-menu > .scope-stack:only-child,
.floor-plan-filter-menu > .scope-stack {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
}

/* Portrait stays stacked; the width rebalance above is for wider widgets.
   :has(.scope-stack) intentionally matches the specificity of the landscape
   search+scope geometry above so portrait can never inherit its two-column
   layout. */
.widget[data-size="portrait"] .footer-filter-menu,
.widget[data-size="portrait"] .footer-filter-menu:has(.scope-stack),
.widget[data-size="utility-small"] .footer-filter-menu,
.widget[data-size="utility-medium"] .footer-filter-menu {
  grid-template-columns: 1fr !important;
}

.widget[data-size="portrait"] .footer-filter-menu .scope-stack {
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: 1fr !important;
}

.widget[data-size="utility-small"] .footer-filter-menu .scope-stack,
.widget[data-size="utility-medium"] .footer-filter-menu .scope-stack {
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: repeat(auto-fit,minmax(128px,1fr)) !important;
}

/* CHECKPOINT — pre Apple-style Dock gel/motion pass. No visual effect. */

/* =========================================================
   DOCK GEL + APPLE-LIKE MOTION V25
   Uses the same background-aware gel language as Filter.
   Front, notification back, and tethered drawers all follow
   the active workbench color. No legacy dark-glass fallback.
   Checkpoint: 67e8da7ae5d5383b7acc03542f689c037fca433b
   ========================================================= */

/* One material vocabulary shared by both Dock faces. */
.atom-shell .atom-dock {
  --dock-gel-base: var(--paper);
  --dock-gel-soft: var(--paper-soft);
  --dock-gel-deep: var(--paper-deep);
}

.atom-shell .dock-face {
  color: var(--ink);
  border-color: color-mix(in srgb,var(--ink) 14%,transparent) !important;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,var(--dock-gel-soft) 88%,rgba(255,255,255,.10)),
      color-mix(in srgb,var(--dock-gel-base) 91%,transparent)
    ) !important;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,white 18%,transparent),
    inset 1px 0 0 color-mix(in srgb,white 7%,transparent),
    inset -1px 0 0 color-mix(in srgb,var(--ink) 5%,transparent),
    inset 0 -1px 0 color-mix(in srgb,var(--ink) 6%,transparent),
    0 16px 34px rgba(0,0,0,.18) !important;
  backdrop-filter: blur(28px) saturate(122%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(122%) !important;
}

/* The notification board is literally the same physical gel face.
   Only its content hierarchy differs. */
.atom-shell .dock-face-back {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,var(--dock-gel-soft) 88%,rgba(255,255,255,.10)),
      color-mix(in srgb,var(--dock-gel-base) 91%,transparent)
    ) !important;
}

/* Keep the sheen extremely restrained so the tinted gel reads before gloss. */
.atom-shell .dock-face::after {
  background:
    linear-gradient(
      108deg,
      transparent 0 28%,
      color-mix(in srgb,white 7%,transparent) 43%,
      color-mix(in srgb,white 2%,transparent) 52%,
      transparent 70%
    ) !important;
  opacity: .42 !important;
}

/* Drawer becomes an overflow-visible interaction shell. Its ::before paints
   the rounded gel body, allowing magnified icons to escape the glass edge. */
.atom-shell .dock-tray {
  --dock-gel-base: var(--paper);
  --dock-gel-soft: var(--paper-soft);
  --dock-gel-deep: var(--paper-deep);

  overflow: visible !important;
  clip-path: none !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  isolation: isolate;
  transition:
    opacity .18s ease,
    transform .34s cubic-bezier(.16,.84,.2,1) !important;
  will-change: transform,opacity;
}

.atom-shell .dock-tray::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  border: 1px solid color-mix(in srgb,var(--ink) 14%,transparent);
  border-radius: inherit;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,var(--dock-gel-soft) 88%,rgba(255,255,255,.10)),
      color-mix(in srgb,var(--dock-gel-base) 91%,transparent)
    );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,white 18%,transparent),
    inset 1px 0 0 color-mix(in srgb,white 7%,transparent),
    inset -1px 0 0 color-mix(in srgb,var(--ink) 5%,transparent),
    inset 0 -1px 0 color-mix(in srgb,var(--ink) 6%,transparent),
    0 16px 34px rgba(0,0,0,.16);
  backdrop-filter: blur(28px) saturate(122%);
  -webkit-backdrop-filter: blur(28px) saturate(122%);
}

.atom-shell .dock-tray-tools {
  position: relative;
  z-index: 2;
  overflow: visible !important;
}

/* The open drawer no longer clips or staggers live pointer response. */
.atom-shell .dock-tray.is-open {
  clip-path: none !important;
  overflow: visible !important;
}

.atom-shell .dock-tray.is-open .dock-tray-tools > button {
  transition-delay: 0s !important;
}

/* Subtle color-matched icon tiles; no charcoal fallback. */
.atom-shell .dock-glyph,
.atom-shell .tray-glyph {
  color: color-mix(in srgb,var(--ink) 88%,transparent) !important;
  border-color: color-mix(in srgb,var(--ink) 10%,transparent) !important;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb,white 7%,transparent),
      transparent
    ),
    color-mix(in srgb,var(--dock-gel-soft) 34%,transparent) !important;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,white 8%,transparent) !important;
}

/* Main Dock remains reactive while a drawer is open. */
.atom-shell .atom-dock.drawer-open .dock-face-front .dock-apps > button {
  transform:
    translateY(var(--dock-lift,0px))
    scale(var(--dock-scale,1)) !important;
  margin-inline: var(--dock-space,0px) !important;
}

/* Responsive, low-latency motion. Geometry is calculated in JS from idle
   positions; these short transitions provide the polished spring tail. */
.atom-shell .dock-face-front .dock-apps > button {
  will-change: transform,margin;
  transition:
    transform .105s cubic-bezier(.16,.84,.2,1),
    margin .105s cubic-bezier(.16,.84,.2,1),
    background .15s ease,
    border-color .15s ease !important;
}

.atom-shell .dock-tray-tools > button {
  will-change: transform;
  transform:
    translateX(var(--tray-shift,0px))
    scale(var(--tray-scale,1)) !important;
  transform-origin: 50% 50% !important;
  transition:
    transform .105s cubic-bezier(.16,.84,.2,1),
    background .14s ease,
    border-color .14s ease,
    opacity .16s ease !important;
}

/* Hover color follows the active background instead of switching to white/grey. */
.atom-shell .dock-face-front .dock-apps > button:hover,
.atom-shell .dock-tray-tools > button:hover {
  background: color-mix(in srgb,var(--dock-gel-soft) 26%,transparent) !important;
  border-color: color-mix(in srgb,var(--ink) 10%,transparent) !important;
}

/* Notification board divider follows the same palette rather than fixed white. */
.atom-shell .dock-board-next {
  border-top-color: color-mix(in srgb,var(--ink) 8%,transparent) !important;
}

/* White uses the same material construction; only shadow contrast needs help. */
.atom-shell[data-background="white"] .dock-face,
.atom-shell[data-background="white"] .dock-tray::before {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    inset 1px 0 0 rgba(255,255,255,.24),
    inset -1px 0 0 rgba(45,54,60,.04),
    inset 0 -1px 0 rgba(45,54,60,.055),
    0 15px 31px rgba(53,62,67,.10) !important;
}

@media (prefers-reduced-motion: reduce) {
  .atom-shell .dock-face-front .dock-apps > button,
  .atom-shell .dock-tray,
  .atom-shell .dock-tray-tools > button {
    transition-duration: .001ms !important;
  }
}

/* =========================================================
   WORKBENCH V27 — VISIBLE GRID = PLACEMENT GRID
   The graph-paper dots now represent the exact authoritative
   container snap lattice. No hidden alternate grid exists.
   ========================================================= */

.paper-grid {
  background-size:
    calc(var(--atom-placement-grid-x,12px) * 4) calc(var(--atom-placement-grid-y,12px) * 4),
    var(--atom-placement-grid-x,12px) var(--atom-placement-grid-y,12px) !important;
  /* Radial-gradient dots sit at each tile center. Offset each layer so those
     centers—not the tile corners—land on the actual snap intersections. */
  background-position:
    calc(var(--atom-placement-grid-origin-x,12px) - (var(--atom-placement-grid-x,12px) * 2))
    calc(var(--atom-placement-grid-origin-y,12px) - (var(--atom-placement-grid-y,12px) * 2)),
    calc(var(--atom-placement-grid-origin-x,12px) - (var(--atom-placement-grid-x,12px) * .5))
    calc(var(--atom-placement-grid-origin-y,12px) - (var(--atom-placement-grid-y,12px) * .5)) !important;
}



/* =========================================================
   KEY SYSTEM DETAILS READABILITY — GEOMETRY / TYPE ONLY
   No material, palette, background, or transparency changes.
   ========================================================= */

.focus-modal-card[data-modal-kind="keySystems"] .assoc-column > label {
  font-size: 10.5px;
}

.focus-modal-card[data-modal-kind="keySystems"] .assoc-column > input {
  font-size: 10.5px;
}

.focus-modal-card[data-modal-kind="keySystems"] .assoc-list > button strong {
  font-size: 11px;
}

.focus-modal-card[data-modal-kind="keySystems"] .assoc-list > button small {
  font-size: 9.5px;
}

.focus-modal-card[data-modal-kind="keySystems"] .association-context-note {
  font-size: 9.5px;
}

.focus-modal-card[data-modal-kind="keySystems"] .association-scope-bar strong {
  font-size: 10px;
}

.focus-modal-card[data-modal-kind="keySystems"] .association-scope-bar small {
  font-size: 9px;
}


/* =========================================================
   KEY SYSTEM DETAILS V30 — MANUAL BITTING + COMPACT TECH GRID
   Geometry/type/state only; existing pane material is unchanged.
   ========================================================= */

.focus-modal-card[data-modal-kind="keySystems"] .detail-field.is-keying-disabled .relation-picker,
.focus-modal-card[data-modal-kind="keySystems"] .detail-field.is-keying-derived > input {
  opacity: .42;
  cursor: not-allowed;
}

.focus-modal-card[data-modal-kind="keySystems"] .key-system-tech-specs {
  margin-top: 14px;
}

.focus-modal-card[data-modal-kind="keySystems"] .tech-spec-row-three {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.focus-modal-card[data-modal-kind="keySystems"] .tech-spec-row-two {
  margin-top: 12px;
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.focus-modal-card[data-modal-kind="keySystems"] .tech-spec-row + .tech-spec-row {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .focus-modal-card[data-modal-kind="keySystems"] .tech-spec-row-three,
  .focus-modal-card[data-modal-kind="keySystems"] .tech-spec-row-two {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   DETAILS FOOTER V31 — ACTIONS LIVE AT THE TRUE BOTTOM EDGE
   Layout only; existing delete styling/material is unchanged.
   ========================================================= */

.focus-modal-body:has(> .detail-footer) {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
}

.focus-modal-body:has(> .detail-footer) > .detail-tab-panel {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.detail-footer {
  min-width: 0;
  min-height: 42px;
  margin-top: 10px;
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,.05);
}

.detail-footer .record-actions {
  margin: 0;
  padding: 0;
  border-top: 0;
}

.detail-footer .delete-blockers {
  margin: 0;
  min-width: 0;
}


/* =========================================================
   KEY SYMBOL DETAILS V32 — HEADER ROLE STATES + INFO GEOMETRY
   Layout/state only; existing modal material and palette remain intact.
   ========================================================= */

.detail-role-slider {
  height: 30px;
  position: relative;
  display: block;
}

.detail-role-slider.is-master {
  width: 92px;
  flex: 0 0 92px;
}

.detail-role-slider.is-control {
  width: 98px;
  flex: 0 0 98px;
}

.detail-role-control {
  width: 100%;
  height: 30px;
  padding: 0 19px;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 9.5px;
  font-weight: 670;
  white-space: nowrap;
  cursor: pointer;
}

.detail-role-control::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 1px;
  background: color-mix(in srgb,var(--ink) 22%,transparent);
  transform: translateY(-50%);
}

.detail-role-control::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--sem-green);
  transform: translate3d(0,-50%,0);
  transition:
    transform .28s cubic-bezier(.2,.78,.2,1),
    background .18s ease;
}

.detail-role-control.is-off::before {
  background: var(--sem-red);
}

.detail-role-slider.is-master .detail-role-control.is-off::before {
  transform: translate3d(69px,-50%,0);
}

.detail-role-slider.is-control .detail-role-control.is-off::before {
  transform: translate3d(75px,-50%,0);
}

.detail-role-control > span {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.focus-modal-card[data-modal-kind="keySymbols"] .key-symbol-info-layout {
  display: grid;
  gap: 12px;
}

.focus-modal-card[data-modal-kind="keySymbols"] .key-symbol-info-row-three {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.focus-modal-card[data-modal-kind="keySymbols"] .key-symbol-info-row-two {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

@media (max-width: 900px) {
  .focus-modal-card[data-modal-kind="keySymbols"] .key-symbol-info-row-three,
  .focus-modal-card[data-modal-kind="keySymbols"] .key-symbol-info-row-two {
    grid-template-columns: 1fr;
  }

  .detail-header-states {
    gap: 3px;
  }
}


/* =========================================================
   ASSOCIATION LABEL ALIGNMENT + CONTENT-FIT DETAILS V33
   Geometry/state only; pane material remains unchanged.
   ========================================================= */

.assoc-column.is-assigned {
  grid-template-rows: 34px auto minmax(0,1fr);
}

.assoc-column.is-assigned > label {
  align-self: end;
  margin-bottom: -1px;
}

.focus-modal-card[data-modal-mode="details"] {
  height: auto;
  max-height: calc(100% - 34px);
}

.focus-modal-card[data-modal-mode="details"] .focus-modal-body:has(> .detail-footer) {
  min-height: 0;
  max-height: calc(100vh - 160px);
}


/* =========================================================
   KEY COPY DETAILS V36 — COMPACT INFO GRID + FOOTER ACTIONS
   Geometry/type only; existing modal material remains unchanged.
   ========================================================= */

.focus-modal-card[data-modal-kind="keyCopies"] .key-copy-info-layout {
  display: grid;
  gap: 14px;
}

.focus-modal-card[data-modal-kind="keyCopies"] .key-copy-info-row-three {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.focus-modal-card[data-modal-kind="keyCopies"] .key-copy-info-row-four {
  grid-template-columns: repeat(4,minmax(0,1fr));
}

.focus-modal-card[data-modal-kind="keyCopies"] .is-readonly-copy-field .detail-value {
  cursor: default;
}

.focus-modal-card[data-modal-kind="keyCopies"] .record-actions {
  gap: 8px;
}

.key-copy-footer-action,
.record-create-action {
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb,var(--ink) 12%,transparent);
  border-radius: 8px;
  color: var(--ink);
  background: color-mix(in srgb,var(--ink) 3%,transparent);
  font-size: 9px;
  font-weight: 700;
}

.key-copy-footer-action:hover,
.record-create-action:hover {
  background: color-mix(in srgb,var(--ink) 7%,transparent);
}

@media (max-width: 980px) {
  .focus-modal-card[data-modal-kind="keyCopies"] .key-copy-info-row-four {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 760px) {
  .focus-modal-card[data-modal-kind="keyCopies"] .key-copy-info-row-three,
  .focus-modal-card[data-modal-kind="keyCopies"] .key-copy-info-row-four {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   KEY RECORD CREATION V37 — SAVE/CLOSE-NATIVE CREATION SURFACES
   Layout/type only; existing modal/footer material is reused.
   ========================================================= */

.focus-modal-card[data-modal-mode="createKeyCopies"] .focus-modal-body {
  overflow: visible;
}

.key-copy-create-summary {
  margin-bottom: 14px;
  padding: 0 2px 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.045);
}

.key-copy-create-summary span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 620;
}

.key-copy-create-summary strong {
  color: var(--ink);
  font-size: var(--data-font-size);
  font-weight: 720;
}

.key-copy-create-row {
  margin-top: 12px;
}

.key-copy-create-row:first-of-type {
  margin-top: 0;
}

.key-copy-create-row-three {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.focus-modal-card[data-modal-mode="createKeyCopies"] .detail-field > input,
.focus-modal-card[data-modal-mode="createKeyCopies"] .detail-field > select {
  width: 100%;
}

.focus-modal-card[data-modal-kind="keySystems"] .record-actions,
.focus-modal-card[data-modal-kind="keySymbols"] .record-actions {
  gap: 8px;
}

@media (max-width: 760px) {
  .key-copy-create-row-three {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   TETRIS UTILITY V39 — PORTRAIT ATOM GAME
   Uses only the existing ATOM semantic palette/material.
   ========================================================= */

.widget[data-kind="tetris"] {
  width: clamp(330px,calc((100vw - 144px) / 4),520px);
  height: clamp(296px,calc((100vh - 258px) / 2),410px);
}

.widget[data-kind="tetris"] .widget-body {
  padding: 8px 12px 10px;
  overflow: hidden;
}

.tetris-shell-v39 {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 34px minmax(0,1fr) 24px;
  gap: 5px;
  place-items: stretch center;
  outline: none;
}

.tetris-status-v39 {
  width: min(100%,320px);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: center;
  gap: 12px;
}

.tetris-status-v39 > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.tetris-status-v39 small {
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 680;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.tetris-status-v39 strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
}

.tetris-next-v39 {
  justify-items: end;
}

.tetris-next-v39 > b {
  width: 28px;
  height: 14px;
  display: grid;
  grid-template-columns: repeat(4,6px);
  grid-template-rows: repeat(2,6px);
  gap: 1px;
}

.tetris-next-cell-v39 {
  width: 6px;
  height: 6px;
  border-radius: 1px;
}

.tetris-board-v39 {
  position: relative;
  height: 100%;
  max-height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 1 / 2;
  min-height: 0;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(10,1fr);
  grid-template-rows: repeat(20,1fr);
  gap: 1px;
  padding: 3px;
  border: 1px solid color-mix(in srgb,var(--ink) 10%,transparent);
  border-radius: 8px;
  background: color-mix(in srgb,var(--ink) 1.5%,transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb,var(--ink) 5%,transparent);
}

.tetris-cell-v39 {
  min-width: 0;
  min-height: 0;
  border-radius: 1px;
  background: color-mix(in srgb,var(--ink) 2.5%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--ink) 2%,transparent);
}

.tetris-cell-v39.is-filled,
.tetris-next-cell-v39.is-filled {
  background: var(--tetris-piece-v39);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,var(--ink) 24%,transparent),
    inset 0 -1px 0 color-mix(in srgb,var(--ink) 10%,transparent);
}

.piece-I { --tetris-piece-v39: var(--sem-teal); }
.piece-J { --tetris-piece-v39: var(--sem-blue); }
.piece-L { --tetris-piece-v39: color-mix(in srgb,var(--sem-amber) 72%,var(--sem-red)); }
.piece-O { --tetris-piece-v39: var(--sem-amber); }
.piece-S { --tetris-piece-v39: var(--sem-green); }
.piece-T { --tetris-piece-v39: var(--sem-magenta); }
.piece-Z { --tetris-piece-v39: var(--sem-red); }

.tetris-help-v39 {
  width: min(100%,320px);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 680;
  white-space: nowrap;
}

.tetris-game-over-v39 {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: color-mix(in srgb,var(--ink) 12%,transparent);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.tetris-game-over-v39 strong {
  font-size: 11px;
  font-weight: 780;
  letter-spacing: .06em;
}

.tetris-game-over-v39 span {
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 620;
}

.widget[data-kind="tetris"].is-tetris-keyboard-active-v39 .widget-title strong::after {
  content: " · PLAY";
  color: var(--sem-teal);
  font-size: 7px;
  font-weight: 720;
  letter-spacing: .06em;
}



/* TETRIS V40 — Space-bar pause state. */
.tetris-game-over-v39.tetris-paused-v40 {
  cursor: default;
}

.widget[data-kind="tetris"].is-tetris-keyboard-active-v39.is-tetris-paused-v40 .widget-title strong::after {
  content: " · PAUSED";
  color: var(--sem-amber);
}


/* =========================================================
   ARCADE CABINET V41 — ATOM BREAK WIDGETS
   ========================================================= */

.tetris-game-over-v39.tetris-start-v41 {
  cursor: default;
}

.tetris-game-over-v39.tetris-start-v41 span {
  font-size: 9px;
}

.arcade-widget-v41 .widget-body {
  min-height: 0;
  height: 100%;
  padding: 7px 10px 10px !important;
  overflow: hidden !important;
}

.arcade-shell-v41 {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 24px minmax(0,1fr) 24px;
  gap: 6px;
  outline: none;
}

.arcade-hud-v41 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: var(--muted);
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.arcade-hud-v41 > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arcade-screen-v41 {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--ink) 12%,transparent);
  border-radius: 10px;
  background:
    linear-gradient(color-mix(in srgb,var(--ink) 2%,transparent),color-mix(in srgb,var(--ink) .5%,transparent));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,var(--ink) 7%,transparent),
    inset 0 0 28px color-mix(in srgb,var(--ink) 2%,transparent);
}

.arcade-screen-v41::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    color-mix(in srgb,var(--ink) 10%,transparent) 3px 4px
  );
}

.arcade-screen-v41 canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.arcade-help-v41 {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 680;
  letter-spacing: .01em;
  text-align: center;
  white-space: nowrap;
}

.widget[data-kind="snake"] .arcade-shell-v41 {
  grid-template-rows: 24px minmax(0,1fr) 32px;
}

.widget[data-kind="snake"] .arcade-help-v41 {
  white-space: normal;
  line-height: 1.25;
}

.arcade-widget-v41.is-arcade-keyboard-active-v41 .widget-title strong::after {
  content: " · PLAY";
  color: var(--sem-teal);
  font-size: 7px;
  font-weight: 720;
  letter-spacing: .06em;
}

@media (max-width: 760px) {
  .arcade-help-v41 {
    font-size: 8.5px;
    white-space: normal;
    line-height: 1.2;
  }
}


/* =========================================================
   ARCADE CABINET V42 — SINGLE PORTRAIT LAUNCHER
   ========================================================= */

.widget[data-kind="arcade"] {
  overflow: hidden;
}

.widget[data-kind="arcade"] .widget-body {
  min-height: 0;
  height: 100%;
  padding: 8px 10px 10px !important;
  overflow: hidden !important;
}

.arcade-cabinet-header-actions-v42 {
  min-width: 46px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.arcade-cabinet-home-v42 {
  appearance: none;
  border: 0;
  border-radius: 7px;
  padding: 4px 7px;
  color: var(--muted);
  background: color-mix(in srgb,var(--ink) 5%,transparent);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: .035em;
  cursor: pointer;
}

.arcade-cabinet-home-v42:hover,
.arcade-cabinet-home-v42:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb,var(--ink) 9%,transparent);
  outline: none;
}

.arcade-cabinet-home-v42[hidden] {
  display: none !important;
}

.arcade-launcher-v42 {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  gap: 12px;
  outline: none;
}

.arcade-launcher-heading-v42 {
  display: grid;
  gap: 3px;
  padding: 2px 2px 0;
}

.arcade-launcher-heading-v42 strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -.01em;
}

.arcade-launcher-heading-v42 span {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.3;
}

.arcade-launcher-grid-v42 {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  grid-template-rows: repeat(3,minmax(0,1fr));
  gap: 8px;
}

.arcade-launch-card-v42:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.arcade-launch-card-v42 {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb,var(--ink) 10%,transparent);
  border-radius: 12px;
  color: var(--ink);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb,var(--ink) 5%,transparent),
      color-mix(in srgb,var(--ink) 1.5%,transparent)
    );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,var(--ink) 7%,transparent),
    0 8px 22px color-mix(in srgb,#000 8%,transparent);
  cursor: pointer;
  transition: transform 120ms ease,border-color 120ms ease,background 120ms ease;
}

.arcade-launch-card-v42:hover,
.arcade-launch-card-v42:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb,var(--sem-teal) 40%,transparent);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb,var(--sem-teal) 7%,transparent),
      color-mix(in srgb,var(--ink) 2%,transparent)
    );
  outline: none;
}

.arcade-launch-card-v42:active {
  transform: translateY(0) scale(.985);
}

.arcade-launch-icon-v42 {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--sem-teal);
}

.arcade-launch-icon-v42 svg {
  width: 28px;
  height: 28px;
}

.arcade-launch-card-v42:nth-child(2) .arcade-launch-icon-v42 {
  color: var(--sem-blue);
}

.arcade-launch-card-v42:nth-child(3) .arcade-launch-icon-v42 {
  color: var(--sem-green);
}

.arcade-launch-card-v42:nth-child(4) .arcade-launch-icon-v42 {
  color: var(--sem-amber);
}

.arcade-launch-card-v42 strong {
  font-size: 10px;
  font-weight: 730;
}

.widget[data-kind="arcade"] .arcade-shell-v41 {
  grid-template-rows: 24px minmax(0,1fr) 34px;
}

.widget[data-kind="arcade"] .arcade-help-v41 {
  padding-inline: 4px;
  font-size: 8.8px;
  line-height: 1.25;
  white-space: normal;
}

.widget[data-kind="arcade"] .arcade-screen-v41 {
  border-radius: 9px;
}

.widget[data-kind="arcade"][data-arcade-game-kind="tetris"] .widget-body {
  padding: 7px 9px 10px !important;
}

.widget[data-kind="arcade"][data-arcade-game-kind="tetris"] .tetris-shell-v39 {
  grid-template-rows: 34px minmax(0,1fr) 28px;
}

.widget[data-kind="arcade"][data-arcade-game-kind="tetris"] .tetris-help-v39 {
  width: 100%;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 8.8px;
  line-height: 1.15;
}

.widget[data-kind="arcade"].is-arcade-cabinet-keyboard-active-v42 .widget-title strong::after {
  content: " · PLAY";
  color: var(--sem-teal);
  font-size: 7px;
  font-weight: 720;
  letter-spacing: .06em;
}

.widget[data-kind="arcade"]:not(.is-arcade-game-active-v42) .widget-title strong::after {
  content: "";
}


/* ARCADE V43 — progression polish + Bubble Pop */
.widget[data-kind="arcade"] .tetris-status-v39 {
  gap: 7px;
}

.widget[data-kind="arcade"] .tetris-status-v39 small {
  font-size: 7px;
}

.widget[data-kind="arcade"] .tetris-status-v39 strong {
  font-size: 10px;
}

.widget[data-kind="arcade"] .arcade-launch-card-v42:last-child .arcade-launch-icon-v42 {
  color: var(--sem-magenta);
}

.widget[data-kind="arcade"] .arcade-launcher-heading-v42 {
  gap: 2px;
}

.widget[data-kind="arcade"] .arcade-launch-card-v42 {
  gap: 5px;
}

.widget[data-kind="arcade"] .arcade-launch-icon-v42 {
  width: 31px;
  height: 31px;
}

.widget[data-kind="arcade"] .arcade-launch-icon-v42 svg {
  width: 24px;
  height: 24px;
}

.widget[data-kind="arcade"] .arcade-hud-v41 {
  gap: 6px;
  font-size: 7.8px;
  letter-spacing: .015em;
}

.widget[data-kind="arcade"][data-arcade-game-kind="bubbles"] .arcade-screen-v41 {
  background:
    radial-gradient(circle at 50% 105%,color-mix(in srgb,var(--sem-magenta) 9%,transparent),transparent 42%),
    linear-gradient(color-mix(in srgb,var(--ink) 2%,transparent),color-mix(in srgb,var(--ink) .5%,transparent));
}


/* ARCADE V44 — pixel particle effects */
.tetris-particle-v44 {
  position: absolute;
  z-index: 3;
  display: block;
  pointer-events: none;
  border-radius: 0;
  transform: translate(-50%,-50%);
  image-rendering: pixelated;
  box-shadow: none;
}

.tetris-particle-v44.particle-teal { background: var(--sem-teal); }
.tetris-particle-v44.particle-purple { background: var(--sem-purple); }
.tetris-particle-v44.particle-magenta { background: var(--sem-magenta); }
.tetris-particle-v44.particle-amber { background: var(--sem-amber); }
.tetris-particle-v44.particle-green { background: var(--sem-green); }
.tetris-particle-v44.particle-red { background: var(--sem-red); }
.tetris-particle-v44.particle-ink { background: var(--ink); }


/* =========================================================
   ARCADE V45 — TOUCH CONTROLLER
   Dedicated controller tray for touch/coarse-pointer devices.
   ========================================================= */

.arcade-touch-controls-v45 {
  display: none;
}

.widget[data-kind="arcade"].is-arcade-touch-v45 .arcade-shell-v41.has-touch-controls-v45 {
  grid-template-rows: 24px minmax(0,1fr) 98px;
  gap: 5px;
}

.widget[data-kind="arcade"].is-arcade-touch-v45 .tetris-shell-v39.has-touch-controls-v45 {
  grid-template-rows: 34px minmax(0,1fr) 98px;
  gap: 5px;
}

.widget[data-kind="arcade"].is-arcade-touch-v45 .arcade-shell-v41.has-touch-controls-v45 .arcade-help-v41,
.widget[data-kind="arcade"].is-arcade-touch-v45 .tetris-shell-v39.has-touch-controls-v45 .tetris-help-v39 {
  display: none;
}

.widget[data-kind="arcade"].is-arcade-touch-v45 .has-touch-controls-v45 > .arcade-touch-controls-v45 {
  grid-row: 3;
  width: 100%;
  min-width: 0;
  height: 98px;
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 3px 7px 1px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.arcade-touch-controls-v45[data-mode="ready"],
.arcade-touch-controls-v45[data-mode="paused"] {
  grid-template-columns: 1fr;
  place-items: center;
}

.arcade-touch-dpad-v45 {
  width: 88px;
  height: 88px;
  justify-self: start;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-template-rows: repeat(3,1fr);
  gap: 2px;
}

.arcade-touch-dir-v45,
.arcade-touch-action-v45,
.arcade-touch-state-button-v45,
.arcade-touch-menu-button-v45 {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid color-mix(in srgb,var(--ink) 14%,transparent);
  color: var(--ink);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb,var(--ink) 8%,transparent),
      color-mix(in srgb,var(--ink) 3%,transparent)
    );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,var(--ink) 10%,transparent),
    0 5px 14px color-mix(in srgb,#000 10%,transparent);
  font: inherit;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.arcade-touch-dir-v45 {
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 11px;
  font-weight: 800;
}

.arcade-touch-dir-v45.is-up {
  grid-column: 2;
  grid-row: 1;
}

.arcade-touch-dir-v45.is-left {
  grid-column: 1;
  grid-row: 2;
}

.arcade-touch-dir-v45.is-right {
  grid-column: 3;
  grid-row: 2;
}

.arcade-touch-dir-v45.is-down {
  grid-column: 2;
  grid-row: 3;
}

.arcade-touch-dpad-center-v45 {
  grid-column: 2;
  grid-row: 2;
  border-radius: 7px;
  background: color-mix(in srgb,var(--ink) 5%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--ink) 7%,transparent);
}

.arcade-touch-dir-v45:active,
.arcade-touch-action-v45:active,
.arcade-touch-state-button-v45:active,
.arcade-touch-menu-button-v45:active {
  transform: scale(.94);
  background: color-mix(in srgb,var(--sem-teal) 16%,transparent);
}

.arcade-touch-controller-spacer-v45 {
  width: 1px;
  height: 48px;
  justify-self: center;
  background: color-mix(in srgb,var(--ink) 6%,transparent);
}

.arcade-touch-action-v45 {
  width: 74px;
  height: 74px;
  justify-self: end;
  align-self: center;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 0;
}

.arcade-touch-action-dot-v45 {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: color-mix(in srgb,var(--sem-teal) 18%,transparent);
  font-size: 14px;
  font-weight: 820;
}

.arcade-touch-action-v45 small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 720;
  letter-spacing: .04em;
}

.arcade-touch-paused-actions-v45 {
  width: min(100%,230px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.arcade-touch-state-button-v45,
.arcade-touch-menu-button-v45 {
  min-height: 46px;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .05em;
}

.arcade-touch-state-button-v45 {
  border-color: color-mix(in srgb,var(--sem-teal) 28%,transparent);
}

.arcade-touch-menu-button-v45 {
  color: var(--muted);
}

.arcade-touch-controls-v45[data-mode="ready"] .arcade-touch-state-button-v45 {
  width: min(100%,180px);
}

.widget[data-kind="arcade"].is-arcade-touch-v45 .arcade-screen-v41,
.widget[data-kind="arcade"].is-arcade-touch-v45 .tetris-board-v39 {
  touch-action: none;
}

.widget[data-kind="arcade"].is-arcade-game-active-v42 .arcade-screen-v41,
.widget[data-kind="arcade"].is-arcade-game-active-v42 .tetris-board-v39 {
  cursor: pointer;
}

@media (pointer: coarse) {
  .widget[data-kind="arcade"] .arcade-launcher-heading-v42 span {
    font-size: 9px;
  }
}

/* =========================================================
   PINNING LAB V46 — STRICT ATOM STAGE-4 LANDSCAPE
   Source behavior retained; standalone lab material removed.
   ========================================================= */

.widget[data-kind="pinning"].pinning-lab-widget-v46 {
  overflow: visible !important;
}

.widget[data-kind="pinning"].pinning-lab-widget-v46 .widget-body {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 4px 10px 10px !important;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden !important;
  background: transparent !important;
}

.widget[data-kind="pinning"] .context-chips {
  flex: 0 0 auto;
}

.pinning-lab-v46 {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(270px,31%) minmax(0,1fr);
  gap: 9px;
  color: var(--ink);
}

.pin-input-panel-v46,
.pin-result-panel-v46 {
  min-width: 0;
  min-height: 0;
  border: 1px solid color-mix(in srgb,var(--ink) 10%,transparent);
  border-radius: 16px;
  background: transparent;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,white 6%,transparent),
    inset 0 0 0 1px color-mix(in srgb,var(--ink) 1.5%,transparent);
}

.pin-input-panel-v46 {
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pin-format-toggle-v46 {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 3px;
  margin-bottom: 9px;
  border: 1px solid color-mix(in srgb,var(--ink) 9%,transparent);
  border-radius: 10px;
  background: transparent;
}

.pin-format-toggle-v46 button {
  height: 31px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: color-mix(in srgb,var(--ink) 46%,transparent);
  background: transparent;
  font-size: 10px;
  font-weight: 760;
  cursor: default;
  opacity: 1;
}

.pin-format-toggle-v46 button.is-active {
  color: var(--ink);
  border-color: color-mix(in srgb,var(--sem-purple) 34%,transparent);
  background: color-mix(in srgb,var(--sem-purple) 11%,transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb,white 5%,transparent);
}

.pin-primary-fields-v46 {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pin-field-v46 {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 4px 7px;
  margin-bottom: 9px;
}

.pin-field-v46 > span,
.pin-operating-label-v46 > span {
  color: color-mix(in srgb,var(--ink) 52%,transparent);
  font-size: 9px;
  font-weight: 710;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.pin-field-v46 > strong {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb,var(--sem-purple) 78%,var(--ink));
  font-size: 9px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-field-v46 > input,
.pin-key-row-v46 > input {
  width: 100%;
  min-width: 0;
  height: 34px;
  color: var(--ink);
  border: 1px solid color-mix(in srgb,var(--ink) 10%,transparent);
  border-radius: 8px;
  outline: 0;
  background:
    linear-gradient(180deg,color-mix(in srgb,white 3%,transparent),transparent),
    color-mix(in srgb,var(--paper-soft) 14%,transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb,white 3%,transparent);
  font: 720 11px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing: .075em;
}

.pin-field-v46 > input {
  grid-column: 1 / -1;
  padding: 0 9px;
}

.pin-operating-field-v46 {
  flex: 1 1 auto;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pin-operating-label-v46 {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pin-operating-label-v46 > b {
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  color: color-mix(in srgb,var(--ink) 54%,transparent);
  border: 1px solid color-mix(in srgb,var(--ink) 9%,transparent);
  border-radius: 999px;
  font-size: 8px;
}

.pin-key-rows-v46 {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 2px 0 0;
  overflow: auto;
}

.pin-key-row-v46 {
  display: grid;
  grid-template-columns: minmax(88px,.72fr) minmax(0,1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.pin-key-row-v46 > input {
  padding: 0 8px;
}

.pin-key-row-v46 > .pin-key-name-v46 {
  color: color-mix(in srgb,var(--ink) 72%,transparent);
  letter-spacing: 0;
  font-family: inherit;
  font-size: 10px;
}

.pin-no-operating-v46 {
  min-height: 48px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb,var(--ink) 34%,transparent);
  border: 1px dashed color-mix(in srgb,var(--ink) 9%,transparent);
  border-radius: 9px;
  font-size: 9px;
}

.pin-left-actions-v46 {
  flex: 0 0 auto;
  display: flex;
  margin-top: 7px;
}

.pin-action-v46 {
  min-height: 30px;
  padding: 5px 9px;
  color: color-mix(in srgb,var(--ink) 84%,transparent);
  border: 1px solid color-mix(in srgb,var(--ink) 10%,transparent);
  border-radius: 8px;
  background: transparent;
  font-size: 9px;
  font-weight: 720;
  cursor: pointer;
  transition:
    border-color .14s ease,
    background .14s ease,
    transform .10s ease;
}

.pin-action-v46:hover {
  border-color: color-mix(in srgb,var(--ink) 18%,transparent);
  background: color-mix(in srgb,var(--paper-soft) 20%,transparent);
}

.pin-action-v46:active {
  transform: translateY(1px);
}

.pin-action-v46.is-primary {
  color: color-mix(in srgb,var(--sem-purple) 78%,var(--ink));
  border-color: color-mix(in srgb,var(--sem-purple) 26%,transparent);
  background: color-mix(in srgb,var(--sem-purple) 8%,transparent);
}

.pin-status-v46 {
  flex: 0 0 auto;
  min-height: 22px;
  padding-top: 6px;
  color: color-mix(in srgb,var(--ink) 44%,transparent);
  font-size: 9px;
  line-height: 1.35;
}

.pin-status-v46.is-warning {
  color: color-mix(in srgb,var(--sem-amber) 78%,var(--ink));
}

.pin-result-panel-v46 {
  display: grid;
  grid-template-rows: 38px minmax(205px,44%) minmax(0,1fr);
  overflow: hidden;
}

.pin-result-head-v46 {
  min-width: 0;
  padding: 4px 8px 4px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid color-mix(in srgb,var(--ink) 8%,transparent);
}

.pin-result-head-v46 > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pin-result-head-v46 strong {
  font-size: 11px;
  font-weight: 740;
}

.pin-result-head-v46 span {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb,var(--ink) 42%,transparent);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-result-actions-v46 {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pin-pref-v46[aria-pressed="true"] {
  color: color-mix(in srgb,var(--sem-purple) 82%,var(--ink));
  border-color: color-mix(in srgb,var(--sem-purple) 26%,transparent);
  background: color-mix(in srgb,var(--sem-purple) 9%,transparent);
}

.pin-diagram-v46 {
  min-width: 0;
  min-height: 0;
  padding: 8px 9px 7px;
  display: grid;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb,var(--ink) 8%,transparent);
  background: transparent;
  position: relative;
}

.pin-diagram-spacer-v46 {
  min-width: 124px;
  pointer-events: none;
}

.pin-chamber-v46 {
  min-width: 0;
  height: 100%;
  margin: 0 4px;
  padding: 22px 6px 7px;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--ink) 10%,transparent);
  border-radius: 11px;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb,var(--ink) 2%,transparent),
      transparent 14%,
      transparent 86%,
      color-mix(in srgb,var(--ink) 2%,transparent)
    );
  box-shadow:
    inset 1px 0 0 color-mix(in srgb,white 2%,transparent),
    inset -1px 0 0 color-mix(in srgb,var(--ink) 2%,transparent);
  isolation: isolate;
}

.pin-chamber-v46::after {
  content: attr(data-n);
  position: absolute;
  z-index: 8;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: color-mix(in srgb,var(--ink) 43%,transparent);
  font-size: 9px;
  font-weight: 760;
}

.pin-stack-v46 {
  --jiggle-x: 0px;
  --jiggle-r: 0deg;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  transform: translateX(var(--jiggle-x)) rotate(var(--jiggle-r));
  transform-origin: 50% 88%;
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

.pin-stack-v46.is-jiggling {
  transition: none;
}

.pin-seg-v46 {
  width: min(64%,88px);
  min-height: 8px;
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  opacity: 0;
  transform-origin: 50% 100%;
  animation: pinDropV46 .62s cubic-bezier(.2,.76,.22,1.04) var(--delay,0s) both;
}

.pin-seg-v46.is-bottom {
  cursor: grab;
  touch-action: none;
}

.pin-seg-v46.is-bottom:active {
  cursor: grabbing;
}

.pin-shell-v46 {
  position: absolute;
  inset: 0;
  transform-origin: 50% 60%;
  transition: transform .26s cubic-bezier(.2,.8,.2,1);
}

.pin-shell-v46.is-crooked {
  transform: translateX(2px) rotate(4deg);
}

.pin-shell-v46.is-settled {
  animation: waferSettleV46 .34s cubic-bezier(.2,.9,.2,1);
}

.pin-seg-v46 svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pin-shape-v46 {
  fill: color-mix(in srgb,var(--pin-base) 58%,transparent);
  stroke: color-mix(in srgb,var(--pin-base) 82%,var(--ink));
  stroke-width: 1.45;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.pin-seg-v46.is-bottom .pin-shape-v46 {
  stroke-width: 1.8;
}

.pin-rim-v46 {
  fill: none;
  stroke: color-mix(in srgb,white 42%,transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.pin-shadow-v46 {
  fill: none;
  stroke: color-mix(in srgb,var(--ink) 13%,transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.pin-seg-v46 > span {
  position: relative;
  z-index: 5;
  color: color-mix(in srgb,var(--ink) 90%,transparent);
  font: 800 9px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  text-shadow: 0 1px 2px color-mix(in srgb,var(--paper-deep) 72%,transparent);
  pointer-events: none;
  transition: opacity .16s ease;
}

.pin-spring-v46 {
  width: min(56%,70px);
  height: 39px;
  flex: 0 0 39px;
  position: relative;
  opacity: 0;
  animation: springDropV46 .6s cubic-bezier(.2,.8,.2,1.08) var(--delay,0s) both;
}

.pin-spring-v46 svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pin-spring-v46 path {
  fill: none;
  stroke: color-mix(in srgb,var(--sem-grey) 70%,transparent);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pin-spring-cap-v46 {
  fill: color-mix(in srgb,var(--sem-grey) 22%,transparent);
  stroke: color-mix(in srgb,var(--sem-grey) 64%,transparent);
  stroke-width: 1.2;
}

.pin-spring-label-v46 {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translate(100%,-50%);
  color: color-mix(in srgb,var(--ink) 30%,transparent);
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: 0;
  transition: opacity .2s;
}

.pin-spring-v46:hover .pin-spring-label-v46 {
  opacity: 1;
}

.pin-table-wrap-v46 {
  min-width: 0;
  min-height: 0;
  margin: 7px 9px 9px;
  overflow: auto;
  border: 1px solid color-mix(in srgb,var(--ink) 9%,transparent);
  border-radius: 9px;
  background: transparent;
}

.pin-table-v46 {
  width: 100%;
  min-width: 610px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
}

.pin-table-v46 th,
.pin-table-v46 td {
  height: 32px;
  padding: 4px 6px;
  border-right: 1px solid color-mix(in srgb,var(--ink) 7%,transparent);
  border-bottom: 1px solid color-mix(in srgb,var(--ink) 7%,transparent);
  background: transparent;
  text-align: center;
  font-size: 9px;
}

.pin-table-v46 th:first-child,
.pin-table-v46 td:first-child {
  width: 124px;
  min-width: 124px;
  text-align: left;
}

.pin-table-v46 thead th {
  height: 30px;
  color: color-mix(in srgb,var(--ink) 48%,transparent);
  font-size: 8px;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.pin-table-v46 tbody tr:last-child td {
  border-bottom: 0;
}

.pin-table-v46 th:last-child,
.pin-table-v46 td:last-child {
  border-right: 0;
}

.pin-segment-head-v46 {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.pin-order-v46 {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: color-mix(in srgb,var(--ink) 48%,transparent);
  border: 1px solid color-mix(in srgb,var(--ink) 9%,transparent);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.pin-order-v46:hover {
  color: var(--ink);
  border-color: color-mix(in srgb,var(--ink) 16%,transparent);
}

.pin-chip-v46 {
  min-width: 28px;
  height: 24px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb,var(--ink) 90%,transparent);
  border: 1.5px solid color-mix(in srgb,var(--pin-base) 82%,var(--ink));
  border-radius: 6px;
  background: color-mix(in srgb,var(--pin-base) 44%,transparent);
  font-weight: 800;
}

.pin-chip-v46.is-bottom {
  border-width: 2px;
}

.pin-empty-cell-v46 {
  color: color-mix(in srgb,var(--ink) 32%,transparent);
}

/* Mono is not a white pin theme. It is an etched-glass technical outline:
   transparent body, neutral line, no rim or shadow decoration. */
.pinning-lab-v46.is-mono .pin-shape-v46 {
  fill: transparent !important;
  stroke: color-mix(in srgb,var(--ink) 40%,transparent) !important;
}

.pinning-lab-v46.is-mono .pin-rim-v46,
.pinning-lab-v46.is-mono .pin-shadow-v46 {
  display: none !important;
}

.pinning-lab-v46.is-mono .pin-chip-v46 {
  color: color-mix(in srgb,var(--ink) 68%,transparent);
  border-color: color-mix(in srgb,var(--ink) 34%,transparent) !important;
  background: transparent !important;
}

/* Details mirrors the standalone lab: remove labels in the physical stack
   and clear the additional control-height / total-stack rows. */
.pinning-lab-v46.is-details-hidden .pin-seg-v46 > span {
  opacity: 0 !important;
}

.pinning-lab-v46.is-details-hidden .pin-extra-row-v46 {
  display: none !important;
}

.pinning-empty-v46 {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px;
  color: color-mix(in srgb,var(--ink) 48%,transparent);
  border: 1px dashed color-mix(in srgb,var(--ink) 11%,transparent);
  border-radius: 16px;
  background: transparent;
  text-align: center;
}

.pinning-empty-v46 > strong {
  color: color-mix(in srgb,var(--ink) 78%,transparent);
  font-size: 13px;
}

.pinning-empty-v46 > span:last-child {
  max-width: 440px;
  font-size: 10px;
  line-height: 1.45;
}

.pinning-empty-v46.is-error > strong {
  color: color-mix(in srgb,var(--sem-red) 82%,var(--ink));
}

.pinning-empty-icon-v46 {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb,var(--sem-purple) 64%,var(--ink));
}

.pinning-empty-icon-v46 svg {
  width: 32px;
  height: 32px;
}

@keyframes pinDropV46 {
  0% { transform: translateY(-230px); opacity: 0; }
  64% { transform: translateY(6px); opacity: 1; }
  80% { transform: translateY(-3px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes springDropV46 {
  0% { transform: translateY(-200px) scaleY(1.15); opacity: 0; }
  68% { transform: translateY(5px) scaleY(.78); opacity: 1; }
  84% { transform: translateY(-2px) scaleY(1.07); opacity: 1; }
  100% { transform: translateY(0) scaleY(1); opacity: 1; }
}

@keyframes waferSettleV46 {
  0% { transform: translateX(2px) rotate(4deg); }
  55% { transform: translateX(-1px) rotate(-1.5deg); }
  100% { transform: translateX(0) rotate(0); }
}

@media (max-width: 1100px) {
  .pinning-lab-v46 {
    grid-template-columns: minmax(235px,34%) minmax(0,1fr);
  }

  .pin-primary-fields-v46 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pin-seg-v46,
  .pin-spring-v46 {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .pin-shell-v46,
  .pin-stack-v46 {
    transition: none !important;
  }
}



/* =========================================================
   SITEWIDE EDIT / CONNECTION SEMANTIC PALETTE — 2026-09-02
   Contract:
   PURPLE = opens popup / edit / inspect / selection surface.
   BLUE   = connection / relationship cable semantic.
   The legacy --sem-magenta token carries the purple edit color.
   ========================================================= */

:root{
  --sem-magenta:#8b72bd;
  --popup-edit:var(--sem-magenta);
  --popup-edit-soft:color-mix(in srgb,var(--sem-magenta) 12%,transparent);
  --popup-edit-line:color-mix(in srgb,var(--sem-magenta) 32%,transparent);
}

.legend-magenta{background:var(--sem-magenta) !important}
.legend-connect,.legend-purple{background:var(--sem-purple) !important}

.edit-control::before,
.widget-header .edit-control::before,
.modal-edit::before{
  background:var(--sem-magenta) !important;
}

.edit-control:hover::before{
  background:color-mix(in srgb,var(--sem-magenta) 86%,white) !important;
}

.edit-control[aria-pressed="true"]::before{
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 0 0 4px color-mix(in srgb,var(--sem-magenta) 16%,transparent) !important;
}

.modal-edit.is-active::before{
  background:transparent !important;
  border-color:var(--sem-magenta) !important;
  box-shadow:
    0 0 0 3px color-mix(in srgb,var(--sem-magenta) 12%,transparent),
    inset 0 0 0 2px color-mix(in srgb,var(--sem-magenta) 32%,transparent) !important;
}

.cell-link,
.detail-relation,
.relation-picker,
.details-button,
.inventory-quick,
.inventory-button,
.detail-inventory-open,
.detail-related-list > button,
.component-list > button,
.inventory-list > button,
[data-open-details-kind],
[data-related-kind],
[data-open-stock],
[data-open-set-components],
[data-open-inventory-kind],
[data-modal-select-field],
[data-context-edit],
.column-editor-toggle{
  --popup-edit:var(--sem-magenta);
}

.cell-link,
.detail-relation,
.relation-picker,
[data-open-details-kind],
[data-related-kind],
[data-open-stock],
[data-open-set-components],
[data-open-inventory-kind],
[data-modal-select-field],
[data-context-edit],
.column-editor-toggle{
  color:color-mix(in srgb,var(--sem-magenta) 88%,white) !important;
}

.cell-link:hover,
.detail-relation:hover,
.relation-picker:hover,
[data-open-details-kind]:hover,
[data-related-kind]:hover,
[data-open-stock]:hover,
[data-open-set-components]:hover,
[data-open-inventory-kind]:hover,
[data-modal-select-field]:hover,
[data-context-edit]:hover,
.column-editor-toggle:hover{
  color:color-mix(in srgb,var(--sem-magenta) 78%,white) !important;
  text-decoration-color:color-mix(in srgb,var(--sem-magenta) 72%,transparent) !important;
}

.details-button,
.inventory-quick{
  color:var(--sem-magenta) !important;
}

.details-button:hover,
.inventory-quick:hover{
  color:color-mix(in srgb,var(--sem-magenta) 82%,white) !important;
  background:var(--popup-edit-soft) !important;
  box-shadow:inset 0 0 0 1px var(--popup-edit-line) !important;
}

.focus-modal-card .detail-field > input:focus,
.focus-modal-card .detail-field > select:focus,
.focus-modal-card .relation-picker:focus,
.focus-modal-card [data-modal-select-field]:focus{
  border-color:color-mix(in srgb,var(--sem-magenta) 46%,transparent) !important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--sem-magenta) 10%,transparent) !important;
}

.column-choice input{
  accent-color:var(--sem-magenta) !important;
}

/* Filter opens a popup, so its interaction language is purple too. */
.footer-filter-toggle{
  color:color-mix(in srgb,var(--sem-magenta) 68%,var(--ink)) !important;
}
.footer-filter-toggle:hover,
.footer-filter.is-open .footer-filter-toggle{
  color:color-mix(in srgb,var(--sem-magenta) 88%,white) !important;
}
.atom-shell .footer-filter-menu{
  border-color:color-mix(in srgb,var(--sem-magenta) 16%,var(--ink) 10%) !important;
}
.atom-shell .footer-filter-menu .universal-filter-search:focus-within,
.atom-shell .footer-filter-menu .scope-combo > input:focus{
  border-color:color-mix(in srgb,var(--sem-magenta) 34%,var(--ink) 7%) !important;
}
.atom-shell .footer-filter-menu .scope-options > button:hover,
.atom-shell .footer-filter-menu .scope-options > button.is-selected{
  border-color:color-mix(in srgb,var(--sem-magenta) 24%,transparent) !important;
  background:color-mix(in srgb,var(--sem-magenta) 14%,var(--filter-gel-soft) 20%) !important;
}

/* White background keeps purple recognizable without becoming neon. */
.atom-shell[data-background="white"] .cell-link,
.atom-shell[data-background="white"] .detail-relation,
.atom-shell[data-background="white"] .relation-picker,
.atom-shell[data-background="white"] [data-open-details-kind],
.atom-shell[data-background="white"] [data-related-kind],
.atom-shell[data-background="white"] [data-open-stock],
.atom-shell[data-background="white"] [data-open-set-components],
.atom-shell[data-background="white"] [data-open-inventory-kind],
.atom-shell[data-background="white"] [data-modal-select-field],
.atom-shell[data-background="white"] [data-context-edit],
.atom-shell[data-background="white"] .column-editor-toggle{
  color:color-mix(in srgb,var(--sem-magenta) 78%,#332b33) !important;
}


/* =========================================================
   WORKBENCH V60 — GREEN CREATE CONTROL
   Green creates a new record. Purple opens/edits. Blue connects.
   ========================================================= */

.create-control{
  position:relative;
  width:23px;
  min-width:23px;
  height:23px;
  min-height:23px;
  margin:0;
  padding:0;
  display:grid;
  place-items:center;
  border:0;
  border-radius:50%;
  color:inherit;
  background:transparent;
  box-shadow:none;
  cursor:pointer;
  touch-action:manipulation;
}

.create-control::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:13px;
  height:13px;
  display:block;
  border-radius:50%;
  background:var(--sem-green);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.13);
  transform:translate(-50%,-50%);
}

.create-control:hover::before{
  background:color-mix(in srgb,var(--sem-green) 86%,white);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.10),
    0 0 0 4px color-mix(in srgb,var(--sem-green) 12%,transparent);
}

.create-control:focus-visible{
  outline:2px solid color-mix(in srgb,var(--sem-green) 76%,white);
  outline-offset:2px;
}

.widget-header .create-control{
  position:relative !important;
  width:23px !important;
  min-width:23px !important;
  height:23px !important;
  min-height:23px !important;
  margin:0 !important;
  padding:0 !important;
  display:grid !important;
  place-items:center !important;
  line-height:0 !important;
}

.widget-header .create-control::before{
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  width:13px !important;
  height:13px !important;
  margin:0 !important;
  transform:translate(-50%,-50%) !important;
  box-sizing:border-box;
}

/* Generated systems can contain tens of thousands of Key Symbols. Keep the
   sandbox write real while mounting only one spreadsheet page at a time. */
.widget[data-kind="keySymbols"].has-large-symbol-pagination .widget-body {
  min-height:0;
  display:flex !important;
  flex-direction:column;
  overflow:hidden !important;
}

.widget[data-kind="keySymbols"].has-large-symbol-pagination .sheet-table {
  flex:1 1 auto;
  min-height:0;
}

.widget[data-kind="keySymbols"].has-large-symbol-pagination .pager {
  flex:0 0 31px;
  min-height:31px;
  margin:0;
  padding:4px 8px 0;
  justify-content:flex-end;
  border-top:1px solid rgba(255,255,255,.07);
}
