/* The atlas and playground are tools, not miniature landing pages.
   A quiet catalog, a full-size map and one deliberate editorial inspector. */
body.workspace-page {
  --sidebar: 244px;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0e1d42;
  color: #fff8f1;
  line-height: 1.45;
  font-family: "DM Sans", system-ui, sans-serif;
}
.workspace-page button,
.workspace-page input { font: inherit; }
.workspace-page .sidebar-toggle,
.workspace-page .sidebar-overlay { display: none; }
.workspace-page .sidebar {
  position: relative;
  inset: auto;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: auto;
  height: 100%;
  overflow: hidden;
  padding: 23px 18px 0;
  border-right: 1px solid rgba(255,255,255,.18);
  background: #0e1d42;
}
.workspace-page .sidebar-logo {
  flex: none;
  margin: 0;
  padding: 0 0 17px;
  border-bottom: 1px solid rgba(255,255,255,.17);
  font: 700 1.05rem "DM Sans", sans-serif;
  letter-spacing: -.04em;
}
.workspace-page .sidebar-tools {
  flex: none;
  gap: 13px;
  margin: 14px 0 0;
}
.workspace-page .sidebar-tools a { font-size: .62rem; }
.workspace-page .catalog-intro { flex: none; padding: 48px 5px 29px; }
.workspace-page .catalog-index,
.workspace-page .catalog-search-label,
.workspace-page .detail-eyebrow,
.workspace-page .canvas-foot,
.workspace-page .stage-label,
.workspace-page .stage-corner {
  font: 400 .62rem/1.6 "DM Mono", monospace;
  letter-spacing: .11em;
}
.workspace-page .catalog-index { color: #b4c9e0; }
.workspace-page .catalog-intro h1 {
  margin: 12px 0 10px;
  font: 400 2.8rem/.9 "Instrument Serif", Georgia, serif;
  letter-spacing: -.025em;
}
.workspace-page .catalog-intro h1 em { font-weight: 400; color: #cbdff1; }
.workspace-page .catalog-intro p { max-width: 190px; color: #b3c3d9; font-size: .72rem; line-height: 1.5; }
.workspace-page .catalog-search-label { flex: none; margin: 0 5px 9px; color: #b3c8e0; }
.workspace-page .catalog-search {
  flex: none;
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.29);
  border-radius: 2px;
  outline: none;
  background: rgba(255,255,255,.045);
  color: #fff8f1;
  font-size: .73rem;
}
.workspace-page .catalog-search::placeholder { color: #9fb1cc; }
.workspace-page .catalog-search:focus { border-color: #c5dcef; background: rgba(255,255,255,.08); }
.workspace-page .catalog-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 20px -8px 0;
  padding: 0 8px 35px;
  scrollbar-color: #70819c transparent;
}
.workspace-page .sidebar-label {
  margin: 22px 0 8px;
  padding: 0 5px;
  color: #91a9c7;
  font-size: .56rem;
  letter-spacing: .13em;
}
.workspace-page .sidebar-label:first-child { margin-top: 0; }
.workspace-page .catalog-no-results { margin: 18px 5px; color: #b9c9dc; font-size: .73rem; }
.workspace-page .catalog-no-results[hidden] { display: none; }
.workspace-page .sidebar-label[hidden],
.workspace-page .geo-link[hidden],
.workspace-page .drag-item[hidden] { display: none !important; }
.workspace-page .sidebar .geo-link,
.workspace-page .sidebar .drag-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #cad7e8;
  font-size: .73rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.workspace-page .sidebar .geo-link:hover,
.workspace-page .sidebar .drag-item:hover { color: #fff; background: rgba(255,255,255,.085); }
.workspace-page .sidebar .geo-link.active { color: #fff; background: rgba(192,221,239,.14); border-left-color: #d5e7f5; }
.workspace-page .sidebar .geo-link.active::after { content: "↗"; margin-left: auto; color: #cbdff1; }
.workspace-page .tag-dot { width: 5px; height: 5px; }
.workspace-page .tag-dot.standard { background: #e7e9f0; }
.workspace-page .tag-dot.custom { background: #a7cfe3; }
.workspace-page .tag-dot.new { background: #e8bdd2; }

.workspace-page .main,
.playground-page .main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #101d38;
}
.workspace-page .topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 89px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(255,255,255,.17);
  background: #14234f;
}
.workspace-page .tool-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.workspace-page .tool-kicker { color: #aac0da; font-size: .6rem; letter-spacing: .13em; }
.workspace-page .topbar h2 { margin: 0; font: 400 clamp(2rem, 2.8vw, 2.8rem)/.9 "Instrument Serif", Georgia, serif; white-space: nowrap; }
.workspace-page .topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 11px; flex-wrap: wrap; }
.workspace-page .workspace-link { margin-right: 12px; color: #c9dbee; font-size: .64rem; }
.workspace-page .geo-badge {
  margin: 0;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.31);
  border-radius: 2px;
  color: #dce9f7;
  font: 400 .59rem "DM Mono", monospace;
  letter-spacing: .08em;
}
.workspace-page .topbar .btn,
.workspace-page .btn-replay {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.33);
  border-radius: 2px;
  background: transparent;
  color: #fff8f1;
  font: 600 .69rem "DM Sans", sans-serif;
  letter-spacing: .01em;
  text-transform: none;
}
.workspace-page .topbar .btn:hover,
.workspace-page .btn-replay:hover { border-color: #fff8f1; color: #fff; background: rgba(255,255,255,.08); }
.workspace-page .topbar .btn-primary { border-color: #fff8f1; background: #fff8f1; color: #14234f; }
.workspace-page .topbar .btn-primary:hover { background: #fff; color: #14234f; }
.workspace-page .topbar #layer-count { color: #c6d7ea; font: .64rem "DM Mono", monospace; }
.workspace-page .workspace-body { flex: 1; display: grid; min-height: 0; min-width: 0; }
.showroom-page .workspace-body { grid-template-columns: minmax(0,1fr) 335px; }
.playground-page .workspace-body { grid-template-columns: minmax(0,1fr) minmax(315px, 30%); }
.workspace-page .map-container {
  grid-column: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: auto;
  border: 0;
  background: #131d2c;
  isolation: isolate;
}
.workspace-page .map-container::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09);
}
.workspace-page .map-container #showroom-map,
.workspace-page .map-container #playground-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.workspace-page .stage-label {
  position: absolute;
  z-index: 5;
  top: 19px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 2px;
  background: rgba(14,29,66,.84);
  color: #fff;
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.workspace-page .stage-dot { width: 6px; height: 6px; border-radius: 50%; background: #c7e9f4; box-shadow: 0 0 9px #c7e9f4; }
.workspace-page .stage-label-divider { color: #879bbd; }
.workspace-page .stage-corner {
  position: absolute;
  z-index: 5;
  bottom: 25px;
  left: 22px;
  padding-left: 13px;
  border-left: 1px solid rgba(255,255,255,.79);
  color: #e1e9f3;
  line-height: 1.5;
  pointer-events: none;
  text-shadow: 0 1px 4px #0e1d42;
}
.workspace-page .loading-overlay { background: #14234f; }

/* Showroom: the map is the exhibit; source and explanation live in a field-note drawer. */
.showroom-page .detail-panel {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid #e0ddd9;
  background: #f6f0e9;
  color: #182845;
}
.showroom-page .detail-topline { display: flex; justify-content: space-between; gap: 12px; padding: 22px 23px; border-bottom: 1px solid #c7ced3; color: #536b8b; font: .56rem "DM Mono", monospace; letter-spacing: .07em; }
.showroom-page .detail-head { padding: 37px 24px 27px; }
.showroom-page .detail-eyebrow,
.playground-page .detail-eyebrow { color: #4f7090; }
.showroom-page .detail-head h3 { margin: 13px 0 0; font: 400 2.7rem/.94 "Instrument Serif", Georgia, serif; letter-spacing: -.025em; }
.showroom-page .detail-head h3 em { color: #436f91; font-weight: 400; }
.showroom-page .info-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  min-height: 0;
  padding: 25px 24px 28px;
  border-top: 1px solid #c9d0d3;
  border-bottom: 1px solid #c9d0d3;
  background: transparent;
  color: #4b5b6d;
}
.showroom-page .info-panel .status { color: #315e81; font: .63rem "DM Mono", monospace; text-transform: uppercase; letter-spacing: .09em; }
.showroom-page .info-panel .status::before { content: "●"; margin-right: 8px; color: #578d9c; font-size: .5rem; }
.showroom-page .info-panel .desc { margin: 0; font-size: .85rem; line-height: 1.67; }
.showroom-page .detail-code { flex: none; min-height: 0; }
.showroom-page .code-toggle {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  border: 0;
  border-bottom: 1px solid #c9d0d3;
  background: transparent;
  color: #203c60;
  font: .63rem "DM Mono", monospace;
  letter-spacing: .1em;
  cursor: pointer;
}
.showroom-page .code-toggle:hover { color: #102047; background: rgba(115,150,182,.09); }
.showroom-page .code-toggle .arrow { font-size: 1.1rem; line-height: .6; }
.showroom-page .code-panel { overflow: auto; max-height: 360px; border-bottom: 1px solid #c9d0d3; background: #e9ebeb; }
.showroom-page .code-panel.collapsed { max-height: 0; border-bottom: 0; }
.showroom-page .code-panel pre { padding: 20px 24px; color: #243755; font: .66rem/1.65 "DM Mono", monospace; }
.showroom-page .detail-foot { display: flex; justify-content: space-between; margin-top: auto; padding: 24px; color: #66809b; font: .6rem "DM Mono", monospace; letter-spacing: .07em; text-transform: uppercase; }

/* Playground: a live preview and an actual composition inspector. */
.playground-page .canvas-wrapper {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid #d3d5d6;
  background: #f6f0e9;
  color: #182845;
}
.playground-page .canvas-heading { flex: none; padding: 25px 22px 21px; }
.playground-page .canvas-heading h3 { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; font: 400 2.5rem/.98 "Instrument Serif", Georgia, serif; }
.playground-page .canvas-heading .count { display: inline-grid; place-items: center; width: 23px; height: 23px; border: 1px solid #95a8b5; border-radius: 50%; color: #446487; font: .63rem "DM Mono", monospace; }
.playground-page .canvas-heading p { max-width: 280px; color: #58687a; font-size: .76rem; line-height: 1.55; }
.playground-page .canvas-header { flex: none; display: flex; justify-content: space-between; gap: 8px; padding: 12px 22px; border-top: 1px solid #cbd0d3; border-bottom: 1px solid #cbd0d3; color: #597390; font: .59rem "DM Mono", monospace; letter-spacing: .11em; }
.playground-page #drop-canvas { flex: 1; min-height: 0; overflow-y: auto; padding: 17px 16px 30px; scrollbar-color: #bbc4ca transparent; }
.playground-page .empty-state { min-height: 155px; height: auto; padding: 20px; border: 1px dashed #a8b5c2; border-radius: 2px; background: rgba(188,207,223,.15); color: #617992; font: .67rem/1.6 "DM Mono", monospace; letter-spacing: .04em; text-align: center; }
.playground-page .empty-state.drag-over { border-color: #507c9b; background: #dfe9ed; color: #254f75; }
.playground-page .card { border: 1px solid #c7ced1; border-radius: 2px; background: #fffdfa; color: #233955; box-shadow: 0 4px 13px rgba(21,38,65,.035); }
.playground-page .card-header { padding: 10px 11px; }
.playground-page .card-header .card-title { color: #1c3255; font-size: .76rem; }
.playground-page .card-header .geo-badge { border-color: #c8d1d8; color: #42627e; }
.playground-page .card-header .card-actions button { color: #62778d; }
.playground-page .card-body { border-top-color: #d9dce0; }
.playground-page .field-row { align-items: flex-start; }
.playground-page .field-row label { color: #53677b; }
.playground-page .field-row input,
.playground-page .field-row select,
.playground-page .field-row textarea { min-width: 0; background: #f7f8f7; border-color: #bdc9d1; color: #243f5a; }
.playground-page .field-row input:focus,
.playground-page .field-row select:focus,
.playground-page .field-row textarea:focus { border-color: #4c7898; }
.playground-page .field-row .coord-hint { color: #71849a; }
.playground-page .delay-connector { padding-inline: 5px; }
.playground-page .delay-connector .delay-line { border-top-color: #b3c2ce; }
.playground-page .delay-connector .delay-down,
.playground-page .delay-connector .delay-up,
.playground-page .delay-connector .delay-value { border-color: #bdc9d1; background: #fffdfa; color: #435e79; }
.playground-page .delay-connector .delay-unit { color: #617990; }
.playground-page .gc-children { border-color: #b9c6ce; background: #f2f5f5; }
.playground-page .canvas-foot { flex: none; padding: 13px 22px; border-top: 1px solid #cbd0d3; color: #7187a0; }

@media (max-width: 1020px) {
  body.workspace-page { display: block; }
  .workspace-page .sidebar-toggle {
    position: fixed; z-index: 52; top: 17px; left: 15px;
    display: grid; place-items: center;
    width: 42px; height: 42px;
    border: 1px solid rgba(255,255,255,.43); border-radius: 2px;
    background: #152a53; color: #fff8f1; font-size: 1.1rem; cursor: pointer;
  }
  .workspace-page .sidebar-overlay.show { position: fixed; z-index: 40; inset: 0; display: block; background: rgba(3,12,29,.61); }
  .workspace-page .sidebar {
    position: fixed; z-index: 51; top: 0; left: 0; bottom: 0;
    width: min(330px, calc(100vw - 50px));
    padding-top: 72px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 14px 0 40px rgba(3,12,29,.27);
  }
  .workspace-page .sidebar.open { transform: translateX(0); }
  .workspace-page .main { height: 100vh; height: 100dvh; }
  .workspace-page .topbar { padding-left: 71px; }
}
@media (max-width: 720px) {
  .workspace-page .topbar { min-height: 81px; padding: 11px 13px 11px 68px; gap: 9px; }
  .workspace-page .topbar h2 { font-size: 1.85rem; }
  .showroom-page .topbar h2 { white-space: normal; overflow-wrap: anywhere; }
  .workspace-page .tool-kicker { font-size: .48rem; }
  .workspace-page .workspace-link,
  .workspace-page .topbar .geo-badge,
  .workspace-page .topbar #layer-count { display: none; }
  .workspace-page .topbar-right { gap: 5px; }
  .workspace-page .topbar .btn,
  .workspace-page .btn-replay { min-height: 35px; padding: 0 9px; font-size: .64rem; }
  .workspace-page .workspace-body,
  .showroom-page .workspace-body,
  .playground-page .workspace-body { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(245px, 48dvh) minmax(0,1fr); }
  .workspace-page .map-container { grid-column: 1; grid-row: 1; }
  .showroom-page .detail-panel,
  .playground-page .canvas-wrapper { grid-column: 1; grid-row: 2; border-left: 0; border-top: 1px solid #cbd0d3; }
  .showroom-page .detail-head { padding-top: 23px; padding-bottom: 20px; }
  .showroom-page .detail-head h3 { font-size: 2.2rem; }
  .playground-page .canvas-heading { padding: 15px 18px 13px; }
  .playground-page .canvas-heading h3 { font-size: 2.1rem; margin: 5px 0; }
  .playground-page .canvas-heading p { font-size: .68rem; }
  .playground-page #drop-canvas { padding: 12px; }
}
@media (max-width: 420px) {
  .workspace-page .stage-corner { display: none; }
  .workspace-page .stage-label { top: 12px; left: 11px; padding: 7px; font-size: .52rem; }
  .workspace-page .topbar h2 { font-size: 1.6rem; }
  .workspace-page .btn-replay { white-space: nowrap; }
  .playground-page .topbar .btn { padding-inline: 6px; }
  .playground-page .field-row { flex-direction: column; gap: 3px; }
  .playground-page .field-row label,
  .playground-page .field-row input,
  .playground-page .field-row select,
  .playground-page .field-row textarea { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-page .sidebar,
  .workspace-page .code-panel { transition: none; }
}
