/* Pico provides components; app fonts and auth/chrome colours follow ./DESIGN.md. */
@font-face { font-family: Lato; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/lato-400.v1.woff2") format("woff2"); }
@font-face { font-family: Lato; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/lato-700.v1.woff2") format("woff2"); }
@font-face { font-family: Lato; font-style: normal; font-weight: 900; font-display: swap; src: url("/fonts/lato-900.v1.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 900; font-display: swap; src: url("/fonts/barlow-semi-condensed-900.v1.woff2") format("woff2"); }
[data-theme="dark"] {
  --pico-font-family-sans-serif: Lato, sans-serif;
  --pico-font-size: 15px;
  --pico-background-color: #090909;
  --pico-color: #fff;
  --pico-muted-color: rgba(255, 255, 255, 0.6);
  --pico-muted-border-color: rgba(255, 255, 255, 0.2);
  --pico-border-radius: 4px;
  --pico-primary: #ffbf00;
  --pico-primary-underline: rgba(255, 191, 0, 0.5);
  --pico-primary-hover-underline: var(--pico-primary-hover);
  --pico-primary-background: #d6ff00;
  --pico-primary-border: var(--pico-primary-background);
  --pico-primary-hover: #ffd65c;
  --pico-primary-hover-background: #deff33;
  --pico-primary-hover-border: var(--pico-primary-hover-background);
  --pico-primary-focus: rgba(255, 191, 0, 0.25);
  --pico-primary-inverse: #090909;
  --pico-secondary: var(--pico-color);
  --pico-secondary-background: #1e1c1d;
  --pico-secondary-border: var(--pico-muted-border-color);
  --pico-secondary-inverse: var(--pico-color);
  --pico-secondary-hover: var(--pico-color);
  --pico-secondary-hover-background: #252a2a;
  --pico-secondary-hover-border: rgba(255, 255, 255, 0.4);
  --pico-secondary-focus: rgba(255, 255, 255, 0.2);
  --pico-h1-color: var(--pico-color);
  --pico-h2-color: var(--pico-color);
  --pico-h3-color: var(--pico-color);
  --pico-h4-color: var(--pico-color);
  --pico-h5-color: var(--pico-color);
  --pico-h6-color: var(--pico-color);
  --pico-form-element-background-color: #1e1c1d;
  --pico-form-element-active-background-color: var(--pico-form-element-background-color);
  --pico-form-element-selected-background-color: #393a39;
  --pico-form-element-border-color: rgba(255, 255, 255, 0.4);
  --pico-form-element-color: var(--pico-color);
  --pico-form-element-placeholder-color: rgba(255, 255, 255, 0.5);
  --pico-form-element-active-border-color: var(--pico-primary);
  --pico-form-element-focus-color: var(--pico-primary-focus);
  --pico-form-element-valid-border-color: #2deb50;
  --pico-form-element-invalid-border-color: #eb2d4e;
  --pico-card-background-color: #1e1c1d;
  --pico-card-sectioning-background-color: rgba(255, 255, 255, 0.05);
  --pico-card-border-color: var(--pico-muted-border-color);
  --pico-modal-overlay-background-color: rgba(9, 9, 9, 0.7);
  --pico-dropdown-background-color: var(--pico-card-background-color);
  --pico-dropdown-border-color: var(--pico-muted-border-color);
  --pico-dropdown-hover-background-color: var(--pico-secondary-hover-background);
  --pico-code-background-color: #121212;
  --pico-code-color: var(--pico-muted-color);
  --pico-ins-color: #2deb50;
  --pico-del-color: #f37c90;
  --pico-text-selection-color: rgba(255, 191, 0, 0.3);
  --admin-primary-gradient: linear-gradient(93.9deg, #d6ff00 -3.24%, #ffbf00 138.63%);
}
:is(button, [role="button"], input[type="submit"]) { border-radius: 24px; font-weight: 700; }
button:not([class]):not([rel="prev"]), button[type="submit"]:not(.secondary, .outline, .danger) {
  background: var(--admin-primary-gradient); color: var(--pico-primary-inverse); font-weight: 900;
}
button:not([class]):not([rel="prev"]):disabled, button[type="submit"]:disabled { opacity: 0.5; }
:is(#login, .admin-section > .head, dialog > article > header) h2 {
  font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  font-size: 32px; line-height: 38px; font-weight: 900;
}
dialog > article { border: 1px solid var(--pico-card-border-color); }
table { font-variant-numeric: tabular-nums; }
thead th { color: var(--pico-muted-color); font-weight: 700; }
body.signed-in { display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
#admin-content { min-width: 0; width: 100%; max-width: 100rem; margin: 0 auto; padding: 2.5rem; }
body:not(.signed-in) #admin-content { max-width: 34rem; padding-top: 5rem; }
.section-help { color: var(--pico-muted-color); }
#admin-sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: 2rem 1.25rem;
  background: #121212; border-right: 1px solid var(--pico-card-border-color); }
.admin-brand { display: block; color: var(--pico-color); text-decoration: none; }
.admin-brand img { display: block; width: 120px; height: 21px; filter: invert(1); margin-bottom: 0.65rem; }
.admin-brand small { display: block; color: var(--pico-muted-color); font-size: 0.8rem; font-weight: 400; }
#admin-navigation { display: block; margin-top: 2rem; }
#admin-navigation ul { display: block; margin: 0; padding: 0; }
#admin-navigation hr { margin: 0.75rem 0; }
#admin-navigation li { display: block; padding: 0; margin-bottom: 0.25rem; }
#admin-navigation a { display: block; margin: 0; padding: 0.65rem 0.8rem; color: var(--pico-muted-color); border-radius: 24px; font-weight: 700; }
#admin-navigation a:is(:hover, :focus-visible) { background: var(--pico-secondary-background); color: var(--pico-secondary-inverse); text-decoration: none; }
#admin-navigation a[aria-current="page"] { color: var(--pico-primary); background: linear-gradient(135deg, rgba(255, 191, 0, 0.3), rgba(255, 191, 0, 0.05)); box-shadow: inset 0 0 0 1px rgba(255, 191, 0, 0.2); }
#signout { width: 100%; margin-top: 2rem; }
#admin-menu-toggle { display: none; }
#login { margin-top: 2rem; }
.admin-section > .head { margin: 0 0 1rem; flex-wrap: wrap; align-items: start; }
.admin-section > .head > button { margin: 0; }
.admin-section > .head > small { align-self: center; }
.admin-section > .head h2 { margin: 0; }
.admin-section { min-width: 0; }
button { justify-self: start; }
:is(button, [role="button"]).danger {
  --pico-primary: var(--pico-del-color);
  --pico-primary-hover: #ffadb9;
  --pico-primary-background: rgba(235, 45, 78, 0.12);
  --pico-primary-border: rgba(235, 45, 78, 0.4);
  --pico-primary-hover-background: rgba(235, 45, 78, 0.2);
  --pico-primary-hover-border: var(--pico-del-color);
  --pico-primary-inverse: var(--pico-del-color);
  --pico-primary-focus: rgba(235, 45, 78, 0.25);
  border-color: var(--pico-border-color);
}

@media (max-width: 48rem) {
  body.signed-in { display: block; }
  #admin-content { padding: 1.25rem; }
  #admin-sidebar { position: static; height: auto; padding: 1rem 1.25rem; border-right: 0; border-bottom: 1px solid var(--pico-card-border-color); }
  #admin-sidebar header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  #admin-menu-toggle { display: block; }
  #admin-sidebar:has([aria-expanded="false"]) #admin-navigation { display: none; }
}
  .feedback-message { white-space: pre-wrap; overflow-wrap: anywhere; }
  .section-help { font-size: 0.9rem; }
  .oauth-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
  :where(main, dialog) ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
  :where(main, dialog) li { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem;
       border: 1px solid var(--pico-muted-border-color); border-radius: 8px; }
  li img { width: 64px; height: 40px; object-fit: cover; border-radius: 4px; background: var(--pico-card-background-color); }
  li .none { width: 64px; height: 40px; border-radius: 4px; background: var(--pico-card-background-color);
             display: grid; place-items: center; font-size: 0.65rem; color: var(--pico-form-element-placeholder-color); }
  li.stack { display: block; }
  .head { display: flex; align-items: center; gap: 0.75rem; }
  .grow { flex: 1; min-width: 0; }
  .slug { color: var(--pico-muted-color); font-size: 0.8rem; }
  .pane { display: grid; gap: 0.6rem; padding: 0.75rem 0 0.25rem; }
  .pane form { margin: 0; }
  .row, .ds-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .field { font-size: 0.8rem; color: var(--pico-muted-color); }
  .media-studio { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid #ffffff25;
    border-radius: 16px; background: linear-gradient(135deg, #ffffff08, #ffffff02); }
  .media-toolbar { align-items: end; padding-bottom: 1rem; border-bottom: 1px solid #ffffff18; }
  .media-toolbar label { flex: 1; min-width: 9rem; }
  .media-editor { padding: 0; margin: 0; border: 0; min-width: 0; }
  .media-section { border-top: 1px solid #ffffff18; padding: 1rem 0 0; margin: 1rem 0; }
  .media-section > .row, .media-section > div > .row { margin: 0.6rem 0; align-items: end; }
  .media-section input[type="number"] { width: 7rem; }
  .media-vector { display: flex; flex-wrap: wrap; gap: 0.35rem; }
  .media-vector > .field { width: 100%; }
  .media-vector label { min-width: 0; }
  .media-vector input[type="number"] { width: 4.8rem; }
  .media-node-bar { margin: 1rem 0; align-items: end; }
  .media-node-bar > input { flex: 1; min-width: 9rem; }
  .media-panorama { width: 100%; aspect-ratio: 2; position: relative; background: #090909;
    border: 1px solid #ffffff30; border-radius: 7px; overflow: hidden; touch-action: none; user-select: none; }
  .media-panorama > img { width: 100%; height: 100%; object-fit: fill; display: block; pointer-events: none; }
  .media-no-image { display: grid; place-items: center; height: 100%; font-size: 0.8rem; color: var(--pico-muted-color); }
  .media-mask-overlay { position: absolute; inset: 0; pointer-events: none; }
  .media-mask { position: absolute; border: 1px solid #75eaf2; background: #75eaf21c; }
  .media-mask.selected { border: 2px solid #d6ff00; background: #d6ff0026; }
  .media-mask span { position: absolute; top: 0; left: 0; max-width: 100%; overflow: hidden;
    font-size: 0.6rem; line-height: 1.4; white-space: nowrap; color: #090909; background: #d6ff00; padding: 0.12rem 0.25rem; }
  .media-mask-readout { font: 0.7rem/1.6 ui-monospace, monospace; overflow-wrap: anywhere; }
  .media-region-fields { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
  .media-region-fields input { width: 7rem; }
  .media-link { padding: 0.65rem; background: #09090966; border: 1px solid #ffffff12; border-radius: 7px; margin-bottom: 0.6rem; }
  .media-link input[type="number"] { width: 6rem; }
  .media-publish { padding-top: 1rem; border-top: 1px solid #ffffff25; }
  .media-publish > p { margin: 0.7rem 0; }
  .media-kit { margin: 1.8rem 0 0; border-top: 1px solid #ffffff25; padding-top: 1rem; }
  .media-kit > summary { color: #ddd; }
  .media-review-head { border-top: 1px solid #ffffff25; margin-top: 2rem; padding-top: 1rem; align-items: end; }
  .media-review-layout { display: grid; grid-template-columns: minmax(10rem, 0.65fr) minmax(0, 1.7fr); gap: 1rem; align-items: start; }
  .media-review-layout ul { max-height: 35rem; overflow: auto; }
  .media-review-layout li { padding: 0; display: block; }
  .media-variation-choice { display: grid; text-align: left; gap: 0.4rem; width: 100%; border: 1px solid transparent; }
  .media-variation-choice[aria-pressed="true"] { border-color: #d6ff00; }
  .media-variation-choice strong { font-size: 0.8rem; }
  .media-review-view { padding: 0.7rem; border: 1px solid #ffffff20; border-radius: 8px; margin: 0.8rem 0; }
  .media-review-images { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .media-review-images img { display: block; width: 100%; aspect-ratio: 2; object-fit: contain; background: #090909; border-radius: 4px; }
  .media-review-images figcaption { color: var(--pico-muted-color); font-size: 0.65rem; margin-top: 0.3rem; }
  .media-reviewed { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.7rem; }
  .media-prompt { padding: 0.65rem; background: #09090966; border-radius: 6px; font-size: 0.8rem; white-space: pre-wrap; }
  .media-review-layout pre { max-height: 12rem; overflow: auto; font-size: 0.65rem; white-space: pre-wrap; }
  .media-image-error { border: 1px solid #ff768e; }
  @media (max-width: 45rem) {
    .media-studio { padding: 0.85rem; }
    .media-review-layout { grid-template-columns: 1fr; }
    .media-review-layout ul { max-height: 15rem; }
    .media-review-images { grid-template-columns: 1fr; }
  }
  .editor { border: 1px solid var(--pico-muted-border-color); border-radius: 8px; padding: 1rem; margin: 1rem 0;
            display: grid; gap: 0.75rem; }
  .editor h3 { font-size: 0.85rem; margin: 0.5rem 0 0; color: var(--pico-muted-color); font-weight: 600; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(21rem, 1fr);
            gap: 1.25rem; align-items: start; }
  /* The map stays put while the controls beside it scroll, so a district's numbers
     are never being edited against a preview that has left the screen. */
  .stage-column { position: sticky; top: 1rem; }
  .controls { display: grid; gap: 0.75rem; align-content: start; }
  /* One column on a narrow window, where two would make both of them useless. */
  @media (max-width: 62rem) { .layout { grid-template-columns: minmax(0, 1fr); }
                              .stage-column { position: static; } }
  .stage { position: relative; margin: 0 auto; border-radius: 6px; overflow: hidden;
           touch-action: none; cursor: crosshair; }
  .stage .art { position: absolute; inset: 0; width: 100%; height: 100%; }
  .mark, .pill { position: absolute; transform: translate(-50%, -50%); cursor: grab; }
  .mark img { width: 100%; height: 100%; display: block; pointer-events: none; }
  .mark.bare { border: 1px dashed var(--pico-primary-background); border-radius: 4px; background: rgba(214, 255, 0, 0.14); }
  /* A marker whose district has a traced outline is no longer what a member taps,
     and it must stop looking like it: lime is the navigation area and nothing
     else, so this box goes quiet and reads as what it is — where the art sits. */
  .mark.bare.quiet { border-color: var(--pico-form-element-placeholder-color); background: rgba(154, 154, 168, 0.09); }
  .pill { white-space: nowrap; background: rgba(17, 19, 16, 0.82); border: 1px solid var(--pico-muted-border-color);
          border-radius: 999px; padding: 0.1rem 0.45rem; font-size: 0.7rem; line-height: 1.4; }
  .armed { outline: 2px solid var(--pico-primary-background); outline-offset: 2px; }
  /* The traced navigation area. The SVG spans the artwork and is scaled to it, so
     a point is stored and drawn as the same fraction; the stroke opts out of that
     scaling so a wide map does not get a fatter outline than a tall one. */
  .area { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .area polygon { fill: rgba(214, 255, 0, 0.14); stroke: var(--pico-primary-background); stroke-width: 2;
                  vector-effect: non-scaling-stroke; }
  .area.bad polygon { fill: rgba(255, 180, 180, 0.14); stroke: var(--pico-del-color); }
  .area.still polygon { fill: rgba(214, 255, 0, 0.07); stroke-dasharray: 5 4; }
  /* Handles are dp, not per cent: a point you drag has to stay the size of a
     fingertip whatever the preview has been resized to. */
  .vertex, .midpoint { position: absolute; transform: translate(-50%, -50%); padding: 0;
                       justify-self: auto; border-radius: 50%; }
  .vertex { width: 15px; height: 15px; background: var(--pico-primary-background); border: 2px solid var(--pico-card-background-color);
            cursor: grab; touch-action: none; }
  .vertex.on { background: var(--pico-secondary-inverse); }
  .vertex:focus-visible, .midpoint:focus-visible { outline: 2px solid var(--pico-secondary-inverse); outline-offset: 2px; }
  .midpoint { width: 17px; height: 17px; background: var(--pico-card-background-color); color: var(--pico-primary-background); border: 1px solid var(--pico-primary-background);
              font-size: 0.7rem; line-height: 1; display: grid; place-items: center; }
  .problem { font-size: 0.75rem; color: var(--pico-del-color); }
  .district { border: 1px solid var(--pico-muted-border-color); border-radius: 6px; padding: 0.5rem 0.6rem;
              display: grid; gap: 0.4rem; }
  .district.off { opacity: 0.5; }
  .district .head { gap: 0.5rem; }
  .district .sum { font-size: 0.75rem; color: var(--pico-form-element-placeholder-color); font-family: ui-monospace, monospace; }
  .chev { background: none; color: var(--pico-muted-color); padding: 0.1rem 0.35rem; font-size: 0.8rem;
          line-height: 1; }
  .chev:is(:hover, :active, :focus-visible) { color: var(--pico-secondary-inverse); }
  .coords { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
  .coords input[type="number"] { width: 5rem; padding: 0.3rem 0.4rem; }
  /* The hero is drawn 412x300 in the app; the thumbnail holds that shape so what
     is previewed here is croppable the same way. The selector covers <video> as
     well as <img>: an animated hero has to be previewed MOVING, or the one thing
     an admin is choosing between is the one thing they cannot see. */
  .hero-thumb { width: 74px; height: 54px; object-fit: cover; border-radius: 4px;
    border: 1px solid var(--pico-muted-border-color); display: block; }
  .hero-kind { font-size: 0.7rem; color: var(--pico-primary-background); text-transform: uppercase;
    letter-spacing: 0.04em; }
  /* The worker's verdict on an upload this editor already called saved. It sits
     in the district's own row rather than the page-level message strip because
     by the time it can be read the admin has reloaded, and a strip at the top
     would not say WHICH district refused. */
  .hero-error { font-size: 0.75rem; color: var(--pico-del-color); flex-basis: 100%; }
  .working { color: var(--pico-primary-background); font-size: 0.8rem; }
  .inline { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--pico-muted-color); }
  .hint { font-size: 0.8rem; color: var(--pico-muted-color); }
  .hex { width: 6.5rem; text-transform: lowercase; font-family: ui-monospace, monospace; }
  .msg { padding: 0.6rem 0.8rem; border-radius: 6px; margin: 0 0 1rem; display: none;
         position: sticky; top: 0.75rem; z-index: 30; background: var(--pico-secondary-hover-background);
         max-height: 7rem; overflow: auto; overflow-wrap: anywhere; }
  .msg:not(:empty) { display: block; }
  .msg.err { display: block; background: rgba(235, 45, 78, 0.12); color: var(--pico-del-color); }
  .msg.ok { display: block; background: rgba(45, 235, 80, 0.12); color: #7cf392; }
  .hide, [hidden] { display: none !important; }
  #recording-player { width: 100%; max-height: 26rem; background: #000; margin: 0.75rem 0; }
  .recording-detail { min-width: 0; overflow-wrap: anywhere; }

  .highlight-list-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; }
  .highlight-list-heading h3, .highlight-list-heading p { margin: 0; }
  .highlight-tree { gap: 0.7rem; margin-top: 1rem; }
  .highlight-tree li { display: block; min-width: 0; padding: 0; }
  .highlight-tree details { margin: 0; }
  .highlight-tree summary { display: flex; align-items: center; gap: 0.7rem; padding: 1rem; color: var(--pico-color); font-size: 0.9rem; list-style: none; }
  .highlight-tree summary::-webkit-details-marker { display: none; }
  .highlight-tree summary:hover { background: var(--pico-secondary-hover-background); }
  .highlight-tree summary:focus-visible { outline-offset: -3px; }
  .highlight-tree summary > svg { flex: 0 0 18px; transition: transform 150ms ease; }
  .highlight-tree details[open] > summary > svg { transform: rotate(90deg); }
  .highlight-identity { display: grid; flex: 1; min-width: 0; gap: 0.2rem; }
  .highlight-identity > strong { font-size: 1rem; overflow-wrap: anywhere; }
  .highlight-meta { display: block; color: var(--pico-muted-color); font-size: 0.75rem; overflow-wrap: anywhere; }
  .highlight-summary-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.35rem; font-size: 0.7rem; }
  .highlight-count { color: var(--pico-muted-color); white-space: nowrap; }
  .highlight-status { display: inline-flex; align-items: center; padding: 0.15rem 0.45rem; border-radius: 5px; background: var(--pico-muted-border-color); color: #c8cbd7; font-size: 0.7rem; }
  .highlight-status.failed { color: #ffc0c0; background: #43272e; }
  .highlight-status.active, .highlight-status:is(.queued,.importing,.analyzing,.planning,.preparing,.rendering) { color: #b8d4ff; background: #24334e; }
  .highlight-status:is(.review,.published) { color: #d6ff00; background: #2d361c; }
  .highlight-groups { margin: 0 1rem 1rem 1.6rem; padding-left: 0.8rem; border-left: 1px solid #45485b; gap: 0.65rem; }
  .highlight-group { background: var(--pico-card-background-color); }
  .highlight-group > details > summary { padding: 0.7rem; }
  .highlight-group-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
  .highlight-recaps { margin: 0 0.7rem 0.7rem; gap: 0.6rem; }
  .highlight-tree .highlight-project { padding: 0.8rem; background: var(--pico-card-background-color); }
  .highlight-recap-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.3rem; }
  .highlight-recap-heading strong { font-size: 0.85rem; overflow-wrap: anywhere; }
  .highlight-error { margin: 0.6rem 0; color: #ffc0c0; font-size: 0.8rem; overflow-wrap: anywhere; }
  .highlight-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
  .highlight-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; }
  .highlight-icon-button svg { pointer-events: none; }
  .highlight-preview { display: block; width: 100%; max-height: 480px; margin-top: 0.7rem; background: #090909; border-radius: 6px; }
  .table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1rem; --pico-form-element-spacing-vertical: 0.3rem; --pico-form-element-spacing-horizontal: 0.6rem; }
  .table-pagination button { margin: 0; width: auto; }
  .highlight-page-range { flex: 1; color: var(--pico-muted-color); font-size: 0.8rem; }
  .highlight-page-number { font-size: 0.8rem; font-variant-numeric: tabular-nums; }
  .highlight-tree .highlight-empty { padding: 1.5rem; color: var(--pico-muted-color); text-align: center; border-style: dashed; }
  @media (prefers-reduced-motion: reduce) { .highlight-tree summary > svg { transition: none; } }
  @media (max-width: 40rem) {
    .highlight-tree summary { flex-wrap: wrap; padding: 0.8rem; gap: 0.5rem; }
    .highlight-tree summary > .highlight-summary-badges { flex-basis: 100%; justify-content: flex-start; padding-left: 1.65rem; }
    .highlight-groups { margin: 0 0.5rem 0.6rem 0.8rem; padding-left: 0.5rem; }
    .highlight-recaps { margin: 0 0.4rem 0.4rem; }
    .highlight-icon-button { width: 40px; height: 40px; }
    .highlight-page-range { flex-basis: 100%; }
  }

  #highlight-editor > article { width: min(1420px, 95vw); max-width: 95vw; height: 90vh; }
  #highlight-editor h3 { margin: 0.5rem 0; }
  .highlight-edit-layout { display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr); gap: 1.5rem; }
  .highlight-edit-layout.timeline-only { grid-template-columns: minmax(0, 1fr); }
  .clip-bin[hidden], #highlight-editor button[hidden] { display: none; }
  fieldset.highlight-edit-layout { border: 0; padding: 0; margin: 0; min-width: 0; }
  .clip-bin { min-width: 0; }
  .clip-bin > input, .clip-bin > select { width: 100%; box-sizing: border-box; margin-bottom: 1rem; }
  #editor-bin-items { max-height: 63vh; overflow: auto; display: grid; gap: 0.65rem; }
  .bin-clip, .timeline-clip { background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: 10px; padding: 0.9rem; overflow-wrap: anywhere; }
  .bin-clip.selected { border-color: var(--pico-primary-background); }
  .editor-bin-parts { list-style: none; display: grid; gap: 0.35rem; padding: 0; margin: 0.7rem 0; }
  .editor-bin-parts > li { display: block; padding: 0; border: 0; background: none; }
  #highlight-editor .editor-bin-part { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; width: 100%; min-height: 40px; padding: 0.5rem; text-align: left; color: #c8cbd7; background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: 6px; }
  #highlight-editor .editor-bin-part:hover { background: #272a38; }
  #highlight-editor .editor-bin-part[aria-current="true"] { color: #d6ff00; background: #252c19; border-color: var(--pico-primary-background); }
  #highlight-editor .editor-bin-part:focus-visible { outline: 2px solid #d6ff00; outline-offset: 2px; }
  .editor-bin-range { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
  .editor-bin-position { font-size: 0.7rem; color: var(--pico-muted-color); }
  .clip-badge { font-size: 0.7rem; color: var(--pico-primary-background); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
  #editor-timeline { display: grid; gap: 0.8rem; }
  .edit-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.7rem; margin: 0.7rem 0; }
  .edit-fields .music-choice { grid-column: 1 / -1; }
  #highlight-editor input:invalid { border-color: var(--pico-del-color); }
  #highlight-editor .hint, #highlight-editor .problem { font-size: 0.8rem; }
  #highlight-editor .problem { color: var(--pico-del-color); }
  .edit-check { display: flex; align-items: center; gap: 0.5rem; margin: 0.6rem 0; white-space: pre-wrap; }
  .edit-check input { flex: 0 0 auto; }
  #editor-video { display: block; width: 100%; max-height: 38vh; background: #090909; border-radius: 10px; scroll-margin-top: 7rem; }
  #editor-video[hidden] { display: none; }
  .editor-footer { position: sticky; bottom: calc(-1 * var(--pico-block-spacing-vertical)); display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; background: var(--pico-card-background-color); border-top: 1px solid var(--pico-muted-border-color); z-index: 2; }
  #editor-message { min-height: 1.5rem; flex-basis: 100%; margin: 0; }
  .edit-empty { padding: 2rem; text-align: center; border: 1px dashed var(--pico-muted-border-color); border-radius: 10px; }
  #highlight-editor .editor-icon-button { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
  #highlight-editor .editor-icon-button svg { pointer-events: none; }
  #highlight-editor .editor-icon-button[aria-busy="true"] svg { animation: editor-busy 1.2s ease-in-out infinite; }
  @keyframes editor-busy { 50% { opacity: 0.35; } }
  .editor-timeline-heading { flex-wrap: wrap; margin-top: 0.7rem; }
  .editor-mode-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--pico-muted-border-color); border-radius: 9px; background: #090a10; }
  #highlight-editor .editor-mode-switch button { background: transparent; color: var(--pico-muted-color); }
  #highlight-editor .editor-mode-switch button[aria-pressed="true"] { background: var(--pico-muted-border-color); color: #d6ff00; }
  .editor-transport { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
  .editor-timecode { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; padding: 0 0.35rem; color: var(--pico-color); white-space: nowrap; }
  #editor-zoom { width: 80px; min-width: 50px; padding: 0; accent-color: var(--pico-primary-background); }
  .editor-timeline-scroll { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--pico-muted-border-color); border-radius: 10px; background: #0c0d13; scrollbar-color: #45485b var(--pico-card-background-color); padding: 0 0 18px; }
  .editor-timeline-surface { min-width: 100%; position: relative; padding-bottom: 14px; }
  .editor-ruler { height: 34px; position: relative; cursor: crosshair; border-bottom: 1px solid #343746; touch-action: none; overflow: hidden; }
  .editor-tick { position: absolute; height: 100%; box-sizing: border-box; padding: 5px 0 0 5px; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--pico-muted-color); border-left: 1px solid var(--pico-muted-border-color); pointer-events: none; }
  .editor-track { display: flex; align-items: stretch; padding: 14px 0 0; min-height: 110px; }
  .editor-sequence-clip { position: relative; flex: 0 0 auto; min-width: 0; height: 110px; box-sizing: border-box; border: 1px solid #5d6073; border-radius: 6px; background: #242634; cursor: grab; color: var(--pico-secondary-inverse); outline-offset: -3px; overflow: hidden; }
  .editor-sequence-clip.selected { border-color: #d6ff00; box-shadow: inset 0 0 0 1px #d6ff00; }
  .editor-sequence-clip.drop-target { box-shadow: inset 5px 0 var(--pico-color); }
  .editor-filmstrip { position: absolute; inset: 25px 0 20px; overflow: hidden; pointer-events: none; }
  .editor-filmstrip-cell { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; background: var(--pico-card-background-color); border-right: 1px solid #ffffff16; box-sizing: border-box; overflow: hidden; }
  .editor-filmstrip-cell img { width: 100%; height: 100%; object-fit: cover; }
  .editor-frame-status { padding: 4px; color: var(--pico-muted-color); font-size: 9px; line-height: 1.2; text-align: center; }
  .editor-filmstrip-cell.failed { background: #30202a; }
  .editor-clip-body { position: relative; display: flex; height: 100%; box-sizing: border-box; flex-direction: column; justify-content: space-between; padding: 5px 12px; overflow: hidden; user-select: none; pointer-events: none; }
  .editor-clip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; font-weight: 600; }
  .editor-clip-duration { color: #bec5ab; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
  .editor-trim-handle { position: absolute; top: 0; bottom: 0; width: 10px; z-index: 1; cursor: ew-resize; touch-action: none; user-select: none; border-radius: 4px; }
  .editor-trim-handle.start { left: 0; }
  .editor-trim-handle.end { right: 0; }
  .editor-trim-handle::after { content: ''; position: absolute; width: 2px; height: 22px; left: 4px; top: calc(50% - 11px); background: #a0a5b7; border-radius: 2px; }
  .editor-sequence-clip.selected .editor-trim-handle::after { background: #d6ff00; }
  .editor-trim-handle:hover, .editor-trim-handle:focus-visible { background: #ffffff26; outline: 1px solid #d6ff00; outline-offset: -2px; }
  .editor-playhead { position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--pico-color); pointer-events: none; z-index: 2; will-change: transform; }
  .editor-playhead::before { content: ''; position: absolute; left: -5px; top: 0; width: 11px; height: 12px; background: var(--pico-color); clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }
  .editor-timeline-help { margin: 0; }
  .editor-clip-actions { display: flex; align-items: center; gap: 5px; min-height: 38px; flex-wrap: wrap; }
  .editor-selected-trim { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: #c9cdba; }
  #editor-timeline-feedback:empty { display: none; }
  @media(prefers-reduced-motion: reduce) { #highlight-editor .editor-icon-button[aria-busy="true"] svg { animation: none; } }
  #highlight-schedule { margin: 1rem 0; }
  @media(max-width: 700px) { .highlight-edit-layout { grid-template-columns: 1fr; } #editor-bin-items { max-height: 28vh; } .timeline-clip > .head { flex-wrap: wrap; } }
  @media(max-width: 700px) { #highlight-editor .editor-icon-button { width: 40px; height: 40px; } .editor-transport { gap: 3px; } .editor-transport > .grow { flex-basis: 100%; } #editor-zoom { flex: 1; max-width: 160px; } .editor-trim-handle { width: 14px; } .editor-trim-handle::after { left: 6px; } .editor-timecode { margin-left: auto; } }
  .stream-live-list { margin: 1rem 0 1.5rem; padding: 1rem; background: #181b24; border: 1px solid #343949; border-radius: 12px; }
  .stream-live-list summary { margin-bottom: 0.75rem; cursor: pointer; }
  #stream-live-list { max-height: 260px; overflow: auto; }
  #stream-debug > article { width: min(1180px, calc(100vw - 32px)); max-width: calc(100vw - 32px); }
  #stream-debug h3 { font-size: 0.95rem; margin: 0 0 10px; }
  #stream-debug p { overflow-wrap: anywhere; }
  .stream-debug-toolbar { flex-wrap: wrap; padding: 18px 0 8px; }
  .stream-inline { display: flex; align-items: center; gap: 8px; color: var(--pico-muted-color); }
  .stream-inline input { accent-color: var(--pico-primary-background); }
  .stream-viewer { margin: 16px 0; padding: 18px; border: 1px solid #3d4b61; border-radius: 12px; background: #181e29; }
  .stream-viewer .head { flex-wrap: wrap; }
  .stream-viewer h3 { margin-bottom: 0 !important; }
  #stream-viewer-video { width: 100%; height: min(56vh, 560px); background: #05070b; object-fit: contain; border-radius: 8px; }
  #stream-viewer-metrics { font: 12px/1.6 ui-monospace, monospace; color: #c6d9ef; }
  #stream-viewer-feedback:empty, #stream-viewer-metrics:empty { display: none; }
  .stream-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; background: var(--pico-muted-border-color); color: var(--pico-muted-color); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
  .stream-chain-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--pico-muted-border-color); }
  .stream-chain-heading { color: var(--pico-muted-color); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
  .stream-chain { display: flex; flex-wrap: wrap; gap: 8px; }
  button.stream-stage { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #343b4c; border-radius: 8px; background: #1a1f2a; color: var(--pico-muted-color); font-size: 11px; font-weight: 500; text-align: left; }
  button.stream-stage[aria-pressed="true"] { border-color: #8192ad; background: #242e3d; }
  button.stream-stage:focus-visible { outline: 2px solid var(--pico-primary-background); outline-offset: 3px; }
  .stream-stage-state { color: var(--pico-muted-color); font-weight: 400; }
  .stream-stage-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #748096; }
  .stream-stage[data-status="live"] .stream-stage-dot, .stream-stage[data-status="recording"] .stream-stage-dot { background: var(--pico-primary-background); box-shadow: 0 0 0 3px var(--pico-primary-background)15; animation: stream-status-pulse 2s ease-in-out infinite; }
  .stream-stage[data-status="recent"] .stream-stage-dot { background: var(--pico-primary-background); }
  .stream-stage[data-status="stale"] .stream-stage-dot, .stream-stage[data-status="waiting"] .stream-stage-dot, .stream-stage[data-status="processing"] .stream-stage-dot, .stream-stage[data-status="paused"] .stream-stage-dot { background: #eabd71; }
  .stream-stage[data-status="completed"] .stream-stage-dot, .stream-stage[data-status="captured"] .stream-stage-dot { background: #7ac8ff; }
  .stream-stage[data-status="failed"] .stream-stage-dot { background: #ff8e99; }
  .stream-stage[data-status="bypassed"] { border-style: dashed; }
  .stream-chain-detail { margin: 10px 0 0; font-size: 11px; line-height: 1.6; color: var(--pico-muted-color); }
  .stream-row-age { display: block; color: #eabd71; margin-top: 4px; font-size: 10px; }
  @keyframes stream-status-pulse { 50% { box-shadow: 0 0 0 4px var(--pico-primary-background)25; } }
  @media (prefers-reduced-motion: reduce) { .stream-stage-dot { animation: none !important; } }
  .stream-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin: 22px 0; align-items: start; }
  .stream-chart { min-width: 0; margin: 0; padding: 16px; background: #181e29; border: 1px solid #303a4d; border-radius: 12px; }
  .stream-chart figcaption { color: #bac6d8; font-size: 12px; line-height: 1.4; }
  .stream-chart-value { display: block; margin: 9px 0 0; font: 500 26px/1.3 ui-monospace, monospace; }
  .stream-chart svg { display: block; width: 100%; height: 70px; margin-top: 8px; }
  .stream-chart:has(.stream-chart-details[open]) svg { height: auto; }
  .stream-chart-grid { stroke: #364256; stroke-width: 1; }
  .stream-chart-tick { display: none; fill: #b3c1d5; font: 13px ui-monospace, monospace; }
  .stream-chart-axis { display: none; fill: #dce5f2; font: 12px system-ui, sans-serif; }
  .stream-chart:has(.stream-chart-details[open]) :is(.stream-chart-tick, .stream-chart-axis) { display: initial; }
  .stream-chart-details { margin-top: 7px; color: #aebed3; font-size: 11px; line-height: 1.5; }
  .stream-chart-details summary { cursor: pointer; }
  .stream-chart-details[open] > summary { margin-bottom: 10px; }
  .stream-chart-legend { display: grid; gap: 9px; margin: 0; padding: 10px 0 0; list-style: none; border-top: 1px solid #303a4d; }
  .stream-chart-legend li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 3px 7px; margin: 0; padding: 0; border: 0; background: none; font-size: 11px; line-height: 1.5; }
  .stream-chart-key { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; }
  .stream-chart-series { grid-column: 2 / 4; overflow-wrap: anywhere; color: #c5d3e7; }
  .stream-chart-legend strong { grid-column: 2; color: #f1f5fc; font-variant-numeric: tabular-nums; }
  .stream-chart-legend time { grid-column: 3; color: var(--pico-muted-color); font-variant-numeric: tabular-nums; }
  .stream-chart-window { margin-top: 10px; color: #aebed3; font-size: 11px; line-height: 1.5; }
  .stream-chart-window summary { cursor: pointer; }
  .stream-chart .hint { margin-bottom: 0; font-size: 11px; }
  .stream-notice { border-left: 3px solid #eabd71; background: #322b20; color: #ecd7b4; padding: 12px 16px; border-radius: 5px; }
  .stream-table-wrap { overflow: auto; margin-bottom: 22px; }
  .stream-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .stream-table th { color: var(--pico-muted-color); font-weight: 500; text-align: left; white-space: nowrap; }
  .stream-table :is(th,td) { padding: 10px; border-bottom: 1px solid var(--pico-muted-border-color); }
  .stream-table td { font-variant-numeric: tabular-nums; min-width: 100px; }
  .stream-control { padding: 18px; margin: 20px 0; border: 1px solid #61752a; background: #21271b; border-radius: 10px; }
  .stream-control .head { flex-wrap: wrap; }
  .stream-events { max-height: 260px; overflow: auto; margin: 0 0 22px; padding: 0; list-style: none; }
  .stream-events li { font-size: 12px; border: 0; border-radius: 0; border-bottom: 1px solid var(--pico-muted-border-color); flex-wrap: wrap; }
  .stream-events time { color: #aab8cd; min-width: 90px; font-variant-numeric: tabular-nums; }
  .stream-evidence { margin: 8px 0; border: 1px solid var(--pico-muted-border-color); border-radius: 8px; padding: 12px; }
  .stream-evidence summary { cursor: pointer; color: #cbd6e8; font-size: 13px; }
  .stream-evidence pre { max-height: 350px; overflow: auto; padding: 12px; background: var(--pico-code-background-color); font-size: 11px; }
  @media(max-width: 600px) { #stream-debug { width: calc(100vw - 24px); max-height: calc(100vh - 24px); padding: 12px; } #stream-debug > header { top: -12px; } #recording-list > li { flex-wrap: wrap; } #recording-list .recording-detail { flex-basis: 100%; } .stream-debug-toolbar > .grow { flex-basis: 100%; } }

  .experience-layout { display: grid; grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .experience-queue { display: grid; gap: 0.65rem; }
  .experience-queue > .hint { margin: 0; }
  #experience-list li { padding: 0; overflow: hidden; }
  .experience-queue-item { display: grid; gap: 0.35rem; width: 100%; text-align: left; border-radius: 7px; background: var(--pico-card-background-color); color: var(--pico-secondary-inverse); font-weight: 400; padding: 0.8rem; }
  .experience-queue-item strong { overflow-wrap: anywhere; }
  .experience-queue-item[aria-pressed="true"] { box-shadow: inset 3px 0 var(--pico-primary-background); background: var(--pico-secondary-hover-background); }
  .experience-queue-item:hover { background: var(--pico-muted-border-color); }
  .experience-detail .head { flex-wrap: wrap; }
  .experience-detail h3 { overflow-wrap: anywhere; }
  .experience-detail h4 { margin: 1.3rem 0 0.65rem; }
  .experience-description { white-space: pre-wrap; overflow-wrap: anywhere; }
  .experience-badge { display: inline-block; padding: 0.15rem 0.5rem; background: var(--pico-muted-border-color); color: #c6c8d3; border-radius: 5px; font-size: 0.75rem; font-weight: 500; }
  .experience-badge.approved { color: #c9ec77; background: #23301c; }
  .experience-badge.submitted, .experience-badge.changes_requested { color: #f1d096; background: #342b1c; }
  .experience-badge.rejected, .experience-badge.disabled { color: var(--pico-del-color); background: rgba(235, 45, 78, 0.12); }
  .experience-metadata { display: grid; gap: 0.6rem; margin: 1rem 0; font-size: 0.8rem; }
  .experience-metadata > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0.65rem; }
  .experience-metadata dt { color: var(--pico-muted-color); }
  .experience-metadata dd { margin: 0; overflow-wrap: anywhere; }
  .experience-checks { margin-top: 0.65rem; }
  .experience-checks li { display: block; padding: 0.5rem; font-size: 0.8rem; overflow-wrap: anywhere; }
  .experience-warning { color: #f1d096; }
  .experience-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .experience-previews iframe { width: 100%; height: 28rem; box-sizing: border-box; border: 1px solid var(--pico-muted-border-color); border-radius: 8px; background: white; }
  .experience-decisions { margin-top: 0.75rem; }
  .experience-history li { display: grid; gap: 0.25rem; font-size: 0.8rem; overflow-wrap: anywhere; }
  .experience-history p { margin: 0; white-space: pre-wrap; }
  .experience-empty { padding: 1rem; color: #b5b6c4; }
  @media (max-width: 58rem) { .experience-layout { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 40rem) { .experience-previews { grid-template-columns: minmax(0, 1fr); } .experience-metadata > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } }
  .maintenance-fields { display: grid; gap: 0.6rem; }
  .maintenance-parameters { border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); padding: 1rem; margin-block: 1rem; }
  .maintenance-parameters legend { padding-inline: 0.4rem; font-weight: 700; }
  .maintenance-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; --pico-form-element-spacing-vertical: 0.3rem; --pico-form-element-spacing-horizontal: 0.8rem; }
  .maintenance-actions :is(label, button) { margin: 0; width: auto; }
  .maintenance-actions label { display: flex; align-items: center; gap: 0.5rem; }
  .maintenance-state { font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--pico-muted-border-color); }
  .maintenance-state.running, .maintenance-state.queued { color: var(--pico-primary-background); }
  .maintenance-state.failed { color: var(--pico-del-color); }
  .maintenance-result pre { max-height: 24rem; overflow: auto; padding: 0.65rem; background: var(--pico-code-background-color); font-size: 0.75rem; }

.godot-map-preview { display: block; width: 100%; height: min(65vh, 650px); min-height: 280px; background: #090909; border: 1px solid #444; border-radius: 8px; margin: 14px 0; }
.ds-plugin-button { display: inline-flex; align-items: center; gap: 8px; }
.ds-plugin-button svg { width: 18px; height: 18px; flex: none; }
.ds-plugin-steps li { margin-bottom: 12px; }
.ds-plugin-steps button { display: block; width: max-content; margin: 8px 0 0; }
.ds-plugin-release { padding: 16px 0; border-top: 1px solid var(--ds-line); }
.ds-plugin-release-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.ds-plugin-release-heading h4 { margin: 0; }
.ds-plugin-release-heading time { font-size: 13px; }
.ds-plugin-release-heading button { margin: 0; padding: 6px 14px; font-size: 14px; }
.ds-plugin-latest { color: var(--pico-primary); font-size: 13px; }
.ds-plugin-release ul { margin: 0; }
.godot-state-preview img { max-width: 100%; width: auto; height: 240px; object-fit: contain; background: repeating-conic-gradient(#252a2a 0% 25%, #1e1c1d 0% 50%) 50% / 24px 24px; }
.godot-state-form { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 8px; align-items: end; }
.godot-state-form h4 { flex-basis: 100%; }
.godot-placement { padding: 10px 0; border-bottom: 1px solid #444; align-items: end; }
.godot-placement input { max-width: 110px; }

/* District Studio — Assisted Canvas. Scoped to avoid changing other admin tools. */
.district-studio, .district-panel { --ds-line: var(--pico-card-border-color); --ds-muted: var(--pico-muted-color); }
.district-studio { background: var(--pico-card-background-color); }
.district-studio { border: 1px solid var(--ds-line); border-radius: 16px; overflow: clip; }
:is(.district-studio, .district-panel) :is(h2, h3, h4, p) { margin: 0; color: inherit; }
:is(.district-studio, .district-panel) h3 { font-size: 18px; line-height: 1.25; }
:is(.district-studio, .district-panel) p + p { margin-top: 10px; }
.district-studio button { border: 1px solid var(--ds-line); padding: 10px 13px; border-radius: 8px; font: inherit; min-height: 42px; }
/* Keep secondary ink independent of Pico's per-button primary colour variable. */
.district-studio button:where([class]:not(.ds-primary, .danger)) { background: transparent; color: var(--pico-secondary-inverse); }
.district-studio button:where([class]:not(.ds-primary, .danger)):not(:disabled):is(:hover, :active, :focus-visible) { background: var(--pico-secondary-hover-background); border-color: var(--pico-secondary-hover-border); color: var(--pico-secondary-inverse); }
:is(.district-studio, .district-panel) .ds-primary { background: var(--admin-primary-gradient); color: #131600; font-weight: 800; border-color: #d6ff00; }
:is(.district-studio, .district-panel) .ds-primary:not(:disabled):is(:hover, :active, :focus-visible) { background: var(--admin-primary-gradient); border-color: #e0ff40; color: #131600; }
:is(.district-studio, .district-panel) .ds-danger { color: #ff8fa2; border-color: transparent; }
:is(.district-studio, .district-panel) :is(.ds-muted, .ds-save, .ds-eyebrow) { color: var(--ds-muted); }
.ds-eyebrow { font-size: 13px; letter-spacing: .075em; margin-bottom: 14px !important; }
.ds-actions > :is(button, [role="button"]) { width: auto; margin: 0; max-width: 100%; white-space: normal; }
.district-studio button.ds-save { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; min-height: 24px; margin: 0; padding: 0; border: 0; border-radius: 50%; outline-offset: 2px; }
.ds-save::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pico-ins-color); }
.ds-save:is([data-state="pending"], [data-state="saving"])::before { background: #ffbf00; }
.ds-save[data-state="unsaved"]::before { background: var(--pico-del-color); }
.ds-version { display: flex; border: 1px solid var(--ds-line); border-radius: 9px; overflow: hidden; flex-shrink: 0; }
.ds-version button { border: 0; border-radius: 0; }
.ds-version button[aria-pressed="true"] { background: #353d22; color: var(--pico-primary); font-weight: 800; }
.ds-workspace { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: stretch; }
.ds-left { min-width: 0; padding: 24px 18px; }
.ds-left { border-right: 1px solid var(--ds-line); }
.ds-panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.ds-building-list { display: grid; gap: 10px; margin-bottom: 20px; }
.ds-building-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; width: 100%; gap: 12px; text-align: left; border-color: transparent !important; padding: 10px 9px !important; }
.ds-building-row[aria-pressed="true"], .ds-building-group-toggle[data-selected="true"] { background: #333c20 !important; border-color: #a0ba5e !important; }
.ds-building-row > span { display: grid; gap: 5px; }
.ds-building-row strong { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.ds-building-row .ds-muted { font-size: 13px; }
.ds-building-group-toggle { grid-template-columns: 46px minmax(0, 1fr) 16px; gap: 8px; margin-bottom: 0; }
.ds-building-group-toggle[aria-expanded="true"] .ds-building-chevron { transform: rotate(90deg); }
.ds-building-instances { display: grid; gap: 8px; margin: 8px 0 0 8px; padding-left: 8px; border-left: 1px solid var(--ds-line); }
.ds-building-instances[hidden] { display: none; }
.ds-thumbnail { width: 46px; height: 56px; object-fit: contain; display: block; }
.ds-wide { width: 100%; }
.ds-section { padding-top: 22px; margin-top: 26px; border-top: 1px solid var(--ds-line); }
.ds-section > :is(button, input, select, .ds-actions) { margin-top: 16px; }
.ds-section > strong { display: block; }
.ds-first { border-top: 0; padding-top: 0; }
.ds-section > h3 { margin-bottom: 12px; }
.ds-scope { margin-top: 24px !important; font-size: 13px; }
.ds-coordinates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.ds-remove { margin-top: 32px; }
.ds-center { min-width: 0; margin: 0; background: #090909; }
.ds-map-status { padding: 11px 18px; display: flex; align-items: center; gap: 12px; font-size: 13px; background: #272b22; flex-wrap: wrap; }
.ds-map-status strong { letter-spacing: .04em; }
.ds-map { position: relative; min-height: 300px; background: #10140a; }
.ds-loading { position: absolute; bottom: 12px; left: 12px; right: 12px; width: fit-content; max-width: calc(100% - 24px); margin: 0; padding: 10px 14px; color: #fff; background: #1e1c1d; border: 1px solid #707070; border-radius: 8px; pointer-events: none; }
.ds-map .godot-map-preview { margin: 0; width: 100%; height: clamp(350px, 52vw, 610px); min-height: 0; border: 0; border-radius: 0; background: transparent; }
.ds-building { cursor: grab; touch-action: none; }
.ds-building:active { cursor: grabbing; }
.ds-checks { border-top: 1px solid var(--ds-line); border-bottom: 1px solid var(--ds-line); padding: 8px 18px; background: #1e1c1d; font-size: 14px; }
.ds-issue { color: #ffadb9 !important; padding: 8px 0; }
.ds-issue .ds-actions { margin-top: 8px; }
.ds-issue .ds-actions button { font-size: 12px; padding: 5px 8px; min-height: 32px; }
.ds-inspector h3 { font-size: 24px; overflow-wrap: anywhere; }
.ds-inspector p { font-size: 14px; }
.ds-inspector .ds-eyebrow { font-size: 12px; }
.ds-inspector select { width: 100%; }
.ds-banner { padding: 14px 20px; background: #343022; border-bottom: 1px solid #8d7845; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.ds-banner button { flex-shrink: 0; }
.ds-empty { padding: 60px 25px; text-align: center; color: var(--ds-muted) !important; }
.ds-review { display: flex; flex-direction: column; gap: 16px; }
.ds-review .ds-eyebrow { margin: 0 !important; }
.ds-change-list { overflow-y: auto; max-height: 35vh; }
.ds-change-list article { padding: 14px 0; border-bottom: 1px solid var(--ds-line); }
.ds-change-list article > p { color: var(--ds-muted); margin-top: 5px; font-size: 13px; }
.ds-change-list button { font-size: 12px; padding: 4px 8px; min-height: 32px; margin-top: 8px; }
.ds-review-decision { position: sticky; bottom: 0; background: #1e1c1d; padding-top: 16px; border-top: 1px solid var(--ds-line); display: grid; gap: 12px; }
.ds-ack { display: flex !important; align-items: flex-start; gap: 10px !important; font-size: 13px !important; }
.ds-ack input { accent-color: #d6ff00; margin-top: 4px; flex-shrink: 0; }
.district-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.district-panel > article { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; }
.district-panel > article > header.modal-header { position: static; flex: none; margin: 0; padding: 12px 16px; }
.district-panel #godot-view-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.district-panel :is(#godot-view-content, #godot-library-content) > * + * { margin-top: 16px; }
.district-panel :is(.ds-library, .ds-proposal-list) { display: grid; gap: 12px; }
.ds-library-card { display: grid; grid-template-columns: 70px 1fr; gap: 7px 16px; border: 1px solid var(--ds-line); border-radius: 9px; padding: 16px; }
.ds-library-card .ds-thumbnail { grid-row: span 3; width: 70px; height: 90px; }
.ds-library-card .ds-actions { grid-column: 2; }
.ds-upload { margin-top: 28px; border-top: 1px solid var(--ds-line); padding-top: 24px; gap: 14px; }
.district-panel :is(ul, ol) { padding-left: 22px; display: block; list-style: disc; }
.district-panel ol { list-style: decimal; }
.district-panel li { display: list-item; border: 0; padding: 4px 0; }
.district-panel .godot-state-preview { margin-top: 20px; }
.district-panel .godot-state-preview :is(img, canvas) { width: 100%; max-height: 380px; height: auto; object-fit: contain; background: repeating-conic-gradient(#252a2a 0% 25%, #1e1c1d 0% 50%) 50% / 24px 24px; }
.district-panel .godot-state-form { display: grid; grid-template-columns: 1fr 1fr; }
.district-panel .godot-state-form :is(h4, p) { grid-column: 1 / -1; }
.district-panel .godot-state-form input { width: 100%; }
@media (min-width: 1700px) { .ds-workspace { grid-template-columns: 290px minmax(0, 1fr); } .ds-left { padding: 28px 22px; } }
@media (max-width: 1100px) {
  .ds-workspace { grid-template-columns: 200px minmax(0, 1fr); }
  .ds-review { display: block; }
  .ds-review > :is(.ds-eyebrow, h3, p) { grid-column: 1 / -1; }
  .ds-review-decision { position: static; }
}
@media (max-width: 700px) {
  .ds-workspace { display: flex; flex-direction: column; }
  .ds-center { order: 0; }
  .ds-left { order: 1; border-right: 0; border-top: 1px solid var(--ds-line); }
  .ds-inspector h3 { margin-bottom: 24px; }
  .ds-version button { flex: 1; }
  .ds-map .godot-map-preview { height: 340px; }
  .ds-review > * { margin-bottom: 20px; }
  .ds-change-list { max-height: none; }
    .district-panel .godot-state-form { grid-template-columns: 1fr; }
  .ds-library-card { grid-template-columns: 50px 1fr; gap: 10px; }
  .ds-library-card .ds-thumbnail { width: 50px; }
}



#users-table :is(th, td) { white-space: nowrap; vertical-align: middle; }

/* Compact table controls keep Pico's native appearance and spacing variables. */
.admin-section > .head, .admin-section > nav, .admin-section table {
  --pico-form-element-spacing-vertical: 0.3rem;
  --pico-form-element-spacing-horizontal: 0.6rem;
}
.admin-search { max-width: 25rem; }
/* Search/filter controls remain separate, with matching heights and label gaps. */
.admin-search, .admin-filters, .clip-bin { --pico-form-element-spacing-vertical: 0.5rem; }
.admin-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.admin-filters > label { display: flex; flex-direction: column; gap: 0.5rem; flex: 0 1 10rem; min-width: 0; margin: 0; }
.admin-filters > label:has(input[type=search]) { flex: 1 1 18rem; }
.admin-filters > button { flex: 0 0 auto; width: auto; }
.admin-filters > input[type=search] { flex: 1 1 18rem; max-width: 25rem; }
.admin-filters > label:has(input[type=checkbox]) { flex: 0 0 auto; flex-direction: row; align-items: center; min-height: 40px; }
.admin-filters :is(input, select, button) { margin: 0; }
.admin-search input, .admin-filters :is(input:not([type=checkbox]), select, button), .clip-bin > :is(input, select) { min-height: 40px; }
@media (max-width: 40rem) {
  .admin-filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .admin-filters > input[type=search] { max-width: none; }
}
.admin-section table td { vertical-align: middle; }
.admin-section table button { margin-block: 0; }
.admin-section table .row { flex-wrap: nowrap; }
#user-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; }
#user-detail dd { margin: 0; overflow-wrap: anywhere; }

/* Onboarding's passionChip / passionLayout: 40px pills, 8px gaps, 24px categories. */
#passions-board { margin: 24px 0; }
.passion-category { margin-bottom: 24px; }
.passion-category > .head, .passion-category > h3 { margin: 0 0 10px; }
.passion-category > h3 { font: 700 15px/21px Lato, sans-serif; }
.passion-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 48px; }
.passion-chip { --pico-color: #fff; display: inline-flex; position: relative; align-items: center; gap: 8px; height: 40px; margin: 0;
  padding: 0 12px; border: 1px solid transparent; border-radius: 20px; color: var(--pico-secondary-inverse); font: 400 14px/21px Lato, sans-serif;
  background: linear-gradient(90deg, #333, #151515) padding-box, linear-gradient(90deg, #535353, #2e2e2e) border-box; }
.passion-chip.is-selected { background: linear-gradient(90deg, #463706, #171308) padding-box, var(--admin-primary-gradient) border-box; }
.passion-chip.is-inactive { opacity: 0.5; }
.passion-chip.is-inactive:focus-within { opacity: 1; }
.passion-name[type=text] { field-sizing: content; width: auto; min-width: 3ch; max-width: 24ch; height: 26px; padding: 0; margin: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; font: inherit; color: inherit; }
.passion-name[type=text]:focus { outline: 1px solid var(--pico-primary); outline-offset: 3px; }
.passion-category > .head > .passion-name { font-weight: 700; }
.passion-chip > input[type=checkbox] { width: 15px; height: 15px; margin: 0; flex: none; }
.passion-grip { border: 0; background: transparent; color: var(--pico-muted-color); padding: 0; margin: 0; min-width: 20px; cursor: grab; }
.passion-actions { position: relative; margin: 0; }
.passion-actions > summary { padding: 0; margin: 0; min-width: 22px; text-align: center; color: var(--pico-muted-color); list-style: none; }
.passion-actions > summary::after, .passion-actions > summary::-webkit-details-marker { display: none; }
.passion-actions > div { position: absolute; right: 0; top: 100%; z-index: 20; display: grid; gap: 6px; min-width: 210px; padding: 10px;
  background: var(--pico-card-background-color); border: 1px solid var(--pico-card-border-color); border-radius: 4px; box-shadow: 0 10px 20px #0008; }
.passion-actions button { margin: 0; padding: 5px 10px; font-size: 13px; width: 100%; }
.passion-chip:has(.passion-actions[open]) { z-index: 5; }
.passion-add { margin: 10px 0 0; }
.passion-add > summary, #passions-create-category > summary { color: var(--pico-primary); font-size: 14px; }
.passion-create { margin: 12px 0 0; }
.passion-create input { flex: 1; min-width: 10rem; max-width: 24rem; margin: 0; }
.passion-create button { margin: 0; }
.passion-drop-target { outline: 2px dashed var(--pico-primary); outline-offset: 4px; }
.is-dragging .passion-chip { transition: none; }
#passions-board.is-preview { max-width: 370px; }

button.passion-more { margin: 12px 0 0; padding: 0; border: 0; background: none; color: var(--pico-primary); font: 700 14px/21px Lato, sans-serif; }
.is-preview .passion-chip:disabled { opacity: 0.35; }
.is-preview .passion-category > h3 { font-size: 14px; }
.is-preview .passion-chips { min-height: 40px; }
.is-preview .passion-chip { padding-inline: 16px; font-weight: 700; color: var(--pico-muted-color); }
.is-preview .passion-chip.is-selected { color: var(--pico-primary); }

/* Keep language copy readable beside the visibility and publication controls. */
.translation-header { flex-wrap: wrap; align-items: start; }
.translation-header > .grow { flex-basis: 20rem; overflow-wrap: anywhere; }
.translation-header > select { width: auto; min-width: 9rem; }
.translation-header > :is(select, button) { margin: 0; }

.owner-search { position: relative; }
.owner-search input { margin-bottom: 0; min-height: 40px; --pico-form-element-spacing-vertical: 0.5rem; }
.owner-search [role=listbox] { position: absolute; z-index: 40; top: 100%; left: 0; right: 0; margin-top: 0.35rem; padding: 0.35rem;
  max-height: 16rem; overflow: auto; background: var(--pico-card-background-color); border: 1px solid var(--pico-card-border-color); border-radius: 4px; }
.owner-search [role=option] { display: grid; gap: 0.15rem; padding: 0.65rem; border: 0; cursor: pointer; overflow-wrap: anywhere; }
.owner-search [role=option]:hover, .owner-search [aria-selected=true] { background: var(--pico-secondary-hover-background); }
.owner-search [role=option] small, .owner-picker > small { color: var(--pico-muted-color); }
.owner-selection { margin: 0.5rem 0; justify-content: space-between; }
.owner-selection button { margin: 0; padding: 0.25rem 0.65rem; font-size: 0.85rem; }
.owner-selection small { flex: 1; min-width: 0; overflow-wrap: anywhere; }

#users-filters-open { display: grid; place-items: center; width: 38px; height: 38px; flex: none; padding: 0; border-radius: 50%; }

/* One loading placeholder per section or list; Pico's tbody spinner otherwise
   occupies its own first column beside an old empty-state row. */
.admin-section[aria-busy="true"]::before,
.admin-section tbody[aria-busy="true"]::before,
#experience-list[aria-busy="true"]::before { display: none; }
.admin-section[aria-busy="true"] > :not(.head, .section-help, .section-message),
.admin-section[aria-busy="true"] > .head small,
.admin-section tbody[aria-busy="true"] > tr,
#experience-list[aria-busy="true"] > * { display: none; }
.admin-section[aria-busy="true"] > .head button { visibility: hidden; }
.admin-section[aria-busy="true"]::after,
.overflow-auto:has(> table > tbody[aria-busy="true"])::after,
#experience-list[aria-busy="true"]::after {
  content: "Loading…";
  display: grid;
  place-items: center;
  min-height: 8rem;
  color: var(--pico-muted-color);
}
.overflow-auto:has(> table > tbody[aria-busy="true"]) { position: relative; min-height: 11rem; }
.overflow-auto:has(> table > tbody[aria-busy="true"])::after { position: absolute; inset: 3rem 0 0; }
.admin-section:has(tbody[aria-busy="true"]) > .table-pagination { visibility: hidden; }

.admin-section:has(tbody[aria-busy="true"]) > .head small { visibility: hidden; }
#experience-detail[aria-busy="true"]::before,
#stream-debug-content[aria-busy="true"]::before { display: none; }
.admin-loading, #experience-detail[aria-busy="true"] > .experience-empty {
  display: grid; place-items: center; min-height: 8rem; margin: 0;
  color: var(--pico-muted-color); text-align: center;
}

/* Pico article provides the shared modal surface, padding and scrolling. */
:is(dialog, .district-panel) > article > .modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: calc(-1 * var(--pico-block-spacing-vertical)); z-index: 3; }
:is(dialog, .district-panel) > article > .modal-header h2 { margin: 0; min-width: 0; font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif; font-size: 32px; line-height: 38px; font-weight: 900; color: var(--pico-color); }
dialog button { --pico-form-element-spacing-vertical: 0.3rem; --pico-form-element-spacing-horizontal: 0.7rem; width: auto; margin-block: 0; }
:is(dialog, .district-panel) > article > .modal-header > button { flex: none; margin: 0; }

.ds-map-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 4px; margin-left: auto; }
.ds-map-tools button { flex: 0 0 32px; display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%; margin: 0; }
.ds-map-tools button svg { pointer-events: none; }
.ds-map-tools button[aria-pressed="true"] { color: var(--pico-primary); border-color: currentColor; }

.ds-inspector { border-top: 1px solid var(--ds-line); margin-top: 24px; padding-top: 24px; }


.ds-map-state { display: flex; align-items: center; flex-wrap: wrap; flex: 1 1 18rem; gap: 4px 12px; min-width: 0; }
.ds-plugin-update { display: inline-flex; align-items: center; flex: none; max-width: 100%; border: 1px solid #ffbf0050; border-radius: 999px; background: #ffbf000a; }
.ds-plugin-update[hidden] { display: none; }
.ds-plugin-update button { min-height: 32px; margin: 0; padding: 4px 8px; border: 0; border-radius: 999px; background: transparent; color: var(--pico-primary); font-size: 12px; line-height: 18px; white-space: nowrap; }
.ds-plugin-update .ds-plugin-update-close { width: 32px; padding: 4px; font-size: 18px; }

.ds-version button { margin: 0; min-height: 32px; padding: 5px 10px; font-size: 13px; }
.ds-studio-tools { display: flex; align-items: center; gap: 4px; border-left: 1px solid var(--pico-muted-border-color); padding-left: 8px; margin-left: 4px; }
.ds-map-tools button[data-count] { position: relative; }
.ds-map-tools button[data-count]::after { content: attr(data-count); position: absolute; top: -4px; right: -4px; min-width: 13px; padding: 0 3px; border-radius: 8px; background: var(--pico-primary); color: var(--pico-primary-inverse); font: 700 9px/13px Lato, sans-serif; }

.ds-map-tool { display: inline-flex; flex: none; border-radius: 50%; }
.ds-map-tool:focus-visible { outline: 2px solid var(--pico-primary); outline-offset: 3px; }
.ds-tool-tip { position: fixed; z-index: 10000; width: 240px; max-width: calc(100vw - 16px); padding: 12px 14px; border: 1px solid var(--pico-muted-border-color); border-radius: 10px; background: var(--pico-card-background-color); color: var(--pico-color); box-shadow: 0 6px 24px #0008; font: 400 13px/1.5 Lato, sans-serif; }
.ds-tool-tip strong { display: block; margin-bottom: 4px; font-size: 14px; }
.ds-tool-tip p { margin: 0; color: var(--pico-muted-color); }

.ds-attention { display: grid; gap: 16px; }
.ds-attention-item { display: grid; gap: 10px; padding: 12px; border: 1px solid #ffbf0040; border-radius: 8px; background: #ffbf000a; font-size: 13px; line-height: 1.5; }
.ds-attention-item button { justify-self: start; min-height: 32px; margin: 0; padding: 5px 10px; font-size: 13px; white-space: normal; }


.ds-workspace > .ds-map-status { grid-column: 1 / -1; order: -1; border-bottom: 1px solid var(--ds-line); }

.ds-tile-control { display: inline-flex; align-items: center; border-radius: 999px; }
.ds-tile-control.has-selection { height: 32px; border: 1px solid var(--pico-primary); background: #ffbf000a; }
.ds-tile-control.has-selection .ds-map-tool button { width: 30px; height: 30px; min-height: 30px; border: 0; }
.ds-map-tools .ds-tile-copy { flex: none; width: auto; height: 30px; min-height: 30px; padding: 0 10px 0 4px; border: 0; background: transparent; color: var(--pico-primary); font-size: 11px; font-weight: 900; }

/* Keep the editor within the viewport; only its sidebar scrolls vertically. */
@media (min-width: 769px) {
  body.signed-in:has(#section-exploration.active) #admin-content { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.signed-in:has(#section-exploration.active) #panel,
  #section-exploration.active { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; }
  #section-exploration > :not(#godot-studio) { flex-shrink: 0; }
  #godot-studio { flex: 1; min-height: 0; }
  .ds-workspace { height: 100%; grid-template-rows: auto minmax(0, 1fr); }
  .ds-left { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .ds-center { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .ds-map { flex: 1; min-height: 0; }
  .ds-map .godot-map-preview { height: 100%; }
  .ds-checks { flex-shrink: 0; max-height: 30%; overflow-y: auto; }
}
@media (max-width: 768px) {
  .ds-left { max-height: 55dvh; overflow-y: auto; overscroll-behavior: contain; }
}

/* Studio uses the complete content pane; layout controls stay on its toolbar. */
body.signed-in:has(#section-exploration.active) #admin-content { max-width: none; margin: 0; padding: 0; }
#godot-studio { border: 0; border-radius: 0; }
.ds-layout-tools { margin-left: 0; flex-wrap: nowrap; }
body.signed-in:has(#section-exploration.active #godot-toggle-main[aria-expanded="false"]) { grid-template-columns: minmax(0, 1fr); }
body:has(#section-exploration.active #godot-toggle-main[aria-expanded="false"]) #admin-sidebar { display: none; }
.ds-workspace:has(#godot-toggle-studio[aria-expanded="false"]) { grid-template-columns: minmax(0, 1fr); }

.ds-map-content { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.ds-view-host { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; background: var(--pico-card-background-color); }
.district-panel button { min-height: 32px; padding: 5px 10px; margin-block: 0; font-size: 13px; border-radius: 24px; }
.district-panel #godot-view-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.ds-map-tools button[aria-pressed="true"], #godot-tool-building[aria-pressed="true"] { color: var(--pico-primary); border-color: currentColor; background: #ffbf0012; }

.ds-review-workspace { overflow: hidden; }
.ds-review-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border-bottom: 1px solid var(--ds-line); }
.ds-review-heading h2 { margin: 0; font-size: 28px; }
.ds-review-heading button { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%; }
.ds-review-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); align-items: stretch; min-height: 0; flex: 1; overflow: hidden; }
.ds-review-preview { min-width: 0; min-height: 0; height: 100%; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.ds-review-preview .ds-map { min-height: 0; }
.ds-review-layout > .ds-review { display: flex; padding: 20px; min-width: 0; min-height: 0; height: 100%; overflow: hidden; gap: 12px; }
.ds-review-changes { flex: 1; min-height: 60px; overflow-y: auto; overscroll-behavior: contain; }
.ds-review-layout .ds-review-decision { position: static; margin-top: auto; flex-shrink: 0; }
.ds-review-layout .ds-change-list { max-height: none; overflow: visible; }
@media (max-width: 1050px) {
  .ds-review-workspace { overflow-y: auto; }
  .ds-review-layout { grid-template-columns: minmax(0, 1fr); overflow: visible; flex: none; }
  .ds-review-layout > .ds-review { height: auto; overflow: visible; }
  .ds-review-changes { overflow: visible; }
  .ds-review-preview { position: static; height: 45dvh; min-height: 300px; }
}

.ds-review-map { display: flex; flex: 1; min-height: 0; }
.ds-review-map > .godot-map-preview { width: 100%; height: 100%; }
.ds-review-preview > p { font-size: 13px; }
.ds-review-heading, .ds-review-layout { background: var(--pico-card-background-color); }
.ds-review-layout button { min-height: 32px; padding: 5px 10px; margin: 0; font-size: 13px; border-radius: 24px; }
.ds-review-layout .ds-change-list article { margin: 0 0 12px; padding: 14px; border: 1px solid var(--ds-line); border-radius: 8px; background: transparent; }
.ds-review-layout .ds-change-list small { display: block; margin-bottom: 4px !important; font-size: 11px; }
.ds-review-layout .ds-change-list button { margin-top: 10px; }
.ds-review-preview [role="group"] { flex: none; }

.district-studio .ds-danger:not(:disabled):is(:hover, :active, :focus-visible) { color: #ff8fa2; background: #eb2d4e18; border-color: #eb2d4e66; }

/* Ground settings use compact Pico fields and stay visible without accordions. */
#godot-library-content.ds-ground-settings { display: grid; gap: 14px; font-size: 14px; --pico-form-element-spacing-vertical: 0.35rem; --pico-form-element-spacing-horizontal: 0.6rem; }
#godot-library-content.ds-ground-settings > * + * { margin-top: 0; }
.ds-ground-settings .ds-section, .ds-ground-settings .ds-upload { margin: 0; padding-top: 12px; }
.ds-ground-settings .ds-section > :is(h3, p) { margin-bottom: 10px; }
.ds-ground-settings .ds-section > :is(button, input, select, .ds-actions) { margin-top: 8px; }
.ds-ground-settings .ds-coordinates { margin: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.ds-ground-settings label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; }
.ds-ground-settings :is(input, select, form) { margin: 0; font-size: inherit; }
.ds-ground-settings form { display: grid; gap: 10px; }
.ds-ground-settings .ds-issue:empty { display: none; }

.district-panel .ds-upload-compact { display: grid; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--ds-line); border-radius: 8px; --pico-form-element-spacing-vertical: 0.3rem; --pico-form-element-spacing-horizontal: 0.6rem; }
.ds-upload-compact h3 { font-size: 16px; }
.ds-upload-compact :is(p, label) { font-size: 13px; }
.ds-upload-compact .ds-actions > label { flex: 1; min-width: min(100%, 14rem); margin: 0; }
.ds-upload-compact :is(input, section) { margin: 0; }
.ds-upload-compact p:empty { display: none; }

/* Announce updates without adding a row; the status dot exposes their details. */
.ds-center > #godot-map-message { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.district-panel section > h3 + :is(p, input, .ds-actions) { margin-top: 10px; }
.ds-upload-compact section > h3 { font-size: 13px; margin-bottom: 6px; }

/* Keep map navigation separate from building drags and tile selection. */
.ds-map .godot-map-preview { cursor: grab; touch-action: none; }
.ds-map .godot-map-preview:active { cursor: grabbing; }
.ds-placement { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; align-items: center; }
.district-studio .ds-placement-remove { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; margin: 0; border-radius: 50%; }
.ds-district-filters { margin: 16px 0; }
.ds-district-filters button[aria-pressed="true"] { color: var(--pico-primary); border-color: currentColor; background: #ffbf0012; }
.ds-library-card .ds-thumbnail { grid-row: span 4; }

/* Map-visible region authoring keeps the artwork beside its controls. */
.ds-region-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; min-height: 560px; }
.ds-region-workspace > :first-child { min-width: 0; }
.ds-region-inspector { max-height: 76vh; overflow: auto; padding: 16px; border: 1px solid var(--pico-muted-border-color); border-radius: 12px; background: var(--pico-card-background-color); }
.ds-region-inspector h3 { font-size: 1rem; margin: 0; }
.ds-region-inspector h4 { font-size: .9rem; margin: 0 0 10px; }
.ds-region-inspector p, .ds-region-inspector label { font-size: .8rem; }
.ds-region-inspector input, .ds-region-inspector select, .ds-region-inspector button { font-size: .8rem; padding: 8px; margin-bottom: 8px; }
.ds-region-inspector input[type=checkbox] { margin: 0 8px; }
.ds-region-inspector section { border-top: 1px solid var(--pico-muted-border-color); padding-top: 14px; margin-top: 14px; }
.ds-panel-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.ds-region-inspector .ds-actions { flex-wrap:wrap; }
.ds-region-points { display:grid; gap:6px; }
.ds-region-points > div { display:flex; gap:6px; align-items:center; }
.ds-region-points input { width:85px; }
.ds-region-layers { display:flex; gap:6px; flex-wrap:wrap; }
@media (max-width: 1000px) {
  .ds-region-workspace { grid-template-columns: minmax(0,1fr); }
  .ds-region-inspector { max-height: none; }
  .ds-region-workspace .godot-map-preview { min-height: 360px; }
}

.ds-region-inspector { min-height:0; max-height:100%; overscroll-behavior:contain; }
.ds-region-workspace { min-height:0; height:100%; flex:1; }
.ds-region-inspector > .ds-panel-heading { position:sticky; top:-16px; z-index:3; padding:12px 0; background:var(--pico-card-background-color); }
.ds-region-inspector .ds-drawing-bar { position:sticky; top:42px; z-index:2; padding:10px; border:1px solid var(--pico-primary); border-radius:8px; background:var(--pico-card-background-color); }
.ds-region-inspector .ds-drawing-bar.ds-shape-controls { position:static; }
.ds-round-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.ds-round-controls p, .ds-round-controls[data-shape="circle"] > label:first-child { grid-column:1 / -1; }
.ds-region-inspector button[aria-pressed="true"] { color:var(--pico-primary); border-color:currentColor; background:#ffbf0012; }
.ds-region-inspector details { margin:12px 0; border-bottom:1px solid var(--pico-muted-border-color); padding:8px 0; }
.ds-region-inspector summary { font-size:.8rem; font-weight:700; }
.ds-region-inspector .ds-region-point { display:grid; grid-template-columns:18px 1fr 1fr; gap:6px; align-items:center; }
.ds-region-inspector .ds-region-point label { min-width:0; }
.ds-region-inspector .ds-region-point button { grid-column:2 / -1; }
@media(max-width:1000px){ .ds-region-workspace {height:auto;overflow:auto;} .ds-region-inspector {max-height:65vh;} }

.godot-map-preview[data-clean-preview="true"] .ds-placement-outline { display:none; }

/* Residential zones reuse the Studio inspector and canvas. */
#ds-residential-inspector .residential-artwork { display:grid; grid-template-columns:22px 42px minmax(0,1fr) auto; gap:8px; align-items:center; margin:10px 0; }
#ds-residential-inspector .residential-artwork .ds-thumbnail { width:42px; height:42px; object-fit:contain; }
#ds-residential-inspector .residential-artwork input { margin:0; }
#ds-residential-inspector .residential-artwork small { color:var(--pico-muted-color); font-size:.65rem; }
#ds-residential-inspector .ds-actions { margin-top:12px; }
.residential-dialog { width:min(600px,calc(100vw - 32px)); max-height:85vh; overflow:auto; padding:24px; }
.residential-dialog .row { margin-top:20px; }
#residential-zones-list td > small { display:block; margin-top:4px; font-size:.7rem; }
