    :root {
      color-scheme: dark;
      --bg: #0b0d12;
      --surface: #12151c;
      --surface-2: #191d27;
      --surface-3: #222735;
      --line: #2a3040;
      --text: #f5f7fb;
      --muted: #8d96aa;
      --accent: #5b8cff;
      --accent-2: #8b5cf6;
      --success: #26d980;
      --warning: #ffbf46;
      --danger: #ff5f6d;
      --shadow: 0 16px 45px rgba(0, 0, 0, .32);
      --header-height: 66px;
      --console-height: 150px;
    }

    html[data-theme="light"] {
      color-scheme: light;
      --bg: #edf0f6;
      --surface: #ffffff;
      --surface-2: #f6f7fb;
      --surface-3: #e8ebf2;
      --line: #d6dbe6;
      --text: #151824;
      --muted: #667085;
      --accent: #356df3;
      --accent-2: #7546df;
      --shadow: 0 16px 40px rgba(32, 42, 68, .12);
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      width: 100%;
      min-width: 320px;
      min-height: 100%;
      margin: 0;
    }

    body {
      overflow: hidden;
      color: var(--text);
      background:
        radial-gradient(circle at 13% -15%, rgba(91, 140, 255, .18), transparent 32%),
        var(--bg);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    button,
    input,
    textarea {
      font: inherit;
    }

    button {
      color: inherit;
    }

    .sr-only {
      width: 1px;
      height: 1px;
      position: absolute;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      clip-path: inset(50%);
    }

    .app {
      display: grid;
      grid-template-rows: var(--header-height) minmax(0, 1fr);
      width: 100vw;
      height: 100dvh;
    }

    .topbar {
      display: flex;
      align-items: center;
      gap: 18px;
      min-width: 0;
      padding: 0 18px;
      background: rgba(18, 21, 28, .9);
      border-bottom: 1px solid var(--line);
      box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      z-index: 20;
    }

    html[data-theme="light"] .topbar {
      background: rgba(255, 255, 255, .88);
    }

    .brand {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 10px;
      color: var(--text);
      text-decoration: none;
    }

    .brand__mark {
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      position: relative;
      overflow: hidden;
      color: #fff;
      background: linear-gradient(145deg, var(--accent), var(--accent-2));
      border-radius: 11px;
      box-shadow: 0 7px 20px rgba(91, 140, 255, .3);
      font-weight: 900;
    }

    .brand__mark::after {
      content: "";
      width: 22px;
      height: 9px;
      position: absolute;
      top: 3px;
      left: -5px;
      background: rgba(255, 255, 255, .22);
      border-radius: 50%;
      transform: rotate(-30deg);
    }

    .brand__name {
      font-size: 17px;
      font-weight: 850;
      letter-spacing: -.35px;
    }

    .project {
      display: flex;
      min-width: 150px;
      max-width: 380px;
      flex: 1 1 300px;
      flex-direction: column;
      gap: 2px;
    }

    .project__title {
      width: 100%;
      padding: 3px 7px;
      color: var(--text);
      background: transparent;
      border: 1px solid transparent;
      border-radius: 6px;
      outline: none;
      font-size: 14px;
      font-weight: 750;
      text-overflow: ellipsis;
    }

    .project__title:hover,
    .project__title:focus {
      border-color: var(--line);
      background: var(--surface-2);
    }

    .project__status {
      padding-left: 7px;
      color: var(--muted);
      font-size: 10px;
    }

    .actions {
      display: flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 8px;
      margin-left: auto;
    }

    .button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-height: 38px;
      padding: 8px 12px;
      color: var(--text);
      background: var(--surface-3);
      border: 1px solid var(--line);
      border-radius: 9px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 750;
      transition: transform .16s ease, background .16s ease, border-color .16s ease;
    }

    .button:hover {
      background: var(--surface-2);
      border-color: #46506a;
      transform: translateY(-1px);
    }

    .button:focus-visible,
    .icon-button:focus-visible,
    .panel__toggle:focus-visible {
      outline: 3px solid rgba(91, 140, 255, .28);
      outline-offset: 2px;
    }

    .button--run {
      color: #07150f;
      background: linear-gradient(135deg, #58eba0, var(--success));
      border-color: transparent;
      box-shadow: 0 8px 20px rgba(38, 217, 128, .2);
    }

    .button--run:hover {
      background: linear-gradient(135deg, #6cf1ad, #2de58b);
      border-color: transparent;
    }

    .button svg,
    .icon-button svg {
      width: 15px;
      height: 15px;
      flex: 0 0 auto;
      fill: currentColor;
    }

    .main {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: minmax(150px, var(--split-size, 44%)) 9px minmax(150px, 1fr);
      min-height: 0;
      gap: 0;
      padding: 8px;
    }

    .main.layout-right,
    .main.layout-left {
      grid-template-rows: minmax(0, 1fr);
      grid-template-columns: minmax(230px, var(--split-size, 45%)) 9px minmax(260px, 1fr);
    }

    .main.layout-bottom .editors {
      grid-column: 1;
      grid-row: 1;
    }

    .main.layout-bottom .workspace-resizer {
      grid-column: 1;
      grid-row: 2;
    }

    .main.layout-bottom .workspace {
      grid-column: 1;
      grid-row: 3;
    }

    .main.layout-right .editors {
      grid-column: 1;
      grid-row: 1;
    }

    .main.layout-right .workspace-resizer {
      grid-column: 2;
      grid-row: 1;
    }

    .main.layout-right .workspace {
      grid-column: 3;
      grid-row: 1;
    }

    .main.layout-left .workspace {
      grid-column: 1;
      grid-row: 1;
    }

    .main.layout-left .workspace-resizer {
      grid-column: 2;
      grid-row: 1;
    }

    .main.layout-left .editors {
      grid-column: 3;
      grid-row: 1;
    }

    .main.layout-right .editors,
    .main.layout-left .editors {
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: repeat(3, minmax(120px, 1fr));
      overflow-x: hidden;
      overflow-y: auto;
    }

    .workspace-resizer {
      display: grid;
      place-items: center;
      min-width: 0;
      min-height: 0;
      padding: 0;
      position: relative;
      z-index: 15;
      color: var(--muted);
      background: transparent;
      border: 0;
      outline: 0;
      cursor: row-resize;
      touch-action: none;
    }

    .workspace-resizer::before {
      content: "";
      width: 42px;
      height: 4px;
      background: var(--line);
      border-radius: 99px;
      box-shadow: 0 0 0 1px rgba(255, 255, 255, .025);
      transition: width .16s ease, height .16s ease, background .16s ease, box-shadow .16s ease;
    }

    .layout-right .workspace-resizer,
    .layout-left .workspace-resizer {
      cursor: col-resize;
    }

    .layout-right .workspace-resizer::before,
    .layout-left .workspace-resizer::before {
      width: 4px;
      height: 42px;
    }

    .workspace-resizer:hover::before,
    .workspace-resizer:focus-visible::before,
    .workspace-resizer.is-dragging::before {
      background: var(--accent);
      box-shadow: 0 0 14px rgba(91, 140, 255, .55);
    }

    .workspace-resizer:hover::before,
    .workspace-resizer.is-dragging::before {
      width: 64px;
    }

    .layout-right .workspace-resizer:hover::before,
    .layout-left .workspace-resizer:hover::before,
    .layout-right .workspace-resizer.is-dragging::before,
    .layout-left .workspace-resizer.is-dragging::before {
      width: 4px;
      height: 64px;
    }

    body.is-resizing,
    body.is-resizing * {
      cursor: row-resize !important;
      user-select: none !important;
    }

    body.is-resizing-side,
    body.is-resizing-side * {
      cursor: col-resize !important;
    }

    .editors {
      display: grid;
      grid-template-columns: repeat(3, minmax(230px, 1fr));
      min-width: 0;
      min-height: 0;
      gap: 8px;
      overflow-x: auto;
      scrollbar-color: var(--surface-3) transparent;
    }

    .panel {
      display: grid;
      grid-template-rows: 42px minmax(0, 1fr);
      min-width: 230px;
      min-height: 0;
      overflow: hidden;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 11px;
      box-shadow: var(--shadow);
    }

    .panel.is-collapsed {
      grid-template-rows: 42px;
      min-width: 44px;
      min-height: 42px;
    }

    .panel.is-collapsed .editor-wrap,
    .panel.is-collapsed .panel__name,
    .panel.is-collapsed .panel__language,
    .panel.is-collapsed .panel__format {
      display: none;
    }

    .panel.is-collapsed .panel__head {
      justify-content: center;
      padding: 0 8px;
      border-bottom: 0;
    }

    .panel.is-collapsed .panel__collapse {
      margin-left: 0;
    }

    .panel.is-collapsed .panel__type {
      display: none;
    }

    .panel__head {
      display: flex;
      align-items: center;
      gap: 9px;
      min-width: 0;
      padding: 0 11px;
      background: var(--surface-2);
      border-bottom: 1px solid var(--line);
    }

    .panel__type {
      display: grid;
      place-items: center;
      width: 23px;
      height: 23px;
      color: #fff;
      border-radius: 6px;
      font-size: 10px;
      font-weight: 900;
    }

    .panel__type--html {
      background: #ff7043;
    }

    .panel__type--css {
      background: #4586ff;
    }

    .panel__type--js {
      color: #151515;
      background: #f5d442;
    }

    .panel__name {
      overflow: hidden;
      font-size: 12px;
      font-weight: 800;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .panel__language {
      color: var(--muted);
      font-size: 10px;
    }

    .panel__toggle {
      display: grid;
      place-items: center;
      width: 27px;
      height: 27px;
      margin-left: auto;
      padding: 0;
      color: var(--muted);
      background: transparent;
      border: 0;
      border-radius: 6px;
      cursor: pointer;
      font-size: 17px;
    }

    .panel__format {
      margin-left: auto;
    }

    .panel__collapse {
      margin-left: 0;
      font-size: 19px;
      font-weight: 800;
    }

    .panel__toggle:hover {
      color: var(--text);
      background: var(--surface-3);
    }

    .editor-wrap {
      display: grid;
      grid-template-columns: 45px minmax(0, 1fr);
      min-height: 0;
      overflow: hidden;
      background: #10131a;
    }

    html[data-theme="light"] .editor-wrap {
      background: #fbfcfe;
    }

    .line-numbers {
      margin: 0;
      padding: 14px 9px 30px 0;
      overflow: hidden;
      color: #596176;
      background: rgba(0, 0, 0, .09);
      border-right: 1px solid rgba(128, 140, 166, .11);
      font: 12.5px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      text-align: right;
      user-select: none;
    }

    .editor {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 14px 14px 30px;
      resize: none;
      tab-size: 2;
      color: #dce3f5;
      caret-color: var(--accent);
      background: transparent;
      border: 0;
      outline: 0;
      font: 12.5px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      white-space: pre;
      overflow: auto;
      scrollbar-width: thin;
      scrollbar-color: #303746 transparent;
    }

    html[data-theme="light"] .editor {
      color: #252a37;
    }

    .workspace {
      display: grid;
      grid-template-rows: 43px minmax(0, 1fr) auto;
      min-height: 0;
      overflow: hidden;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 11px;
      box-shadow: var(--shadow);
    }

    .workspace__head {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 11px;
      background: var(--surface-2);
      border-bottom: 1px solid var(--line);
    }

    .traffic-lights {
      display: flex;
      gap: 6px;
    }

    .traffic-lights span {
      width: 9px;
      height: 9px;
      border-radius: 50%;
    }

    .traffic-lights span:nth-child(1) {
      background: var(--danger);
    }

    .traffic-lights span:nth-child(2) {
      background: var(--warning);
    }

    .traffic-lights span:nth-child(3) {
      background: var(--success);
    }

    .workspace__tab {
      color: var(--text);
      font-size: 12px;
      font-weight: 800;
    }

    .preview-url {
      min-width: 0;
      max-width: 360px;
      flex: 1;
      margin: 0 auto;
      padding: 6px 11px;
      overflow: hidden;
      color: var(--muted);
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 7px;
      font-size: 10px;
      text-align: center;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .layout-control {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 6px;
      padding: 3px 5px 3px 8px;
      color: var(--muted);
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 7px;
      font-size: 10px;
      font-weight: 750;
    }

    .layout-control select {
      max-width: 88px;
      padding: 3px 4px;
      color: var(--text);
      background: var(--surface-2);
      border: 0;
      border-radius: 4px;
      outline: 0;
      cursor: pointer;
      font-size: 10px;
      font-weight: 750;
    }

    .workspace__tools {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .icon-button {
      display: grid;
      place-items: center;
      width: 29px;
      height: 29px;
      padding: 0;
      color: var(--muted);
      background: transparent;
      border: 1px solid transparent;
      border-radius: 7px;
      cursor: pointer;
    }

    .icon-button:hover,
    .icon-button[aria-pressed="true"] {
      color: var(--text);
      background: var(--surface-3);
      border-color: var(--line);
    }

    .preview {
      width: 100%;
      height: 100%;
      background: #fff;
      border: 0;
    }

    .console {
      display: none;
      height: var(--console-height);
      min-height: 90px;
      max-height: 42vh;
      grid-template-rows: 34px minmax(0, 1fr);
      resize: vertical;
      overflow: auto;
      background: #0d1016;
      border-top: 1px solid var(--line);
    }

    .console.is-open {
      display: grid;
    }

    .console__head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 11px;
      color: #aab3c7;
      background: #121722;
      border-bottom: 1px solid #252c3b;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .5px;
      text-transform: uppercase;
    }

    .console__clear {
      padding: 4px 7px;
      color: #aab3c7;
      background: transparent;
      border: 1px solid #30384a;
      border-radius: 5px;
      cursor: pointer;
      font-size: 9px;
    }

    .console__output {
      margin: 0;
      padding: 9px 12px;
      overflow: auto;
      color: #cbd3e6;
      font: 11px/1.6 "SFMono-Regular", Consolas, monospace;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .console-line {
      display: block;
      padding: 2px 0;
      border-bottom: 1px solid rgba(255, 255, 255, .035);
    }

    .console-line--error {
      color: #ff8190;
    }

    .console-line--warn {
      color: #ffd36a;
    }

    .console-line--info {
      color: #72a5ff;
    }

    .toast {
      display: flex;
      align-items: center;
      gap: 9px;
      max-width: calc(100vw - 28px);
      position: fixed;
      right: 16px;
      bottom: 16px;
      z-index: 100;
      padding: 11px 14px;
      color: #fff;
      background: #202635;
      border: 1px solid #3a4359;
      border-radius: 10px;
      box-shadow: 0 16px 42px rgba(0, 0, 0, .36);
      font-size: 12px;
      font-weight: 700;
      opacity: 0;
      pointer-events: none;
      transform: translateY(10px);
      transition: opacity .2s ease, transform .2s ease;
    }

    .toast.is-visible {
      opacity: 1;
      transform: translateY(0);
    }

    .modal {
      display: none;
      place-items: center;
      position: fixed;
      inset: 0;
      z-index: 200;
      padding: 20px;
      background: rgba(3, 5, 9, .72);
      backdrop-filter: blur(8px);
    }

    .modal.is-open {
      display: grid;
    }

    .modal__card {
      width: min(100%, 420px);
      padding: 24px;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 16px;
      box-shadow: 0 26px 70px rgba(0, 0, 0, .45);
    }

    .modal__card h2 {
      margin: 0 0 8px;
      font-size: 19px;
    }

    .modal__card p {
      margin: 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }

    .modal__actions {
      display: flex;
      justify-content: flex-end;
      gap: 9px;
      margin-top: 22px;
    }

    .button--danger {
      color: #fff;
      background: var(--danger);
      border-color: transparent;
    }

    .preview-fullscreen .topbar,
    .preview-fullscreen .editors {
      display: none;
    }

    .preview-fullscreen .workspace-resizer {
      display: none;
    }

    .preview-fullscreen .app {
      grid-template-rows: minmax(0, 1fr);
    }

    .preview-fullscreen .main {
      height: 100dvh;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: minmax(0, 1fr);
      padding: 0;
    }

    .preview-fullscreen .workspace {
      grid-column: 1 !important;
      grid-row: 1 !important;
      border: 0;
      border-radius: 0;
    }

    @media (max-width: 900px) {
      :root {
        --header-height: 60px;
      }

      .topbar {
        gap: 10px;
        padding: 0 10px;
      }

      .brand__name,
      .project__status,
      .button__label--optional {
        display: none;
      }

      .project {
        min-width: 90px;
      }

      .button {
        min-width: 38px;
        padding: 8px 10px;
      }

      .main {
        grid-template-rows: minmax(150px, var(--split-size, 48%)) 9px minmax(150px, 1fr);
      }

      .main.layout-right,
      .main.layout-left {
        grid-template-columns: minmax(220px, var(--split-size, 45%)) 9px minmax(260px, 1fr);
      }

      .layout-control > span {
        display: none;
      }
    }

    @media (max-width: 620px) {
      body {
        overflow: auto;
      }

      .app {
        height: auto;
        min-height: 100dvh;
      }

      .topbar {
        position: sticky;
        top: 0;
      }

      .brand__mark {
        width: 34px;
        height: 34px;
      }

      .project {
        display: none;
      }

      .actions {
        width: 100%;
        justify-content: flex-end;
      }

      .button[data-action="save"],
      .button[data-action="reset"] {
        display: none;
      }

      .main {
        display: flex;
        min-height: calc(100dvh - var(--header-height));
        flex-direction: column;
      }

      .main.layout-left,
      .main.layout-right {
        display: flex;
      }

      .workspace-resizer {
        display: none;
      }

      .editors {
        display: flex;
        height: 370px;
        min-height: 370px;
        scroll-snap-type: x mandatory;
      }

      .panel {
        min-width: calc(100vw - 18px);
        scroll-snap-align: start;
      }

      .workspace {
        height: 470px;
        min-height: 470px;
      }

      .preview-url {
        display: none;
      }

      .layout-control {
        display: none;
      }

      .panel.is-collapsed {
        min-width: 52px;
        scroll-snap-align: none;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
      }
    }