/* Prooflet studio: content on the left, artwork in the centre, commands at its edge. */
@media (min-width: 901px) {
  body.editor-studio { --editor-topbar-h: 56px; overflow: hidden; }
  .editor-studio .editor-top-nav {
    display: flex; height: 56px; min-height: 56px; padding: 0 16px; gap: 16px;
    box-shadow: none; border-bottom: 1px solid var(--editor-dark-line); z-index: 80;
  }
  .editor-studio .editor-brand { flex: none; gap: 7px; font-size: 22px; }
  .editor-studio .editor-brand img { width: 24px; height: 24px; }
  .editor-studio .editor-nav-links, .editor-studio .editor-nav-spec,
  .editor-studio .editor-side-tabs, .editor-studio .editor-workspace-hint { display: none; }
  .editor-studio .editor-canvas-toolbar { flex: 1; min-width: 0; gap: 8px; }
  .editor-studio .editor-project-id { border: 0; background: transparent; min-height: 36px; padding: 0; flex: 1; max-width: 380px; }
  .editor-studio .editor-project-id > .label { display: none; }
  .editor-studio .editor-project-id .editor-custom-select-trigger { background: transparent; border: 0; min-height: 36px; }
  .editor-studio .editor-top-nav > .nav-actions { flex: none; gap: 8px; }
  /* Reserve both locales so a delayed caption update cannot move a pointer target. */
  .editor-studio .editor-top-nav .save-state-indicator { box-sizing: border-box; flex: 0 0 84px; width: 84px; text-align: center; font-size: 12px; white-space: nowrap; }
  .editor-studio .studio-document-actions #save-project { box-sizing: border-box; width: 100px; min-width: 100px; justify-content: center; }
  .editor-studio .studio-document-actions .studio-export > summary { box-sizing: border-box; width: 88px; min-width: 88px; text-align: center; }
  .editor-studio .editor-top-nav .button { min-height: 36px; padding: 7px 16px; border-radius: 6px; font-size: 13px; }
  .editor-studio .editor-top-nav .toolbar-history { background: transparent; border: 0; }
  .editor-studio .toolbar-history button { min-width: 34px; width: 34px; min-height: 34px; padding: 8px; }
  .editor-studio .toolbar-history button span { display: none; }
  .editor-studio .editor-shortcuts { margin-left: 0; }
  .studio-document-tools, .studio-document-actions { display: flex; align-items: center; gap: 6px; flex: none; }
  .studio-document-actions { margin-left: 0; }
  .studio-button, .studio-menu summary {
    min-height: 34px; border: 0; border-radius: 6px; padding: 7px 10px;
    color: var(--editor-dark-text); background: transparent; font: 500 13px/1.4 "IBM Plex Sans", sans-serif;
    cursor: pointer; text-decoration: none; white-space: nowrap;
  }
  .studio-button:hover, .studio-menu summary:hover { background: var(--editor-dark-hover); }
  .studio-button:disabled { opacity: .45; cursor: default; }
  .studio-button:focus-visible, .studio-menu summary:focus-visible, .studio-export summary:focus-visible,
  .studio-pane-collapse:focus-visible { outline: 2px solid #f0744f; outline-offset: -2px; }
  .editor-studio .studio-menu, .editor-studio .studio-export { position: relative; margin: 0; padding: 0; border: 0; background: transparent; border-radius: 0; }
  .editor-studio .studio-export > summary { background: #c9441f; color: #fff; border-color: #c9441f; }
  .editor-studio .studio-export > summary:hover { background: #b23c1b; }
  .studio-menu summary, .studio-export summary { list-style: none; }
  .studio-menu summary::-webkit-details-marker, .studio-export summary::-webkit-details-marker { display: none; }
  .studio-menu-body, .studio-export-body {
    position: absolute; top: calc(100% + 12px); left: 0; width: 280px; padding: 12px;
    background: var(--editor-dark-panel); color: var(--editor-dark-text); border-radius: 8px;
    box-shadow: 0 12px 36px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 10px;
    max-height: calc(100dvh - 80px); overflow-y: auto; z-index: 90;
  }
  .studio-menu:not([open]) > .studio-menu-body, .studio-export:not([open]) > .studio-export-body { display: none; }
  .studio-export-body { left: auto; right: 0; width: 340px; padding: 20px; gap: 12px; }
  .studio-export-body h2 { margin: 0; font-size: 18px; }
  .studio-muted { margin: 0; color: var(--editor-dark-muted); font-size: 13px; line-height: 1.5; }
  .studio-export .editor-rail-actions { display: flex; flex-direction: column; padding: 0; border: 0; gap: 10px; }
  .studio-menu-body .toolbar-control-group { justify-content: flex-start; min-height: 36px; }
  .studio-menu-body { gap: 4px; }
  .studio-menu-body > a, .studio-menu-section > .studio-button { text-align: left; width: 100%; }
  .studio-menu-section { display: flex; flex-direction: column; gap: 2px; }
  .studio-menu-section + .studio-menu-section { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--editor-dark-line); }
  .studio-menu-zoom { display: flex; gap: 4px; }
  .studio-menu-zoom > .studio-button { flex: 1; }
  .studio-menu-section [aria-pressed="true"] { background: var(--editor-dark-raised); }

  .editor-studio .editor-workbench.has-task-rail {
    --editor-side-panel-w: 512px;
    position: relative; grid-template-columns: 76px var(--editor-side-panel-w) minmax(0, 1fr);
    grid-template-rows: minmax(0,1fr); height: calc(100dvh - 56px); min-height: 0;
  }
  .editor-studio .editor-task-rail { grid-column: 1; grid-row: 1; position: relative; top: 0; height: 100%; padding: 10px 6px; gap: 4px; overflow: visible; }
  .editor-studio .editor-task-rail .toolbar-add { gap: 4px; }
  .editor-studio .editor-task-rail button { min-height: 64px; }
  .editor-studio .editor-task-rail .studio-tool-active { background: var(--editor-dark-hover); color: #ffb39c; }
  .editor-studio .editor-side-panel {
    grid-column: 2; grid-row: 1; position: relative; top: 0; height: 100%; border: 0;
    border-right: 1px solid var(--editor-dark-line); overflow: hidden; min-width: 0;
  }
  .studio-pane-head { display: flex; align-items: center; flex: none; min-height: 56px; padding: 12px 20px; }
  .studio-pane-head h2 { font-size: 17px; line-height: 1.3; font-weight: 600; margin: 0; }
  .studio-pane-collapse {
    position: absolute; left: 588px; top: calc(50% - 20px); width: 24px; height: 48px;
    display: grid; place-items: center; border: 1px solid var(--editor-dark-line); border-left: 0;
    border-radius: 0 6px 6px 0; background: var(--editor-dark-panel); z-index: 30; cursor: pointer;
  }
  .studio-pane-collapse img { width: 16px; height: 16px; }
  .editor-studio .editor-canvas-stage { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; padding: 0; overflow: hidden; }
  .editor-studio .editor-artboard { flex: 1 1 auto; min-height: 0; height: auto; width: 100%; padding: 42px 30px 24px; }
  .editor-studio .editor-canvas-status { top: 8px; left: 28px; right: 18px; padding: 0; }
  .editor-studio .editor-canvas-status strong { font-size: 12px; font-weight: 500; }
  .editor-studio .editor-canvas-status .inline-status { font-size: 11px; }
  .studio-format {
    display: flex; align-items: center; gap: 8px; flex: none; min-height: 52px; padding: 8px 24px;
    background: var(--editor-dark-panel); border-bottom: 1px solid var(--editor-dark-line); overflow-x: auto;
  }
  .studio-selection-name { flex: 1; min-width: 100px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--editor-dark-muted); }
  .studio-bottom { display: flex; align-items: center; flex: none; height: 48px; padding: 6px 16px; gap: 12px; background: var(--editor-dark-panel); border-top: 1px solid var(--editor-dark-line); }
  .studio-bottom .toolbar-icon-button { min-height: 32px; height: 32px; padding: 5px 10px; font-size: 12px; }
  .studio-bottom .toolbar-control-group { min-height: 32px; border: 0; background: transparent; }
  .studio-bottom .toolbar-value { min-width: 44px; font-size: 12px; }
  .studio-zoom { display: flex; align-items: center; gap: 4px; }
  .studio-zoom { margin-left: auto; }
  .studio-zoom-slider { width: 96px; accent-color: #f0744f; cursor: pointer; }
  .editor-studio .editor-step-body { padding: 16px 20px; }
  .editor-studio .editor-step-head { padding: 12px 20px; }
  .editor-studio .editor-step-title { font-size: 16px; }
  .editor-studio .editor-checklist { padding: 0 12px 16px; }
  .editor-studio #editor-status-line { flex: none; order: 20; padding: 12px 16px; border-top: 1px solid var(--editor-dark-line); border-bottom: 0; }
  .editor-studio .editor-status-detail { font-size: 12px; }
  .editor-studio .editor-layers-flyout { position: absolute; inset: var(--studio-pane-head-height, 56px) 0 var(--studio-status-height, 0px); min-height: 0; width: auto; max-height: none; border: 0; box-shadow: none; border-radius: 0; overflow: auto; }
  .editor-studio .editor-layers-flyout-head { display: none; }
  .studio-feedback { flex: none; padding: 0 20px; background: var(--editor-dark-panel); }
  .studio-feedback:has(> :not([hidden])) { padding-block: 10px; }
  .editor-studio .editor-workbench.has-task-rail.studio-pane-collapsed { --editor-side-panel-w: 0px; }
  .studio-pane-collapsed .editor-side-panel { visibility: hidden; }
  .studio-pane-collapsed .studio-pane-collapse { left: 76px; }
  .studio-pane-collapsed .studio-pane-collapse img { transform: rotate(180deg); }
  .editor-studio .editor-workbench.side-panel-collapsed { --editor-side-panel-w: 0px; }
  .editor-studio .editor-task-rail::-webkit-scrollbar { width: 3px; }
  .editor-studio ::selection { background: Highlight; color: HighlightText; }
  .editor-studio input, .editor-studio textarea { caret-color: #f0744f; }
  .editor-studio input[type=number], .editor-studio .toolbar-value { font-variant-numeric: tabular-nums; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .editor-studio .editor-workbench.has-task-rail { --editor-side-panel-w: 448px; grid-template-columns: 68px var(--editor-side-panel-w) minmax(0,1fr); }
  .editor-studio .editor-task-rail { padding-inline: 2px; }
  .studio-pane-collapse { left: 516px; }
  .studio-pane-collapsed .studio-pane-collapse { left: 68px; }
  .editor-studio .editor-top-nav { gap: 8px; padding-inline: 12px; }
  .editor-studio .editor-brand span { display: none; }
  .studio-zoom-slider { display: none; }
  .studio-bottom { gap: 6px; padding-inline: 8px; }
  .studio-bottom .toolbar-icon-button { padding-inline: 8px; }
  .studio-format { padding-inline: 14px; }
}
@media (max-width: 900px) {
  .studio-document-tools, .studio-document-actions, .studio-pane-head,
  .studio-pane-collapse, .studio-format, .studio-bottom, .studio-feedback { display: none; }
}
@media (min-width: 901px) {
  .editor-studio #tool-text { display: none; }
  .editor-studio .studio-content-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 24px; }
  .editor-studio .studio-content-panel[hidden], .studio-format [hidden] { display: none; }
  .studio-add-text { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; background: #c9441f; color: #fff; border-color: #c9441f; min-height: 42px; }
  .studio-section-title { margin: 28px 0 14px; font-size: 14px; font-weight: 600; }
  .studio-content-panel .editor-logo-import, .studio-content-panel .field-stack { margin: 0; padding: 0; }
  .studio-content-panel .editor-action-row { display: block; }
  .studio-content-panel .editor-action-cell { margin-top: 8px; }
  .studio-content-panel #artwork-file-action { width: 100%; min-height: 42px; }
  .studio-content-panel .artwork-recent { margin-top: 24px; }
  .studio-block-choice { width: 100%; min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
  .studio-block-choice .prooflet-ui-icon { width: 30px; height: 30px; }
  .studio-format-fields, .studio-quick-actions { display: flex; align-items: center; gap: 6px; flex: none; }
  .studio-format-fields .field { display: flex; margin: 0; padding: 0; min-width: 0; align-items: center; }
  .studio-format-fields .field-label, .studio-format-fields .colour-readout,
  .studio-format-fields .colour-quick-row, .studio-format-fields .colour-contrast-note { display: none; }
  .studio-format-fields select, .studio-format-fields input[type=number] { height: 34px; min-height: 34px; border-radius: 5px; padding: 5px 8px; font-size: 13px; }
  .studio-format-fields #user-object-font-family { width: 150px; }
  .studio-format-fields #user-object-font-weight { width: 88px; }
  .studio-format-fields #user-object-align { width: 82px; }
  .studio-format-fields #user-object-size-pt { width: 62px; }
  .studio-format-fields .text-colour-trigger { width: 32px; height: 32px; }
  .studio-format .studio-quick-actions .studio-button { padding: 7px; }
  .studio-format-has-text .studio-selection-name { display: none; }
  .studio-format #studio-position { margin-left: auto; }
  .editor-studio .studio-menu summary { padding: 7px 10px; }
  .editor-studio .studio-menu { align-self: center; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .studio-format-fields #user-object-font-family { width: 116px; }
  .studio-format-fields #user-object-align { width: 66px; }
  .studio-format-fields #user-object-font-weight { width: 76px; }
  .studio-format { gap: 5px; }
  .studio-format-fields { gap: 4px; }
  .studio-format-has-text .studio-quick-actions { display: none; }
  .editor-studio .studio-content-panel { padding-inline: 16px; }
}
@media (max-width: 900px) { .studio-content-panel { display: none; } }
@media (min-width: 901px) {
  .editor-studio svg.prooflet-ui-icon { filter: none; color: inherit; width: 20px; height: 20px; }
  .editor-studio .studio-add-text { background: #c9441f; border-color: #c9441f; color: #fff; }
  .editor-studio .studio-add-text:hover { background: #b23c1b; }
  .editor-studio .studio-add-text:disabled { opacity: .45; cursor: default; }
  .editor-studio .studio-format-fields select, .editor-studio .studio-format-fields input[type=number] {
    background: var(--editor-dark-raised); color: var(--editor-dark-text); border: 1px solid var(--editor-dark-line-strong); font-family: "IBM Plex Sans", sans-serif;
  }
  .editor-studio .studio-format-fields select:focus-visible, .editor-studio .studio-format-fields input:focus-visible { outline: 2px solid #f0744f; outline-offset: 1px; }
  .editor-studio .studio-content-panel .field-label { font-family: "IBM Plex Sans", sans-serif; font-size: 13px; letter-spacing: 0; text-transform: none; }
  .editor-studio .editor-task-rail .toolbar-add > button[aria-expanded=true] { background: var(--editor-dark-hover); color: #ffb39c; }
  .studio-content-panel .editor-logo-import > .editor-action-row > .field-label { display: none; }
}
@media (min-width: 901px) {
  body.editor-studio .editor-task-rail #tool-layers[aria-expanded="true"] {
    background: var(--editor-dark-hover); color: #ffb39c;
  }
}
/* Relocation must retain the flyout's hidden state outside its original tools anchor. */
.editor-studio .editor-layers-flyout[hidden] { display: none; }

/* Profile stays anchored; the tool list owns its scrollbar and overflow cue. */
.studio-rail-scroll { display: contents; }
.studio-account-footer { display: none; }
@media (min-width: 901px) {
  .editor-studio .studio-rail-scroll {
    display: flex; flex-direction: column; gap: 4px;
    flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden;
    scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--editor-dark-muted) var(--editor-dark-panel);
  }
  .editor-studio .studio-rail-scroll > * { flex-shrink: 0; }
  .editor-studio .studio-rail-scroll .editor-task-button,
  .editor-studio .studio-rail-scroll .toolbar-add > button,
  .editor-studio .studio-rail-scroll .studio-rail-previews .toolbar-icon-button { width: 100%; }
  .editor-studio .studio-rail-scroll::-webkit-scrollbar { width: 5px; }
  .editor-studio .studio-rail-scroll::-webkit-scrollbar-track { background: var(--editor-dark-panel); }
  .editor-studio .studio-rail-scroll::-webkit-scrollbar-thumb { background: var(--editor-dark-muted); border-radius: 4px; }
  .editor-studio .studio-account-footer {
    display: flex; position: relative; flex: none; justify-content: center; padding-top: 8px;
    background: var(--editor-dark-panel);
  }
  .editor-studio .has-more-tools .studio-account-footer::before {
    content: ""; position: absolute; inset: -24px 0 auto; height: 24px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--editor-dark-panel));
  }
  .editor-studio .studio-account-footer .nav-account { flex-direction: column; }
  .editor-studio .studio-account-footer .nav-account-button { min-height: 44px; height: 44px; justify-content: center; }
  .editor-studio .studio-account-footer .nav-workspace { max-width: 58px; overflow-wrap: anywhere; font-size: 10px; }
  .editor-studio .studio-account-footer .nav-account-item { min-height: 38px; }
}
