[hidden] { display: none !important; }

    @property --ba-pos {
      syntax: '<percentage>';
      inherits: true;
      initial-value: 50%;
    }

    :root,
    #etherx-studio,
    [data-theme="light"],
    #etherx-studio[data-theme="light"] {
      color-scheme: light;
      --md-bg: #e7eaf0;
      --md-surface-low: #ffffff;
      --md-surface: #ffffff;
      --md-surface-high: #eff1f5;
      --md-surface-highest: #dfe3eb;
      --md-field: #f6f7fa;
      --md-ink: #1d1d1f;
      --md-ink-var: #3f4148;
      --md-muted: #575b64;
      --md-outline: #767b87;
      --md-hairline: rgba(15, 23, 42, .12);
      --md-hairline-strong: rgba(15, 23, 42, .22);
      --md-primary: #0066cc;
      --md-primary-hover: #0071e3;
      --md-primary-active: #0052a8;
      --md-on-primary: #ffffff;
      --md-primary-container: rgba(0, 102, 204, .11);
      --md-on-primary-container: #004e9e;
      --md-accent: #0066cc;
      --md-good: #1f7a34;
      --md-good-bg: rgba(31, 122, 52, .10);
      --md-good-container: #e3f7e8;
      --md-good-ink: #145e25;
      --md-good-line: #28a745;
      --md-err: #c91826;
      --md-err-bg: rgba(201, 24, 38, .09);
      --md-err-container: #fde8e8;
      --md-err-ink: #9c0d18;
      --toggle-track: #dfe3eb;
      --toggle-thumb-bg: #ffffff;
      --canvas-grad: radial-gradient(ellipse 85% 420px at 50% -90px, rgba(0, 113, 227, .11), transparent 72%);
      --rim-top: inset 0 1px 0 rgba(255, 255, 255, .85);
      --rim-hi: inset 0 1px 0 rgba(255, 255, 255, 1);
      --md-elev-1: 0 2px 10px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
      --md-elev-2: 0 8px 24px rgba(15, 23, 42, .10);
      --r-xl: 18px;
      --r-lg: 12px;
      --r-md: 10px;
      --r-sm: 8px;
      --md-ease: cubic-bezier(.2, 0, 0, 1);
      --md-decel: cubic-bezier(.05, .7, .1, 1);
      --md-spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.077, 1.106 28.4%, 1.051 35%, 0.986 52.8%, 1);
      --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
      --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
      font-family: var(--sans);
      accent-color: var(--md-primary);
    }

    [data-theme="dark"],
    #etherx-studio[data-theme="dark"] {
      color-scheme: dark;
      --md-bg: #070709;
      --md-surface-low: #101014;
      --md-surface: #16161b;
      --md-surface-high: #1f1f27;
      --md-surface-highest: #2b2b35;
      --md-field: #15151a;
      --md-ink: #f5f5f7;
      --md-ink-var: #d1d1d8;
      --md-muted: #9898a0;
      --md-outline: #707078;
      --md-hairline: rgba(255, 255, 255, .10);
      --md-hairline-strong: rgba(255, 255, 255, .20);
      --md-primary: #0071e3;
      --md-primary-hover: #0a84ff;
      --md-primary-active: #0060c4;
      --md-on-primary: #ffffff;
      --md-primary-container: rgba(0, 113, 227, .18);
      --md-on-primary-container: #7ac0ff;
      --md-accent: #0a84ff;
      --md-good: #30d158;
      --md-good-bg: rgba(48, 209, 88, .13);
      --md-good-container: #13311d;
      --md-good-ink: #9bf0b0;
      --md-good-line: #28a745;
      --md-err: #ff453a;
      --md-err-bg: rgba(255, 69, 58, .13);
      --md-err-container: #4a1615;
      --md-err-ink: #ffb3ae;
      --toggle-track: #262630;
      --toggle-thumb-bg: #32323c;
      --canvas-grad: radial-gradient(ellipse 85% 420px at 50% -90px, rgba(0, 113, 227, .16), transparent 72%);
      --rim-top: inset 0 1px 0 rgba(255, 255, 255, .07);
      --rim-hi: inset 0 1px 0 rgba(255, 255, 255, .13);
      --md-elev-1: 0 2px 10px rgba(0, 0, 0, .48);
      --md-elev-2: 0 8px 24px rgba(0, 0, 0, .60);
    }

    #etherx-studio,
    #etherx-studio * {
      box-sizing: border-box;
    }

    * {
      box-sizing: border-box;
    }

      ::selection {
        background: var(--md-primary);
        color: var(--md-on-primary);
      }

      html {
        -webkit-text-size-adjust: 100%;
        overflow-x: clip;
        scroll-behavior: smooth;
        scrollbar-color: var(--md-outline) var(--md-bg);
        scrollbar-width: thin;
      }

      body {
        margin: 0;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: clip;
        background: var(--md-bg);
        color: var(--md-ink);
        font-family: var(--sans);
        font-size: 14px;
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }

      #etherx-studio button,
      #etherx-studio input,
      #etherx-studio select,
      button,
      input,
      select {
        font: inherit;
        color: inherit;
      }

      #etherx-studio button,
      #etherx-studio select,
      button,
      select {
        cursor: pointer;
      }

      #etherx-studio a,
      a {
        color: inherit;
        text-decoration: none;
      }

      #etherx-studio p,
      p {
        color: var(--md-ink-var);
      }

      #etherx-studio h1,
      #etherx-studio h2,
      #etherx-studio h3,
      #etherx-studio label,
      #etherx-studio .field-label {
        color: var(--md-ink);
        opacity: 1;
      }

      #etherx-studio svg,
      svg {
        display: block;
        flex-shrink: 0;
      }

      :focus-visible {
        outline: 2px solid var(--md-accent);
        outline-offset: 2px;
      }

      button:disabled,
      input:disabled,
      select:disabled {
        opacity: .42;
        cursor: not-allowed;
      }

      svg {
        display: block;
      }

      .visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
      }

      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }

      @keyframes mdPulse {
        50% {
          opacity: .35;
          transform: scale(.82);
        }
      }

      @keyframes mdIndeterminate {
        0% {
          transform: translateX(-100%) scaleX(.35);
        }

        60% {
          transform: translateX(40%) scaleX(.65);
        }

        100% {
          transform: translateX(120%) scaleX(.35);
        }
      }

      .shell {
        width: min(1120px, 100%);
        margin: 0 auto;
        padding: 0 12px 32px;
      }

      .topbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px 20px;
        padding: 18px 2px 16px;
        margin-bottom: 12px;
        border-bottom: 1px solid var(--md-hairline);
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
      }

      .mark {
        position: relative;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        display: grid;
        place-items: center;
        border-radius: 11px;
        overflow: hidden;
        background: #101216;
        border: 1px solid rgba(255, 255, 255, .16);
        box-shadow: 0 2px 8px rgba(0, 0, 0, .24);
        transition: border-color .22s var(--md-ease), transform .22s var(--md-ease);
      }

      .mark svg {
        position: relative;
        z-index: 1;
        width: 24px;
        height: 24px;
        display: block;
      }

      .brand:hover .mark {
        border-color: var(--md-primary);
      }

      .brand-text {
        min-width: 0;
      }

      .brand-name {
        font-size: 18px;
        font-weight: 600;
        line-height: 1.15;
        letter-spacing: -.02em;
        white-space: nowrap;
        color: var(--md-ink);
      }

      .brand-name b {
        color: var(--md-ink);
        font-weight: 700;
      }

      .brand-sub {
        font-size: 11px;
        color: var(--md-muted);
        letter-spacing: .04em;
        margin-top: 2px;
        white-space: nowrap;
        font-weight: 500;
      }

      .top-right {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        width: 100%;
        min-width: 0;
      }

      .top-status {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
        gap: 8px;
        width: 100%;
        min-width: 0;
      }

      #etherx-studio .connect-gmail-btn {
        grid-column: 1 / -1;
        order: 3;
        width: 100%;
        max-width: 100%;
        justify-content: center;
      }

      .bridge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 38px;
        padding: 5px 13px;
        border-radius: var(--r-md);
        border: 1px solid var(--md-hairline);
        width: 100%;
        min-width: 0;
        background: var(--md-surface);
        color: var(--md-ink-var);
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease);
      }

      .bridge::before {
        content: '';
        width: 7px;
        height: 7px;
        flex: 0 0 7px;
        border-radius: 50%;
        background: var(--md-outline);
      }

      .bridge[data-ok=true] {
        background: var(--md-good-bg);
        border-color: color-mix(in srgb, var(--md-good) 35%, transparent);
        color: var(--md-good-ink);
      }

      .bridge[data-ok=true]::before {
        background: var(--md-good);
      }

      .bridge[data-ok=false] {
        background: var(--md-surface);
        border-color: var(--md-hairline);
        color: var(--md-muted);
      }

      .bridge[data-ok=false]::before {
        background: var(--md-outline);
      }

      #etherx-studio .drive-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 38px;
        padding: 5px 14px;
        border-radius: var(--r-md);
        border: 1px solid var(--md-hairline-strong);
        width: 100%;
        min-width: 0;
        background: var(--md-surface);
        color: var(--md-ink);
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        box-shadow: var(--rim-top);
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .drive-btn:hover:not(:disabled) {
        background: var(--md-surface-high);
        border-color: color-mix(in srgb, var(--md-primary) 50%, transparent);
      }

      #etherx-studio .drive-btn:active:not(:disabled) {
        transform: scale(.985);
      }

      #etherx-studio .drive-btn svg {
        width: 15px;
        height: 15px;
        flex: 0 0 15px;
        color: var(--md-ink-var);
      }

      #etherx-studio .drive-btn[data-loading=true] svg {
        animation: mdPulse .9s ease-in-out infinite;
      }

      #etherx-studio .drive-btn[data-mounted=true] {
        border-color: color-mix(in srgb, var(--md-good) 45%, transparent);
        background: var(--md-good-container);
        color: var(--md-good-ink);
      }

      #etherx-studio .drive-btn[data-mounted=true]:hover:not(:disabled) {
        background: color-mix(in srgb, var(--md-good-ink) 8%, var(--md-good-container));
      }

      #etherx-studio .drive-btn[data-mounted=true] svg {
        color: var(--md-good);
      }

      .socials {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        width: 100%;
      }

      #etherx-studio a.social-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 36px;
        padding: 5px 12px;
        border-radius: var(--r-md);
        border: 1px solid var(--md-hairline-strong);
        background: var(--md-surface);
        color: var(--md-ink);
        font-size: 12.5px;
        font-weight: 500;
        white-space: nowrap;
        box-shadow: var(--rim-top);
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease);
      }

      #etherx-studio a.social-link:hover {
        background: var(--md-surface-high);
        border-color: var(--md-outline);
        color: var(--md-ink);
      }

      #etherx-studio a.social-link svg {
        width: 15px;
        height: 15px;
        flex: 0 0 15px;
        color: var(--md-primary);
      }

      #etherx-studio button.theme-switch {
        position: relative;
        width: 58px;
        height: 32px;
        flex: 0 0 58px;
        border-radius: 9999px;
        background: var(--toggle-track);
        border: 1px solid var(--md-hairline-strong);
        color: var(--md-ink);
        display: grid;
        grid-template-columns: 24px 24px;
        align-items: center;
        justify-items: center;
        gap: 2px;
        padding: 3px;
        margin: 0;
        line-height: 0;
        cursor: pointer;
        transition: background-color .24s var(--md-ease), border-color .24s var(--md-ease);
      }

      #etherx-studio button.theme-switch:hover {
        border-color: var(--md-outline);
      }

      #etherx-studio .theme-switch-thumb {
        position: absolute;
        top: 3px;
        left: 3px;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--toggle-thumb-bg);
        box-shadow: 0 2px 6px rgba(0, 0, 0, .25), 0 0 0 1px var(--md-hairline);
        transition: transform .32s cubic-bezier(.34, 1.45, .64, 1), background-color .24s var(--md-ease);
        z-index: 1;
        pointer-events: none;
      }

      [data-theme="dark"] #etherx-studio .theme-switch-thumb,
      #etherx-studio[data-theme="dark"] .theme-switch-thumb {
        transform: translateX(26px);
      }

      [data-theme="light"] #etherx-studio .theme-switch-thumb,
      #etherx-studio[data-theme="light"] .theme-switch-thumb {
        transform: translateX(0);
      }

      #etherx-studio .theme-switch-icon {
        position: relative;
        z-index: 2;
        width: 24px;
        height: 24px;
        display: grid;
        place-items: center;
        padding: 0;
        margin: 0;
        line-height: 0;
        color: var(--md-muted);
        transition: color .2s var(--md-ease);
        pointer-events: none;
      }

      #etherx-studio .theme-switch-icon svg {
        width: 14px;
        height: 14px;
        display: block;
        margin: 0;
        flex: 0 0 14px;
      }

      [data-theme="light"] #etherx-studio .theme-switch-icon.sun-icon,
      #etherx-studio[data-theme="light"] .theme-switch-icon.sun-icon,
      [data-theme="dark"] #etherx-studio .theme-switch-icon.moon-icon,
      #etherx-studio[data-theme="dark"] .theme-switch-icon.moon-icon {
        color: var(--md-ink);
      }

      /* Material 3 Segmented Pipeline Stepper */
      .pipeline {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: center;
        gap: 6px;
        margin: 0 0 16px;
        padding: 5px;
        border-radius: var(--r-lg);
        background: var(--md-surface-low);
        border: 1px solid var(--md-hairline);
        box-shadow: var(--rim-top);
      }

      .pipe-sep {
        display: none;
      }

      #etherx-studio .pipe-step {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 46px;
        padding: 8px 10px;
        border-radius: var(--r-md);
        border: 1px solid transparent;
        background: transparent;
        text-align: left;
        min-width: 0;
        color: var(--md-muted);
        transition: background-color .22s var(--md-ease), color .22s var(--md-ease), border-color .22s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .pipe-step:hover:not(:disabled):not([aria-current=step]) {
        background: color-mix(in srgb, var(--md-ink) 5%, transparent);
        color: var(--md-ink);
      }

      #etherx-studio .pipe-step:active:not(:disabled) {
        transform: scale(.985);
      }

      #etherx-studio .pipe-step[aria-current=step] {
        background: var(--md-surface-high);
        border-color: color-mix(in srgb, var(--md-primary) 42%, transparent);
        box-shadow: var(--rim-top), 0 2px 8px rgba(0, 0, 0, .14);
        color: var(--md-ink);
      }

      .pipe-num {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
        display: grid;
        place-items: center;
        border-radius: 7px;
        background: var(--md-surface-high);
        font: 600 11px var(--mono);
        font-variant-numeric: tabular-nums;
        color: var(--md-muted);
        transition: background-color .22s var(--md-ease), color .22s var(--md-ease);
      }

      .pipe-step[aria-current=step] .pipe-num {
        background: var(--md-primary);
        color: var(--md-on-primary);
        font-weight: 700;
      }

      .pipe-step[data-complete=true]:not([aria-current=step]) .pipe-num {
        background: var(--md-good-container);
        color: var(--md-good);
      }

      .pipe-copy {
        min-width: 0;
        display: grid;
        gap: 1px;
      }

      .pipe-copy strong {
        display: block;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .pipe-copy small {
        display: none;
        font-size: 11px;
        font-weight: 400;
        color: var(--md-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .pipe-step[aria-current=step] .pipe-copy small {
        color: color-mix(in srgb, var(--md-on-primary-container) 78%, transparent);
      }

      /* Windows & Tonal Surface Cards */
      .windows {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
      }

      .windows>* {
        min-width: 0;
      }

      .win[hidden] {
        display: none;
      }

      .win {
        overflow: hidden;
        opacity: 1;
        transform: none;
        transition: opacity .26s var(--md-decel), transform .26s var(--md-decel);
      }

      @starting-style {
        .win {
          opacity: 0;
          transform: translateY(6px);
        }
      }

      .card {
        position: relative;
        border-radius: var(--r-xl);
        border: 1px solid var(--md-hairline);
        background: var(--md-surface-low);
        box-shadow: var(--rim-top), var(--md-elev-1);
      }

      .win-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px 12px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--md-hairline);
      }

      .win-bar-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
      }

      .label-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        color: var(--md-muted);
        letter-spacing: .04em;
        font-size: 11px;
        font-weight: 600;
      }

      .label-row .mono {
        font-family: var(--mono);
        font-weight: 500;
        color: var(--md-muted);
        padding: 2px 8px;
        border-radius: 9999px;
        background: var(--md-surface-high);
      }

      /* Window 1: Tool Selector */
      .win-tools-body {
        padding: 18px;
        display: grid;
        gap: 12px;
      }

      .tool-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
      }

      #etherx-studio .tool {
        position: relative;
        display: flex;
        align-items: center;
        gap: 13px;
        min-height: 58px;
        padding: 11px 14px;
        border-radius: var(--r-lg);
        text-align: left;
        width: 100%;
        min-width: 0;
        background: var(--md-surface);
        box-shadow: var(--rim-top);
        color: var(--md-ink-var);
        border: 1px solid var(--md-hairline);
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), box-shadow .2s var(--md-ease), color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .tool:hover:not(:disabled) {
        background: var(--md-surface-high);
        border-color: var(--md-hairline-strong);
        color: var(--md-ink);
        transform: translateY(-1px);
      }

      #etherx-studio .tool:active:not(:disabled) {
        transform: scale(.99);
      }

      #etherx-studio .tool[aria-selected=true] {
        background: color-mix(in srgb, var(--md-primary) 9%, var(--md-surface));
        border-color: color-mix(in srgb, var(--md-primary) 58%, transparent);
        box-shadow: var(--rim-hi), 0 4px 16px rgba(0, 113, 227, .12);
        color: var(--md-ink);
      }

      .tool-icon {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        display: grid;
        place-items: center;
        border-radius: var(--r-md);
        background: var(--md-surface-high);
        border: 1px solid var(--md-hairline);
        color: var(--md-ink-var);
        transition: background-color .22s var(--md-ease), border-color .22s var(--md-ease), color .22s var(--md-ease), transform .22s var(--md-spring);
      }

      .tool-icon svg {
        width: 18px;
        height: 18px;
      }

      .tool:hover:not(:disabled) .tool-icon {
        background: var(--md-surface-highest);
        color: var(--md-ink);
      }

      .tool[aria-selected=true] .tool-icon {
        background: var(--md-primary);
        border-color: var(--md-primary);
        color: var(--md-on-primary);
      }

      .tool-text {
        min-width: 0;
        flex: 1 1 auto;
        display: block;
      }

      .tool-name {
        display: block;
        font-weight: 600;
        font-size: 13.5px;
        line-height: 1.25;
        letter-spacing: -.01em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--md-ink);
      }

      .win-foot {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 16px;
        border-top: 1px solid var(--md-hairline);
      }

      #etherx-studio .btn-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 40px;
        padding: 6px 15px;
        border-radius: var(--r-md);
        border: 1px solid var(--md-hairline-strong);
        background: var(--md-surface);
        color: var(--md-ink);
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        box-shadow: var(--rim-top);
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .btn-back svg {
        width: 15px;
        height: 15px;
        flex: 0 0 15px;
        color: var(--md-ink-var);
      }

      #etherx-studio .btn-back:hover:not(:disabled) {
        background: var(--md-surface-high);
        border-color: var(--md-outline);
      }

      #etherx-studio .btn-back:active:not(:disabled) {
        transform: scale(.985);
      }

      #etherx-studio .btn-sec {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 42px;
        padding: 6px 20px;
        border-radius: var(--r-md);
        border: 1px solid var(--md-primary-active);
        background: var(--md-primary);
        color: var(--md-on-primary);
        font-size: 13.5px;
        font-weight: 600;
        white-space: nowrap;
        box-shadow: 0 2px 10px rgba(0, 102, 204, .26);
        transition: background-color .2s var(--md-ease), box-shadow .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .btn-sec:hover:not(:disabled) {
        background: var(--md-primary-hover);
        box-shadow: 0 4px 16px rgba(0, 102, 204, .34);
      }

      #etherx-studio .btn-sec:active:not(:disabled) {
        transform: scale(.985);
        background: var(--md-primary-active);
      }

      .head-nav {
        display: grid;
        gap: 4px;
        min-width: 0;
      }

      .win-exec-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        align-items: center;
      }

      .field-error {
        margin: 10px 0 0;
        padding: 10px 14px;
        border-radius: var(--r-md);
        background: var(--md-err-bg);
        color: var(--md-err);
        font-size: 12.5px;
        font-weight: 500;
        transition: opacity .2s var(--md-decel), transform .2s var(--md-decel);
      }

      @starting-style {
        .field-error:not([hidden]) {
          opacity: 0;
          transform: translateY(-4px);
        }
      }

      .field-error[hidden] {
        display: none;
      }

      .proc-body {
        padding: 16px;
        display: grid;
        gap: 14px;
      }

      .proc-top {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
      }

      .proc-btns {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
      }

      .proc-btns:empty {
        display: none;
      }

      .proc-empty-btn[hidden] {
        display: none;
      }

      /* Stage Header & Tonal Step Badges */
      .stage-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 14px;
        padding: 18px 16px 16px;
        border-bottom: 1px solid var(--md-hairline);
      }

      #etherx-studio .stage-head h1 {
        font-size: clamp(21px, 3.6vw, 27px);
        font-weight: 600;
        line-height: 1.18;
        letter-spacing: -.025em;
        margin: 0;
        color: var(--md-ink);
      }

      #etherx-studio .stage-head p {
        color: var(--md-ink-var);
        font-size: 13px;
        margin: 4px 0 0;
        max-width: 62ch;
        line-height: 1.48;
      }

      .step {
        font: 500 11.5px var(--mono);
        font-variant-numeric: tabular-nums;
        color: var(--md-muted);
        white-space: nowrap;
        padding: 4px 10px;
        border-radius: var(--r-sm);
        border: 1px solid var(--md-hairline);
        background: var(--md-surface-high);
      }

      .stage-body {
        display: grid;
        gap: 0;
      }

      .block {
        padding: 16px;
      }

      .block+.block {
        border-top: 1px solid var(--md-hairline);
      }

      .block-head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 0 12px;
      }

      .block-index {
        min-width: 26px;
        height: 22px;
        padding: 0 6px;
        flex: 0 0 auto;
        display: grid;
        place-items: center;
        border-radius: 6px;
        background: var(--md-surface-high);
        border: 1px solid var(--md-hairline-strong);
        color: var(--md-ink-var);
        font: 600 10.5px var(--mono);
        font-variant-numeric: tabular-nums;
        letter-spacing: .02em;
      }

      .field-label {
        display: block;
        font-weight: 600;
        font-size: 13px;
        margin: 0;
        color: var(--md-ink);
      }

      /* M3 Source Upload Dropzone & Filled Path Input */
      .drop {
        position: relative;
        display: flex;
        align-items: center;
        gap: 14px;
        min-height: 88px;
        padding: 16px;
        border-radius: var(--r-lg);
        cursor: pointer;
        border: 1.5px dashed color-mix(in srgb, var(--md-primary) 34%, transparent);
        background: color-mix(in srgb, var(--md-primary) 4%, var(--md-surface));
        transition: border-color .2s var(--md-ease), background-color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      .drop:hover,
      .drop.dragover {
        border-style: solid;
        border-color: var(--md-primary);
        background: color-mix(in srgb, var(--md-primary) 10%, var(--md-surface));
      }

      .drop:active {
        transform: scale(.994);
      }

      .drop:focus-visible {
        border-style: solid;
        border-color: var(--md-primary);
        outline: 2px solid var(--md-primary);
        outline-offset: 2px;
      }

      .drop-icon {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        display: grid;
        place-items: center;
        border-radius: var(--r-md);
        background: var(--md-primary-container);
        color: var(--md-on-primary-container);
        transition: transform .22s var(--md-spring), background-color .2s var(--md-ease), color .2s var(--md-ease);
      }

      .drop:hover .drop-icon,
      .drop.dragover .drop-icon {
        background: var(--md-primary);
        color: var(--md-on-primary);
      }

      .drop-icon svg {
        width: 19px;
        height: 19px;
      }

      .drop-text {
        display: grid;
        gap: 2px;
        min-width: 0;
      }

      .drop strong {
        font-size: 13.5px;
        font-weight: 600;
        color: var(--md-ink);
      }

      .drop em {
        font-style: normal;
        color: var(--md-primary);
        text-decoration: underline;
        text-underline-offset: 3px;
        text-decoration-thickness: 1.5px;
      }

      .drop span {
        font-size: 12px;
        color: var(--md-muted);
      }

      .or {
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--md-muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .08em;
        font-weight: 600;
        margin: 13px 0 11px;
      }

      .or::before,
      .or::after {
        content: '';
        height: 1px;
        flex: 1;
        background: var(--md-hairline);
      }

      .path-wrap {
        position: relative;
      }

      .drop[hidden],
      .or[hidden] {
        display: none;
      }

      .path-wrap svg {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
        height: 16px;
        color: var(--md-muted);
        pointer-events: none;
        transition: color .2s var(--md-ease);
      }

      .path-wrap:focus-within svg {
        color: var(--md-primary);
      }

      #etherx-studio .path-wrap input[type=text] {
        padding-left: 40px;
        font-family: var(--mono);
        font-size: 12.5px;
      }

      #etherx-studio input[type=text],
      #etherx-studio input[type=number],
      #etherx-studio select {
        background-color: var(--md-field);
        border: 1px solid var(--md-hairline-strong);
        color: var(--md-ink);
        border-radius: var(--r-md);
        min-height: 46px;
        width: 100%;
        padding: 9px 13px;
        min-width: 0;
        transition: border-color .2s var(--md-ease), box-shadow .2s var(--md-ease), background-color .2s var(--md-ease);
      }

      #etherx-studio input[type=text]:hover:not(:disabled),
      #etherx-studio input[type=number]:hover:not(:disabled),
      #etherx-studio select:hover:not(:disabled) {
        border-color: var(--md-outline);
        background-color: var(--md-surface-high);
      }

      #etherx-studio input[type=text]:focus,
      #etherx-studio input[type=number]:focus,
      #etherx-studio select:focus {
        border-color: var(--md-primary);
        background-color: var(--md-surface-high);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-primary) 26%, transparent);
        outline: none;
      }

      #etherx-studio input[type=number] {
        font-family: var(--mono);
        font-variant-numeric: tabular-nums;
        font-weight: 500;
        font-size: 13px;
      }

      #etherx-studio input::placeholder {
        color: var(--md-muted);
      }

      #etherx-studio select,
      #etherx-studio select:hover:not(:disabled),
      #etherx-studio select:focus {
        appearance: none;
        -webkit-appearance: none;
        padding-right: 36px;
        font-weight: 500;
        font-size: 13px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 13px center;
        background-size: 12px 12px;
      }

      [data-theme="dark"] #etherx-studio select,
      [data-theme="dark"] #etherx-studio select:hover:not(:disabled),
      [data-theme="dark"] #etherx-studio select:focus,
      #etherx-studio[data-theme="dark"] select,
      #etherx-studio[data-theme="dark"] select:hover:not(:disabled),
      #etherx-studio[data-theme="dark"] select:focus {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c2c6d0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 13px center;
        background-size: 12px 12px;
      }

      select option {
        background: var(--md-surface-high);
        color: var(--md-ink);
      }

      .helper {
        color: var(--md-muted);
        font-size: 12px;
        margin: 0;
      }

      .selected-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
      }

      .selected-row:has(#selected-file:empty) {
        display: none;
      }

      #selected-file:empty {
        display: none;
      }

      #selected-file:not(:empty) {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 14px;
        border-radius: 9999px;
        background: var(--md-good-bg);
        border: 1px solid color-mix(in srgb, var(--md-good) 36%, transparent);
        color: var(--md-good-ink);
        font-size: 12px;
        font-weight: 500;
        max-width: 100%;
        overflow-wrap: anywhere;
      }

      #selected-file:not(:empty)::before {
        content: '';
        width: 7px;
        height: 7px;
        flex: 0 0 7px;
        border-radius: 50%;
        background: var(--md-good);
      }

      #etherx-studio .clear-file {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        min-height: 32px;
        padding: 4px 11px;
        border-radius: var(--r-sm);
        border: 1px solid var(--md-hairline-strong);
        background: var(--md-surface-high);
        color: var(--md-ink-var);
        font-size: 11.5px;
        font-weight: 500;
        transition: background-color .18s var(--md-ease), border-color .18s var(--md-ease), color .18s var(--md-ease);
      }

      #etherx-studio .clear-file:hover {
        background: var(--md-err-bg);
        border-color: color-mix(in srgb, var(--md-err) 40%, transparent);
        color: var(--md-err-ink);
      }

      .clear-file[hidden] {
        display: none;
      }

      .drop-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
      }

      .drop-actions[hidden] {
        display: none;
      }

      .clip-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 8px;
      }

      .clip-chips[hidden] {
        display: none;
      }

      .clip-chip {
        display: inline-flex;
        align-items: center;
        padding: 5px 10px;
        border-radius: var(--r-sm);
        background: var(--md-surface-high);
        border: 1px solid var(--md-hairline);
        font: 500 11.5px var(--mono);
        color: var(--md-ink-var);
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      /* Clean Flat Parameter Grid & Authentic Material 3 Switches */
      .settings {
        display: grid;
        gap: 14px;
      }

      .settings-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px 14px;
      }

      .settings-grid:empty {
        display: none;
      }

      .settings-grid .field-pair {
        grid-column: 1/-1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px 14px;
      }

      .settings-grid .field-triple {
        grid-column: 1/-1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 15px 14px;
      }

      .settings-grid>label,
      .settings-grid .field-pair>label,
      .settings-grid .field-triple>label,
      .settings-grid>.field-card {
        display: grid;
        gap: 6px;
        align-content: start;
        min-width: 0;
        padding: 0;
        border: 0;
        background: transparent;
      }

      .settings-grid .field-card.wide,
      .settings-grid>label.wide,
      .settings-grid .field-pair>label.wide,
      .settings-grid .field-triple>label.wide {
        grid-column: 1/-1;
      }

      .settings-grid .field-label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 11.5px;
        letter-spacing: .015em;
        color: var(--md-muted);
        font-weight: 500;
        margin: 0;
        transition: color .18s var(--md-ease);
      }

      .settings-grid>label:focus-within .field-label,
      .settings-grid .field-pair>label:focus-within .field-label,
      .settings-grid .field-triple>label:focus-within .field-label,
      .settings-grid>.field-card:focus-within .field-label {
        color: var(--md-accent);
      }

      @media(max-width:759px) {
        .settings-grid .field-triple {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }

      @media(max-width:599px) {
        .settings-grid,
        .settings-grid .field-pair,
        .settings-grid .field-triple {
          grid-template-columns: minmax(0, 1fr);
        }
      }

      .settings-grid>.range-card {
        display: grid;
        gap: 2px;
        padding: 10px 13px 4px;
        border-radius: var(--r-md);
        background: var(--md-field);
        border: 1px solid var(--md-hairline-strong);
        transition: border-color .2s var(--md-ease), background-color .2s var(--md-ease);
      }

      .settings-grid>.range-card:hover {
        border-color: var(--md-outline);
        background: var(--md-surface-high);
      }

      .settings-grid>.range-card:has(.range-input:focus-within) {
        border-color: var(--md-primary);
        background: var(--md-surface-high);
      }

      .range-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .params-card {
        grid-column: 1 / -1;
        display: grid;
        background: var(--md-field);
        border: 1px solid var(--md-hairline-strong);
        border-radius: var(--r-md);
        overflow: hidden;
      }

      .params-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 11px 16px;
        border-bottom: 1px solid var(--md-hairline);
      }

      .params-title {
        font-size: 11.5px;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--md-primary);
        font-weight: 600;
      }

      #etherx-studio .params-reset {
        background: var(--md-surface);
        border: 1px solid var(--md-hairline-strong);
        color: var(--md-ink-var);
        border-radius: var(--r-sm);
        padding: 4px 11px;
        min-height: 28px;
        font-size: 11.5px;
        font-weight: 500;
        cursor: pointer;
        transition: color .18s var(--md-ease), border-color .18s var(--md-ease), background-color .18s var(--md-ease);
      }

      #etherx-studio .params-reset:hover:not(:disabled) {
        color: var(--md-ink);
        border-color: var(--md-outline);
        background: var(--md-surface-high);
      }

      .params-list {
        display: grid;
      }

      .param-row {
        display: grid;
        grid-template-columns: minmax(145px, 180px) minmax(0, 1fr) auto;
        align-items: center;
        gap: 14px;
        padding: 2px 16px;
        min-height: 46px;
        transition: background-color .18s var(--md-ease);
      }

      .param-row + .param-row {
        border-top: 1px solid var(--md-hairline);
      }

      .param-row:hover {
        background: color-mix(in srgb, var(--md-surface-high) 55%, transparent);
      }

      .param-row:has(.range-input:focus-visible),
      .param-row:has(.range-num:focus) {
        background: var(--md-surface-high);
      }

      .settings-grid .param-row .field-label {
        font-size: 12.5px;
        color: var(--md-ink-var);
        white-space: nowrap;
      }

      .param-row:has(.range-input:focus-within) .field-label,
      .param-row:has(.range-num:focus) .field-label {
        color: var(--md-primary);
      }

      #etherx-studio .range-num,
      #etherx-studio input[type=number].range-num {
        width: 66px;
        min-width: 66px;
        min-height: 32px;
        padding: 4px 8px;
        font: 600 12.5px var(--mono);
        font-variant-numeric: tabular-nums;
        color: var(--md-ink);
        background: var(--md-surface-low);
        border: 1px solid var(--md-hairline-strong);
        border-radius: var(--r-sm);
        text-align: center;
        line-height: 1.3;
        -moz-appearance: textfield;
      }

      input[type=number].range-num::-webkit-inner-spin-button,
      input[type=number].range-num::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
      }

      #etherx-studio input[type=number].range-num:hover:not(:disabled) {
        border-color: var(--md-outline);
        background: var(--md-surface);
      }

      #etherx-studio input[type=number].range-num:focus {
        border-color: var(--md-primary);
        background: var(--md-surface);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-primary) 24%, transparent);
        outline: none;
      }

      .range-val {
        font: 600 12px var(--mono);
        font-variant-numeric: tabular-nums;
        color: var(--md-ink);
        background: var(--md-surface);
        border: 1px solid var(--md-hairline);
        border-radius: 6px;
        padding: 2px 8px;
        min-width: 40px;
        text-align: center;
        line-height: 1.35;
      }

      .range-wrap {
        position: relative;
        width: 100%;
        height: 44px;
        display: flex;
        align-items: center;
        touch-action: pan-y;
      }

      .range-track {
        position: relative;
        width: 100%;
        height: 4px;
        border-radius: 9999px;
        background: var(--md-surface-highest);
        overflow: hidden;
        transition: height .14s var(--md-ease);
      }

      .range-wrap:hover .range-track {
        height: 6px;
      }

      .range-wrap:has(.range-input:focus-visible) .range-track {
        outline: 2px solid var(--md-primary);
        outline-offset: 4px;
      }

      .range-fill {
        position: absolute;
        top: 0;
        bottom: 0;
        left: var(--range-start, 0%);
        width: var(--range-width, 0%);
        border-radius: 9999px;
        background: var(--md-primary);
      }

      input[type=range].range-input {
        appearance: none;
        -webkit-appearance: none;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        outline: none !important;
        cursor: pointer;
      }

      input[type=range].range-input::-webkit-slider-runnable-track {
        height: 4px;
        border: 0;
        background: transparent;
        box-shadow: none;
      }

      input[type=range].range-input::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: var(--md-primary);
        border: 2px solid var(--md-bg);
        margin-top: -6px;
        box-shadow: var(--md-elev-1);
        transition: transform .16s var(--md-spring);
      }

      .range-wrap:hover input[type=range].range-input::-webkit-slider-thumb,
      input[type=range].range-input:active::-webkit-slider-thumb {
        transform: scale(1.18);
      }

      input[type=range].range-input::-moz-range-track {
        height: 4px;
        border: 0;
        background: transparent;
        box-shadow: none;
      }

      input[type=range].range-input::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: var(--md-primary);
        border: 2px solid var(--md-bg);
        box-shadow: var(--md-elev-1);
      }

      .field-group-title {
        grid-column: 1/-1;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 11.5px;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--md-primary);
        font-weight: 600;
        padding: 12px 0 2px;
        margin-top: 2px;
      }

      .field-group-title::after {
        content: '';
        height: 1px;
        flex: 1;
        background: var(--md-hairline);
      }

      .field-group-title:first-child {
        padding-top: 0;
        margin-top: 0;
      }

      .switches {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
      }

      .switches:empty {
        display: none;
      }

      .check {
        display: inline-flex;
        align-items: center;
        gap: 11px;
        min-height: 44px;
        padding: 7px 14px;
        border-radius: var(--r-md);
        background: var(--md-surface);
        border: 1px solid var(--md-hairline);
        box-shadow: var(--rim-top);
        color: var(--md-ink-var);
        font-size: 12.5px;
        font-weight: 500;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        max-width: 100%;
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease);
      }

      .check-label {
        min-width: 0;
        flex: 1 1 auto;
        overflow-wrap: anywhere;
        line-height: 1.35;
      }

      .check:hover {
        background: var(--md-surface-high);
        border-color: var(--md-hairline-strong);
        color: var(--md-ink);
      }

      .check input {
        appearance: none;
        -webkit-appearance: none;
        position: relative;
        margin: 0;
        width: 40px;
        height: 22px;
        flex: 0 0 40px;
        border-radius: 9999px;
        background: var(--md-surface-highest);
        border: 1px solid var(--md-hairline-strong);
        cursor: pointer;
        transition: background-color .22s var(--md-ease), border-color .22s var(--md-ease);
      }

      .check input::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 3px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--md-muted);
        transform: translateY(-50%);
        transition: transform .26s var(--md-spring), width .22s var(--md-spring), height .22s var(--md-spring), background-color .2s var(--md-ease);
      }

      .check input:checked {
        background: var(--md-primary);
        border-color: var(--md-primary);
      }

      .check input:checked::before {
        width: 14px;
        height: 14px;
        transform: translate(18px, -50%);
        background: var(--md-on-primary);
      }

      .check.is-checked,
      .check:has(input:checked) {
        background: var(--md-surface);
        border-color: color-mix(in srgb, var(--md-primary) 35%, var(--md-hairline-strong));
        color: var(--md-ink);
      }

      .check:has(input:disabled) {
        opacity: .42;
        cursor: not-allowed;
      }

      .note {
        display: flex;
        gap: 10px;
        align-items: flex-start;
        padding: 11px 14px;
        border-radius: var(--r-md);
        background: var(--md-surface);
        border: 1px solid var(--md-hairline);
        color: var(--md-ink-var);
        font-size: 12.5px;
        margin: 0;
        line-height: 1.48;
      }

      .note:empty {
        display: none;
      }

      .note::before {
        content: 'i';
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
        display: grid;
        place-items: center;
        border-radius: 9999px;
        background: var(--md-primary-container);
        color: var(--md-on-primary-container);
        font: 600 11px var(--mono);
        margin-top: 1px;
      }

      /* Action Dock & Telemetry Console */
      .exec-actions {
        display: flex;
        align-items: stretch;
        gap: 10px;
      }

      #etherx-studio .run {
        border: 1px solid var(--md-primary-active);
        border-radius: var(--r-lg);
        min-height: 50px;
        flex: 1 1 auto;
        min-width: 0;
        padding: 6px 8px 6px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        background: var(--md-primary);
        color: var(--md-on-primary);
        font-weight: 600;
        font-size: 14px;
        letter-spacing: -.01em;
        box-shadow: 0 2px 14px rgba(0, 102, 204, .28);
        transition: background-color .2s var(--md-ease), transform .16s var(--md-ease), box-shadow .2s var(--md-ease);
      }

      #run-label {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
      }

      #etherx-studio .run:hover:not(:disabled) {
        background: var(--md-primary-hover);
        box-shadow: 0 4px 18px rgba(0, 102, 204, .38);
      }

      #etherx-studio .run:active:not(:disabled) {
        transform: scale(.985);
        background: var(--md-primary-active);
      }

      #etherx-studio .run:focus-visible {
        outline-offset: 3px;
      }

      #etherx-studio .run:disabled {
        opacity: .6;
        box-shadow: none;
      }

      body[data-busy=true] #etherx-studio .run:disabled {
        opacity: .92;
        background: var(--md-primary-container);
        color: var(--md-on-primary-container);
      }

      #etherx-studio .cancel {
        display: none;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 0 0 auto;
        min-height: 46px;
        min-width: 96px;
        padding: 0 20px;
        border-radius: 9999px;
        border: 1px solid color-mix(in srgb, var(--md-err) 55%, transparent);
        background: var(--md-err-container);
        color: var(--md-err-ink);
        font-weight: 600;
        font-size: 13px;
        white-space: nowrap;
        transition: background-color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .cancel:hover:not(:disabled) {
        background: color-mix(in srgb, var(--md-err-ink) 8%, var(--md-err-container));
      }

      #etherx-studio .cancel:active:not(:disabled) {
        transform: scale(.98);
      }

      body[data-busy=true] #etherx-studio .cancel:not([hidden]) {
        display: inline-flex;
      }

      .auto-dl {
        width: 100%;
        min-height: 52px;
        flex-direction: row-reverse;
        justify-content: space-between;
        border-radius: var(--r-md);
        padding: 10px 14px;
      }

      .run-go {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        display: grid;
        place-items: center;
        border-radius: var(--r-sm);
        background: rgba(255, 255, 255, .16);
        color: var(--md-on-primary);
      }

      body[data-busy=true] .run-go {
        color: var(--md-on-primary-container);
      }

      .run-go svg {
        width: 16px;
        height: 16px;
        transition: transform .2s var(--md-spring);
      }

      .run:hover:not(:disabled) .run-go svg.arrow {
        transform: translateX(2px);
      }

      .spin {
        display: none;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
        border-top-color: currentColor;
        animation: spin .8s linear infinite;
      }

      body[data-busy=true] .run-go .arrow {
        display: none;
      }

      body[data-busy=true] .run-go .spin {
        display: block;
      }

      .console {
        display: grid;
        gap: 14px;
        padding: 16px;
        border-radius: var(--r-lg);
        background: var(--md-surface);
        border: 1px solid var(--md-hairline);
        box-shadow: var(--rim-top);
      }

      .status-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
      }

      .status-name {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .06em;
        font-weight: 600;
        color: var(--md-muted);
      }

      .status-sub {
        font-size: 13.5px;
        color: var(--md-ink);
        margin: 4px 0 0;
        overflow-wrap: anywhere;
        font-weight: 500;
        line-height: 1.42;
      }

      .state {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: var(--md-ink-var);
        background: var(--md-surface-high);
        border-radius: 9999px;
        padding: 6px 13px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
        white-space: nowrap;
      }

      .state::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
      }

      .state.busy {
        background: var(--md-primary-container);
        color: var(--md-on-primary-container);
      }

      .state.busy::before {
        animation: mdPulse 1.2s ease-in-out infinite;
      }

      .state.error {
        color: var(--md-err);
        background: var(--md-err-bg);
      }

      .state.done {
        color: var(--md-good);
        background: var(--md-good-bg);
      }

      .prog-meta {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 10px;
        font: 500 12px var(--mono);
        font-variant-numeric: tabular-nums;
      }

      .prog-pct {
        font-size: clamp(20px, 3vw, 26px);
        font-weight: 600;
        line-height: 1.05;
        letter-spacing: -.03em;
        color: var(--md-ink);
      }

      .prog-detail {
        color: var(--md-muted);
        text-align: right;
        overflow-wrap: anywhere;
        font-size: 12px;
      }

      .time-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        font: 500 11.5px var(--mono);
        font-variant-numeric: tabular-nums;
        color: var(--md-muted);
      }

      .time-row>span {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 4px 8px;
        padding: 9px 12px;
        border-radius: var(--r-md);
        background: var(--md-surface-high);
        min-width: 0;
      }

      .time-row b {
        color: var(--md-ink);
        font-size: 12.5px;
        font-weight: 600;
        white-space: nowrap;
      }

      /* Google Material 3 Linear Progress Indicator */
      .progress {
        position: relative;
        height: 6px;
        background: var(--md-surface-highest);
        border-radius: 9999px;
        overflow: hidden;
      }

      .progress span {
        position: absolute;
        inset: 0 auto 0 0;
        height: 100%;
        display: block;
        width: 0;
        border-radius: 9999px;
        background: var(--md-primary);
        transition: width .26s var(--md-ease);
      }

      .progress.indeterminate span {
        width: 100%;
        transform-origin: left center;
        animation: mdIndeterminate 1.5s var(--md-ease) infinite;
      }

      .progress.done span {
        width: 100%;
        background: var(--md-good);
      }

      .progress.error span {
        background: var(--md-err);
      }

      .result {
        display: none;
      }

      .result.visible {
        display: grid;
        gap: 10px;
        padding: 14px;
        border-radius: var(--r-md);
        background: var(--md-good-bg);
        border: 1px solid color-mix(in srgb, var(--md-good) 35%, transparent);
        transition: opacity .24s var(--md-decel), transform .24s var(--md-decel);
      }

      @starting-style {
        .result.visible {
          opacity: 0;
          transform: translateY(6px);
        }
      }

      .result span {
        min-width: 0;
        overflow-wrap: anywhere;
        font: 500 12px var(--mono);
        color: var(--md-good-ink);
      }

      .result-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
      }

      .result-actions[hidden] {
        display: none;
      }

      #etherx-studio .preview-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        border: 1px solid var(--md-hairline-strong);
        border-radius: var(--r-md);
        background: var(--md-surface-high);
        color: var(--md-ink);
        padding: 8px 16px;
        font-size: 13px;
        font-weight: 500;
        min-height: 44px;
        white-space: nowrap;
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .preview-toggle:hover {
        background: var(--md-surface-highest);
        border-color: var(--md-outline);
      }

      #etherx-studio .preview-toggle[hidden] {
        display: none;
      }

      #etherx-studio .download {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: 1 1 180px;
        border: 1px solid var(--md-good-line);
        border-radius: var(--r-md);
        background: var(--md-good-container);
        color: var(--md-good-ink);
        padding: 8px 18px;
        font-size: 13px;
        font-weight: 600;
        min-height: 44px;
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .download:hover {
        border-color: var(--md-good);
        background: color-mix(in srgb, var(--md-good-ink) 8%, var(--md-good-container));
      }

      #etherx-studio .download:active {
        transform: scale(.985);
      }

      #etherx-studio .download span {
        display: inline-block;
        color: inherit;
        transition: transform .18s var(--md-spring);
      }

      #etherx-studio .download:hover span {
        transform: translateY(2px);
      }

      .log-box {
        border: 1px solid var(--md-hairline);
        border-radius: var(--r-md);
        background: var(--md-surface-low);
        overflow: hidden;
        transition: border-color .22s var(--md-ease);
      }

      .log-box[data-open=true] {
        border-color: var(--md-hairline-strong);
      }

      .log-bar {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        gap: 6px;
        flex-wrap: wrap;
        padding: 6px;
        border-bottom: 1px solid transparent;
        transition: border-color .22s var(--md-ease);
      }

      .log-box[data-open=true] .log-bar {
        border-bottom-color: var(--md-hairline);
      }

      #etherx-studio .log-tab {
        flex: 1 1 180px;
        min-width: 0;
        min-height: 44px;
        padding: 6px 8px 6px 10px;
        border: 0;
        border-radius: var(--r-sm);
        background: transparent;
        color: var(--md-ink);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        text-align: left;
        transition: background-color .18s var(--md-ease);
      }

      .log-tab:hover {
        background: color-mix(in srgb, var(--md-ink) 6%, transparent);
      }

      .log-tab:active {
        background: color-mix(in srgb, var(--md-ink) 9%, transparent);
      }

      .log-tab-title {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        flex-wrap: wrap;
      }

      .log-count {
        font: 500 11px/1.2 var(--mono);
        font-variant-numeric: tabular-nums;
        color: var(--md-muted);
        white-space: nowrap;
      }

      .log-tab-right {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
      }

      .log-pill {
        display: inline-flex;
        align-items: center;
        padding: 4px 11px;
        border-radius: 9999px;
        border: 1px solid var(--md-hairline-strong);
        background: var(--md-surface-high);
        color: var(--md-ink-var);
        font-size: 12px;
        font-weight: 500;
        line-height: 1.2;
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease);
      }

      .log-tab:hover .log-pill {
        border-color: var(--md-outline);
        color: var(--md-ink);
      }

      .log-chevron {
        width: 26px;
        height: 26px;
        border-radius: 9999px;
        display: grid;
        place-items: center;
        background: var(--md-surface-high);
        border: 1px solid var(--md-hairline);
        color: var(--md-ink-var);
        transition: transform .28s var(--md-decel), background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease);
      }

      .log-chevron svg {
        width: 14px;
        height: 14px;
      }

      .log-box[data-open=true] .log-chevron {
        transform: rotate(180deg);
        background: var(--md-primary);
        border-color: var(--md-primary);
        color: var(--md-on-primary);
      }

      #etherx-studio .log-btn {
        min-height: 40px;
        padding: 6px 14px;
        border-radius: var(--r-md);
        border: 1px solid var(--md-hairline-strong);
        background: var(--md-surface);
        color: var(--md-ink-var);
        font-size: 12px;
        font-weight: 500;
        flex: 0 0 auto;
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .log-btn:hover {
        background: color-mix(in srgb, var(--md-ink) 8%, var(--md-surface));
        border-color: var(--md-outline);
        color: var(--md-ink);
      }

      .log-btn:active {
        transform: scale(.98);
      }

      .log-btn[data-copied=true] {
        border-color: color-mix(in srgb, var(--md-good) 50%, transparent);
        background: var(--md-good-container);
        color: var(--md-good-ink);
      }

      .log-panel {
        display: grid;
        grid-template-rows: 0fr;
        opacity: 0;
        transition: grid-template-rows .28s var(--md-decel), opacity .22s var(--md-ease);
      }

      .log-box[data-open=true] .log-panel {
        grid-template-rows: 1fr;
        opacity: 1;
      }

      .log-panel-inner {
        min-height: 0;
        overflow: hidden;
      }

      .log-box[data-open=false] .log-panel-inner {
        visibility: hidden;
        pointer-events: none;
        transition: visibility 0s linear .28s;
      }

      .log-box[data-open=true] .log-panel-inner {
        visibility: visible;
        transition-delay: 0s;
      }

      .log-panel-body {
        padding: 10px;
      }

      pre {
        margin: 0;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        max-height: 220px;
        overflow: auto;
        color: var(--md-ink-var);
        font: 400 11.5px/1.6 var(--mono);
        background: var(--md-bg);
        border: 1px solid var(--md-hairline);
        border-radius: var(--r-sm);
        padding: 11px 13px;
        user-select: text;
        -webkit-user-select: text;
        scrollbar-width: thin;
        scrollbar-color: var(--md-outline) transparent;
      }

      pre::-webkit-scrollbar {
        width: 6px;
        height: 6px;
      }

      pre::-webkit-scrollbar-thumb {
        background: var(--md-surface-highest);
        border-radius: 9999px;
      }
      /* Material 3 Before / After Quality Comparison */
      .compare-wrap {
        display: grid;
        grid-template-rows: 0fr;
        opacity: 0;
        transform: translateY(8px);
        border: 0 solid var(--md-hairline);
        border-radius: var(--r-lg);
        overflow: hidden;
        transition: grid-template-rows .36s var(--md-decel), opacity .3s var(--md-decel), transform .36s var(--md-decel);
      }

      .compare-wrap:not(.visible) .compare-inner {
        visibility: hidden;
        pointer-events: none;
      }

      .compare-wrap.visible {
        grid-template-rows: 1fr;
        opacity: 1;
        transform: none;
        border-width: 1px;
      }

      .compare-inner {
        min-height: 0;
        overflow: hidden;
      }

      .compare-card {
        padding: 16px;
        display: grid;
        gap: 12px;
        background: var(--md-surface);
      }

      .ba-head {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px 14px;
      }

      .ba-title-wrap {
        display: grid;
        gap: 3px;
        min-width: 0;
      }

      .ba-title {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
        font-size: 13.5px;
        color: var(--md-ink);
      }

      .ba-badge {
        display: inline-grid;
        place-items: center;
        padding: 3px 9px;
        border-radius: 9999px;
        background: var(--md-primary-container);
        color: var(--md-on-primary-container);
        font: 600 10px var(--mono);
        letter-spacing: .04em;
        text-transform: uppercase;
      }

      .ba-meta {
        font: 500 11.5px var(--mono);
        font-variant-numeric: tabular-nums;
        color: var(--md-muted);
        overflow-wrap: anywhere;
      }

      .ba-controls {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
      }

      .ba-seg {
        display: inline-flex;
        align-items: center;
        height: 36px;
        padding: 3px;
        border-radius: var(--r-md);
        background: var(--md-surface-low);
        border: 1px solid var(--md-hairline-strong);
        gap: 2px;
      }

      #etherx-studio .ba-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 36px;
        min-width: 44px;
        padding: 0 13px;
        border-radius: var(--r-md);
        border: 1px solid var(--md-hairline-strong);
        background: var(--md-surface-high);
        color: var(--md-ink-var);
        font-size: 12px;
        font-weight: 500;
        line-height: 1;
        white-space: nowrap;
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .ba-seg .ba-btn {
        height: 28px;
        padding: 0 12px;
        border-radius: 7px;
        border: 0;
        background: transparent;
      }

      #etherx-studio .ba-btn:hover:not(:disabled):not([aria-pressed=true]):not(.holding) {
        background: var(--md-surface-highest);
        border-color: var(--md-outline);
        color: var(--md-ink);
      }

      #etherx-studio .ba-seg .ba-btn:hover:not(:disabled):not([aria-pressed=true]) {
        background: color-mix(in srgb, var(--md-ink) 8%, transparent);
        color: var(--md-ink);
      }

      #etherx-studio .ba-btn:active:not(:disabled) {
        transform: scale(.975);
      }

      #etherx-studio .ba-btn[aria-pressed=true],
      #etherx-studio .ba-seg .ba-btn[aria-pressed=true],
      #etherx-studio .ba-btn.ba-hold.holding {
        background: var(--md-primary);
        color: var(--md-on-primary);
        border-color: transparent;
        font-weight: 600;
      }

      .ba-btn.ba-hold {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        touch-action: none;
      }

      .ba-stage {
        position: relative;
        padding: 8px;
        border-radius: var(--r-md);
        background: var(--md-bg);
        border: 1px solid var(--md-hairline);
      }

      .ba-frame {
        position: relative;
        width: min(100%, calc(var(--ba-max-h, min(66vh, 620px)) * var(--ba-ar, 1.7778)));
        aspect-ratio: var(--ba-ar, 1.7778);
        margin: 0 auto;
        overflow: hidden;
        border-radius: var(--r-sm);
        background: #000000;
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
        cursor: ew-resize;
        contain: layout style;
      }

      .ba-frame[data-zoom="2"],
      .ba-frame[data-zoom="3"] {
        cursor: grab;
        touch-action: none;
      }

      .ba-layer {
        position: absolute;
        inset: 0;
        overflow: hidden;
        contain: layout style paint;
      }

      .ba-layer.ba-before-box {
        z-index: 2;
        will-change: clip-path;
        clip-path: inset(0 calc(100% - var(--ba-pos, 50%)) 0 0);
      }

      .ba-layer.ba-after-box {
        z-index: 1;
      }

      .ba-stage.holding .ba-before-box {
        transition: clip-path .16s var(--md-ease);
      }

      .ba-media {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        pointer-events: none;
        transform: scale(var(--ba-zoom, 1));
        transform-origin: var(--ba-zx, 50%) var(--ba-zy, 50%);
        transition: transform .18s var(--md-ease);
      }

      .ba-frame[data-zoom="2"] .ba-media,
      .ba-frame[data-zoom="3"] .ba-media,
      .ba-stage.ba-panning .ba-media {
        will-change: transform;
      }

      .ba-stage.ba-panning .ba-media {
        transition: none;
      }

      .ba-media[hidden] {
        display: none;
      }

      .ba-tag {
        position: absolute;
        top: 10px;
        z-index: 5;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        border-radius: 9999px;
        font: 600 10.5px var(--mono);
        letter-spacing: .04em;
        text-transform: uppercase;
        pointer-events: none;
        background: rgba(17, 19, 24, .82);
        border: 1px solid rgba(255, 255, 255, .2);
        color: #f5f5f7;
      }

      .ba-tag-before {
        left: 10px;
      }

      .ba-tag-after {
        right: 10px;
        border-color: transparent;
        color: var(--md-on-primary);
        background: var(--md-primary);
      }

      .ba-divider {
        position: absolute;
        top: 0;
        bottom: 0;
        left: var(--ba-pos, 50%);
        z-index: 6;
        width: 44px;
        transform: translate3d(-50%, 0, 0);
        display: grid;
        place-items: center;
        cursor: ew-resize;
        touch-action: none;
        background: transparent;
        border: 0;
        padding: 0;
        will-change: left;
      }

      .ba-divider::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 2px;
        transform: translateX(-50%);
        background: var(--md-primary);
        box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
      }

      .ba-knob {
        position: relative;
        z-index: 1;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        background: var(--md-primary);
        color: var(--md-on-primary);
        border: 2px solid var(--md-bg);
        box-shadow: var(--md-elev-2);
        transition: transform .16s var(--md-spring);
      }

      .ba-divider:hover .ba-knob,
      .ba-divider.dragging .ba-knob {
        transform: scale(1.1);
      }

      .ba-divider:focus-visible {
        outline: none;
      }

      .ba-divider:focus-visible .ba-knob {
        outline: 2px solid var(--md-primary);
        outline-offset: 3px;
      }

      .ba-knob svg {
        width: 16px;
        height: 16px;
      }

      .ba-stage[data-mode=side] .ba-frame {
        width: 100%;
        aspect-ratio: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        background: transparent;
        cursor: default;
      }

      .ba-stage[data-mode=side] .ba-frame[data-zoom="2"],
      .ba-stage[data-mode=side] .ba-frame[data-zoom="3"] {
        cursor: grab;
      }

      .ba-stage[data-mode=side].holding .ba-frame {
        grid-template-columns: minmax(0, 1fr);
      }

      .ba-stage[data-mode=side].holding .ba-after-box,
      .ba-stage[data-mode=side].holding .ba-tag-after {
        display: none;
      }

      .ba-stage[data-mode=side].holding .ba-before-box {
        width: min(100%, calc(var(--ba-max-h, min(66vh, 620px)) * var(--ba-ar, 1.7778)));
        margin: 0 auto;
      }

      .ba-stage[data-mode=side] .ba-layer {
        position: relative;
        inset: auto;
        min-width: 0;
        overflow: hidden;
        aspect-ratio: var(--ba-ar, 1.7778);
        clip-path: none !important;
        border-radius: var(--r-sm);
        border: 1px solid var(--md-hairline-strong);
        background: #000000;
      }

      .ba-stage[data-mode=side] .ba-before-box {
        order: 1;
      }

      .ba-stage[data-mode=side] .ba-after-box {
        order: 2;
        border-color: var(--md-primary);
      }

      .ba-stage[data-mode=side] .ba-divider {
        display: none;
      }

      .ba-stage[data-mode=side] .ba-tag-before {
        top: 8px;
        left: 8px;
        right: auto;
      }

      .ba-stage[data-mode=side] .ba-tag-after {
        top: 8px;
        left: calc(50% + 12px);
        right: auto;
      }

      .ba-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        border-radius: var(--r-md);
        background: var(--md-surface-low);
        border: 1px solid var(--md-hairline);
        flex-wrap: wrap;
      }

      .ba-bar[hidden] {
        display: none;
      }

      #etherx-studio .ba-play {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        border: 0;
        background: var(--md-primary);
        color: var(--md-on-primary);
        box-shadow: var(--md-elev-1);
        transition: transform .16s var(--md-ease), filter .16s var(--md-ease);
      }

      .ba-play:hover:not(:disabled) {
        filter: brightness(1.06);
      }

      .ba-play:active:not(:disabled) {
        transform: scale(.94);
      }

      .ba-play:disabled,
      .ba-btn:disabled {
        opacity: .48;
        cursor: not-allowed;
      }

      input.ba-scrub:disabled {
        opacity: .48;
        cursor: not-allowed;
      }

      .ba-vid-state {
        font: 500 11.5px var(--mono);
        color: var(--md-ink-var);
        white-space: nowrap;
      }

      .ba-vid-state[hidden] {
        display: none;
      }

      .ba-play svg {
        width: 17px;
        height: 17px;
      }

      .ba-scrub-wrap {
        position: relative;
        flex: 1 1 150px;
        min-width: 110px;
        height: 44px;
        display: flex;
        align-items: center;
      }

      .ba-scrub-track {
        position: relative;
        width: 100%;
        height: 4px;
        border-radius: 9999px;
        background: var(--md-surface-highest);
        overflow: hidden;
        transition: height .14s var(--md-ease);
      }

      .ba-scrub-wrap:hover .ba-scrub-track {
        height: 6px;
      }

      .ba-scrub-wrap:has(.ba-scrub:focus-visible) .ba-scrub-track {
        outline: 2px solid var(--md-primary);
        outline-offset: 4px;
      }

      .ba-scrub-fill {
        display: block;
        height: 100%;
        width: var(--ba-prog, 0%);
        border-radius: 9999px;
        background: var(--md-primary);
      }

      input.ba-scrub {
        appearance: none;
        -webkit-appearance: none;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        outline: none !important;
        cursor: pointer;
      }

      input.ba-scrub::-webkit-slider-runnable-track {
        height: 4px;
        border: 0;
        background: transparent;
        box-shadow: none;
      }

      input.ba-scrub::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--md-primary);
        border: 2px solid var(--md-bg);
        margin-top: -5px;
        box-shadow: var(--md-elev-1);
        transition: transform .16s var(--md-spring);
      }

      .ba-scrub-wrap:hover input.ba-scrub::-webkit-slider-thumb,
      input.ba-scrub:active::-webkit-slider-thumb {
        transform: scale(1.22);
      }

      input.ba-scrub::-moz-range-track {
        height: 4px;
        border: 0;
        background: transparent;
        box-shadow: none;
      }

      input.ba-scrub::-moz-range-thumb {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--md-primary);
        border: 2px solid var(--md-bg);
        box-shadow: var(--md-elev-1);
      }

      .ba-bar-right {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
      }

      .ba-time {
        font: 500 12px var(--mono);
        font-variant-numeric: tabular-nums;
        color: var(--md-ink-var);
        white-space: nowrap;
        padding: 0 4px;
      }

      .ba-speed {
        height: 36px;
        min-width: 56px;
        padding: 0 12px;
        border-radius: var(--r-md);
        font: 600 12px var(--mono);
        font-variant-numeric: tabular-nums;
      }

      /* About Section & Core Team Telegram Cards */
      .studio-about {
        margin-top: 18px;
        overflow: hidden;
      }

      #etherx-studio .about-heading {
        margin: 0;
        color: var(--md-ink);
      }

      #etherx-studio .about-toggle {
        width: 100%;
        min-height: 56px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 15px 16px;
        border: 0;
        border-bottom: 1px solid transparent;
        background: transparent;
        color: var(--md-ink);
        font-size: clamp(18px, 3vw, 22px);
        font-weight: 600;
        line-height: 1.2;
        letter-spacing: -.02em;
        text-align: left;
        transition: background-color .2s var(--md-ease), border-color .22s var(--md-ease);
      }

      .about-toggle:hover {
        background: color-mix(in srgb, var(--md-ink) 5%, transparent);
      }

      .about-toggle:active {
        background: color-mix(in srgb, var(--md-ink) 8%, transparent);
      }

      .about-toggle:focus-visible {
        outline-offset: -3px;
      }

      .studio-about[data-open=true] .about-toggle {
        border-bottom-color: var(--md-hairline);
      }

      .about-meta {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
      }

      .about-chevron {
        width: 30px;
        height: 30px;
        border-radius: var(--r-sm);
        display: grid;
        place-items: center;
        background: var(--md-surface-high);
        border: 1px solid var(--md-hairline);
        color: var(--md-ink-var);
        transition: transform .28s var(--md-decel), background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease);
      }

      .about-chevron svg {
        width: 15px;
        height: 15px;
      }

      .about-toggle:hover .about-chevron {
        border-color: var(--md-hairline-strong);
        color: var(--md-ink);
      }

      .studio-about[data-open=true] .about-chevron {
        transform: rotate(180deg);
        background: var(--md-primary);
        border-color: var(--md-primary);
        color: var(--md-on-primary);
      }

      .about-panel {
        display: grid;
        grid-template-rows: 0fr;
        opacity: 0;
        transition: grid-template-rows .32s var(--md-decel), opacity .24s var(--md-ease);
      }

      .studio-about[data-open=true] .about-panel {
        grid-template-rows: 1fr;
        opacity: 1;
      }

      .about-panel-inner {
        min-height: 0;
        overflow: hidden;
      }

      .studio-about[data-open=false] .about-panel-inner {
        visibility: hidden;
        pointer-events: none;
        transition: visibility 0s linear .32s;
      }

      .studio-about[data-open=true] .about-panel-inner {
        visibility: visible;
        transition-delay: 0s;
      }

      .about-body {
        padding: 16px;
        background: color-mix(in srgb, var(--md-bg) 78%, var(--md-surface-high));
      }

      .admins-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
      }

      .admin-card {
        position: relative;
        border-radius: 14px;
        border: 1px solid var(--md-hairline);
        padding: 20px 15px 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        overflow: hidden;
        background: var(--md-surface);
        box-shadow: var(--md-elev-1);
        transition: background-color .22s var(--md-ease), border-color .22s var(--md-ease), box-shadow .22s var(--md-ease), transform .2s var(--md-ease);
      }

      .admin-card::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        pointer-events: none;
        opacity: 0;
        transition: opacity .26s var(--md-ease);
        background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 35%), color-mix(in srgb, var(--md-primary) 7%, transparent), transparent 72%);
      }

      .admin-card:hover {
        border-color: color-mix(in srgb, var(--md-primary) 42%, var(--md-hairline-strong));
        box-shadow: var(--md-elev-2);
        transform: translateY(-2px);
      }

      .admin-card:hover::before {
        opacity: 1;
      }

      .admin-avatar-wrap {
        position: relative;
        width: 72px;
        height: 72px;
        margin-bottom: 12px;
        flex: 0 0 auto;
      }

      .admin-avatar-halo {
        display: none;
      }

      .admin-avatar-ring {
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 1px solid var(--md-hairline-strong);
        box-shadow: 0 3px 10px rgba(0, 0, 0, .09);
        pointer-events: none;
      }

      .admin-avatar-inner {
        position: relative;
        z-index: 1;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        padding: 2px;
        background: var(--md-surface);
        overflow: hidden;
        display: grid;
        place-items: center;
      }

      .admin-avatar-fallback {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        display: grid;
        place-items: center;
        background: var(--md-primary-container);
        color: var(--md-on-primary-container);
        font-size: 24px;
        font-weight: 700;
      }

      .admin-avatar-img {
        position: absolute;
        inset: 2px;
        width: calc(100% - 4px);
        height: calc(100% - 4px);
        border-radius: 50%;
        object-fit: cover;
        display: block;
        opacity: 0;
        transition: opacity .24s var(--md-ease), transform .28s var(--md-ease);
      }

      .admin-avatar-img.loaded {
        opacity: 1;
      }

      .admin-card:hover .admin-avatar-img {
        transform: scale(1.03);
      }

      .admin-role {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 3px 9px;
        border-radius: 6px;
        margin-bottom: 10px;
        background: var(--md-surface-high);
        border: 1px solid var(--md-hairline);
        color: var(--md-muted);
        font: 600 10px var(--mono);
        letter-spacing: .04em;
        text-transform: uppercase;
        white-space: nowrap;
      }

      .admin-role svg {
        width: 11px;
        height: 11px;
        color: var(--md-muted);
        flex: 0 0 11px;
      }

      .admin-handle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.25;
        letter-spacing: -.015em;
        color: var(--md-ink);
        margin-bottom: 5px;
        max-width: 100%;
        overflow-wrap: anywhere;
        transition: color .18s var(--md-ease);
      }

      .admin-handle:hover {
        color: var(--md-primary);
      }

      .admin-verified {
        width: 15px;
        height: 15px;
        flex: 0 0 15px;
        color: var(--md-primary);
      }

      .admin-pos {
        display: block;
        font-size: 12px;
        font-weight: 400;
        color: var(--md-muted);
        line-height: 1.45;
        margin: 0 0 16px;
        min-height: 36px;
      }

      .admin-actions {
        margin-top: auto;
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
      }

      #etherx-studio .admin-tg {
        flex: 1 1 auto;
        min-width: 0;
        height: 38px;
        padding: 0 12px;
        border-radius: var(--r-md);
        border: 1px solid var(--md-hairline-strong);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        background: var(--md-surface-high);
        color: var(--md-ink);
        font-size: 12.5px;
        font-weight: 600;
        white-space: nowrap;
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .admin-tg:hover {
        background: var(--md-primary);
        border-color: var(--md-primary);
        color: var(--md-on-primary);
      }

      #etherx-studio .admin-tg:active {
        transform: scale(.98);
      }

      #etherx-studio .admin-tg svg {
        width: 14px;
        height: 14px;
        flex: 0 0 14px;
        color: var(--md-primary);
        transition: color .2s var(--md-ease);
      }

      #etherx-studio .admin-tg:hover svg {
        color: currentColor;
      }

      #etherx-studio .admin-copy {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        display: grid;
        place-items: center;
        border-radius: var(--r-md);
        border: 1px solid var(--md-hairline-strong);
        padding: 0;
        background: var(--md-surface-high);
        color: var(--md-muted);
        transition: background-color .2s var(--md-ease), border-color .2s var(--md-ease), color .2s var(--md-ease), transform .16s var(--md-ease);
      }

      #etherx-studio .admin-copy:hover {
        background: color-mix(in srgb, var(--md-ink) 8%, var(--md-surface-high));
        border-color: var(--md-outline);
        color: var(--md-ink);
      }

      #etherx-studio .admin-copy:active {
        transform: scale(.96);
      }

      #etherx-studio .admin-copy[data-copied=true] {
        border-color: var(--md-good-line);
        background: var(--md-good-container);
        color: var(--md-good);
      }

      #etherx-studio .admin-copy svg {
        width: 16px;
        height: 16px;
      }

      @media(max-width:767px), (pointer:coarse), (hover:none) {
        #etherx-studio input[type=text],
        #etherx-studio input[type=number],
        #etherx-studio select,
        #etherx-studio .path-wrap input[type=text] {
          font-size: 16px;
          min-height: 46px;
        }

        #etherx-studio input[type=number].range-num {
          width: 74px;
          min-width: 74px;
          min-height: 44px;
          padding: 6px 8px;
        }

        #etherx-studio .params-reset,
        #etherx-studio .clear-file {
          min-height: 44px;
          padding: 8px 14px;
        }

        #etherx-studio .admin-tg {
          min-height: 44px;
        }

        #etherx-studio .drive-btn,
        #etherx-studio a.social-link,
        #etherx-studio .btn-back,
        #etherx-studio .btn-sec {
          min-height: 44px;
        }

        #etherx-studio .admin-copy {
          width: 44px;
          height: 44px;
          flex-basis: 44px;
        }
      }

      @media(max-width:599px) {
        .settings-grid {
          grid-template-columns: minmax(0, 1fr);
          gap: 12px;
        }

        .switches {
          display: grid;
          grid-template-columns: minmax(0, 1fr);
          gap: 8px;
        }

        .check {
          width: 100%;
          min-height: 48px;
          padding: 8px 14px;
        }
      }

      @media(max-width:559px) {
        #etherx-studio .ba-btn {
          height: 44px;
        }

        #etherx-studio .ba-seg {
          height: 44px;
          padding: 2px;
        }

        #etherx-studio .ba-seg .ba-btn {
          height: 38px;
        }

        .ba-speed {
          height: 44px;
        }

        .ba-scrub-wrap {
          order: 3;
          flex: 1 0 100%;
          height: 44px;
        }

        .ba-bar-right {
          margin-left: auto;
        }

        .exec-actions {
          flex-wrap: wrap;
        }

        #etherx-studio .exec-actions .cancel {
          flex: 1 1 120px;
        }

        .param-row {
          grid-template-columns: minmax(0, 1fr) auto;
          gap: 2px 10px;
          padding: 10px 14px 2px;
        }

        .param-row .field-label {
          grid-column: 1;
          grid-row: 1;
        }

        .param-row .range-num {
          grid-column: 2;
          grid-row: 1;
          min-height: 38px;
        }

        .param-row .range-wrap {
          grid-column: 1 / -1;
          grid-row: 2;
        }
      }

      @media(max-width:519px) {
        .pipeline {
          grid-template-columns: minmax(0, .82fr) minmax(0, .92fr) minmax(0, 1.26fr);
          gap: 4px;
          padding: 4px;
        }

        #etherx-studio .pipe-step {
          padding: 6px 7px;
          gap: 5px;
        }

        .pipe-num {
          width: 18px;
          height: 18px;
          flex-basis: 18px;
          font-size: 9.5px;
        }

        .pipe-copy strong {
          font-size: 11.5px;
        }

        .time-row>span {
          padding: 8px 9px;
          gap: 3px 4px;
          font-size: 10.5px;
        }

        .time-row b {
          font-size: 11px;
        }
      }

      /* >= 520 */
      @media(min-width:520px) {
        #etherx-studio .pipe-step {
          justify-content: flex-start;
          gap: 10px;
          padding: 9px 14px;
        }

        .pipe-num {
          width: 26px;
          height: 26px;
          flex-basis: 26px;
          font-size: 11px;
        }

        .pipe-copy strong {
          font-size: 13px;
        }

        .pipe-copy small {
          display: block;
        }

        .pipe-sep {
          display: block;
          flex: 0 0 auto;
          width: 14px;
          height: 1px;
          background: var(--md-hairline-strong);
        }

        .pipeline {
          display: flex;
          align-items: center;
          gap: 6px;
          padding: 6px;
        }

        #etherx-studio .pipeline .pipe-step {
          flex: 1 1 0;
        }

        .tool-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 10px;
        }
      }

      /* >= 560 */
      @media(min-width:560px) {
        .shell {
          padding: 0 20px 32px;
        }

        .topbar {
          padding: 18px 2px 16px;
        }

        .mark {
          width: 44px;
          height: 44px;
          flex-basis: 44px;
        }

        .brand-name {
          font-size: 19px;
        }

        .top-right {
          display: flex;
          flex-wrap: wrap;
          align-items: center;
          width: auto;
          gap: 8px;
        }

        .top-status {
          display: inline-flex;
          width: auto;
        }

        #etherx-studio .bridge,
        #etherx-studio .drive-btn {
          width: auto;
          font-size: 12px;
          padding: 6px 15px;
        }

        #etherx-studio .connect-gmail-btn {
          grid-column: auto;
          order: 0;
          width: auto;
          max-width: 240px;
          justify-content: flex-start;
        }

        .socials {
          display: inline-flex;
          width: auto;
        }

        .win-bar {
          padding: 12px 20px;
        }

        .stage-head {
          padding: 20px 20px 18px;
        }

        .win-tools-body {
          padding: 18px 20px;
        }

        .win-foot {
          padding: 14px 20px;
        }

        .compare-card {
          padding: 18px 20px;
        }

        .block {
          padding: 18px 20px;
        }

        .proc-body {
          padding: 18px 20px;
        }

        #etherx-studio .about-toggle {
          padding: 18px 20px;
        }

        .about-body {
          padding: 18px 20px;
        }

        .admins-grid {
          display: flex;
          flex-wrap: wrap;
          justify-content: center;
          gap: 12px;
        }

        .admin-card {
          flex: 0 1 calc(50% - 6px);
        }

        .win-exec-bar {
          grid-template-columns: minmax(230px, auto) minmax(240px, 340px);
          justify-content: space-between;
        }
      }

      /* >= 900 */
      @media(min-width:900px) {
        .shell {
          padding: 0 28px 40px;
        }

        .tool-grid {
          grid-template-columns: repeat(3, minmax(0, 1fr));
          gap: 10px;
        }

        #etherx-studio .tool {
          min-height: 66px;
          padding: 12px 15px;
        }

        .win-bar {
          padding: 12px 24px;
        }

        .stage-head {
          padding: 22px 24px 18px;
        }

        .win-tools-body {
          padding: 20px 24px;
        }

        .win-foot {
          padding: 14px 24px;
        }

        .compare-card {
          padding: 20px 24px;
        }

        .block {
          padding: 20px 24px;
        }

        .proc-body {
          padding: 20px 24px;
        }

        #etherx-studio .about-toggle {
          padding: 20px 24px;
        }

        .about-body {
          padding: 20px 24px;
        }
      }

      @media(min-width:820px) and (max-width:1039px) {
        .admin-card {
          flex: 0 1 calc(33.333% - 8px);
        }
      }

      @media(min-width:1040px) {
        .admins-grid {
          display: grid;
          grid-template-columns: repeat(5, minmax(0, 1fr));
          gap: 10px;
        }

        .admin-card {
          flex: initial;
          padding: 18px 12px 14px;
        }

        .admin-handle {
          font-size: 14.5px;
        }

        #etherx-studio .admin-tg {
          padding: 6px 10px;
        }
      }

      @media(prefers-reduced-motion:reduce) {

        *,
        *::before,
        *::after {
          animation-duration: .01ms !important;
          animation-iteration-count: 1 !important;
          transition-duration: .01ms !important;
          scroll-behavior: auto !important;
        }

        .studio-loader-sheen,
        .studio-loader-pulse,
        .studio-loader-stroke {
          animation: none !important;
        }

        .studio-loader-stroke {
          stroke-dashoffset: 0 !important;
        }
      }

      @media(forced-colors:active) {

        .tool[aria-selected=true],
        .pipe-step[aria-current=step],
        .drive-btn,
        .social-link,
        .run,
        .cancel,
        .download,
        .log-tab,
        .log-btn,
        .btn-back,
        .btn-sec,
        .ba-btn,
        .ba-play,
        .admin-tg,
        .admin-copy {
          border: 2px solid CanvasText;
        }
      }

    /* Root & Colab output canvas override (beats Colab outputframe & rendered_html CSS) */
    html,
    body,
    .studio-canvas,
    #etherx-studio {
      background-color: var(--md-bg) !important;
      background-image: var(--canvas-grad) !important;
      color: var(--md-ink) !important;
    }

    .studio-canvas,
    #etherx-studio {
      width: 100%;
      min-height: 100%;
      overflow-x: clip;
      padding: 8px 0 24px;
      border-radius: 14px;
      font-family: var(--sans);
      line-height: 1.5;
    }

    .studio-loader {
      position: fixed;
      inset: 0;
      z-index: 9999;
      display: grid;
      place-items: center;
      padding: 24px;
      background: var(--md-bg) !important;
      transition: opacity .36s cubic-bezier(.16, 1, .3, 1), visibility .36s cubic-bezier(.16, 1, .3, 1);
    }

    .studio-loader.is-done {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .studio-loader-inner {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 18px;
      width: min(304px, 100%);
      padding: 22px;
      background: var(--md-surface);
      border: 1px solid var(--md-hairline);
      border-radius: 16px;
      transition: transform .36s cubic-bezier(.16, 1, .3, 1), opacity .36s cubic-bezier(.16, 1, .3, 1);
    }

    .studio-loader.is-done .studio-loader-inner {
      transform: translateY(-4px) scale(.988);
      opacity: 0;
    }

    .studio-loader-head {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .studio-loader-mark {
      position: relative;
      width: 44px;
      height: 44px;
      flex: 0 0 44px;
      border-radius: 11px;
      background: #101216;
      border: 1px solid rgba(255, 255, 255, .15);
      display: grid;
      place-items: center;
      overflow: hidden;
    }

    .studio-loader-sheen {
      position: absolute;
      inset: -20%;
      background: linear-gradient(108deg, transparent 36%, rgba(255, 255, 255, .2) 50%, transparent 64%);
      transform: translateX(-120%);
      animation: studioSheen 1.85s cubic-bezier(.4, 0, .2, 1) infinite;
      pointer-events: none;
    }

    .studio-loader-mark svg {
      position: relative;
      z-index: 1;
      width: 24px;
      height: 24px;
      display: block;
    }

    .studio-loader-stroke {
      stroke-dasharray: 26;
      stroke-dashoffset: 26;
      animation: studioDraw .65s cubic-bezier(.16, 1, .3, 1) forwards;
    }

    .studio-loader-stroke.s2 {
      animation-delay: .12s;
    }

    .studio-loader-brand {
      display: flex;
      flex-direction: column;
      gap: 3px;
      min-width: 0;
      text-align: left;
    }

    .studio-loader-title {
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      font-size: 19px;
      font-weight: 600;
      letter-spacing: -.025em;
      line-height: 1.18;
      color: var(--md-ink);
    }

    .studio-loader-sub {
      font-family: 'Roboto Mono', ui-monospace, Consolas, monospace;
      font-size: 11.5px;
      color: var(--md-muted);
      letter-spacing: .02em;
      line-height: 1.3;
      min-height: 15px;
    }

    .studio-loader-track {
      position: relative;
      width: 100%;
      height: 3px;
      border-radius: 9999px;
      background: var(--md-hairline);
      overflow: hidden;
    }

    .studio-loader-fill {
      position: relative;
      display: block;
      width: 32%;
      height: 100%;
      border-radius: 9999px;
      background: var(--md-primary);
      transition: width .32s cubic-bezier(.16, 1, .3, 1);
      overflow: hidden;
    }

    .studio-loader-pulse {
      position: absolute;
      inset: 0;
      width: 55%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
      transform: translateX(-120%);
      animation: studioRailSweep 1.2s cubic-bezier(.4, 0, .2, 1) infinite;
    }

    @keyframes studioDraw {
      to { stroke-dashoffset: 0; }
    }

    @keyframes studioSheen {
      0% { transform: translateX(-120%); }
      55%, 100% { transform: translateX(120%); }
    }

    @keyframes studioRailSweep {
      0% { transform: translateX(-120%); }
      100% { transform: translateX(240%); }
    }
  

    [hidden] { display: none !important; }
    .block-head-flush { margin-bottom: 0; }

    #etherx-studio .bridge {
      cursor: pointer;
    }

    #etherx-studio .connect-gmail-btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 6px 12px;
      border-radius: 9999px;
      border: 1px solid var(--md-primary);
      background: var(--md-primary);
      color: #ffffff;
      font: inherit;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      min-width: 0;
      overflow: hidden;
      box-sizing: border-box;
      transition: transform .14s ease, opacity .15s ease, background .15s ease;
    }

    #etherx-studio .connect-gmail-btn:hover {
      opacity: .92;
      transform: translateY(-1px);
    }

    #etherx-studio .connect-gmail-btn[data-connected="true"] {
      background: var(--md-good-bg);
      color: var(--md-good-ink);
      border-color: var(--md-good-line);
    }

    #etherx-studio .connect-gmail-btn svg {
      width: 14px;
      height: 14px;
      flex: none;
    }

    #etherx-studio #gmail-btn-label {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .gmail-modal {
      position: fixed;
      inset: 0;
      z-index: 2500;
      display: grid;
      place-items: center;
      padding: 18px;
      background: rgba(15, 23, 42, .56);
    }

    .gmail-card {
      width: min(560px, 100%);
      max-height: 92vh;
      overflow-y: auto;
      background: var(--md-surface);
      color: var(--md-ink);
      border: 1px solid var(--md-hairline-strong);
      border-radius: 20px;
      padding: 22px;
      box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
    }

    .gmail-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }

    .gmail-head h2 {
      margin: 0;
      font-size: 18px;
      font-weight: 600;
    }

    .gmail-head p {
      margin: 4px 0 0;
      font-size: 13px;
      color: var(--md-muted);
    }

    .gmail-step {
      padding: 14px;
      border-radius: 14px;
      background: var(--md-field);
      border: 1px solid var(--md-hairline);
      margin-bottom: 12px;
    }

    .gmail-step-title {
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .04em;
      color: var(--md-muted);
      margin-bottom: 8px;
    }

    .gmail-actions-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .gmail-cmd {
      display: block;
      margin-top: 8px;
      padding: 8px 10px;
      border-radius: 8px;
      background: var(--md-surface);
      border: 1px solid var(--md-hairline);
      font-family: 'Roboto Mono', ui-monospace, Consolas, monospace;
      font-size: 11.5px;
      overflow-x: auto;
      white-space: nowrap;
      color: var(--md-ink);
    }

    .gmail-fields {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 120px;
      gap: 10px;
      margin-bottom: 10px;
    }

    .gmail-fields label,
    .gmail-code-label {
      display: flex;
      flex-direction: column;
      gap: 5px;
      font-size: 12px;
      font-weight: 500;
      color: var(--md-muted);
    }

    .gmail-fields input,
    .gmail-code-label input {
      width: 100%;
      min-height: 38px;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid var(--md-hairline-strong);
      background: var(--md-surface);
      color: var(--md-ink);
      font-size: 13px;
    }

    .gmail-status-note {
      margin: 10px 0 0;
      font-size: 12.5px;
      color: var(--md-muted);
    }

    .gmail-status-note[data-err="true"] {
      color: var(--md-err-ink);
    }

    @media (max-width: 600px) {
      .gmail-fields { grid-template-columns: minmax(0, 1fr); }
    }

    .gmail-actions-row-sp { margin-top: 12px; }
    .gmail-setup-copy {
      margin: 0;
      font-size: 13px;
      line-height: 1.5;
      color: var(--md-ink);
    }
    .gmail-error-box {
      margin: 12px 0 0;
      padding: 10px 12px;
      border-radius: 10px;
      background: var(--md-err-bg);
      border: 1px solid rgba(201, 24, 38, .28);
      color: var(--md-err-ink);
      font-size: 12.5px;
      line-height: 1.45;
      word-break: break-word;
    }
    .gmail-origin-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 8px;
    }
    .gmail-origin-cmd {
      margin-top: 0;
      flex: 1 1 auto;
      min-width: 0;
    }
    .gmail-link-btn {
      display: inline-flex;
      align-items: center;
      text-decoration: none;
    }
    #etherx-studio .connect-gmail-btn[data-busy="true"] {
      opacity: .84;
      cursor: progress;
    }
    .gmail-account-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .gmail-user-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .gmail-avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: var(--md-primary);
      color: #ffffff;
      display: grid;
      place-items: center;
      font-size: 14px;
      font-weight: 700;
      flex: none;
    }
    .gmail-user-meta strong {
      display: block;
      font-size: 13.5px;
      color: var(--md-ink);
      word-break: break-word;
    }
    .gmail-user-sub {
      display: block;
      font-size: 12px;
      color: var(--md-muted);
    }
    .colab-manual-details {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--md-hairline);
      font-size: 12px;
      color: var(--md-muted);
    }
    .colab-manual-details summary {
      cursor: pointer;
      user-select: none;
      font-weight: 500;
    }
    .colab-manual-form {
      margin-top: 10px;
    }
