@scope (#profile-studio) {
  :scope {
    color-scheme: light;
    --ink: #182124;
    --muted: #717575;
    --line: #deded7;
    --cream: #faf9f5;
    --blue: #254ef4;
    --panel: 296px;
  }
  * {
    box-sizing: border-box;
  }
  :scope {
    margin: 0;
    background: #f6f5ef;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 13px;
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
    color: inherit;
  }
  button {
    cursor: pointer;
  }
  button:disabled {
    opacity: 0.35;
    cursor: default;
  }
  button,
  a,
  input,
  select,
  textarea {
    outline-offset: 4px;
  }
  button:focus-visible,
  a:focus-visible {
    outline: 2px solid var(--blue);
  }
  button {
    border: 0;
    background: none;
  }
  a {
    color: inherit;
  }
  svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }
  button svg {
    pointer-events: none;
  }
  input,
  select,
  textarea {
    min-width: 0;
    border: 1px solid #deded8;
    background: #fff;
    border-radius: 5px;
    padding: 9px 10px;
    width: 100%;
    font-size: 12px;
  }
  input[type="checkbox"] {
    width: auto;
    accent-color: #254ef4;
  }
  input[type="color"] {
    padding: 3px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 5px;
    cursor: pointer;
  }
  input[type="range"] {
    padding: 0;
    accent-color: #254ef4;
  }
  textarea {
    resize: vertical;
    min-height: 75px;
  }
  select {
    height: 35px;
  }
  input[type="number"] {
    padding-right: 2px;
  }
  label {
    font-size: 11px;
    color: #565d5f;
    display: block;
  }
  label > input,
  label > select,
  label > textarea {
    margin-top: 5px;
  }
  .hide {
    display: none !important;
  }
  .topbar {
    height: 65px;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    gap: 20px;
    position: relative;
    z-index: 30;
  }
  .brand {
    font-weight: 600;
    font-size: 19px;
    letter-spacing: -0.8px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .brand svg {
    width: 27px;
    height: 25px;
    stroke-width: 2.3;
  }
  .brand span {
    font-weight: 400;
  }
  .public-meta {
    font-size: 11px;
    color: var(--muted);
    margin-left: auto;
  }
  .btn {
    height: 36px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #d9dbd4;
    border-radius: 6px;
    background: var(--cream);
    font-size: 12px;
    white-space: nowrap;
  }
  .btn:hover {
    background: #eeeee7;
  }
  .btn.primary {
    color: white;
    background: #1d2629;
    border-color: #1d2629;
  }
  .btn.primary:hover {
    background: #354046;
  }
  .iconbtn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
  }
  .iconbtn:hover {
    background: #eaece8;
  }
  .editor-only {
    display: none;
  }
  :scope.editing .editor-only {
    display: flex;
  }
  :scope.editing .visitor-only {
    display: none;
  }
  .editor-title {
    display: none;
    gap: 12px;
    align-items: center;
    font-size: 12px;
  }
  :scope.editing .editor-title {
    display: flex;
  }
  .editor-title strong {
    font-weight: 600;
  }
  .status-dot {
    height: 5px;
    width: 5px;
    display: inline-block;
    background: #789380;
    border-radius: 100%;
    margin-right: 5px;
  }
  .subtle {
    color: var(--muted);
    font-size: 11px;
  }
  .header-tools {
    gap: 9px;
    align-items: center;
  }
  .device-switch {
    padding: 3px;
    background: #eeeee9;
    border: 1px solid #e1e2dc;
    border-radius: 7px;
    display: flex;
    gap: 2px;
  }
  .device-switch button {
    height: 29px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    color: #757b7a;
    font-size: 11px;
    border-radius: 4px;
  }
  .device-switch button.active {
    background: white;
    box-shadow: 0 1px 3px #16201e12;
    color: #172223;
  }
  .divider {
    height: 21px;
    width: 1px;
    background: #dedfd8;
  }
  .workbench {
    display: flex;
    min-height: calc(100vh - 65px);
  }
  .stage-scroll {
    width: 100%;
    padding: 30px 28px 0;
    overflow: auto;
    position: relative;
  }
  .profile-wrap {
    margin: 0 auto;
    position: relative;
    max-width: 1180px;
    box-shadow: 0 0 0 1px #1634420b;
  }
  .artboard {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    overflow: hidden;
    isolation: isolate;
    transition: background-color 0.15s;
  }
  .node {
    position: absolute;
    white-space: pre-wrap;
    transform-origin: center;
    box-sizing: border-box;
    outline: 0;
    display: flex;
    align-items: flex-start;
    line-height: 1.1;
    color: #06182b;
    overflow: hidden;
  }
  .node.image {
    display: block;
  }
  .node img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    user-select: none;
  }
  .node.text {
    padding: 0;
  }
  .node.link {
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    gap: 12px;
    padding: 4px 0;
    white-space: normal;
  }
  .node.link .link-arrow {
    font-family: Arial;
    font-size: 28px;
    margin-left: 8px;
    flex-shrink: 0;
  }
  .node.link:hover .link-arrow {
    transform: translate(4px, -3px);
    transition: transform 0.18s;
  }
  .node.link:hover {
    text-decoration: none;
    opacity: 0.78;
  }
  .node.shape {
    display: block;
  }
  .node.tabs {
    overflow: visible;
    align-items: center;
    gap: 2px;
    border: 1px solid #839aad55;
    padding: 3px;
    border-radius: 50px !important;
    background: transparent !important;
    font-family:
      -apple-system, BlinkMacSystemFont, Arial, sans-serif !important;
  }
  .node.tabs button {
    height: 100%;
    border-radius: 50px;
    padding: 0 21px;
    font-size: 12px;
    white-space: nowrap;
  }
  .node.tabs button.active {
    background: var(--profile-ink, #081d31);
    color: var(--profile-bg, #e7f2fb);
  }
  .node.tabs small {
    margin-left: 5px;
    font-size: 9px;
    opacity: 0.65;
  }
  .visitor-footer {
    max-width: 1180px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    padding: 24px 0 28px;
    font-size: 10px;
    letter-spacing: 0.03em;
    color: #6f787a;
  }
  :scope.editing .stage-scroll {
    padding: 38px 36px 45px;
    background: #e9ebe7;
    height: calc(100vh - 65px);
  }
  :scope.editing .profile-wrap {
    box-shadow: 0 8px 45px #34403818;
  }
  :scope.editing .node {
    cursor: grab;
    touch-action: none;
    user-select: none;
  }
  :scope.editing .node:hover {
    outline: 1px solid #254ef485;
    outline-offset: 0;
  }
  :scope.editing .node.selected {
    outline: 1.5px solid #254ef4;
  }
  :scope.editing .node.locked {
    cursor: not-allowed;
  }
  .node.hidden-node {
    opacity: 0.2 !important;
  }
  :scope.editing .node.hidden-node {
    outline: 1px dashed #828b8b;
  }
  .resize-handle {
    position: absolute;
    width: 9px;
    height: 9px;
    background: white;
    border: 1.5px solid #254ef4;
    bottom: -5px;
    right: -5px;
    z-index: 20;
    cursor: nwse-resize;
  }
  .rotate-handle {
    position: absolute;
    top: -32px;
    left: calc(50% - 7px);
    width: 14px;
    height: 14px;
    border: 1.5px solid #254ef4;
    border-radius: 50%;
    background: white;
    cursor: grab;
  }
  .rotate-handle:after {
    position: absolute;
    content: "";
    height: 16px;
    width: 1px;
    background: #254ef4;
    left: 5px;
    top: 12px;
  }
  :scope.editing .node.selected {
    overflow: visible;
  }
  .node.selected img {
    border-radius: inherit;
  }
  .selection-label {
    position: absolute;
    top: -22px;
    left: -1px;
    background: #254ef4;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 9px;
    line-height: 17px;
    padding: 0 5px;
    white-space: nowrap;
    pointer-events: none;
  }
  .rail {
    width: 66px;
    min-width: 66px;
    border-right: 1px solid var(--line);
    background: var(--cream);
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 7px;
  }
  .rail button {
    width: 50px;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #505958;
    font-size: 9px;
    border-radius: 6px;
  }
  .rail button:hover {
    background: #eceee8;
    color: #254ef4;
  }
  .rail button svg {
    width: 20px;
    height: 20px;
  }
  .rail .rail-spacer {
    flex: 1;
  }
  .inspector {
    width: var(--panel);
    min-width: var(--panel);
    background: var(--cream);
    border-left: 1px solid var(--line);
    height: calc(100vh - 65px);
    flex-direction: column;
  }
  .inspector-top {
    padding: 21px 20px 12px;
  }
  .inspector-top h2 {
    font-size: 19px;
    font-family: Georgia, serif;
    font-weight: 400;
    margin: 0 0 14px;
  }
  .inspector-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
  }
  .inspector-tabs button {
    flex: 1;
    color: #808585;
    padding: 11px 2px;
    font-size: 11px;
    border-bottom: 2px solid transparent;
  }
  .inspector-tabs button.active {
    color: #20292b;
    border-bottom-color: #263336;
  }
  .inspector-content {
    padding: 0 20px 25px;
    overflow: auto;
    flex: 1;
  }
  .section {
    padding: 19px 0;
    border-bottom: 1px solid var(--line);
  }
  .section:last-child {
    border-bottom: 0;
  }
  .section h3 {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .section p {
    font-size: 11px;
    line-height: 1.6;
    color: #777e7b;
    margin: 8px 0 0;
  }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .form-grid.three {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }
  .form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .row {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .row.spread {
    justify-content: space-between;
  }
  .fill-row {
    display: flex;
    gap: 7px;
    align-items: center;
  }
  .fill-row input[type="text"] {
    flex: 1;
  }
  .fill-row label {
    width: 40px;
    font-size: 10px;
  }
  .small-label {
    font-size: 10px;
    color: #8b908c;
    margin-bottom: 8px;
  }
  .inspector-note {
    padding: 11px 20px;
    border-top: 1px solid var(--line);
    font-size: 9px;
    color: #7e8681;
    line-height: 1.7;
    flex-shrink: 0;
  }
  .mini-buttons {
    display: flex;
    gap: 5px;
  }
  .mini-buttons .btn {
    height: 29px;
    font-size: 10px;
    flex: 1;
    padding: 0 6px;
  }
  .layer {
    display: flex;
    gap: 9px;
    align-items: center;
    height: 41px;
    border-radius: 5px;
    padding: 0 7px;
    margin: 2px -7px;
    font-size: 11px;
    cursor: pointer;
  }
  .layer.active {
    background: #e8edff;
    color: #254ef4;
  }
  .layer:hover {
    background: #eceee7;
  }
  .layer > span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .layer > svg {
    width: 14px;
    height: 14px;
  }
  .layer .iconbtn {
    width: 23px;
    height: 27px;
  }
  .layer .iconbtn svg {
    width: 13px;
    height: 13px;
  }
  .preset-card {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 16px;
    padding: 0;
  }
  .preset-art {
    height: 132px;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid #10233010;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
  }
  .preset-art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
  }
  .preset-art span {
    font-size: 49px;
    letter-spacing: -3px;
    font-family: Georgia, serif;
  }
  .preset-card strong {
    display: block;
    font-size: 11px;
    margin-top: 8px;
    font-weight: 600;
  }
  .preset-card small {
    font-size: 10px;
    color: #808882;
  }
  .preset-card:hover .preset-art {
    outline: 2px solid #254ef4;
    outline-offset: 3px;
  }
  .zoom-bar {
    position: fixed;
    bottom: 19px;
    left: calc((100% - var(--panel) + 66px) / 2);
    transform: translateX(-50%);
    gap: 11px;
    align-items: center;
    font-size: 10px;
    background: #fafaf6ed;
    border: 1px solid #daddd5;
    border-radius: 7px;
    padding: 7px 12px;
    z-index: 25;
    box-shadow: 0 3px 13px #1423190b;
  }
  .zoom-bar span {
    color: #7c847e;
  }
  .toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 17px;
    background: #19252d;
    color: white;
    border-radius: 7px;
    z-index: 150;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.2s,
      transform 0.2s;
    max-width: calc(100% - 30px);
    text-align: center;
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .dialog-shade {
    position: fixed;
    inset: 0;
    background: #081b3455;
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
  }
  .dialog {
    background: var(--cream);
    border: 1px solid #fff8;
    border-radius: 10px;
    box-shadow: 0 18px 80px #061a3955;
    width: 440px;
    max-height: 90vh;
    overflow: auto;
    padding: 26px;
  }
  .dialog h2 {
    font-family: Georgia, serif;
    font-weight: 400;
    font-size: 27px;
    letter-spacing: -0.5px;
    margin: 0 0 12px;
  }
  .dialog p {
    line-height: 1.7;
    font-size: 12px;
    color: #6c7474;
  }
  .dialog .actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 22px;
  }
  .dialog label {
    margin-top: 15px;
  }
  .video-grid {
    position: absolute;
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, 1fr);
    left: 40px;
    right: 40px;
    top: 548px;
  }
  .video-card {
    text-align: left;
    padding: 0;
    color: inherit;
  }
  .video-poster {
    height: 310px;
    overflow: hidden;
    position: relative;
    background: #071c30;
    border-radius: 3px;
  }
  .video-poster img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s;
  }
  .video-card:hover img {
    transform: scale(1.04);
  }
  .video-play {
    position: absolute;
    left: 18px;
    bottom: 18px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    background: #fffde0e6;
    color: #061b35;
    border-radius: 50%;
  }
  .video-time {
    position: absolute;
    right: 12px;
    bottom: 15px;
    color: white;
    background: #071c308a;
    border-radius: 3px;
    font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 10px;
    padding: 3px 5px;
  }
  .video-card h3 {
    font:
      24px Georgia,
      serif;
    margin: 15px 0 6px;
    letter-spacing: -0.7px;
  }
  .video-card p {
    font-size: 11px;
    color: #506777;
    margin: 0;
  }
  .mobile-art .video-grid {
    grid-template-columns: 1fr;
    left: 24px;
    right: 24px;
    top: 428px;
    gap: 24px;
  }
  .mobile-art .video-poster {
    height: 325px;
  }
  .demo-notice {
    font-size: 10px;
    letter-spacing: 0.02em;
    line-height: 1.6;
    color: #798482;
    text-align: center;
    margin: 24px auto 0;
  }
  :scope.editing .demo-notice {
    display: none;
  }
  .upload-zone {
    border: 1px dashed #cdd1c8;
    border-radius: 5px;
    padding: 14px 8px;
    text-align: center;
    font-size: 11px;
    color: #777f78;
    cursor: pointer;
    display: block;
  }
  .upload-zone:hover {
    border-color: #254ef4;
    color: #254ef4;
  }
  .upload-zone img {
    width: 100%;
    height: 88px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 9px;
  }
  .gradient-stop {
    display: flex;
    gap: 6px;
    margin: 7px 0;
    align-items: center;
  }
  .gradient-stop input[type="text"] {
    width: 80px;
  }
  .gradient-stop input[type="number"] {
    width: 49px;
    padding-left: 6px;
  }
  .gradient-stop .iconbtn {
    width: 25px;
  }
  .gradient-preview {
    height: 34px;
    border-radius: 4px;
    margin: 8px 0;
  }
  .color-swatches {
    display: flex;
    gap: 9px;
  }
  .color-swatches button {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #0002;
    box-shadow:
      0 0 0 3px #faf9f5,
      0 0 0 4px transparent;
  }
  .color-swatches button:hover {
    box-shadow:
      0 0 0 3px #faf9f5,
      0 0 0 4px #a3a8a1;
  }
  .presets-input {
    margin-bottom: 12px;
  }
  .empty-select {
    padding-top: 22px;
  }
  .empty-select h3 {
    font-size: 13px;
    margin: 0 0 6px;
  }
  .empty-select p {
    color: #747e79;
    font-size: 11px;
    line-height: 1.7;
  }
  .check-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
  }
  .mobile-editor-toggle {
    display: none;
  }
  .crop-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .responsive-label {
    position: absolute;
    top: -22px;
    font-size: 9px;
    letter-spacing: 0.04em;
    color: #77847a;
    left: 0;
  }
  .video-modal {
    width: min(700px, 95vw);
  }
  .demo-motion {
    height: 310px;
    background: #061428;
    position: relative;
    overflow: hidden;
    border-radius: 5px;
  }
  .demo-motion img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: drift 12s ease-in-out infinite alternate;
    animation-play-state: paused;
  }
  .demo-motion.playing img {
    animation-play-state: running;
  }
  .demo-motion.playing:after {
    animation: grain 1s steps(2) infinite;
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      0deg,
      transparent 0 3px,
      #fff1 3px 4px
    );
    pointer-events: none;
  }
  .motion-caption {
    position: absolute;
    left: 22px;
    bottom: 20px;
    font-size: 38px;
    font-family: Georgia, serif;
    color: white;
    letter-spacing: -1.5px;
  }
  .motion-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
  }
  .motion-controls input {
    flex: 1;
  }
  .motion-controls span {
    font-size: 10px;
    white-space: nowrap;
    color: #79827d;
  }
  @keyframes drift {
    from {
      transform: scale(1.03) translate(-0.6%, 0);
    }
    to {
      transform: scale(1.16) translate(1%, -2%);
    }
  }
  @keyframes grain {
    50% {
      opacity: 0.4;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    * {
      animation: none !important;
      transition: none !important;
    }
  }
  @media (max-width: 850px) {
    .topbar {
      padding: 0 18px;
    }
    .public-meta {
      display: none;
    }
    .stage-scroll {
      padding: 18px 14px 0;
    }
    .visitor-footer {
      padding: 20px 2px;
    }
    .editor-title .subtle {
      display: none;
    }
    :scope.editing .topbar {
      padding: 0 12px;
      gap: 8px;
    }
    :scope.editing .brand {
      display: none;
    }
    :scope.editing .editor-title {
      display: none;
    }
    .header-tools {
      gap: 5px;
      width: 100%;
      justify-content: space-between;
    }
    .header-tools .btn {
      padding: 0 9px;
    }
    .header-tools .divider {
      display: none;
    }
    :scope.editing .rail {
      width: 48px;
      min-width: 48px;
    }
    .rail button {
      width: 42px;
    }
    :scope.editing .stage-scroll {
      padding: 32px 15px 60px;
    }
    .inspector {
      position: fixed;
      right: 0;
      top: 65px;
      z-index: 40;
      box-shadow: -6px 0 25px #24322415;
      width: 280px;
      min-width: 280px;
      display: none !important;
    }
    .inspector.open {
      display: flex !important;
    }
    .mobile-editor-toggle {
      display: inline-flex;
    }
    .zoom-bar {
      left: calc(50% + 24px);
      font-size: 9px;
    }
    .zoom-bar .hint {
      display: none;
    }
    .device-switch button {
      padding: 0 7px;
    }
    .header-tools .export-button {
      display: none;
    }
  }
  @media (max-width: 460px) {
    .topbar {
      height: 59px;
      padding: 0 16px;
    }
    .brand {
      font-size: 17px;
    }
    .brand svg {
      width: 23px;
    }
    .topbar > .btn {
      height: 32px;
      font-size: 11px;
    }
    .stage-scroll {
      padding: 0;
    }
    .profile-wrap {
      box-shadow: none;
    }
    .visitor-footer {
      padding: 19px 18px;
      font-size: 9px;
    }
    .demo-notice {
      padding: 0 16px;
      font-size: 9px;
    }
    :scope.editing .stage-scroll,
    .inspector {
      height: calc(100vh - 59px);
    }
    .inspector {
      top: 59px;
    }
    .header-tools .btn {
      font-size: 11px;
      height: 32px;
    }
    .device-switch .device-text {
      display: none;
    }
    .device-switch button {
      height: 27px;
    }
    .header-tools .history-buttons .iconbtn {
      width: 26px;
    }
    :scope.editing .stage-scroll {
      padding-left: 9px;
      padding-right: 9px;
    }
  }
  /* Profile editor v2 */
  .range-control {
    display: block;
    margin: 13px 0;
  }
  .range-control > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: 11px;
    color: #5c6663;
  }
  .range-control .range-fields {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .range-fields input[type="range"] {
    height: 22px;
    flex: 1;
    min-width: 0;
  }
  .range-fields input[type="number"] {
    width: 53px;
    height: 30px;
    text-align: center;
    padding: 3px;
    font-size: 11px;
  }
  .range-fields b {
    font-weight: 400;
    font-size: 10px;
    color: #8a938e;
    width: 16px;
  }
  .section > summary {
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .section > summary:after {
    content: "+";
    font-weight: 400;
    font-size: 16px;
    color: #8e9790;
  }
  .section[open] > summary:after {
    content: "−";
  }
  .section > summary + div {
    padding-top: 16px;
  }
  .section p {
    font-size: 10px;
  }
  .choice-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin-bottom: 14px;
  }
  .choice-grid button {
    border: 1px solid #dce0d7;
    border-radius: 7px;
    padding: 10px 2px;
    font-size: 10px;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
  .choice-grid button.active {
    background: #e9eeff;
    border-color: #8098ed;
    color: #254ef4;
  }
  .choice-grid button svg {
    width: 20px;
    height: 20px;
  }
  .quick-adds {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }
  .quick-adds button {
    padding: 12px 2px;
    background: #fff;
    border: 1px solid #e1e3db;
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 10px;
  }
  .quick-adds button:hover {
    border-color: #8098ed;
  }
  .empty-select {
    padding-bottom: 19px;
    border-bottom: 1px solid var(--line);
  }
  .inspector-top h2 {
    font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.5px;
  }
  .inspector-tabs button.active {
    border-color: #3559dd;
    color: #254ef4;
  }
  .inspector-note {
    font-size: 10px;
  }
  .node.music {
    align-items: center !important;
    overflow: hidden;
    container-type: size;
  }
  .music-inner {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 16px;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    letter-spacing: 0;
    font-style: normal;
    line-height: 1.3;
    cursor: inherit;
  }
  .record-area {
    width: 125px;
    height: 125px;
    position: relative;
    flex-shrink: 0;
    display: grid;
    place-items: center;
  }
  .record {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background:
      repeating-radial-gradient(
        circle at center,
        transparent 0 2px,
        #ffffff11 2px 3px
      ),
      var(--record-color, #151719);
    box-shadow: 0 5px 10px #07152233;
    display: grid;
    place-items: center;
    animation: record-spin 9s linear infinite;
    animation-play-state: paused;
  }
  .music-inner.playing .record {
    animation-play-state: running;
  }
  .record:after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e7eff3;
    position: absolute;
    left: calc(50% - 3.5px);
    top: calc(50% - 3.5px);
    border: 1px solid #0008;
  }
  .record img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
  }
  .music-info {
    flex: 1;
    min-width: 0;
  }
  .music-eyebrow {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.55;
    margin-bottom: 7px;
  }
  .music-title {
    font-size: 17px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .music-artist {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .music-buttons {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-top: 12px;
  }
  .music-play {
    height: 30px;
    width: 30px;
    background: var(--music-accent, #244edd);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--music-on, #fff);
    padding: 0;
    flex-shrink: 0;
  }
  .music-play svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    fill: currentColor;
  }
  .music-seek {
    accent-color: var(--music-accent);
    height: 15px;
    min-width: 0;
    flex: 1;
    padding: 0;
  }
  .music-time {
    font-size: 9px;
    opacity: 0.55;
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    padding-left: 39px;
    letter-spacing: 0;
  }
  .music-external {
    font-size: 10px;
    text-decoration: none;
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 9px;
  }
  .music-external svg {
    width: 11px;
    height: 11px;
  }
  .music-inner.compact .record-area {
    width: 64px;
    height: 64px;
  }
  .music-inner.compact .record {
    border-radius: 7px;
    width: 64px;
    height: 64px;
    background: none;
    box-shadow: none;
    animation: none;
  }
  .music-inner.compact .record img {
    width: 64px;
    height: 64px;
    border-radius: 7px;
  }
  .music-inner.compact .record:after {
    display: none;
  }
  .music-inner.compact .music-eyebrow {
    display: none;
  }
  .music-inner.cover {
    display: block;
    padding: 0;
    isolation: isolate;
    color: inherit !important;
  }
  .music-inner.cover .record-area {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
  }
  .music-inner.cover .record {
    width: 100%;
    height: 100%;
    border-radius: 0;
    animation: none;
    box-shadow: none;
  }
  .music-inner.cover .record img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
  }
  .music-inner.cover .record:after {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
    background: linear-gradient(0deg, #061523dd, transparent);
  }
  .music-inner.cover .music-info {
    position: absolute;
    bottom: 18px;
    left: 20px;
    right: 20px;
  }
  .music-inner.cover .music-artist,
  .music-inner.cover .music-time {
    opacity: 0.8;
  }
  .music-inner.cover .music-title {
    font-size: 22px;
  }
  .music-empty {
    font-size: 10px;
    opacity: 0.65;
    margin-top: 10px;
  }
  .music-error {
    font-size: 10px;
    margin-top: 8px;
    color: #b4412c;
  }
  :scope.editing .node.music input,
  :scope.editing .node.music button,
  :scope.editing .node.music a {
    pointer-events: none;
  }
  .music-image-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #dce0d7;
    border-radius: 7px;
    width: 100%;
    text-align: left;
    background: #fff;
  }
  .music-image-picker img {
    width: 45px;
    height: 45px;
    border-radius: 5px;
    object-fit: cover;
  }
  .music-image-picker span {
    font-size: 11px;
  }
  .effects-layer {
    position: absolute;
    inset: 0;
    pointer-events: none !important;
    overflow: hidden;
    z-index: 100;
    contain: strict;
    opacity: var(--effect-opacity, 0.7);
  }
  .particle {
    position: absolute;
    top: -15px;
    left: var(--x);
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    background: var(--particle-color, #fff);
    animation: fall var(--speed, 10s) linear var(--delay, 0s) infinite;
    opacity: var(--o, 0.6);
    will-change: transform;
  }
  .effects-layer.rain .particle {
    width: 1px;
    height: 18px;
    border-radius: 1px;
    background: var(--particle-color, #c1d8e9);
  }
  .effects-layer.sparkles .particle {
    width: 4px;
    height: 4px;
    top: var(--y);
    border-radius: 0;
    transform: rotate(45deg);
    animation: twinkle var(--speed, 4s) ease-in-out var(--delay, 0s) infinite;
    box-shadow: 0 0 7px #fff7;
  }
  .effects-paused .particle {
    animation-play-state: paused;
  }
  .fade-node {
    animation: profile-fade var(--fade-duration, 0.8s) ease
      var(--fade-delay, 0s) both;
  }
  .fade-up-node {
    animation: profile-fade-up var(--fade-duration, 0.8s) ease
      var(--fade-delay, 0s) both;
  }
  .fade-edge-both {
    mask-image: linear-gradient(
      to bottom,
      transparent,
      #000 var(--fade-edge, 15%),
      #000 calc(100% - var(--fade-edge, 15%)),
      transparent
    );
  }
  .fade-edge-bottom {
    mask-image: linear-gradient(
      to bottom,
      #000 calc(100% - var(--fade-edge, 25%)),
      transparent
    );
  }
  .fade-edge-top {
    mask-image: linear-gradient(
      to bottom,
      transparent,
      #000 var(--fade-edge, 25%)
    );
  }
  @keyframes profile-fade {
    from {
      opacity: 0;
    }
    to {
      opacity: var(--node-opacity, 1);
    }
  }
  @keyframes profile-fade-up {
    from {
      opacity: 0;
      translate: 0 18px;
    }
    to {
      opacity: var(--node-opacity, 1);
      translate: 0 0;
    }
  }
  @keyframes record-spin {
    to {
      transform: rotate(360deg);
    }
  }
  @keyframes fall {
    to {
      transform: translate3d(
        var(--drift, 35px),
        var(--fall-distance, 1200px),
        0
      );
    }
  }
  @keyframes twinkle {
    0%,
    100% {
      opacity: 0;
      scale: 0.4;
    }
    50% {
      opacity: var(--o, 0.65);
      scale: 1;
    }
  }
  .profile-controls {
    max-width: 1180px;
    margin: 0 auto 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }
  .profile-controls .btn {
    font-size: 11px;
    height: 32px;
    background: #fff8;
  }
  .effect-preview-note {
    padding: 8px 10px;
    background: #f0f1ea;
    border-radius: 5px;
    font-size: 10px;
    line-height: 1.5;
    color: #6d7a6f;
    margin-top: 12px;
  }
  @media (max-width: 460px) {
    .profile-controls {
      padding: 12px 16px;
      margin: 0;
    }
    .music-inner {
      gap: 12px;
      padding: 12px;
    }
    .record-area {
      width: 106px;
      height: 106px;
    }
    .record {
      width: 103px;
      height: 103px;
    }
    .music-title {
      font-size: 16px;
    }
    .music-eyebrow {
      font-size: 8px;
    }
    .music-play {
      height: 28px;
      width: 28px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .effects-layer {
      display: none;
    }
    .record,
    .fade-node,
    .fade-up-node {
      animation: none !important;
      opacity: var(--node-opacity, 1);
    }
  }

  .gradient-stop {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 48px 24px;
    gap: 6px;
  }
  .gradient-stop input[type="range"] {
    grid-row: 2;
    grid-column: 1/5;
    width: 100%;
    margin: 4px 0 7px;
  }
  .gradient-stop input[type="number"] {
    grid-row: 1;
    grid-column: 3;
    width: 48px;
  }
  .gradient-stop input:not([type]) {
    grid-row: 1;
    grid-column: 2;
    width: 100%;
  }
  .gradient-stop > span {
    display: none;
  }
  .gradient-stop > button {
    grid-row: 1;
    grid-column: 4;
  }

  .settings-account {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px 0;
    border-bottom: 1px solid #ddd;
  }
  .settings-account strong {
    font-size: 16px;
  }
  .settings-account span {
    font-size: 11px;
    color: #788478;
  }
  .settings-edit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    gap: 15px;
  }
  .settings-edit-row strong {
    font-size: 13px;
  }
  .settings-edit-row p {
    font-size: 11px;
    margin: 6px 0 0;
  }
  .viewer-dialog {
    width: min(980px, 96vw);
  }
  .viewer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(200px, 1fr);
    gap: 24px;
    margin-top: 18px;
  }
  .viewer-layout video {
    display: block;
    width: 100%;
    background: #081511;
    border-radius: 8px;
    max-height: 65vh;
  }
  .viewer-info h3 {
    font-size: 18px;
    line-height: 1.3;
    margin: 2px 0 9px;
  }
  .viewer-info p {
    font-size: 12px;
  }
  .viewer-meta {
    font-size: 11px;
    color: #7a867c;
    padding: 14px 0;
    border-top: 1px solid #dce1d5;
  }
  .viewer-info a {
    font-size: 12px;
    text-decoration: none;
  }
  .link-label {
    min-width: 0;
    white-space: pre-wrap;
  }
  .link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
  }
  .link-icon svg,
  .link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
  .node.linked-node {
    text-decoration: none;
    gap: 12px;
  }
  .node.text.linked-node {
    align-items: flex-start;
  }
  .node.linked-node.icon-left {
    flex-direction: row-reverse;
    justify-content: flex-end !important;
  }
  .node.linked-node.always-underline .link-label {
    text-decoration: underline;
    text-underline-offset: 0.13em;
  }
  .node.linked-node.hover-underline:hover .link-label {
    text-decoration: underline;
    text-underline-offset: 0.13em;
  }
  .node.linked-node.hover-lift:hover {
    translate: 0 -3px;
    transition: translate 0.2s;
  }
  .node.linked-node.hover-fade:hover {
    filter: opacity(0.65);
  }
  :scope.editing .node.linked-node:hover {
    translate: none;
    filter: none;
  }
  .link-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .link-icon-upload {
    margin-top: 11px;
    width: 100%;
  }

  /* Production sizing and scoped integration. */
  :scope [hidden] {
    display: none !important;
  }
  .layer-name {
    flex: 1;
    text-align: left;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :scope .topbar {
    color: #182124;
    background: #faf9f5 !important;
  }
  :scope .topbar :is(.btn, .iconbtn, strong) {
    color: #182124 !important;
  }
  :scope .topbar .primary {
    color: #fff !important;
  }
  :scope .image-placeholder {
    background: #dce0d8 !important;
  }
  :scope .avatar-initial {
    font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 28px;
    color: #667366;
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
  }

  .topbar {
    height: auto;
    min-height: 54px;
    flex-wrap: wrap;
    padding: 10px 24px;
  }
  .topbar .brand.visitor-only {
    display: none;
  }
  .workbench {
    min-height: calc(100vh - var(--app-chrome-height, 110px));
  }
  :scope.editing .stage-scroll,
  .inspector {
    height: calc(100vh - var(--app-chrome-height, 110px));
  }
  .topbar .public-meta {
    margin-left: auto;
  }
  .stage-scroll {
    min-width: 0;
  }
  .profile-wrap {
    flex-shrink: 0;
  }
  .artboard {
    overflow: hidden;
  }
  .video-grid {
    display: block;
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 24px auto;
    width: 100%;
    max-width: 1180px;
  }
  .public-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  .public-video-card {
    display: block;
    text-decoration: none;
    overflow: hidden;
  }
  .public-video-card-media {
    aspect-ratio: var(--thumbnail-ratio, 16/9) !important;
  }
  .public-video-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .public-video-card svg {
    width: 18px;
    height: 18px;
  }
  .visitor-footer {
    padding: 24px;
    max-width: 1180px;
    margin: auto;
  }
  .session-notice {
    padding: 10px 24px;
    background: #f2eee0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
  }
  .session-notice:empty {
    display: none;
  }
  .session-notice button {
    border: 1px solid;
    padding: 6px;
    border-radius: 4px;
  }
  .height-controls {
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  .height-controls input {
    width: 100%;
  }
  .node[tabindex]:focus-visible {
    outline: 3px solid #254ef4;
  }
  .node img[src=""],
  img:not([src]) {
    visibility: hidden;
  }
  .node.image:has(img[src=""]) {
    background: #dce0d8 !important;
  }
  .image-placeholder {
    height: 100%;
    width: 100%;
    background: #dce0d8;
    display: grid;
    place-items: center;
    color: #667366;
  }
  .inspector-close {
    display: none;
  }
  .public-switch {
    display: flex;
    gap: 10px;
    margin: 10px auto 24px;
    max-width: 1180px;
  }
  .public-switch button {
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 30px;
  }
  .public-switch .active {
    color: white;
    background: #152530;
  }
  .asset-list {
    overflow-wrap: anywhere;
  }
  .asset-list li {
    margin: 10px 0;
  }
  .asset-list button {
    margin-left: 10px;
  }
  .loading {
    padding: 32px;
  }
  .editor-title {
    min-width: 120px;
  }
  .header-tools {
    flex-wrap: wrap;
  }
  .status-dot {
    flex-shrink: 0;
  }
  .inspector-content {
    padding-bottom: 40px;
  }
  .node.text,
  .node.sticker {
    overflow-wrap: anywhere;
  }
  .dialog {
    max-height: 85vh;
    overflow: auto;
  }
  .dialog p {
    line-height: 1.6;
  }
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  @media (max-width: 850px) {
    .inspector {
      top: var(--app-chrome-height, 110px);
      z-index: 45;
    }
    .inspector-close {
      display: inline-flex;
    }
    .topbar {
      padding: 8px 12px;
      gap: 8px;
    }
    .header-tools {
      gap: 6px;
    }
    .header-tools .btn {
      padding: 0 9px;
    }
    .editor-title {
      flex: 1;
    }
    .inspector.open {
      width: min(320px, 100vw);
    }
    .public-profile-grid {
      grid-template-columns: 1fr;
    }
    .public-switch {
      padding: 0 12px;
    }
  }
  @media (max-width: 460px) {
    .topbar {
      gap: 8px;
    }
    .header-tools {
      width: 100%;
      justify-content: space-between;
    }
    .history-buttons {
      display: flex;
    }
    .device-switch button {
      min-width: 30px;
      padding: 6px;
    }
    .device-text {
      display: none;
    }
    .rail {
      width: 48px;
    }
    .rail button {
      width: 44px;
    }
    .topbar .divider {
      display: none;
    }
    .zoom-bar .hint {
      display: none;
    }
    .visitor-footer {
      padding: 20px 12px;
    }
    .public-meta {
      display: none;
    }
    .session-notice {
      padding: 10px 12px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    * {
      animation: none !important;
      transition: none !important;
    }
  }
}

@scope (#profile-studio) {
  :scope .topbar {
    background: #faf9f5 !important;
    color: #182124 !important;
  }
  .inspector :is(input, textarea, select) {
    color: #182124 !important;
    background: #fff !important;
  }
}

/* Original STUDIO chrome, scoped below shared public styles. */
@scope (#profile-studio) {
  :scope.editing .topbar { min-height:65px; padding:0 32px; flex-wrap:nowrap; }
  :scope.editing .header-tools { flex-wrap:nowrap; gap:9px; }
  .inspector { background:var(--cream); }
  .height-controls h3, .empty-select h3 { font-size:13px; margin:0 0 12px; font-weight:600; }
  .height-controls p { font-size:11px; line-height:1.55; color:var(--muted); }
  .inspector-top h2 { font-family:Georgia,serif; font-size:19px; font-weight:400; }
  .rail { overflow:auto; }
  .rail button { flex-shrink:0; }
  .styled-video-profile .node.tabs { background:var(--tab-fill) !important; border-radius:var(--tab-radius) !important; font-family:var(--tab-font) !important; }
  .designed-video-grid { top:var(--video-top,0px) !important; left:var(--video-left,0%) !important; right:auto !important; max-width:none; }
  .designed-video-grid .public-video-card { padding:0; min-width:0; }
  .designed-video-grid .public-video-card-media { display:block; position:relative; width:100%; aspect-ratio:var(--thumbnail-ratio, 16/9) !important; overflow:hidden; background:#172223; }
  .designed-video-grid .public-video-card-copy { display:flex; flex-direction:column; gap:6px; padding:14px; font:inherit; color:inherit; width:100%; min-width:0; overflow-wrap:anywhere; }
  .designed-video-grid .public-video-card-copy strong { font-size:inherit; color:inherit; overflow-wrap:anywhere; white-space:normal; }
  .designed-video-grid .public-video-card-copy small { font-size:.75em; white-space:normal; overflow-wrap:anywhere; }
  .public-video-card-overlay { position:absolute; inset:0; display:grid; place-items:center; color:white; pointer-events:none; }
  .public-video-card-duration { position:absolute; right:8px; bottom:8px; border-radius:4px; padding:3px 6px; background:#000b; color:white; font:12px Arial,sans-serif; }
  .videos-empty { border:1px dashed #89968a; padding:28px; border-radius:8px; line-height:1.6; }
  .image-error-label { position:absolute; left:4px; right:4px; bottom:4px; padding:4px; background:#faf9f5e6; color:#182124; font:10px Arial,sans-serif; }
  @media (max-width:850px) {
    :scope.editing .topbar { min-height:59px; padding:8px 12px; flex-wrap:wrap; }
    :scope.editing .header-tools { gap:5px; flex-wrap:wrap; }
    .inspector.open { width:min(296px,100vw); min-width:0; }
  }
}

/* Editor workspace and tools. Keep shared navigation and saved profile styling isolated. */
@scope (#profile-studio) {
  :scope {
    container-name: profile-editor;
    container-type: inline-size;
    min-width: 0;
    max-width: 100%;
    position: relative;
  }
  :scope.editing {
    --handle-size: 28px;
    --focus-ring: #fff;
  }
  :scope.editing .workbench {
    position: relative;
    height: calc(100dvh - var(--app-chrome-height, 110px));
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    align-items: stretch;
  }
  :scope.editing .stage-scroll {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-padding: 80px 36px;
  }
  :scope.editing .rail {
    flex: 0 0 66px;
    min-width: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  :scope.editing .inspector {
    flex: 0 0 var(--panel);
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
    top: auto;
    right: auto;
    z-index: 40;
  }
  :scope.editing .inspector-top,
  :scope.editing .inspector-note {
    flex: 0 0 auto;
    min-width: 0;
  }
  :scope.editing .inspector-top h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    overflow-wrap: anywhere;
  }
  :scope.editing .inspector-content {
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-padding-block: 16px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  :scope.editing .inspector :is(.section, .section > div, label, .form-stack, .range-fields, .fill-row, .crop-row, .link-options) {
    min-width: 0;
    max-width: 100%;
  }
  :scope.editing .inspector :is(.section h3, .section summary, .check-line) {
    gap: 8px;
    overflow-wrap: anywhere;
  }
  :scope.editing .inspector .row {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
  }
  :scope.editing .inspector .row > .btn {
    flex: 1 1 100px;
  }
  :scope.editing .inspector .btn {
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 36px;
    padding-block: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }
  :scope.editing .inspector .form-grid,
  :scope.editing .inspector .crop-row,
  :scope.editing .inspector .link-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :scope.editing .inspector .form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  :scope.editing .inspector :is(.choice-grid, .quick-adds) > button {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  :scope.editing .inspector :is(input, select, textarea) {
    max-width: 100%;
  }
  :scope.editing .inspector .mini-buttons {
    flex-wrap: wrap;
  }
  :scope.editing .inspector .mini-buttons .btn {
    flex: 1 1 64px;
  }
  :scope.editing .topbar {
    min-width: 0;
    max-width: 100%;
    gap: 16px;
  }
  :scope.editing .editor-title {
    flex: 1 1 160px;
    min-width: 0;
  }
  :scope.editing .editor-title > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  :scope.editing .header-tools {
    min-width: 0;
    max-width: 100%;
  }
  :scope.editing .header-tools > :is(.device-switch, .history-buttons, .btn, .iconbtn) {
    flex-shrink: 0;
  }
  :scope.editing .header-tools .btn {
    max-width: 100%;
    height: auto;
    min-height: 36px;
    padding-block: 7px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }
  :scope.editing .history-buttons {
    display: flex;
  }
  :scope.editing .zoom-bar {
    position: absolute;
    max-width: calc(100% - 88px);
    bottom: max(14px, env(safe-area-inset-bottom));
    pointer-events: none;
  }
  :scope.editing :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--focus-ring);
  }
  :scope.editing .section > summary {
    min-height: 32px;
  }
  :scope.editing .node.selected {
    overflow: visible;
    outline-width: calc(1.5px * var(--inverse-zoom, 1));
  }
  :scope.editing #artboard {
    overflow: visible;
  }
  :scope.editing .node-content {
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    align-items: inherit;
    justify-content: inherit;
    flex-direction: inherit;
    gap: inherit;
    border-radius: inherit;
    overflow: hidden;
  }
  :scope.editing :is(.node.image, .node.shape) > .node-content {
    display: block;
  }
  :scope.editing .node.music > .node-content {
    align-items: center;
  }
  :scope.editing .resize-handle,
  :scope.editing .rotate-handle {
    width: calc(var(--handle-size) * var(--inverse-zoom, 1));
    height: calc(var(--handle-size) * var(--inverse-zoom, 1));
    padding: 0;
    border: 0;
    background: transparent;
    touch-action: none;
    z-index: 30;
    display: grid;
    place-items: center;
  }
  :scope.editing .resize-handle {
    bottom: calc(var(--handle-size) * var(--inverse-zoom, 1) / -2);
    right: calc(var(--handle-size) * var(--inverse-zoom, 1) / -2);
  }
  :scope.editing .rotate-handle {
    left: 50%;
    top: calc((28px + var(--handle-size) / 2) * var(--inverse-zoom, 1) * -1);
    transform: translateX(-50%);
    border-radius: 50%;
  }
  :scope.editing .resize-handle::before,
  :scope.editing .rotate-handle::before {
    content: "";
    width: calc(10px * var(--inverse-zoom, 1));
    height: calc(10px * var(--inverse-zoom, 1));
    background: #fff;
    border: calc(1.5px * var(--inverse-zoom, 1)) solid var(--blue);
    box-shadow: 0 0 0 calc(1px * var(--inverse-zoom, 1)) #fff9;
    pointer-events: none;
  }
  :scope.editing .rotate-handle::before {
    width: calc(12px * var(--inverse-zoom, 1));
    height: calc(12px * var(--inverse-zoom, 1));
    border-radius: 50%;
  }
  :scope.editing .rotate-handle::after {
    top: calc(50% + 7px * var(--inverse-zoom, 1));
    left: 50%;
    width: calc(1px * var(--inverse-zoom, 1));
    height: calc(21px * var(--inverse-zoom, 1));
    pointer-events: none;
  }
  :scope.editing .selection-label {
    top: calc(-22px * var(--inverse-zoom, 1));
    left: 0;
    max-width: calc(220px * var(--inverse-zoom, 1));
    padding-inline: calc(5px * var(--inverse-zoom, 1));
    font-size: calc(9px * var(--inverse-zoom, 1));
    line-height: calc(17px * var(--inverse-zoom, 1));
    overflow: hidden;
    text-overflow: ellipsis;
  }
  :scope.editing .selection-toolbar {
    position: sticky;
    left: 0;
    top: -24px;
    z-index: 35;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
    padding: 7px;
    margin: -24px 0 34px;
    border: 1px solid #d2d8cf;
    border-radius: 8px;
    background: #faf9f5f7;
    box-shadow: 0 3px 12px #2030250d;
  }
  .selection-toolbar:empty {
    display: none;
  }
  :scope.editing .selection-toolbar :is(.btn, .iconbtn) {
    min-height: 32px;
    height: auto;
    padding: 5px 8px;
    font-size: 11px;
  }
  :scope.editing .selection-toolbar .align-select,
  :scope.editing .selection-toolbar select {
    flex: 0 1 132px;
    width: auto;
    max-width: 100%;
    min-width: 80px;
  }
  .scope-indicator {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 4px;
    background: #e9edff;
    color: #2545b6;
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    padding: 12px 24px;
    background: #eef1e7;
    border-bottom: 1px solid #d8decb;
    color: #344333;
    font-size: 12px;
  }
  .preview-bar > :is(div, span) {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .preview-bar .btn {
    flex-shrink: 0;
  }
  .save-times {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 12px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
  }
  .studio-skeleton {
    display: grid;
    gap: 18px;
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 32px 24px;
  }
  .skeleton-line,
  .skeleton-card {
    border-radius: 6px;
    background: #e5e8df;
    animation: studio-skeleton-pulse 1.5s ease-in-out infinite alternate;
  }
  .skeleton-line {
    width: 66%;
    height: 14px;
  }
  .skeleton-line:nth-child(even) {
    width: 42%;
  }
  .skeleton-card {
    min-height: 180px;
    width: 100%;
  }
  @keyframes studio-skeleton-pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
  }
  :scope.editing .layer {
    min-height: 56px;
    height: auto;
    gap: 7px;
    padding-block: 6px;
  }
  .layer-check {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
  }
  .layer-thumb,
  .layer .layer-thumb {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    object-fit: cover;
    border: 1px solid #d9dfd1;
    border-radius: 5px;
    background: #eef0e9;
    color: #65715e;
    font: 17px Georgia, serif;
  }
  .layer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .layer-label,
  .layer .layer-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1 1 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    line-height: 1.35;
  }
  .layer-label strong {
    font-size: 11px;
    font-weight: 600;
  }
  .layer-label small {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #6c756d;
    font-size: 10px;
  }
  :scope.editing .layer-name {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  :scope.editing .layer > .iconbtn {
    flex-shrink: 0;
    width: 28px;
    height: 32px;
  }
  .font-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    min-width: 0;
  }
  .font-picker > summary {
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    padding: 10px;
  }
  .font-picker > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 7px;
  }
  .font-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 64px;
    padding: 9px;
    border: 1px solid #dce0d7;
    border-radius: 6px;
    background: #fff;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .font-option :is(.font-sample, strong),
  .font-option > span {
    font-size: 19px;
    line-height: 1.3;
  }
  .font-option small {
    font: 10px Arial, sans-serif;
    color: #6b746e;
  }
  :is(.font-option, .preset-card)[aria-pressed="true"],
  .font-option.active {
    border-color: var(--blue);
    background: #edf0ff;
  }
  .music-inner.artwork-free {
    gap: 0;
    padding: 18px 20px;
  }
  .music-inner.artwork-free .record-area {
    display: none;
  }
  .music-inner.artwork-free .music-info {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
  }
  .music-inner.cover.artwork-free {
    display: flex;
    align-items: center;
    padding: 22px;
    background: linear-gradient(#0b1728b8, #0b1728b8), var(--record-color, #171c24);
  }
  .music-inner.cover.artwork-free .music-info {
    position: static;
  }
  .artwork-empty {
    width: 100%;
    min-width: 0;
    padding: 12px;
    margin-block: 8px;
    border-radius: 5px;
    background: #edf0e8;
    color: #586652;
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .preset-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .preset-grid .preset-card {
    margin: 0;
    min-width: 0;
    padding: 9px;
    background: #fff;
    border: 1px solid #dce0d7;
    border-radius: 8px;
  }
  .preset-card:hover {
    border-color: #839bf0;
  }
  .preset-preview-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 58px);
    align-items: start;
    gap: 8px;
    min-width: 0;
  }
  .mini-preview {
    display: block;
    position: relative;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px #e0e4da;
    border-radius: 4px;
    background: #f0f2eb;
    pointer-events: auto;
    isolation: isolate;
  }
  .preview-stage {
    position: relative;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
  }
  .preview-scale {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    pointer-events: none;
    overflow: hidden;
    isolation: isolate;
  }
  .preview-artboard {
    overflow: hidden;
  }
  :scope.editing .dialog {
    max-width: 100%;
    min-width: 0;
  }
  :scope.editing .dialog:has(.preset-preview-modal) {
    width: min(920px, 100%);
  }
  :scope.editing .dialog .actions {
    flex-wrap: wrap;
  }
  :scope.editing .dialog .btn {
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 36px;
    padding-block: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .preset-preview-modal {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    width: min(900px, 100%);
    min-width: 0;
    max-width: 100%;
  }
  .preset-preview-modal > section {
    min-width: 0;
  }
  .preset-preview-modal h3 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
  }
  .preset-preview-modal .preset-preview-pair {
    gap: 16px;
  }
  .theme-swatches,
  .colour-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0;
  }
  .theme-swatches > span {
    width: 20px;
    height: 20px;
    border: 1px solid #0002;
    border-radius: 50%;
  }
  .theme-swatches > button {
    flex: 1 1 90px;
    width: auto;
    min-width: 0;
    min-height: 36px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .upload-tray {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .upload-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 8px;
    border: 1px solid #dce0d7;
    border-radius: 6px;
    background: #fff;
    overflow-wrap: anywhere;
  }
  .upload-card :is(img, .upload-placeholder) {
    display: block;
    width: 100%;
    height: 74px;
    object-fit: cover;
    border-radius: 3px;
    background: #eef0e9;
  }
  .upload-card :is(strong, small) {
    font-size: 10px;
    line-height: 1.4;
  }
  .upload-card .btn {
    width: 100%;
    margin-top: auto;
  }
  .personal-block-list,
  .video-order-list,
  .history-list,
  .preflight-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 10px 0;
    list-style: none;
    min-width: 0;
  }
  .personal-block-list > :is(div, li) {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .personal-block-list :is(strong, span) {
    flex: 1 1 100%;
    min-width: 0;
  }
  .colour-swatch {
    display: grid;
    place-items: center;
    position: relative;
    width: 30px;
    height: 30px;
    border: 1px solid #17231b33;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--cream);
  }
  .colour-swatch:hover {
    outline: 1px solid #526852;
    outline-offset: 2px;
  }
  .selection-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 10px 0;
  }
  .video-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
    min-width: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid #dce0d7;
    border-radius: 6px;
  }
  .video-order-row > :is(input[type="text"], label, strong, .video-order-title) {
    grid-column: 1 / -1;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .video-order-row > .row {
    grid-column: 1 / -1;
  }
  .video-order-row .iconbtn {
    width: 32px;
    height: 32px;
  }
  .history-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    text-align: left;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .history-row > span {
    flex: 1 1 140px;
    min-width: 0;
  }
  .history-row small {
    color: var(--muted);
    font-size: 10px;
  }
  .history-row.current,
  .history-row[aria-current="true"] {
    background: #edf0ff;
    border-color: #91a4ec;
  }
  .preflight-list > :is(li, button, div) {
    min-width: 0;
    padding: 10px;
    border: 1px solid #e1d6bc;
    border-radius: 6px;
    background: #f8f3e8;
    color: #695332;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .preflight-list button {
    white-space: normal;
    text-align: left;
    min-height: 36px;
  }
  :scope.editing .node.crop-editing {
    cursor: crosshair;
    outline-style: dashed;
  }
  :scope.editing .node.crop-editing > .node-content::after {
    content: "+";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    text-shadow: 0 1px 3px #000;
    font: calc(28px * var(--inverse-zoom, 1)) Arial, sans-serif;
    pointer-events: none;
  }
  .crop-hint {
    padding: 10px;
    border-radius: 5px;
    background: #edf0ff;
    color: #344b9c;
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .style-reset {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 5px 7px;
    border-radius: 4px;
    color: #626d62;
    font-size: 10px;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .style-reset:hover {
    color: var(--blue);
    background: #e9edff;
  }
  :scope.reduced-motion-preview *,
  :scope.reduced-motion-preview *::before,
  :scope.reduced-motion-preview *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  :scope.reduced-motion-preview .effects-layer {
    display: none;
  }
  :scope.reduced-motion-preview :is(.fade-node, .fade-up-node) {
    opacity: var(--node-opacity, 1);
  }
  @container profile-editor (max-width: 850px) {
    :scope.editing .topbar {
      min-height: 59px;
      padding: 8px 12px;
      flex-wrap: wrap;
      gap: 6px;
    }
    :scope.editing :is(.editor-title, .topbar .divider, .zoom-bar .hint) {
      display: none;
    }
    :scope.editing .header-tools {
      display: flex;
      flex-wrap: wrap;
      width: 100%;
      gap: 5px;
      justify-content: space-between;
    }
    :scope.editing .header-tools .btn {
      padding-inline: 9px;
      font-size: 11px;
    }
    :scope.editing .rail {
      flex-basis: 48px;
      width: 48px;
      padding-top: 12px;
    }
    :scope.editing .rail button {
      width: 42px;
    }
    :scope.editing .stage-scroll {
      padding: 32px 15px 65px;
      scroll-padding-inline: 15px;
    }
    :scope.editing .inspector {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      width: min(var(--panel), 100%);
      max-width: 100%;
      height: 100%;
      display: none !important;
      box-shadow: -8px 0 28px #23332124;
      z-index: 45;
    }
    :scope.editing .inspector.open {
      display: flex !important;
      width: min(var(--panel), 100%);
    }
    :scope.editing .inspector-close,
    :scope.editing .mobile-editor-toggle {
      display: inline-flex;
      flex-shrink: 0;
      width: 36px;
      height: 36px;
    }
    :scope.editing .zoom-bar {
      left: calc(50% + 24px);
    }
    :scope.editing .selection-toolbar {
      top: -22px;
      margin-top: -22px;
      margin-bottom: 32px;
    }
  }
  @container profile-editor (max-width: 700px) {
    .preset-preview-modal {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  @container profile-editor (max-width: 520px) {
    :scope.editing .header-tools {
      justify-content: flex-start;
      gap: 5px;
    }
    :scope.editing .header-tools > .btn {
      flex: 1 1 auto;
      min-height: 36px;
    }
    :scope.editing .device-text {
      display: none;
    }
    :scope.editing .device-switch button {
      min-width: 30px;
      min-height: 30px;
      padding: 5px;
    }
    :scope.editing .history-buttons .iconbtn {
      width: 30px;
      height: 36px;
    }
    :scope.editing .inspector.open {
      top: auto;
      bottom: 0;
      width: 100%;
      height: min(62dvh, 580px);
      max-height: calc(100dvh - var(--app-chrome-height, 110px) - 56px);
      border: 1px solid #d4d9cd;
      border-bottom: 0;
      border-radius: 14px 14px 0 0;
      box-shadow: 0 -10px 35px #21322329;
    }
    :scope.editing .inspector-top {
      padding: 12px 16px 0;
    }
    :scope.editing .inspector-top h2 {
      margin-bottom: 4px;
    }
    :scope.editing .inspector-tabs button {
      min-height: 38px;
    }
    :scope.editing .inspector-content {
      padding-inline: 16px;
    }
    :scope.editing .inspector-note {
      display: none;
    }
    :scope.editing .stage-scroll {
      padding-inline: 9px;
    }
    :scope.editing .selection-toolbar {
      padding: 6px;
      gap: 4px;
    }
    :scope.editing .selection-toolbar .btn {
      white-space: normal;
      overflow-wrap: anywhere;
      max-width: 100%;
    }
    .preview-bar {
      padding: 10px 12px;
    }
    .preset-preview-modal {
      padding: 0;
    }
    .preset-preview-modal .preset-preview-pair {
      gap: 8px;
    }
  }
  @media (pointer: coarse) {
    :scope.editing {
      --handle-size: 40px;
    }
    :scope.editing :is(.inspector .iconbtn, .inspector-close, .mobile-editor-toggle, .selection-toolbar .iconbtn, .colour-swatch) {
      min-width: 40px;
      min-height: 40px;
    }
    :scope.editing :is(.inspector .btn, .inspector summary, .inspector .check-line) {
      min-height: 40px;
    }
    :scope.editing .inspector :is(input:not([type="checkbox"]):not([type="color"]):not([type="range"]), select, textarea) {
      font-size: 16px;
    }
    :scope.editing .inspector .gradient-stop {
      grid-template-columns: 40px minmax(0, 1fr) 54px 40px;
    }
    :scope.editing .inspector .gradient-stop input[type="number"] {
      width: 54px;
    }
    :scope.editing .inspector input[type="color"] {
      width: 40px;
      min-width: 40px;
      height: 40px;
    }
    :scope.editing .inspector input[type="range"] {
      min-height: 32px;
    }
    :scope.editing .layer {
      flex-wrap: wrap;
    }
    :scope.editing .layer-name {
      flex-basis: 120px;
    }
    :scope.editing .layer-check {
      width: 20px;
      height: 20px;
      flex-basis: 20px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .skeleton-line,
    .skeleton-card {
      animation: none;
    }
  }
}

@scope (#profile-studio) {
  .selection-extra { display:flex; flex:1 1 auto; gap:6px; align-items:center; flex-wrap:wrap; min-width:0; }
  .selection-extra select { width:auto; max-width:100%; }
  @container profile-editor (max-width:520px) {
    .selection-extra { flex-basis:100%; max-height:140px; overflow:auto; padding-block:6px; border-top:1px solid var(--line); }
  }
}

/* View controls belong to the canvas column, with space reserved below scrolling content. */
@scope (#profile-studio) {
  :scope.editing .workbench {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) var(--panel);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  :scope.editing .rail { grid-column: 1; grid-row: 1 / -1; }
  :scope.editing .stage-scroll {
    grid-column: 2;
    grid-row: 1;
    padding: 24px 24px 40px;
    scroll-padding: 80px 24px;
  }
  :scope.editing .inspector { grid-column: 3; grid-row: 1 / -1; }
  :scope.editing .profile-wrap { max-width: none; }
  :scope.editing .selection-toolbar {
    top: -12px;
    margin: -12px 0 36px;
    padding: 8px;
    gap: 8px;
  }
  :scope.editing .zoom-bar {
    grid-column: 2;
    grid-row: 2;
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    gap: 8px;
    justify-content: center;
    pointer-events: auto;
    background: var(--cream);
    font-size: 11px;
  }
  .zoom-controls {
    display: flex;
    align-items: center;
    border: 1px solid #d9dbd4;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    flex-shrink: 0;
  }
  .zoom-controls button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 19px;
    line-height: 1;
  }
  .zoom-controls button:hover { background: #eeeee7; }
  .zoom-controls output {
    display: block;
    min-width: 52px;
    text-align: center;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .zoom-controls button:focus-visible { outline-offset: -3px; }
  :scope.editing .zoom-bar .btn { padding-inline: 12px; }
  :scope.editing .zoom-bar .btn[aria-pressed="true"] { color: #2545b6; background: #e9edff; border-color: #a8b8ed; }
  :scope.editing .zoom-bar b { margin-left: 4px; font-weight: 500; white-space: nowrap; }
  :scope.editing .zoom-bar .hint { color: var(--muted); white-space: nowrap; }
  :scope.editing .inspector-top h2 { font-family: inherit; font-size: 16px; font-weight: 600; }
  .page-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .page-actions > .btn { width: 100%; }
  .page-actions > .btn:nth-child(-n + 3) { grid-column: 1 / -1; }
  .height-controls { display: grid; gap: 12px; }
  .height-controls :is(h3, p) { margin: 0; }
  .height-controls .scope-indicator { margin-left: 4px; font-size: 9px; padding: 3px 5px; }
  .height-controls label > input { display: block; margin-top: 7px; }
  @container profile-editor (max-width: 1100px) {
    :scope.editing .zoom-bar .hint { display: none; }
  }
  @container profile-editor (max-width: 850px) {
    :scope.editing .workbench { grid-template-columns: 48px minmax(0, 1fr); }
    :scope.editing .stage-scroll { padding: 24px 15px 32px; }
    :scope.editing .zoom-bar b { display: none; }
    :scope.editing .inspector { grid-column: 2; }
  }
  @container profile-editor (max-width: 520px) {
    :scope.editing .inspector.open { grid-column: 1 / -1; }
    :scope.editing .header-tools {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
      align-items: center;
    }
    :scope.editing .header-tools .device-switch { justify-self: start; }
    :scope.editing .header-tools .history-buttons { justify-self: center; }
    :scope.editing .header-tools .mobile-editor-toggle { justify-self: end; }
    :scope.editing .header-tools > .btn { width: 100%; min-height: 38px; }
    :scope.editing .stage-scroll { padding-inline: 10px; }
    :scope.editing .selection-toolbar { gap: 5px; padding: 6px; }
    :scope.editing .zoom-bar { gap: 6px; padding-inline: 6px; }
    :scope.editing .zoom-bar .btn { padding-inline: 9px; }
  }
  @media (pointer: coarse) {
    .zoom-controls button { width: 40px; height: 40px; }
    :scope.editing .zoom-bar .btn { min-height: 40px; }
  }
}
@scope (#profile-studio) {
  .selection-extra { flex-basis: 100%; max-height: 200px; overflow: auto; padding-block: 6px; border-top: 1px solid var(--line); }
}

/* Upload120's existing system type, cream surfaces and neutral control treatment. */
@scope (#profile-studio) {
  :scope.editing {
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --line: #d2d2d7;
    --blue: #1d1d1f;
    --cream: #faf9f5;
    font-family: var(--sans, system-ui, sans-serif);
  }
  :scope.editing .stage-scroll { background: var(--parchment, #f5f5f7); }
  :scope.editing .btn {
    border-color: var(--line);
    border-radius: var(--radius-sm, 8px);
    color: var(--ink);
    background: var(--cream);
    font-weight: 500;
  }
  :scope.editing .btn:hover { background: #eeeee9; border-color: #babac0; }
  :scope.editing .btn.primary { color: #fff; background: #1d1d1f; border-color: #1d1d1f; }
  :scope.editing .btn.primary:hover { background: #000; border-color: #000; }
  :scope.editing .header-tools > .btn { border-radius: var(--pill, 9999px); }
  :scope.editing .inspector-tabs button.active { color: var(--ink); border-color: var(--ink); font-weight: 600; }
  :scope.editing .rail button:hover { color: var(--ink); background: #eeeee9; }
  :scope.editing .choice-grid button.active { color: var(--ink); border-color: #a6a6ac; background: #eeeee9; }
  :scope.editing :is(.quick-adds button, .upload-zone):hover { color: var(--ink); border-color: #a6a6ac; }
  :scope.editing .preset-card:hover .preset-art { outline-color: var(--ink); }
  :scope.editing .style-reset:hover { color: var(--ink); background: #eeeee9; }
  :scope.editing .history-row[aria-current="true"] { color: var(--ink); border-color: #a6a6ac; background: #eeeee9; }
  :scope.editing .section > summary::after { content: none; }
  :scope.editing .section > summary > svg { width: 16px; height: 16px; color: var(--muted); }
  :scope.editing .section[open] > summary > svg { transform: rotate(180deg); }
  :scope.editing :is(input[type="checkbox"], input[type="range"]) { accent-color: var(--ink); }
  :scope.editing :is(.scope-indicator, .crop-hint) { color: #525255; background: #eeeee9; }
  :scope.editing :is(.layer.active, .font-option.active, .font-option[aria-pressed="true"], .preset-card[aria-pressed="true"], .history-row.current) { color: var(--ink); border-color: #a6a6ac; background: #eeeee9; }
  :scope.editing .node:hover { outline-color: #1d1d1f80; }
  :scope.editing .node.selected { outline-color: #1d1d1f; }
  :scope.editing :is(.selection-label, .rotate-handle::after) { background: #1d1d1f; }
  :scope.editing .resize-handle::before,
  :scope.editing .rotate-handle::before { border-color: #1d1d1f; }
  :scope.editing :is(.rail, .topbar, .inspector, .selection-toolbar, .zoom-bar) svg {
    stroke-width: 1.7;
    flex: 0 0 auto;
    vertical-align: middle;
  }
  :scope.editing .rail button svg { width: 20px; height: 20px; }
  :scope.editing :is(.topbar, .inspector, .selection-toolbar) svg { width: 18px; height: 18px; }
  .zoom-controls {
    gap: 10px;
    flex: 0 1 250px;
    min-width: 0;
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .zoom-controls input[type="range"] {
    flex: 1 1 150px;
    width: 150px;
    min-width: 70px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--ink);
    cursor: pointer;
  }
  .zoom-controls output { min-width: 44px; text-align: right; font-size: 12px; }
  :scope.editing .zoom-bar .btn { border-radius: var(--pill, 9999px); }
  :scope.editing .zoom-bar .btn[aria-pressed="true"] { color: var(--ink); background: #eeeee9; border-color: #a6a6ac; }
  @container profile-editor (max-width: 520px) {
    .zoom-controls { flex: 1 1 170px; gap: 8px; }
    .zoom-controls input[type="range"] { width: 110px; }
  }
  @media (pointer: coarse) {
    .zoom-controls input[type="range"] { min-height: 40px; }
  }
}

@scope (#profile-studio) {
  .scope-toggle { cursor: pointer; font: inherit; font-size: 9px; line-height: 1.3; padding: 3px 6px; border: 1px solid var(--line, #deded7); border-radius: 6px; background: transparent; color: var(--muted, #717575); white-space: nowrap; }
  .scope-toggle:hover, .scope-toggle:focus-visible { color: var(--ink, #242e33); border-color: currentColor; outline-offset: 2px; }
  .scope-toggle[aria-pressed="true"] { background: var(--ink, #242e33); color: var(--cream, #fffdf5); }
  :scope.full-page-coverage:not(.editing) .stage-scroll { padding: 0; min-height: calc(100vh - var(--app-chrome-height, 110px)); }
  :scope.full-page-coverage:not(.editing) .profile-wrap { max-width: none; box-shadow: none; }
  :scope.full-page-coverage:not(.editing) .artboard { border-radius: 0; box-shadow: none; }
  :scope.full-page-coverage:not(.editing) .public-switch { margin-block: 0; padding-block: 12px; }
  :scope.full-page-coverage:not(.editing) .visitor-footer { padding-inline: 20px; }
}

/* Owner-authored profile tabs only; Upload120's global navigation is unchanged. */
@scope (#profile-studio) {
  .node.tabs.profile-tab-style,
  .styled-video-profile .node.tabs.profile-tab-style {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    gap: 6px;
    color: var(--profile-tab-color);
  }
  .profile-tab-style > .node-content { display: flex; align-items: stretch; gap: 6px; width: 100%; height: 100%; }
  .profile-tab-style button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    height: auto;
    padding: 9px 15px;
    color: var(--profile-tab-color);
    background: var(--profile-tab-background);
    border: var(--profile-tab-border) solid var(--profile-tab-border-color);
    border-radius: var(--profile-tab-radius);
    font-size: var(--profile-tab-size);
    font-family: inherit;
    line-height: 1.25;
    white-space: nowrap;
  }
  .node.tabs.profile-tab-style button { flex: 1 1 0; height: 100%; padding: 0 12px; }
  .profile-tab-style button.active { color: var(--profile-tab-active-color); background: var(--profile-tab-active-background); }
  .profile-tab-style svg { width: 1.15em; height: 1.15em; flex: 0 0 auto; }
  .profile-tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .profile-tab-style small { margin: 0; font-size: .7em; opacity: .75; flex: 0 0 auto; }
  .profile-tab-style[data-tab-variant="outline"] button { background: transparent; }
  .profile-tab-style[data-tab-variant="outline"] button.active { background: var(--profile-tab-active-background); }
  .profile-tab-style[data-tab-variant="underline"] button {
    background: transparent;
    border-width: 0 0 var(--profile-tab-border);
    border-radius: 0;
  }
  .profile-tab-style[data-tab-variant="underline"] button.active { border-bottom-color: var(--profile-tab-active-background); }
  .profile-tab-style button:focus-visible,
  .video-view-more:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
  .video-pagination { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 20px; }
  .video-page-count { font-size: .8em; opacity: .75; }
  .video-view-more { min-height: 40px; padding: 9px 20px; color: #182124; background: #faf9f5; border: 1px solid #deded7; border-radius: 9999px; }
  .public-switch.profile-tab-style { flex-wrap: wrap; justify-content: center; }
}
