
    /*
      Absentia Sans renders noticeably heavier than typical UI fonts even at its
      own "regular" cut, so the weight ramp below is deliberately shifted: each
      face is registered under a lighter numeric band than its name suggests,
      keeping the app's existing font-weight values (300-800) but resolving them
      to thinner physical files so nothing renders as true bold/heavy/black.
    */
    @font-face {
      font-family: "Absentia Sans";
      src: url("./fonts/absentia-sans-hairline.ttf") format("truetype");
      font-weight: 100 200;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Absentia Sans";
      src: url("./fonts/absentia-sans-thin.ttf") format("truetype");
      font-weight: 201 300;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Absentia Sans";
      src: url("./fonts/absentia-sans-light.ttf") format("truetype");
      font-weight: 301 400;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Absentia Sans";
      src: url("./fonts/absentia-sans-book.ttf") format("truetype");
      font-weight: 401 500;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Absentia Sans";
      src: url("./fonts/absentia-sans-regular.ttf") format("truetype");
      font-weight: 501 650;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Absentia Sans";
      src: url("./fonts/absentia-sans-medium.ttf") format("truetype");
      font-weight: 651 750;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Absentia Sans";
      src: url("./fonts/absentia-sans-demi.ttf") format("truetype");
      font-weight: 751 1000;
      font-style: normal;
      font-display: swap;
    }

    /* Exo: the app's primary UI font (chat message text and the composer
       input keep their own separate Inter stack, set further below). */
    @font-face {
      font-family: "Exo";
      src: url("./fonts/exo-100.ttf") format("truetype");
      font-weight: 100 200;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Exo";
      src: url("./fonts/exo-200.ttf") format("truetype");
      font-weight: 201 300;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Exo";
      src: url("./fonts/exo-300.ttf") format("truetype");
      font-weight: 301 400;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Exo";
      src: url("./fonts/exo-400.ttf") format("truetype");
      font-weight: 401 500;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Exo";
      src: url("./fonts/exo-500.ttf") format("truetype");
      font-weight: 501 600;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Exo";
      src: url("./fonts/exo-600.ttf") format("truetype");
      font-weight: 601 700;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Exo";
      src: url("./fonts/exo-700.ttf") format("truetype");
      font-weight: 701 1000;
      font-style: normal;
      font-display: swap;
    }

    :root {
      --ink: #18201b;
      --muted: #657069;
      --paper: #f4f1e9;
      --card: rgba(255, 255, 252, .82);
      --line: rgba(31, 48, 37, .13);
      --violet: #5d4cc7;
      --violet-dark: #4435a6;
      --lime: #c9f66f;
      --mint: #dff5dd;
      --amber: #f3bc56;
      --red: #ba4e4e;
      --shadow: 0 18px 50px rgba(36, 44, 37, .08);
      --radius: 22px;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--ink);
      background:
        radial-gradient(circle at 6% 4%, rgba(201, 246, 111, .35), transparent 25rem),
        radial-gradient(circle at 94% 10%, rgba(93, 76, 199, .16), transparent 28rem),
        var(--paper);
      font: 15px/1.5 "Exo", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    button, textarea, input { font: inherit; }
    button { color: inherit; }

    .shell {
      width: calc(100% - 32px);
      margin: 0 auto;
      padding: 20px 0;
    }

    .settings-button, .gesture-button, .ai-provider-button {
      flex: none;
      display: grid;
      place-items: center;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      border: 0;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      transition: color .2s ease, transform .4s ease, filter .2s ease;
    }
    .settings-button:hover { color: var(--violet); }
    .gesture-button:hover { color: var(--violet); }
    .gesture-button[hidden] { display: none; }
    .ai-provider-button:hover { color: var(--violet); }
    .gesture-button.active { color: var(--violet); animation: gesture-pulse 1.8s ease-in-out infinite; }
    .ai-provider-button svg { width: 18px; height: 18px; }
    #aiProviderOptions svg { width: 52px; height: 52px; }
    .ai-logo-mask {
      display: inline-block;
      background-color: currentColor;
      -webkit-mask-repeat: no-repeat;
      mask-repeat: no-repeat;
      -webkit-mask-position: center;
      mask-position: center;
      -webkit-mask-size: contain;
      mask-size: contain;
    }
    .ai-provider-button .ai-logo-mask { width: 18px; height: 18px; }
    .ai-provider-button .ai-logo-chatgpt { width: 21px; height: 21px; }
    #aiProviderOptions .ai-logo-mask { width: 52px; height: 52px; }
    .panel-footer {
      flex: none;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      padding: 18px 14px;
      border-top: 1px solid transparent;
      border-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--violet) 28%, transparent) 62%, transparent) 1;
    }


    .layout {
      display: grid;
      grid-template-columns: minmax(280px, 19fr) minmax(0, 63fr) minmax(260px, 18fr);
      gap: 20px;
      align-items: start;
    }
    /* Pinned explicitly (not relying on DOM-order auto-placement) so hiding
       .main-column in workspace-focus mode can't shift the other two panels
       into the wrong grid tracks. */
    .layout > .main-column { grid-column: 1; grid-row: 1; }
    .layout > .artifact-panel { grid-column: 2; grid-row: 1; }
    .layout > .side-column { grid-column: 3; grid-row: 1; }

    .main-column, .side-column { display: grid; gap: 20px; }

    .artifact-panel { display: flex; flex-direction: column; min-width: 0; }
    .artifact-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 24px 17px; }
    .artifact-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .artifact-head-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); font-size: 10px; font-weight: 800; }
    #artifactIcon { display: none; }
    .artifact-head-title strong { display: block; font-size: 15px; }
    .artifact-head-title span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
    .artifact-body { position: relative; flex: 1 1 auto; min-height: 0; padding: 12px; }
    .tool-interface-frame { display: block; width: 100%; height: 100%; border: 1px solid rgba(84,224,250,.2); border-radius: 4px; background: #02080d; }
    .tool-interface-frame[hidden] { display: none; }

    .artifact-content { width: 100%; height: 100%; overflow-y: auto; padding: 6px; }
    .artifact-content[hidden] { display: none; }

    .artifact-empty { display: grid; place-items: center; height: 100%; padding: 30px; color: var(--muted); text-align: center; font-size: 13px; }

    .artifact-markdown h1, .artifact-markdown h2, .artifact-markdown h3 { margin: .7em 0 .35em; line-height: 1.25; }
    .artifact-markdown h1:first-child, .artifact-markdown h2:first-child, .artifact-markdown h3:first-child { margin-top: 0; }
    .artifact-markdown p { margin: .5em 0; line-height: 1.65; font-size: 13px; }
    .artifact-markdown li { margin: .2em 0 .2em 1.3em; font-size: 13px; line-height: 1.6; }
    .artifact-markdown a { color: var(--violet); text-decoration: underline; overflow-wrap: anywhere; }
    .artifact-markdown-gap { height: .5em; }

    .artifact-code { margin: 0; padding: 14px; border-radius: 10px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }

    .artifact-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
    .artifact-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .artifact-table th, .artifact-table td { padding: 9px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
    .artifact-table th { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .artifact-table tr:last-child td { border-bottom: 0; }

    .artifact-progress { display: flex; align-items: center; gap: 14px; padding: 22px; border-radius: 12px; }
    .artifact-progress-pulse { flex: none; width: 12px; height: 12px; border-radius: 50%; animation: artifact-pulse 1.4s ease-in-out infinite; }
    .artifact-progress p { margin: 0; font-size: 13px; }
    @keyframes artifact-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

    .artifact-image-wrap { display: grid; place-items: center; height: 100%; padding: 10px; }
    .artifact-image-wrap img { max-width: 100%; max-height: 100%; border-radius: 10px; }

    .artifact-notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
    .artifact-note-card { padding: 13px; border-radius: 12px; border: 1px solid var(--line); }
    .artifact-note-card p { margin: 0; font-size: 13px; line-height: 1.5; }
    .artifact-note-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 10px; }

    .artifact-menu { display: grid; gap: 8px; }
    .artifact-menu-item { display: block; width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line); text-align: left; cursor: pointer; font-size: 13px; }

    .artifact-mermaid-wrap { display: flex; justify-content: center; padding: 16px 8px; }
    .artifact-mermaid-wrap svg { max-width: 100%; height: auto; }
    .artifact-mermaid-error { margin: 0 8px; }
    .artifact-mermaid-error summary { cursor: pointer; font-size: 11px; }
    .artifact-mermaid-error p { font-size: 12px; margin: 8px 0; }
    .artifact-mermaid-error pre { margin: 0; }

    .workspace-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; }
    .workspace-toolbar[hidden] { display: none; }
    .workspace-switcher, .workspace-add-widgets { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
    .workspace-toolbar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; }

    .workspace-canvas { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 8px; cursor: crosshair; }
    .workspace-canvas[hidden] { display: none; }
    .workspace-widgets { position: absolute; inset: 0; width: 100%; height: 100%; }

    /* Widget visual language, entrance/exit motion, and focus/unfocus states are
       ported from the reference "workspace" project's ui/style.css .widget
       system. That file has three successive, cascading `.widget{}` rewrites
       (the last one nearest the end of the file wins); values here were
       pulled from a live getComputedStyle() probe against the reference CSS
       to get the true final result rather than one superseded draft of it,
       then scaled down proportionally for this app's smaller widget cards. */
    .workspace-widget {
      position: absolute;
      display: flex;
      flex-direction: column;
      width: 260px;
      height: 210px;
      padding: 6px 8px 8px;
      border: 1px solid rgba(88, 231, 250, .4);
      /* Chamfered corners, not rounded ones -- matches JARVIS's own established
         panel language (.card, .hud-button) elsewhere in this app, rather than
         the reference project's rounded-corner treatment. */
      clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
      overflow: visible;
      background:
        linear-gradient(180deg, rgba(88, 231, 250, .1) 0%, rgba(88, 231, 250, .04) 22%, rgba(0, 0, 0, .28) 100%),
        repeating-linear-gradient(90deg, rgba(88, 231, 250, .035) 0 1px, transparent 1px 28px),
        rgba(5, 12, 16, .56);
      backdrop-filter: blur(18px) saturate(1.1);
      color: rgba(248, 248, 248, .96);
      box-shadow:
        inset 0 1px 0 rgba(120, 240, 255, .28),
        inset 0 -1px 0 rgba(88, 231, 250, .08),
        inset 0 0 28px rgba(88, 231, 250, .06),
        0 18px 46px rgba(0, 0, 0, .46),
        0 0 40px rgba(88, 231, 250, .22);
      opacity: 0;
      transform: translateY(30px) scale(.85);
      transition:
        transform 600ms cubic-bezier(.34, 1.56, .64, 1),
        opacity 600ms cubic-bezier(.34, 1.56, .64, 1),
        box-shadow 400ms ease,
        filter 500ms ease,
        border-color 500ms ease;
    }
    .workspace-widget::before {
      /* Corner-accent brackets on the two sharp (uncut) corners, drawn with
         background layers instead of extra DOM nodes -- the same technique
         .card::before already uses for this app's main panels. */
      content: ""; position: absolute; inset: 0; pointer-events: none;
      background:
        linear-gradient(90deg, #58e7fa, #58e7fa) left top / 16px 1.5px no-repeat,
        linear-gradient(#58e7fa, #58e7fa) left top / 1.5px 16px no-repeat,
        linear-gradient(90deg, #58e7fa, #58e7fa) right bottom / 16px 1.5px no-repeat,
        linear-gradient(#58e7fa, #58e7fa) right bottom / 1.5px 16px no-repeat;
      opacity: .75;
    }
    .workspace-widget.active,
    .workspace-widget.dragging {
      opacity: 1;
      transform: translateY(0) scale(1);
      border-color: rgba(88, 231, 250, .6);
      box-shadow:
        inset 0 1px 0 rgba(120, 240, 255, .32),
        inset 0 0 34px rgba(88, 231, 250, .08),
        0 22px 54px rgba(0, 0, 0, .5),
        0 0 48px rgba(88, 231, 250, .3);
    }
    .workspace-widget.entering { animation: workspaceWidgetEntrance 600ms cubic-bezier(.175, .885, .32, 1.275) forwards; }
    @keyframes workspaceWidgetEntrance {
      0% { opacity: 0; transform: translateY(30px) scale(.85); filter: blur(4px); }
      50% { transform: translateY(-5px) scale(1.02); }
      100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
    }
    .workspace-widget.exiting {
      opacity: 0;
      transform: translateY(-10px) scale(.95);
      transition: transform 200ms cubic-bezier(.4, 0, 1, 1), opacity 200ms cubic-bezier(.4, 0, 1, 1);
      filter: blur(0);
    }
    .workspace-widget.dragging {
      transition: none !important;
      cursor: grabbing !important;
      transform: scale(1.02) !important;
    }
    .workspace-widget.workspace-widget-focused {
      transform: scale(1) !important;
      opacity: 1 !important;
      z-index: 40 !important;
      border-color: rgba(88, 231, 250, .6) !important;
      box-shadow:
        inset 0 1px 0 rgba(120, 240, 255, .32),
        inset 0 0 34px rgba(88, 231, 250, .08),
        0 22px 54px rgba(0, 0, 0, .5),
        0 0 48px rgba(88, 231, 250, .3) !important;
    }
    .workspace-widget.workspace-widget-unfocused {
      transform: scale(.76) !important;
      opacity: .68 !important;
      z-index: 5 !important;
      filter: blur(.6px) brightness(.86);
      border-color: rgba(88, 231, 250, .25) !important;
      box-shadow:
        inset 0 0 14px rgba(88, 231, 250, .1),
        0 9px 26px rgba(0, 0, 0, .34),
        0 0 14px rgba(88, 231, 250, .08) !important;
      transition:
        transform 500ms cubic-bezier(.34, 1.56, .64, 1),
        opacity 500ms cubic-bezier(.34, 1.56, .64, 1),
        box-shadow 500ms ease, border-color 500ms ease, filter 500ms ease !important;
    }
    .workspace-widget[data-widget-type="clock"] { width: 190px; height: 130px; }
    .workspace-widget[data-widget-type="tool"] { width: 360px; height: 320px; }
    .workspace-widget[data-widget-type="video"] { width: 360px; height: 246px; }
    .workspace-widget[data-widget-type="video"] .workspace-widget-body { padding: 0; border: 0; background: none; box-shadow: none; }
    .workspace-widget[data-widget-type="doc"] { width: 380px; height: 420px; }
    .workspace-widget[data-widget-type="doc"] .workspace-widget-body { padding: 0; border: 0; background: none; box-shadow: none; display: flex; flex-direction: column; }
    .ww-doc-title { flex: none; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: transparent; font-size: 13px; font-weight: 700; color: inherit; font-family: inherit; }
    .ww-doc-body { flex: 1 1 auto; width: 100%; min-height: 0; resize: none; border: 0; outline: 0; background: transparent; padding: 10px 12px; font-size: 12px; line-height: 1.6; color: inherit; font-family: inherit; }
    .ww-doc-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--line); }
    .ww-doc-wordcount { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
    .ww-doc-footer .hud-button { padding: 5px 10px; font-size: 10px; }
    .workspace-widget-resize {
      position: absolute; bottom: 0; right: 0; width: 20px; height: 20px;
      cursor: nwse-resize; z-index: 4; opacity: .65;
    }
    .workspace-widget-resize::after {
      content: ""; position: absolute; right: 5px; bottom: 5px; width: 9px; height: 9px;
      border-right: 1px solid rgba(120, 240, 255, .8); border-bottom: 1px solid rgba(120, 240, 255, .8);
    }
    .workspace-widget-head {
      display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: 8px;
      min-height: 25px; height: auto; margin: 0 0 7px; padding: 0 0 5px;
      cursor: grab; position: relative;
      background: linear-gradient(180deg, transparent 0%, rgba(88, 231, 250, .14) 50%, transparent 100%);
    }
    .workspace-widget-head::after {
      content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
      background: linear-gradient(90deg, transparent 0%, rgba(88, 231, 250, .8) 50%, transparent 100%);
      opacity: .8;
    }
    .workspace-widget-head.dragging { cursor: grabbing; }
    .workspace-widget-type-label {
      position: relative; flex: 1 1 auto; min-width: 0;
      font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
      padding: 4px 10px; margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      color: rgba(233, 253, 255, .97);
      background:
        linear-gradient(90deg, rgba(88, 231, 250, .2) 0 1px, transparent 1px 100%),
        linear-gradient(135deg, rgba(88, 231, 250, .16) 0%, rgba(88, 231, 250, .05) 100%),
        rgba(3, 16, 22, .4);
      border: 1px solid rgba(88, 231, 250, .38);
      clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
      box-shadow: inset 0 1px 0 rgba(120, 240, 255, .3), 0 2px 8px rgba(0, 0, 0, .2), 0 0 26px rgba(88, 231, 250, .45);
      text-shadow: 0 0 14px rgba(88, 231, 250, .4);
    }
    .workspace-widget-type-label::after {
      content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
      background: linear-gradient(90deg, transparent 0%, rgba(88, 231, 250, .8) 50%, transparent 100%);
    }
    .workspace-widget-body {
      flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px;
      clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
      border: 1px solid rgba(88, 231, 250, .18);
      background:
        radial-gradient(circle at 50% 0%, rgba(88, 231, 250, .08), transparent 58%),
        linear-gradient(180deg, rgba(0, 0, 0, .32) 0%, rgba(0, 0, 0, .5) 100%);
      color: rgba(246, 246, 246, .96);
      text-shadow: 0 1px 12px rgba(0, 0, 0, .62);
      box-shadow: inset 0 1px 0 rgba(88, 231, 250, .1), inset 0 0 24px rgba(0, 0, 0, .22);
      scrollbar-width: thin; scrollbar-color: rgba(88, 231, 250, .45) rgba(0, 0, 0, .18);
    }
    .workspace-widget[data-widget-type="text"] .workspace-widget-body,
    .workspace-widget[data-widget-type="notes"] .workspace-widget-body {
      border: 0; background: none; box-shadow: none;
    }
    .workspace-widget iframe { display: block; width: 100%; height: 100%; border: 0; }

    .ww-text-area { width: 100%; height: 100%; resize: none; border: 0; outline: 0; background: transparent; font-size: 12px; line-height: 1.55; }
    .ww-notes-add { display: flex; gap: 6px; margin-bottom: 8px; }
    .ww-notes-add input { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: transparent; font-size: 11px; }
    .ww-notes-list { display: grid; gap: 6px; }
    .ww-note { display: flex; align-items: flex-start; gap: 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; line-height: 1.4; }
    .ww-note button { flex: none; border: 0; background: transparent; cursor: pointer; font-size: 11px; opacity: .7; }
    .ww-image-fill { width: 100%; height: 100%; display: grid; place-items: center; }
    .ww-image-fill img { max-width: 100%; max-height: 100%; border-radius: 8px; }
    .ww-image-fill.empty { font-size: 11px; text-align: center; }
    .ww-clock-face { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
    .ww-clock-time { font-size: 26px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
    .ww-clock-date { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

    .message-bubble a { color: #167f9a; text-decoration: underline; overflow-wrap: anywhere; }

    .card {
      position: relative;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--card);
      box-shadow: var(--shadow);
      backdrop-filter: blur(16px);
      overflow: hidden;
    }

    .composer { padding: clamp(24px, 5vw, 54px); }
    .composer::after {
      content: "";
      position: absolute;
      width: 230px;
      height: 230px;
      right: -105px;
      top: -120px;
      border: 40px solid rgba(201, 246, 111, .48);
      border-radius: 50%;
      pointer-events: none;
    }

    .eyebrow {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 0 0 14px;
      color: var(--violet-dark);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .14em;
      text-transform: uppercase;
    }
    .eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; }

    h1 {
      max-width: 720px;
      margin: 0 0 12px;
      font: 500 clamp(36px, 6vw, 64px)/1.02 Georgia, "Times New Roman", serif;
      letter-spacing: -.045em;
    }
    h1 em { color: var(--violet); font-style: italic; }
    .intro { max-width: 620px; margin: 0 0 32px; color: var(--muted); font-size: 16px; }

    .prompt-wrap {
      position: relative;
      padding: 10px;
      border: 1px solid rgba(35, 44, 38, .16);
      border-radius: 18px;
      background: rgba(255, 255, 255, .82);
      box-shadow: inset 0 1px 0 white, 0 9px 30px rgba(39, 45, 40, .06);
    }
    #command {
      width: 100%;
      min-height: 128px;
      padding: 12px 12px 8px;
      resize: vertical;
      border: 0;
      outline: 0;
      background: transparent;
      color: var(--ink);
      font-size: 17px;
      line-height: 1.5;
    }
    #command::placeholder { color: #98a099; }

    .prompt-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 8px 4px 2px 10px;
    }
    .mode-note { color: var(--muted); font-size: 12px; }
    .primary {
      border: 0;
      border-radius: 12px;
      background: var(--violet);
      color: white;
      padding: 12px 18px;
      font-weight: 750;
      cursor: pointer;
      box-shadow: 0 8px 18px rgba(93, 76, 199, .24);
      transition: transform .18s ease, background .18s ease;
    }
    .primary:hover { transform: translateY(-1px); background: var(--violet-dark); }
    .primary:disabled { cursor: wait; opacity: .65; transform: none; }

    .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
    .chip {
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 7px 11px;
      background: rgba(255,255,255,.55);
      color: var(--muted);
      cursor: pointer;
      font-size: 12px;
    }
    .chip:hover { border-color: rgba(93,76,199,.34); color: var(--violet); }

    .section-card { padding: 24px; }
    .section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
    h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
    .meta { color: var(--muted); font-size: 12px; }

    .panel-card { padding: 0; overflow: hidden; }
    .panel-tabs { display: flex; }
    .panel-tab { flex: 1; padding: 13px 8px; border: 0; background: transparent; cursor: pointer; font-size: 11px; }
    .panel-pane { display: grid; gap: 20px; padding: 20px; min-width: 0; }
    .panel-pane[hidden] { display: none; }
    .panel-section { min-width: 0; }
    .panel-section .section-head { margin-bottom: 14px; flex-wrap: wrap; row-gap: 8px; }
    .section-head > span { flex-wrap: wrap; row-gap: 8px; }
    .settings-grid { display: grid; gap: 22px; counter-reset: panelsec; }

    .empty {
      display: grid;
      place-items: center;
      min-height: 160px;
      padding: 24px;
      border: 1px dashed rgba(31,48,37,.18);
      border-radius: 16px;
      color: var(--muted);
      text-align: center;
    }
    .empty strong { display: block; color: var(--ink); margin-bottom: 5px; }

    .verify-prompt {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 9px;
      padding: 11px 13px;
      border: 1px solid var(--amber);
      border-radius: 12px;
      background: rgba(243, 188, 86, .14);
      color: var(--ink);
      font-size: 12px;
    }

    .tool-list { display: grid; gap: 9px; }
    .tool-item {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 13px;
      background: rgba(255,255,255,.52);
      text-align: left;
      cursor: pointer;
    }
    .tool-item:hover { border-color: rgba(93,76,199,.32); transform: translateY(-1px); }
    .tool-copy { min-width: 0; }
    .tool-name { font-weight: 750; font-size: 13px; overflow-wrap: anywhere; }
    .tool-desc { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
    .risk { flex: none; padding: 4px 7px; border-radius: 999px; background: var(--mint); color: #426849; font-size: 9px; font-weight: 800; text-transform: uppercase; }
    .risk.high, .risk.prohibited { background: #fae5d4; color: #94592e; }
    .risk.medium { background: #f8efca; color: #776424; }
    .status-pill { flex: none; padding: 4px 7px; border-radius: 999px; background: var(--mint); color: #426849; font-size: 9px; font-weight: 800; text-transform: uppercase; }
    .status-pill.offline { background: #eae6da; color: #746b5c; }
    .ai-area-row-icon { flex: none; width: 26px; height: 26px; display: grid; place-items: center; }
    .ai-area-row-icon .ai-logo-mask, .ai-area-row-icon svg { width: 20px; height: 20px; }
    .ai-area-prompt-list { display: grid; gap: 8px; }
    .ai-area-prompt { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.4); }
    .ai-area-prompt-text { min-width: 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.5; }
    .ai-area-prompt-actions { flex: none; display: flex; flex-direction: column; gap: 6px; }
    .ai-area-prompt-actions .hud-button { padding: 5px 9px; font-size: 9px; }
    .ai-area-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }

    .model-core { display: grid; gap: 14px; }
    .model-identity { padding: 13px; border: 1px solid rgba(67,202,231,.16); border-radius: 4px; background: rgba(2,14,21,.48); }
    .model-provider { display: block; margin-bottom: 5px; color: #61ddf1; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
    .model-id { display: block; color: #a8dbe4; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
    .model-actions { display: flex; gap: 8px; }
    .model-actions button { flex: 1; }
    .credential-note { margin: 12px 0 0; color: #668b95; font-size: 10px; line-height: 1.65; }
    .credential-note strong { color: #ffc767; }
    .model-suggestions { margin-top: 12px; padding: 11px; border: 1px solid rgba(255,185,74,.2); background: rgba(87,58,13,.2); color: #c3a46a; font-size: 10px; line-height: 1.6; }

    .soul-copy { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
    .feedback-row { display: flex; gap: 8px; }
    .feedback-row input {
      min-width: 0;
      flex: 1;
      border: 1px solid var(--line);
      border-radius: 11px;
      padding: 10px 11px;
      outline: 0;
      background: rgba(255,255,255,.65);
    }
    .secondary {
      border: 1px solid var(--line);
      border-radius: 11px;
      padding: 10px 12px;
      background: var(--ink);
      color: white;
      font-weight: 700;
      cursor: pointer;
    }

    dialog {
      width: min(780px, calc(100% - 28px));
      max-height: min(820px, calc(100vh - 40px));
      padding: 0;
      overflow: hidden;
      border: 0;
      border-radius: 22px;
      color: var(--ink);
      background: #fbfaf5;
      box-shadow: 0 30px 100px rgba(17, 21, 18, .3);
    }
    dialog[open] { display: flex; flex-direction: column; }
    dialog::backdrop { background: rgba(24,32,27,.42); backdrop-filter: blur(5px); }
    .dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 23px 24px 17px; border-bottom: 1px solid var(--line); }
    .dialog-head h3 { margin: 0; font-size: 21px; }
    .dialog-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
    .close { border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 10px; background: white; cursor: pointer; font-size: 18px; }
    .dialog-body { min-height: 0; padding: 22px 24px 26px; overflow: auto; }
    .field-label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
    #toolArgs, .import-field, #importSource, #importSchema {
      width: 100%; min-height: 135px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; outline: 0; resize: vertical;
      background: white; color: var(--ink); font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
    }
    .import-field { min-height: auto; resize: none; font-family: inherit; }
    #importSchema { min-height: 80px; }
    #importSource { min-height: 250px; tab-size: 4; }
    .capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 5px 0 14px; }
    .capability-option { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; }
    .run-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
    #runResult { margin-top: 15px; }
    .result-box { padding: 14px; border-radius: 13px; background: #eff5ec; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
    .result-box.error { background: #f9e7e2; color: #813e37; }
    .approval { margin-top: 16px; padding: 16px; border: 1px solid rgba(154,114,37,.28); border-radius: 14px; background: #fff8df; }
    .approval h4 { margin: 0 0 6px; }
    .approval p { color: #6f613d; font-size: 12px; }
    .token { display: inline-block; padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,.75); font: 12px ui-monospace, monospace; }
    details { margin-top: 13px; }
    summary { cursor: pointer; font-size: 12px; font-weight: 750; }
    pre { max-height: 240px; overflow: auto; padding: 13px; border-radius: 10px; background: #202620; color: #dff5dd; font: 11px/1.5 ui-monospace, monospace; white-space: pre-wrap; }

    .toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; padding: 11px 15px; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
    .toast.show { opacity: 1; transform: translateY(0); }

    @media (max-width: 880px) {
      .layout { grid-template-columns: 1fr; }
      .side-column { grid-template-columns: repeat(2, minmax(0,1fr)); }
      .side-column .card:first-child { grid-column: 1 / -1; }
    }
    @media (max-width: 580px) {
      .shell { width: min(100% - 20px, 1380px); padding-top: 12px; }
      .composer, .section-card { padding: 19px; }
      .prompt-actions { align-items: stretch; flex-direction: column; }
      .primary { width: 100%; }
      .side-column { grid-template-columns: 1fr; }
      .side-column .card:first-child { grid-column: auto; }
      .feedback-row { flex-direction: column; }
      .capability-grid { grid-template-columns: 1fr; }
    }
  

    :root {
      --ink: #d9f8ff;
      --muted: #7fa6b2;
      --paper: #02080d;
      --card: rgba(7, 24, 33, .62);
      --line: rgba(85, 220, 255, .18);
      --violet: #4de3ff;
      --violet-dark: #009cc4;
      --lime: #54f6ff;
      --mint: rgba(27, 121, 145, .2);
      --amber: #ffb94a;
      --red: #ff5c68;
      --shadow: 0 25px 90px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(163, 240, 255, .08);
      --radius: 10px;
      --cyan-glow: 0 0 22px rgba(65, 224, 255, .22);
    }

    html { background: #010509; }
    body {
      position: relative;
      overflow-x: hidden;
      color: var(--ink);
      background:
        radial-gradient(ellipse at 48% -8%, rgba(14, 133, 173, .28), transparent 39rem),
        radial-gradient(circle at 3% 68%, rgba(0, 103, 143, .17), transparent 31rem),
        radial-gradient(circle at 96% 42%, rgba(0, 95, 130, .18), transparent 29rem),
        linear-gradient(145deg, #050d14 0%, #0a1925 46%, #07121d 72%, #040b12 100%);
      font-family: "Exo", "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
      letter-spacing: .01em;
    }
    body::before {
      content: "";
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background-image:
        linear-gradient(rgba(80, 218, 247, .032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(80, 218, 247, .032) 1px, transparent 1px);
      background-size: 160px 160px;
      background-position: 50% 32px;
      mask-image: radial-gradient(ellipse 78% 74% at 50% 35%, #000 0%, rgba(0,0,0,.62) 58%, transparent 100%);
      animation: blueprint-drift 34s linear infinite;
    }
    body::after {
      content: "";
      position: fixed;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      background:
        repeating-linear-gradient(0deg, rgba(255,255,255,.01) 0 1px, transparent 1px 5px),
        linear-gradient(90deg, rgba(0,0,0,.24), transparent 13%, transparent 87%, rgba(0,0,0,.24)),
        linear-gradient(180deg, transparent 72%, rgba(0,0,0,.14));
    }

    .holo-environment {
      position: fixed;
      inset: 0;
      z-index: 1;
      overflow: hidden;
      pointer-events: none;
      perspective: 800px;
    }
    .blueprint-plane {
      position: absolute;
      left: -18vw;
      right: -18vw;
      bottom: -45vh;
      height: 92vh;
      opacity: .42;
      transform: rotateX(66deg);
      transform-origin: 50% 100%;
      background-image:
        linear-gradient(rgba(65, 206, 237, .11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(65, 206, 237, .11) 1px, transparent 1px),
        linear-gradient(rgba(65, 206, 237, .18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(65, 206, 237, .18) 1px, transparent 1px);
      background-size: 92px 92px, 92px 92px, 368px 368px, 368px 368px;
      mask-image: linear-gradient(to top, #000 5%, rgba(0,0,0,.74) 42%, transparent 92%);
      animation: plane-current 28s linear infinite;
    }
    .ambient-glow {
      position: absolute;
      width: 42vw;
      min-width: 420px;
      aspect-ratio: 1;
      border-radius: 50%;
      filter: blur(62px);
      opacity: .14;
      mix-blend-mode: screen;
      animation: glow-drift 19s ease-in-out infinite alternate;
    }
    .glow-one { left: -16vw; top: 15vh; background: #00b5e8; }
    .glow-two { right: -19vw; top: 37vh; background: #006da6; animation-delay: -8s; animation-direction: alternate-reverse; }
    .holo-arc {
      position: absolute;
      width: 430px;
      aspect-ratio: 1;
      border: 1px solid rgba(75, 217, 246, .1);
      border-radius: 50%;
      opacity: .52;
    }
    .holo-arc::before,
    .holo-arc::after {
      content: "";
      position: absolute;
      border-radius: inherit;
      border: 1px dashed rgba(75, 217, 246, .075);
    }
    .holo-arc::before { inset: 11%; }
    .holo-arc::after { inset: 28%; border-style: solid; }
    .arc-one { left: -250px; top: 11vh; animation: ambient-orbit 48s linear infinite; }
    .arc-two { right: -300px; bottom: 3vh; width: 540px; animation: ambient-orbit-reverse 61s linear infinite; }
    .holo-node {
      position: absolute;
      width: 5px;
      height: 5px;
      border: 1px solid rgba(135, 244, 255, .72);
      border-radius: 50%;
      background: rgba(69, 221, 248, .65);
      box-shadow: 0 0 9px rgba(71, 222, 249, .8), 0 0 0 8px rgba(71, 222, 249, .025);
      animation: ambient-node 4.8s ease-in-out infinite;
    }
    .holo-node::after {
      content: "";
      position: absolute;
      left: 10px;
      top: 1px;
      width: clamp(70px, 9vw, 145px);
      height: 1px;
      background: linear-gradient(90deg, rgba(71,222,249,.28), transparent);
    }
    .node-one { left: 4.5vw; top: 33vh; }
    .node-two { right: 6vw; top: 18vh; animation-delay: -1.7s; transform: rotate(180deg); }
    .node-three { right: 17vw; bottom: 12vh; animation-delay: -3.2s; }
    .scan-field {
      position: absolute;
      left: 0;
      right: 0;
      top: -18vh;
      height: 18vh;
      opacity: .32;
      background: linear-gradient(to bottom, transparent, rgba(59, 219, 248, .055), transparent);
      animation: environment-scan 16s linear infinite;
    }

    .shell { position: relative; z-index: 2; width: calc(100% - 32px); padding: 20px 0; }
    .settings-button, .gesture-button, .ai-provider-button {
      color: #7fb9c6;
    }
    .settings-button:hover { color: #8ef3ff; filter: drop-shadow(0 0 5px rgba(80,220,255,.65)); }
    #settingsButton svg { transform-origin: center; transition: transform .25s ease, filter .18s ease; }
    #settingsButton:hover svg { transform: rotate(45deg); }
    .gesture-button:hover { color: #8ef3ff; filter: drop-shadow(0 0 5px rgba(80,220,255,.65)); }
    .ai-provider-button:hover { color: #8ef3ff; filter: drop-shadow(0 0 5px rgba(80,220,255,.65)); }
    .gesture-button.active { color: #58e7fa; filter: drop-shadow(0 0 6px rgba(88,231,250,.7)); animation: gesture-pulse 1.8s ease-in-out infinite; }
    .layout { grid-template-columns: minmax(280px, 19fr) minmax(0, 63fr) minmax(260px, 18fr); gap: 16px; }
    .main-column, .side-column { gap: 16px; }

    /* The workspace is the full canvas; chat and tools float above it. */
    .layout {
      position: relative;
      display: block;
      min-height: calc(100vh - 60px);
    }
    .layout > .artifact-panel {
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: auto !important;
      max-width: none;
    }
    .layout > .main-column,
    .layout > .side-column {
      position: absolute;
      top: 0;
      bottom: 0;
      z-index: 2;
      width: min(360px, 28vw);
      pointer-events: none;
    }
    .layout > .main-column { left: 0; }
    .layout > .side-column { right: 0; }
    .layout > .main-column > *,
    .layout > .side-column > * { pointer-events: auto; }
    /* Collapsible right rail (Interfaces/Tools) for the current three-panel layout.
       The toggle lives in the footer next to Settings/AI areas, styled the same
       way, rather than floating over the panel. */
    /* Chat keeps its normal ~19% share; the workspace absorbs the space the
       collapsed rail used to take (63fr + the rail's usual 18fr), instead of
       the two flexible columns splitting it by their old 19:1 ratio. */
    .layout.right-panel-collapsed { grid-template-columns: minmax(280px, 19fr) minmax(0, 81fr) 48px !important; }
    .right-panel-collapsed .side-column .panel-card > .panel-tabs,
    .right-panel-collapsed .side-column .panel-card > .panel-pane { display: none !important; }
    .right-panel-collapsed .side-column .panel-footer {
      flex-direction: column !important;
      justify-content: flex-start !important;
      align-items: center !important;
      gap: 0 !important;
      padding: 10px 4px !important;
      margin-top: 0 !important;
      border-top: 0 !important;
      border-image: none !important;
    }
    /* Each gap is set independently (not a shared flex gap) so the
       AI-areas/Settings spacing and the Settings/collapse spacing can be
       tuned separately. */
    /* All buttons cluster at the bottom in DOM order (AI areas, then
       Settings), with the collapse toggle last -- set apart by extra space
       instead of a divider line. */
    .right-panel-collapsed .side-column .panel-footer .right-collapse-button {
      margin-top: 18px;
    }
    .right-panel-collapsed .side-column .panel-card { display: flex !important; flex-direction: column; height: 100%; }
    /* The corner-accent brackets (.card::before) assume a full-size panel;
       cramped into the 48px rail they just look like clutter, so drop them
       while collapsed. */
    .right-panel-collapsed .side-column .panel-card::before { display: none; }
    /* Workspace-focus mode: hide the chat panel entirely and drop it from the
       grid rather than just shrinking its track to 0 -- a 0-width track would
       still eat one "gap" of empty margin next to the workspace. The
       workspace is explicitly re-pinned to column 1 so it truly starts at
       the shell's left edge. Combined with a collapsed right rail too, the
       workspace takes the whole remaining row. */
    .layout.workspace-focus { grid-template-columns: minmax(0, 82fr) minmax(260px, 18fr) !important; }
    .layout.workspace-focus.right-panel-collapsed { grid-template-columns: minmax(0, 1fr) 48px !important; }
    .layout.workspace-focus .main-column { display: none; }
    .layout.workspace-focus > .artifact-panel { grid-column: 1; }
    .layout.workspace-focus > .side-column { grid-column: 2; }
    /* The core itself survives the panel going away -- it's re-parented (not
       rebuilt) into this fixed corner dock so its live Three.js canvas and
       animation state carry over untouched. It floats as an overlay on top
       of the now full-bleed workspace, well clear of the screen edge. */
    .floating-core-dock {
      position: fixed;
      left: 50px;
      bottom: 50px;
      z-index: 25;
      width: 180px;
      height: 180px;
      pointer-events: none;
    }
    .floating-core-dock[hidden] { display: none; }
    .floating-core-dock .chat-core.hud-visual { width: 100%; height: 100%; min-height: 0; flex: none; }
    .floating-core-dock .ultron-orb { pointer-events: auto; }
    .card {
      border: 1px solid rgba(91, 215, 241, .17);
      border-image: conic-gradient(from 0deg at 50% 50%, rgba(91, 215, 241, .17), transparent, rgba(91, 215, 241, .17), transparent, rgba(91, 215, 241, .17), transparent, rgba(91, 215, 241, .17), transparent, rgba(91, 215, 241, .17)) 1;
      border-radius: 9px;
      background:
        linear-gradient(132deg, rgba(144, 239, 255, .06), transparent 24%),
        linear-gradient(160deg, rgba(8, 29, 39, .76), rgba(3, 14, 22, .54));
      box-shadow: 0 26px 85px rgba(0,0,0,.35), inset 0 1px 0 rgba(178,242,255,.055), inset 0 -1px 0 rgba(0,0,0,.25);
      backdrop-filter: blur(28px) saturate(142%);
      clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
      transition: border-color .35s ease, box-shadow .35s ease, background .35s ease;
    }
    .card::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background:
        linear-gradient(90deg, var(--violet), var(--violet)) left top / 36px 1px no-repeat,
        linear-gradient(var(--violet), var(--violet)) left top / 1px 36px no-repeat,
        linear-gradient(90deg, var(--violet), var(--violet)) right bottom / 36px 1px no-repeat,
        linear-gradient(var(--violet), var(--violet)) right bottom / 1px 36px no-repeat;
      opacity: .62;
    }
    .side-column .card:hover {
      border-color: rgba(94, 226, 250, .25);
      background:
        linear-gradient(132deg, rgba(144, 239, 255, .075), transparent 24%),
        linear-gradient(160deg, rgba(8, 32, 43, .8), rgba(3, 15, 23, .59));
      box-shadow: 0 28px 90px rgba(0,0,0,.4), 0 0 34px rgba(42,196,226,.035), inset 0 1px 0 rgba(178,242,255,.07);
    }

    .composer { padding: clamp(28px, 4vw, 52px); min-height: 525px; }
    .composer::before { z-index: 2; }
    .composer::after {
      content: "";
      position: absolute;
      z-index: 0;
      inset: -70% 0 auto;
      width: 100%;
      height: 45%;
      border: 0;
      border-radius: 0;
      background: linear-gradient(to bottom, transparent, rgba(78, 231, 255, .05), transparent);
      animation: scan-pass 7s linear infinite;
      pointer-events: none;
    }
    .composer-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(250px, .72fr); gap: clamp(20px, 4vw, 58px); align-items: center; }
    .command-zone { min-width: 0; }
    .eyebrow { color: #54e8ff; font-size: 9px; letter-spacing: .24em; }
    .eyebrow::before { width: 34px; height: 1px; box-shadow: 0 0 8px currentColor; }
    h1 {
      max-width: 700px;
      color: #e5faff;
      font-family: "Arial Narrow", "Avenir Next Condensed", Impact, sans-serif;
      font-weight: 300;
      font-size: clamp(40px, 5.5vw, 69px);
      line-height: .98;
      letter-spacing: -.025em;
      text-transform: uppercase;
      text-shadow: 0 0 30px rgba(89, 222, 255, .1);
    }
    h1 em { color: #70eaff; font-style: normal; font-weight: 650; text-shadow: 0 0 18px rgba(78, 224, 255, .38); }
    .intro { max-width: 610px; color: #7195a0; font-size: 13px; line-height: 1.75; }

    .hud-visual { position: relative; display: grid; place-items: center; min-height: 330px; isolation: isolate; }
    .particle-core { position: absolute; z-index: 1; width: min(340px, 112%); aspect-ratio: 1; pointer-events: none; filter: drop-shadow(0 0 9px rgba(72,225,255,.36)); }
    .hud-visual::before {
      content: "";
      position: absolute;
      width: min(310px, 100%);
      aspect-ratio: 1;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(93,240,255,.18), rgba(0,135,190,.06) 34%, transparent 70%);
      filter: blur(8px);
      animation: reactor-breathe 3.6s ease-in-out infinite;
    }
    .orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(89, 229, 255, .25); }
    .orbit::before, .orbit::after { content: ""; position: absolute; background: #63efff; box-shadow: 0 0 10px #63efff; }
    .orbit::before { width: 20px; height: 2px; left: -10px; top: 50%; }
    .orbit::after { width: 2px; height: 20px; top: -10px; left: 50%; }
    .orbit-one { width: 270px; height: 270px; border-style: dashed; animation: orbit-spin 22s linear infinite; }
    .orbit-two { width: 220px; height: 220px; border-color: rgba(89,229,255,.42); animation: orbit-spin-reverse 13s linear infinite; }
    .orbit-three { width: 164px; height: 164px; border-width: 2px; border-color: rgba(102,239,255,.18); box-shadow: inset 0 0 35px rgba(65,214,255,.08), 0 0 22px rgba(65,214,255,.12); animation: orbit-spin 8s linear infinite; }
    .reactor {
      position: relative;
      z-index: 2;
      display: grid;
      place-items: center;
      width: 112px;
      height: 112px;
      border: 1px solid #8ef5ff;
      border-radius: 50%;
      background: radial-gradient(circle, #effeff 0 4%, #83f3ff 5% 12%, #17bee7 13% 25%, rgba(4,64,82,.8) 26% 46%, #031017 47% 100%);
      box-shadow: 0 0 9px #a9f8ff, 0 0 36px rgba(41, 221, 255, .82), 0 0 90px rgba(28, 162, 226, .42), inset 0 0 24px #3de7ff;
      color: #edfdff;
      font: 500 14px/1 "Arial Narrow", sans-serif;
      letter-spacing: .08em;
      text-shadow: 0 0 8px white;
    }
    .reactor::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(232,253,255,.9) 0 5deg, transparent 5deg 14deg); mask: radial-gradient(circle, transparent 0 52%, #000 54% 70%, transparent 72%); opacity: .52; animation: orbit-spin-reverse 10s linear infinite; }
    .hud-readout { position: absolute; bottom: 2px; display: flex; gap: 22px; color: #4cb9ce; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
    .hud-readout b { color: #9af6ff; font-weight: 500; }

    .prompt-wrap {
      border-color: rgba(85, 226, 255, .24);
      border-radius: 5px;
      background: rgba(2, 13, 20, .72);
      box-shadow: inset 0 0 28px rgba(51, 202, 235, .035), 0 10px 40px rgba(0,0,0,.22);
    }
    #command { color: #d7f7fd; caret-color: var(--violet); font-size: 14px; }
    #command::placeholder { color: #466774; }
    .prompt-actions { border-top: 1px solid rgba(79, 213, 242, .1); }
    .mode-note, .meta { color: #537987; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
    .primary {
      border: 1px solid rgba(103, 237, 255, .68);
      border-radius: 0;
      clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
      background: linear-gradient(135deg, rgba(29, 185, 220, .85), rgba(2, 96, 132, .92));
      box-shadow: 0 0 18px rgba(44, 211, 244, .18), inset 0 1px 0 rgba(255,255,255,.2);
      color: #effdff;
      font-size: 10px;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    .primary:hover { background: linear-gradient(135deg, rgba(52, 222, 250, .95), rgba(4, 119, 155, .95)); box-shadow: 0 0 26px rgba(44,211,244,.3); }
    .chips { gap: 7px; }
    .chip {
      border-color: rgba(69, 177, 201, .15);
      border-radius: 3px;
      background: rgba(4, 23, 32, .64);
      color: #537d89;
      font-size: 9px;
      letter-spacing: .05em;
    }
    .chip:hover { border-color: rgba(93,229,255,.48); color: #8eefff; background: rgba(7,48,61,.62); }

    .chat-shell { height: min(760px, calc(100vh - 130px)); width: 100%; max-width: 420px; margin: 0 auto; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: linear-gradient(145deg, rgba(10,34,44,.7), rgba(2,13,20,.55)); }
    .hud-divider { border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--violet) 55%, transparent), transparent) 1; }
    .chat-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: linear-gradient(90deg, rgba(8,33,43,.64), rgba(3,18,26,.36)); backdrop-filter: blur(22px); }
    .chat-core-pinned { position: relative; z-index: 2; display: flex; justify-content: center; align-items: center; padding: 40px 20px; background: linear-gradient(180deg, rgba(6,26,34,.5), rgba(3,18,26,.2)); }
    .chat-title { display: flex; align-items: center; gap: 11px; }
    .chat-title strong { display: block; color: #c8f4fb; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
    .chat-title span { display: block; margin-top: 2px; color: #4d7480; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
    .hud-button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(75,201,229,.2); border-radius: 0; clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px)); padding: 8px 10px; background: rgba(3,25,34,.66); color: #6daeba; text-decoration: none; cursor: pointer; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
    .hud-button svg { flex: none; width: 13px; height: 13px; }
    .hud-button.external { border-color: rgba(120,240,255,.32); color: #8ef3ff; }
    .hud-button.external:hover { border-color: rgba(120,240,255,.6); background: rgba(8,50,63,.72); }
    .hud-button:hover, .hud-button[aria-pressed="true"] { border-color: rgba(89,229,255,.48); color: #9ef4ff; background: rgba(8,55,68,.68); box-shadow: 0 0 16px rgba(59,213,243,.12); }
    .chat-messages { position: relative; z-index: 1; min-height: 0; overflow-y: auto; padding: clamp(12px, 6%, 34px); scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
    .chat-messages::-webkit-scrollbar { display: none; }
    .chat-messages::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 25% 28%, rgba(255,126,10,.035), transparent 25%), radial-gradient(circle at 63% 18%, rgba(31,164,197,.075), transparent 45%); }
    .message-row { display: flex; align-items: flex-start; gap: 9px; width: min(820px, 100%); margin: 0 auto 18px; animation: message-in .24s ease-out; }
    .message-row.user { justify-content: flex-end; }
    .message-avatar { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 3px; border: 1px solid rgba(91,224,250,.28); border-radius: 50%; background: radial-gradient(circle, rgba(68,224,248,.32), rgba(3,25,34,.86)); color: #91effa; font: 700 9px/1 "Exo", ui-monospace, monospace; box-shadow: 0 0 13px rgba(50,201,232,.15); }
    .message-row.user .message-avatar { order: 2; border-color: rgba(255,188,79,.25); background: rgba(75,49,12,.4); color: #ffc46d; box-shadow: none; }
    .message-content { min-width: 0; max-width: min(680px, calc(100% - 35px)); }
    .message-meta { margin: 0 0 5px 2px; color: #4d7480; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
    .message-row.user .message-meta { text-align: right; }
    .message-bubble { padding: 13px 15px; border: 1px solid rgba(69,190,218,.15); border-radius: 3px 12px 12px 12px; background: linear-gradient(135deg, rgba(6,37,47,.76), rgba(3,22,31,.72)); color: #b9dfe7; font: 13px/1.72 Inter, ui-sans-serif, system-ui, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: inset 2px 0 0 rgba(78,221,249,.3); }
    .message-row.user .message-bubble { border-color: rgba(255,188,79,.16); border-radius: 12px 3px 12px 12px; background: linear-gradient(135deg, rgba(65,43,15,.62), rgba(32,26,18,.66)); color: #ead8ba; box-shadow: inset -2px 0 0 rgba(255,188,79,.32); }
    .answer-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; }
    .answer-sources-label { flex: none; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
    .answer-sources-list { display: flex; flex-wrap: wrap; gap: 6px; }
    .answer-source-chip { font-size: 10.5px; line-height: 1; padding: 5px 9px; border-radius: 999px; border: 1px solid rgba(69,190,218,.18); background: rgba(6,37,47,.5); color: var(--muted); text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .answer-source-chip:hover { color: #58e7fa; border-color: rgba(88,231,250,.4); }
    .message-row.typing .message-bubble { display: flex; gap: 5px; align-items: center; min-height: 46px; }
    .typing-dot { width: 5px; height: 5px; border-radius: 50%; background: #58e7fa; box-shadow: 0 0 7px rgba(88,231,250,.6); animation: typing-pulse 1.1s ease-in-out infinite; }
    .typing-dot:nth-child(2) { animation-delay: .16s; }
    .typing-dot:nth-child(3) { animation-delay: .32s; }
    .search-shimmer-icon { flex: none; width: 13px; height: 13px; border: 1.5px solid #58e7fa; border-radius: 50%; position: relative; opacity: .85; animation: search-icon-pulse 1.6s ease-in-out infinite; }
    .search-shimmer-icon::after { content: ""; position: absolute; width: 5px; height: 1.5px; background: #58e7fa; border-radius: 1px; right: -4px; bottom: -1px; transform: rotate(45deg); }
    .search-shimmer-text {
      font: 13px/1.72 Inter, ui-sans-serif, system-ui, sans-serif;
      background: linear-gradient(90deg, rgba(185,223,231,.45) 0%, #eafcff 50%, rgba(185,223,231,.45) 100%);
      background-size: 220% 100%;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      animation: search-shimmer-sweep 1.7s linear infinite;
    }
    .welcome-message { align-items: center; width: min(880px, 96%); margin-top: 5px; margin-bottom: 34px; }
    .welcome-message .message-content { max-width: 560px; }
    .welcome-message .message-bubble { padding: 17px 19px; color: #d4f2f7; font-size: 14px; }
    .chat-core.hud-visual { flex: none; min-height: 222px; width: 222px; }
    .chat-core .particle-core { width: 240px; }
    .chat-core .orbit-one { width: 166px; height: 166px; }
    .chat-core .orbit-two { width: 134px; height: 134px; }
    .chat-core .orbit-three { width: 100px; height: 100px; }
    .chat-core .reactor { width: 68px; height: 68px; font-size: 9px; }
    .chat-core .reactor::before { inset: 7px; }
    .chat-core .hud-readout { display: none; }
    .chat-core.hud-visual { overflow: visible; }
    .ultron-orb {
      position: absolute;
      inset: -24px;
      z-index: 1;
      display: grid;
      place-items: center;
      cursor: grab;
      isolation: isolate;
      filter: drop-shadow(0 0 12px rgba(245, 105, 0, .24));
    }
    .ultron-orb.dragging { cursor: grabbing; }
    .ultron-orb .particle-core {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      aspect-ratio: auto;
      pointer-events: auto;
      touch-action: none;
      filter: saturate(1.22) brightness(1.04) drop-shadow(0 0 5px rgba(255, 146, 20, .62)) drop-shadow(0 0 14px rgba(236, 84, 0, .46));
      mix-blend-mode: screen;
      transition: filter .35s ease, opacity .35s ease;
    }
    .ultron-orb[data-orb-mode="thinking"] .particle-core { filter: saturate(1.28) brightness(1.06) drop-shadow(0 0 11px rgba(255,126,12,.68)); }
    .ultron-orb[data-orb-mode="listening"] .particle-core { filter: saturate(1.22) brightness(1.09) drop-shadow(0 0 13px rgba(255,154,28,.74)); }
    .ultron-orb[data-orb-mode="learning"] .particle-core,
    .ultron-orb[data-orb-mode="alert"] .particle-core { filter: saturate(1.42) brightness(1.15) drop-shadow(0 0 19px rgba(255,119,8,.86)); }
    .orb-fallback {
      position: absolute;
      width: 56%;
      aspect-ratio: 1;
      border: 1px solid rgba(255, 170, 48, .62);
      border-radius: 50%;
      background: repeating-radial-gradient(circle, rgba(255,140,24,.12) 0 1px, transparent 2px 9px);
      box-shadow: 0 0 28px rgba(255,130,20,.38), inset 0 0 24px rgba(255,170,48,.22);
      animation: orbit-spin 18s linear infinite;
      transition: opacity .35s ease;
    }
    .orb-fallback::before, .orb-fallback::after {
      content: "";
      position: absolute;
      inset: 16%;
      border: 1px dashed rgba(255, 194, 94, .66);
      border-radius: 50%;
      transform: rotateX(64deg);
    }
    .orb-fallback::after { transform: rotateY(64deg); }
    .orb-ready .orb-fallback { opacity: 0; }
    .orb-identity {
      position: relative;
      z-index: 3;
      display: grid;
      place-items: center;
      pointer-events: none;
      color: rgba(255, 202, 112, .82);
      font: 700 7px/1 "Exo", ui-monospace, monospace;
      letter-spacing: .16em;
      text-shadow: 0 0 8px #ff9f24;
      transition: opacity .35s ease;
    }
    .orb-identity strong { color: #fff2ce; font-size: 11px; letter-spacing: .05em; }
    .orb-identity span { margin-top: 5px; }
    .orb-ready .orb-identity { opacity: 0; }
    .chat-composer { position: relative; z-index: 3; padding: 15px 18px 18px; border-top: 1px solid rgba(70,197,224,.14); background: linear-gradient(to top, rgba(2,12,18,.93), rgba(4,23,31,.7)); backdrop-filter: blur(26px) saturate(135%); }
    .chat-input-frame { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; align-items: end; max-width: 940px; margin: 0 auto; padding: 8px; border: 1px solid rgba(92,225,249,.25); border-radius: 7px; background: linear-gradient(135deg, rgba(8,31,40,.72), rgba(1,9,14,.76)); box-shadow: inset 0 1px 0 rgba(157,240,255,.05), inset 0 0 36px rgba(49,193,224,.035), 0 13px 34px rgba(0,0,0,.24); }
    #chatInput { width: 100%; min-height: 46px; max-height: 150px; padding: 11px 7px 8px; resize: none; border: 0; outline: 0; background: transparent; color: #d0f2f7; caret-color: #5ce9fb; font: 13px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
    #chatInput::placeholder { color: #42636e; }
    .voice-button { position: relative; display: grid; place-items: center; padding: 0; line-height: 1; width: 42px; height: 42px; border: 1px solid rgba(82,213,242,.24); border-radius: 50%; background: rgba(5,37,47,.7); color: #7fe9f6; cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
    .voice-button:hover { border-color: #58e8fa; box-shadow: 0 0 18px rgba(71,220,244,.22); }
    .voice-button.listening { color: #fff; background: rgba(174,50,59,.62); border-color: #ff7a84; box-shadow: 0 0 0 7px rgba(255,83,97,.08), 0 0 24px rgba(255,83,97,.3); animation: mic-listening 1.2s ease-in-out infinite; }
    .voice-button.finalizing { color: #fff; background: rgba(43,113,133,.62); border-color: #58e7fa; box-shadow: 0 0 0 7px rgba(88,231,250,.08), 0 0 24px rgba(88,231,250,.3); animation: mic-finalizing .75s ease-in-out infinite; }
    .send-button { min-height: 42px; }
    .composer-hint { max-width: 920px; margin: 7px auto 0; color: #3f626d; font-size: 10px; letter-spacing: .06em; text-align: center; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

    .section-card { padding: 17px 19px; }
    .section-head { padding-bottom: 11px; border-bottom: 1px solid rgba(67, 181, 207, .1); }
    h2 { color: #c7eff6; font-size: 10px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; }
    h2::before { content: "// "; color: var(--violet); }

    .panel-card { background: rgba(3,15,22,.66); }
    .panel-tabs { border-bottom: 1px solid rgba(67, 181, 207, .14); background: rgba(4,20,28,.4); }
    .panel-tab { color: #577b86; letter-spacing: .14em; text-transform: uppercase; border-bottom: 2px solid transparent; transition: color .2s ease, border-color .2s ease, background .2s ease; }
    .panel-tab:hover { color: #9ef4ff; }
    .panel-tab[aria-selected="true"] { color: #8ef3ff; border-bottom-color: #4de3ff; background: rgba(46,216,255,.07); text-shadow: 0 0 10px rgba(110,234,250,.3); }
    .panel-pane { counter-reset: panelsec; }
    .panel-section { counter-increment: panelsec; }
    .panel-section:not(:first-child) { padding-top: 18px; border-top: 1px solid rgba(67, 181, 207, .1); }
    .panel-section h2::before { content: "// " counter(panelsec, decimal-leading-zero) " \00b7 "; }
    .empty { border-color: rgba(74,192,218,.15); border-radius: 4px; color: #547581; background: rgba(2,12,18,.3); font-size: 11px; }
    .empty strong { color: #8db8c2; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
    .verify-prompt { border-color: rgba(255,185,74,.32); border-radius: 3px; background: rgba(87,58,13,.28); color: #ffd488; }
    .verify-prompt .secondary { flex: none; }

    .tool-item { position: relative; overflow: hidden; border-color: rgba(68,180,205,.13); border-radius: 4px; background: rgba(3,18,25,.52); }
    .tool-item:hover { border-color: rgba(87,224,255,.42); background: rgba(5,38,49,.7); box-shadow: inset 2px 0 0 var(--violet); }
    .tool-item.just-learned { animation: learned-tool-settle 1.7s ease-out both; }
    .tool-item.just-learned::after {
      content: "";
      position: absolute;
      inset: 0 auto 0 -35%;
      width: 28%;
      pointer-events: none;
      background: linear-gradient(90deg, transparent, rgba(126,242,255,.28), transparent);
      transform: skewX(-16deg);
      animation: learned-tool-scan 1.25s .08s ease-out both;
    }
    .chat-core.learning-pulse .reactor { animation: learned-core-pulse 1.55s ease-out; }
    .chat-core.learning-pulse .particle-core { animation: learned-particle-glow 1.55s ease-out; }
    #toolCount.learning-pulse { animation: learned-count-pulse 1.55s ease-out; }
    .tool-name { display: block; color: #bfeaf2; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
    .tool-desc { display: block; color: #496d77; font-size: 9px; }
    .ai-area-prompt { border-color: rgba(68,180,205,.16); background: rgba(3,18,25,.42); }
    .ai-area-empty { color: #496d77; }
    .interface-chip { display: inline-block; margin-top: 5px; color: #67ddec; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
    .imported-chip { display: inline-block; margin: 5px 0 0 8px; color: #ffc767; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
    .interface-list { display: grid; gap: 8px; }
    .interface-item {
      width: 100%;
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      padding: 10px;
      border: 1px solid rgba(87,224,255,.18);
      border-radius: 4px;
      background: rgba(3,22,30,.66);
      color: inherit;
      text-align: left;
      cursor: pointer;
    }
    .interface-item:hover { border-color: rgba(87,224,255,.5); background: rgba(7,43,54,.72); }
    .interface-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(87,224,255,.38); border-radius: 50%; color: #7beeff; font-size: 9px; box-shadow: inset 0 0 14px rgba(87,224,255,.1); }
    .interface-copy { min-width: 0; }
    .interface-title { display: block; overflow: hidden; color: #c9f7ff; font-size: 10px; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
    .interface-tool { display: block; overflow: hidden; margin-top: 3px; color: #4f7783; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .interface-open { color: #71e9f9; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
    .risk { border: 1px solid rgba(88,231,255,.24); border-radius: 2px; background: rgba(31,152,177,.14); color: #72eafa; }
    .risk.high, .risk.prohibited { border-color: rgba(255,130,72,.28); background: rgba(192,72,26,.14); color: #ffb25e; }
    .risk.medium { border-color: rgba(255,185,74,.25); background: rgba(181,117,24,.13); color: #ffc664; }
    .status-pill { border: 1px solid rgba(88,231,255,.24); border-radius: 2px; background: rgba(31,152,177,.14); color: #72eafa; }
    .status-pill.offline { border-color: rgba(140,160,170,.24); background: rgba(60,72,80,.28); color: #93a7af; }
    .soul-copy { color: #577b86; }
    .feedback-row input, #toolArgs, #chatModelName, #toolModelName, #interfaceModelName, #modelKey, .import-field, #importSource, #importSchema {
      border-color: rgba(74, 200, 228, .2);
      border-radius: 3px;
      background: rgba(2, 12, 18, .72);
      color: #c9edf4;
    }
    .feedback-row input::placeholder { color: #446672; }
    .capability-option { border-color: rgba(74,200,228,.16); border-radius: 3px; background: rgba(2,12,18,.5); color: #78a5af; }
    .secondary { border-color: rgba(93,222,249,.34); border-radius: 0; clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px)); background: rgba(10,61,76,.72); color: #9aedfa; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }

    dialog { border: 1px solid rgba(90,225,255,.28); border-radius: 6px; color: var(--ink); background: rgba(3,15,22,.94); box-shadow: 0 0 80px rgba(0,163,209,.18), 0 35px 100px rgba(0,0,0,.7); backdrop-filter: blur(24px); }
    dialog::backdrop { background: rgba(0,5,8,.74); backdrop-filter: blur(7px); }
    .dialog-head { border-color: rgba(73,197,225,.15); background: rgba(6,31,42,.52); }
    .dialog-head h3 { color: #d5f8ff; font: 400 20px "Exo", "Arial Narrow", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
    .dialog-head p { color: #5a818c; }
    .workspace-manager-dialog { width: min(680px, calc(100% - 28px)); max-height: min(760px, calc(100vh - 36px)); }
    .workspace-manager-dialog .dialog-body { padding: 18px; }
    .workspace-manager-feedback { min-height: 16px; margin: 0 0 12px; color: #76e8f8; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
    .workspace-capture { margin-bottom: 18px; padding: 15px; border: 1px solid rgba(85,220,255,.2); border-radius: 7px; background: rgba(4,29,40,.58); }
    .workspace-capture-title { margin-bottom: 10px; color: #d5f8ff; font: 12px "Exo", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
    .workspace-capture-row { display: flex; gap: 8px; }
    .workspace-capture-row input { min-width: 0; flex: 1; border: 1px solid rgba(85,220,255,.22); border-radius: 5px; padding: 10px 11px; outline: 0; background: rgba(0,10,16,.7); color: #d9f8ff; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
    .workspace-list { display: grid; gap: 9px; }
    .workspace-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px solid rgba(85,220,255,.16); border-radius: 6px; background: rgba(3,20,29,.64); }
    .workspace-card.current { border-color: rgba(255,185,74,.5); box-shadow: inset 0 0 18px rgba(255,185,74,.06); }
    .workspace-card-name { color: #d5f8ff; font: 13px "Exo", sans-serif; letter-spacing: .06em; }
    .workspace-card-meta { margin-top: 4px; color: #6f9ba7; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
    .workspace-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
    .workspace-card-actions .hud-button { padding: 6px 9px; font-size: 9px; }
    .workspace-card-actions .delete { color: #ff8b91; border-color: rgba(255,92,104,.24); }
    .workspace-empty { padding: 24px 12px; border: 1px dashed rgba(85,220,255,.18); color: #6f9ba7; text-align: center; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
    .close { border-color: rgba(87,216,244,.22); border-radius: 3px; background: rgba(5,30,40,.78); color: #85eafa; }
    .field-label { color: #63d8eb; font-size: 10px; }
    .result-box { border: 1px solid rgba(63,210,240,.15); border-radius: 4px; background: rgba(8,70,82,.25); color: #bcecf3; }
    .result-box.error { border-color: rgba(255,95,106,.22); background: rgba(109,28,37,.25); color: #ffabb2; }
    .approval { border-color: rgba(255,185,74,.28); border-radius: 4px; background: rgba(86,57,14,.3); }
    .approval p { color: #b99a61; }
    .token { border: 1px solid rgba(255,199,104,.18); border-radius: 2px; background: rgba(3,12,17,.6); color: #ffd488; }
    pre { border: 1px solid rgba(70,207,235,.18); border-radius: 3px; background: #01090d; color: #78e7f6; }
    .toast { border: 1px solid rgba(81,220,250,.28); border-radius: 3px; background: rgba(4,27,36,.94); color: #bff5fc; box-shadow: 0 0 30px rgba(37,198,230,.2); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
    .artifact-panel { background: linear-gradient(145deg, rgba(10,34,44,.7), rgba(2,13,20,.55)); height: min(760px, calc(100vh - 130px)); }
    .artifact-head { background: rgba(6,31,42,.52); }
    .artifact-head-icon { border-color: rgba(87,224,255,.38); color: #7beeff; background: rgba(3,22,30,.6); box-shadow: inset 0 0 14px rgba(87,224,255,.1); }
    .artifact-head-title strong { color: #d5f8ff; font: 400 15px "Exo", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
    .artifact-head-title span { color: #5a818c; }
    .tool-interface-frame { border-color: rgba(84,224,250,.2); }

    .artifact-content { scrollbar-width: thin; scrollbar-color: rgba(75,191,217,.35) transparent; }
    .artifact-empty { color: #577b86; }
    .artifact-markdown h1, .artifact-markdown h2, .artifact-markdown h3 { color: #d5f8ff; font-family: "Exo", sans-serif; letter-spacing: .02em; }
    .artifact-markdown p, .artifact-markdown li { color: #b9dfe7; }
    .artifact-markdown a { color: #6ee9ff; }
    .artifact-code { border: 1px solid rgba(70,207,235,.18); background: #01090d; color: #78e7f6; }
    .artifact-table-wrap { border-color: rgba(74,192,218,.18); background: rgba(2,12,18,.4); }
    .artifact-table th { color: #63d8eb; border-color: rgba(74,192,218,.14); }
    .artifact-table td { color: #b9dfe7; border-color: rgba(74,192,218,.1); }
    .artifact-progress { border: 1px solid rgba(255,185,74,.28); background: rgba(87,58,13,.22); }
    .artifact-progress-pulse { background: #ffc767; box-shadow: 0 0 10px rgba(255,199,103,.8); }
    .artifact-progress p { color: #ffd488; }
    .artifact-note-card { border-color: rgba(74,192,218,.16); background: rgba(2,12,18,.4); }
    .artifact-note-card p { color: #cdeef4; }
    .artifact-note-card footer { color: #577b86; }
    .artifact-note-card footer small { color: #63d8eb; }
    .artifact-menu-item { border-color: rgba(87,224,255,.22); background: rgba(3,22,30,.6); color: #cdeef4; }
    .artifact-menu-item:hover { border-color: rgba(87,224,255,.5); background: rgba(7,43,54,.72); }
    .artifact-mermaid-error { color: #577b86; }
    .artifact-mermaid-error p { color: #ffb25e; }

    .workspace-toolbar { background: rgba(4,20,28,.4); }
    .workspace-toolbar select { border-color: rgba(74,200,228,.2); background: rgba(2,12,18,.72); color: #c9edf4; }
    .workspace-canvas::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background-image:
        /* fine grid */
        linear-gradient(rgba(88, 232, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 232, 255, 0.05) 1px, transparent 1px),
        /* major grid */
        linear-gradient(rgba(88, 232, 255, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 232, 255, 0.16) 1px, transparent 1px);
      background-size: 32px 32px, 32px 32px, 128px 128px, 128px 128px;
      background-position: center, center, center, center;
      mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 0%, rgba(0,0,0,.55) 60%, transparent 100%);
      -webkit-mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 0%, rgba(0,0,0,.55) 60%, transparent 100%);
    }
    .workspace-canvas.drag-over { box-shadow: inset 0 0 0 2px #58e8fa, inset 0 0 60px rgba(88,232,255,.1); }
    .ww-text-area { color: #fff; }
    .ww-text-area::placeholder { color: #3f626d; }
    .ww-doc-title, .ww-doc-body { color: #d0f2f7; }
    .ww-doc-title::placeholder, .ww-doc-body::placeholder { color: #3f626d; }
    .ww-doc-title { border-color: rgba(74,200,228,.18); }
    .ww-doc-footer { border-color: rgba(74,200,228,.18); }
    .ww-notes-add input { border-color: rgba(74,200,228,.2); background: rgba(2,12,18,.5); color: #cdeef4; }
    .ww-note { border-color: rgba(74,200,228,.14); background: rgba(2,12,18,.4); color: #cdeef4; }
    .ww-note button { color: #ff9f9f; }
    .ww-image-fill.empty { color: #3f626d; }
    .ww-clock-time { color: #eafcff; text-shadow: 0 0 14px rgba(88,232,255,.4); }
    .ww-clock-date { color: #63d8eb; }

    @keyframes orbit-spin { to { transform: rotate(360deg); } }
    @keyframes orbit-spin-reverse { to { transform: rotate(-360deg); } }
    @keyframes blueprint-drift { to { background-position: 160px 192px; } }
    @keyframes plane-current { to { background-position: 92px 92px, 92px 92px, 368px 368px, 368px 368px; } }
    @keyframes glow-drift { from { transform: translate3d(-2vw, -2vh, 0) scale(.92); } to { transform: translate3d(6vw, 5vh, 0) scale(1.08); } }
    @keyframes ambient-orbit { to { transform: rotate(360deg) scale(1.04); } }
    @keyframes ambient-orbit-reverse { to { transform: rotate(-360deg) scale(.96); } }
    @keyframes ambient-node { 0%,100% { opacity: .26; } 48% { opacity: .85; } 56% { opacity: .52; } }
    @keyframes environment-scan { from { transform: translateY(-20vh); } to { transform: translateY(138vh); } }
    @keyframes glass-sweep { 0%, 62% { left: -26%; opacity: 0; } 70% { opacity: 1; } 86%,100% { left: 112%; opacity: 0; } }
    @keyframes reactor-breathe { 0%,100% { transform: scale(.94); opacity: .7; } 50% { transform: scale(1.06); opacity: 1; } }
    @keyframes scan-pass { from { transform: translateY(0); } to { transform: translateY(440%); } }
    @keyframes message-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes typing-pulse { 0%,100% { opacity: .25; transform: translateY(1px); } 50% { opacity: 1; transform: translateY(-2px); } }
    @keyframes search-shimmer-sweep { 0% { background-position: 200% 0; } 100% { background-position: -20% 0; } }
    @keyframes search-icon-pulse { 0%,100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1); } }
    @keyframes gesture-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(88,231,250,.45); } 50% { box-shadow: 0 0 0 6px rgba(88,231,250,0); } }
    @keyframes mic-listening { 0%,100% { transform: scale(.96); } 50% { transform: scale(1.04); } }
    @keyframes mic-finalizing { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
    @keyframes learned-core-pulse {
      0%, 100% { transform: scale(1); filter: brightness(1); }
      28% { transform: scale(1.07); filter: brightness(1.38); box-shadow: 0 0 13px #d9fdff, 0 0 52px rgba(77,231,255,.95), 0 0 112px rgba(35,179,229,.55), inset 0 0 27px #70efff; }
      62% { transform: scale(1.025); filter: brightness(1.12); }
    }
    @keyframes learned-particle-glow {
      0%, 100% { filter: saturate(1.2) drop-shadow(0 0 7px rgba(255,150,24,.52)); opacity: 1; }
      32% { filter: saturate(1.7) brightness(1.25) drop-shadow(0 0 19px rgba(255,184,66,.88)); opacity: .94; }
    }
    @keyframes learned-tool-settle {
      0% { border-color: rgba(114,239,255,.72); background: rgba(13,78,94,.62); box-shadow: inset 3px 0 0 #7af1ff, 0 0 20px rgba(60,218,246,.18); }
      100% { border-color: rgba(68,180,205,.13); background: rgba(3,18,25,.52); box-shadow: none; }
    }
    @keyframes learned-tool-scan { from { left: -35%; opacity: 0; } 18% { opacity: 1; } to { left: 112%; opacity: 0; } }
    @keyframes learned-count-pulse { 0%,100% { color: #537987; } 35% { color: #9cf7ff; text-shadow: 0 0 12px rgba(92,233,255,.7); } }

    @media (prefers-reduced-motion: reduce) {
      .tool-item.just-learned, .tool-item.just-learned::after,
      .chat-core.learning-pulse .reactor, .chat-core.learning-pulse .particle-core,
      #toolCount.learning-pulse { animation: none; }
    }

    @media (max-width: 980px) {
      .composer-grid { grid-template-columns: 1fr; }
      .hud-visual { min-height: 260px; }
      .orbit-one { width: 230px; height: 230px; }
      .orbit-two { width: 188px; height: 188px; }
      .orbit-three { width: 140px; height: 140px; }
      .reactor { width: 94px; height: 94px; }
      .chat-core .reactor { width: 68px; height: 68px; }
    }
    @media (max-width: 880px) {
      .layout { display: grid; position: static; min-height: 0; grid-template-columns: 1fr; }
      .layout > .artifact-panel,
      .layout > .main-column,
      .layout > .side-column {
        position: static;
        width: auto;
        pointer-events: auto;
      }
      .layout > .artifact-panel { height: calc(100vh - 120px) !important; }
    }

    @media (min-width: 881px) {
      html, body { height: 100%; overflow: hidden; }
      .shell { height: 100vh; display: flex; flex-direction: column; }
      .layout { flex: 1 1 auto; min-height: 0; align-items: stretch; }
      .main-column, .side-column { min-height: 0; }
      .main-column {
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(75,191,217,.35) transparent;
      }
      .main-column.scroll-fade-bottom, #chatMessages.scroll-fade-bottom, .panel-pane.scroll-fade-bottom {
        mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
      }
      .main-column { align-content: stretch; align-items: stretch; }
      .side-column { align-content: stretch; align-items: stretch; }
      .chat-shell, .artifact-panel, .panel-card { height: 100%; }
      .artifact-panel { min-height: 0; }
      .panel-card { display: flex; flex-direction: column; }
      .panel-tabs { flex: none; }
      .panel-pane {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
      }
      .panel-pane::-webkit-scrollbar { display: none; }
    }
    @media (max-width: 880px) {
      .chat-shell, .artifact-panel { height: calc(100vh - 120px); }
    }
    @media (max-width: 580px) {
      .shell { width: min(100% - 14px, 1480px); }
      .holo-node, .arc-two { display: none; }
      .blueprint-plane { opacity: .26; }
      .composer { min-height: 0; padding: 24px 18px; }
      .hud-visual { min-height: 235px; }
      .chat-shell, .artifact-panel { height: calc(100vh - 94px); }
      .chat-header { padding: 12px; }
      .chat-messages { padding: 16px 10px; }
      .message-row { width: 100%; }
      .chat-core-pinned { padding: 18px 12px 16px; }
      .chat-core-pinned .chat-core.hud-visual { width: 150px; min-height: 150px; transform: scale(.82); }
      .chat-composer { padding: 10px; }
      .send-button { padding-inline: 12px; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
    }

  

    /* Layout refinements retain the original holographic visual language. */
    :root { color-scheme: dark; }
    html, body { height: 100%; overflow: hidden; }
    .shell { width: 100%; height: 100dvh; margin: 0; padding: 0; display: block; }
    .layout { --left-width: 300px; --right-width: 280px; }
    .layout, .layout.right-panel-collapsed { position: relative; display: block; width: 100%; height: 100%; min-height: 0; }
    .layout > .artifact-panel { position: absolute; inset: 0; width: 100%; height: 100% !important; z-index: 0; border: 0; border-radius: 0; box-shadow: none; clip-path: none; backdrop-filter: none; background: radial-gradient(ellipse at 50% 40%, rgba(9,38,62,.08), transparent 70%), rgba(2,8,16,.30); }
    .layout > .artifact-panel::before { display: none; }
    .layout > .main-column, .layout > .side-column { position: absolute; top: 88px; bottom: 22px; z-index: 3; display: flex; min-height: 0; overflow: visible; pointer-events: none; mask-image: none; }
    .layout > .main-column { left: 22px; width: var(--left-width); }
    .layout > .side-column { left: 22px; right: auto; width: var(--right-width); }
    .layout .chat-shell, .layout .panel-card { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; pointer-events: auto; overflow: hidden; background: linear-gradient(145deg, rgba(10,34,44,.88), rgba(2,15,23,.86)); }
    .chat-shell { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
    .chat-header { padding: 22px 22px 16px; }
    .chat-title strong { font-size: 16px; letter-spacing: .22em; }
    .chat-title span { margin-top: 7px; }
    .chat-core-pinned { padding: 24px 0; }
    .chat-core.hud-visual { width: 190px; min-height: 190px; transform: none; }
    .chat-messages { padding: 20px; scrollbar-width: thin; scrollbar-color: rgba(75,191,217,.25) transparent; }
    .welcome-message { display: block; width: 100%; }
    .welcome-message .message-avatar { display: none; }
    .welcome-message .message-meta { margin-bottom: 12px; }
    .welcome-message .message-bubble { padding: 14px; font-size: 13px; }
    .chat-composer { padding: 14px; }
    .chat-input-frame { padding: 8px; gap: 6px; }
    #chatInput { min-height: 36px; padding: 8px 2px; font-size: 13px; }
    .voice-button { width: 30px; font-size: 9px; }
    .send-button { padding: 8px 10px; font-size: 11px; }
    button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #8ef3ff; outline-offset: 3px; }
    .artifact-head { position: absolute; top: 0; left: 0; right: 0; height: 66px; padding: 16px 26px; }
    .artifact-head-title strong { font-size: 12px; }
    .artifact-head-title span { font-size: 10px; }
    .workspace-toolbar { position: absolute; top: 13px; left: 220px; right: 22px; z-index: 2; padding: 0; height: 40px; gap: 12px; border: 0; flex-wrap: nowrap; background: none; }
    .workspace-switcher, .workspace-add-widgets { flex-wrap: nowrap; gap: 5px; }
    .workspace-toolbar select { max-width: 160px; height: 34px; font-size: 11px; }
    .hud-button { padding: 7px 9px; min-height: 30px; font-size: 10px; }
    .artifact-body { position: absolute; inset: 66px 0 0; padding: 0; }
    .workspace-canvas { border-radius: 0; cursor: default; }
    .workspace-canvas:has(.workspace-widgets:empty)::after { content: 'WORKSPACE // AWAITING INPUT'; position: absolute; top: 43%; left: calc(var(--left-width) + 48px); right: calc(var(--right-width) + 48px); color: #78b6c5; font: 400 clamp(12px, 1.4vw, 19px)/1.6 'Exo', sans-serif; letter-spacing: .18em; text-align: center; pointer-events: none; text-shadow: 0 0 24px rgba(88,231,250,.25); }
    .artifact-content, .tool-interface-frame { margin-left: calc(var(--right-width) + 44px); width: calc(100% - var(--left-width) - var(--right-width) - 88px); height: calc(100% - 44px); margin-top: 22px; }
    .panel-card { display: flex; flex-direction: column; }
    .panel-tabs { flex: none; padding: 14px; gap: 4px; }
    .panel-tab { padding: 10px 14px; font-size: 11px; }
    .panel-pane { min-height: 0; flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(75,191,217,.25) transparent; }
    .panel-section { padding: 0; }
    .section-head { flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
    .section-head > span { flex-wrap: wrap; }
    .interface-list, .tool-list { display: grid; grid-template-columns: 1fr; gap: 9px; }
    .interface-item, .tool-item { padding: 12px; }
    .interface-title { white-space: normal; line-height: 1.6; font-size: 10px; }
    .interface-icon { width: 28px; height: 28px; }
    .interface-open { font-size: 9px; }
    .interface-tool { font-size: 10px; }
    .panel-footer { padding: 10px 14px; }
    .settings-button, .gesture-button { width: 34px; height: 34px; }
    .layout.right-panel-collapsed .side-column { width: 52px; }
    .right-panel-collapsed .side-column .panel-footer { padding: 8px !important; }
    @media (max-width: 1200px) { .layout { --left-width: 270px; --right-width: 240px; } .workspace-toolbar { left: 180px; } .workspace-toolbar .hud-button { padding: 7px; } .workspace-toolbar select { max-width: 120px; } }
    @media (max-width: 1050px) { .layout { --left-width: 250px; --right-width: 220px; } .workspace-toolbar { height: auto; align-items: flex-start; } .workspace-add-widgets { flex-wrap: wrap; justify-content: flex-end; } .artifact-head { height: 104px; } .artifact-body { top: 104px; } .layout > .main-column, .layout > .side-column { top: 122px; } }
    @media (max-width: 700px) {
      html, body { height: auto; overflow: visible; } .shell { height: auto; min-height: 100dvh; }
      .layout, .layout.right-panel-collapsed { display: flex; flex-direction: column; min-height: 100dvh; height: auto; padding: 14px; gap: 14px; }
      .layout > .artifact-panel { position: relative; order: 1; height: 65dvh !important; min-height: 400px; }
      .layout > .main-column, .layout > .side-column, .layout.right-panel-collapsed .side-column { position: relative; inset: auto; width: 100%; display: block; }
      .layout > .main-column { order: 2; height: 600px; } .layout > .side-column { order: 3; height: 440px; }
      .artifact-head { height: 64px; padding: 12px; } .workspace-toolbar { top: 74px; left: 10px; right: 10px; flex-wrap: wrap; } .workspace-add-widgets { justify-content: flex-start; }
      .artifact-body { top: 172px; } .workspace-canvas:has(.workspace-widgets:empty)::after { left: 22px; right: 22px; }
      .artifact-content, .tool-interface-frame { margin: 0; width: 100%; height: 100%; } .right-collapse-button { display: none; }
      .right-panel-collapsed .side-column .panel-card > .panel-tabs { display: flex !important; } .right-panel-collapsed .side-column .panel-card > .panel-pane:not([hidden]) { display: block !important; }
    }
  

    .workspace-core {
      position: absolute;
      inset: auto 28px 24px auto;
      width: min(280px, 28vw, 36vh);
      aspect-ratio: 1;
      display: grid;
      place-items: center;
      pointer-events: none;
      /* Above the canvas stacking context, including raised/dragged widgets. */
      z-index: 3;
      transition: right .9s cubic-bezier(.22,1,.36,1), bottom .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1);
    }
    body:not(:has(#cameraPreview:not([hidden]))) .artifact-body:has(#workspaceCanvas:not([hidden]) .workspace-widgets:empty) .workspace-core {
      right: 50%;
      bottom: 58%;
      transform: translate(50%, 50%) scale(1.35);
    }
    .workspace-core .chat-core.hud-visual {
      width: 100%;
      min-height: 0;
      aspect-ratio: 1;
      height: auto;
      opacity: .8;
      animation: core-arrive 1.6s ease-out both;
      transition: opacity .8s ease;
    }
    .workspace-core .chat-core::before {
      content: '';
      position: absolute;
      inset: -18%;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255,119,12,.1), rgba(255,119,12,.025) 44%, transparent 70%);
      filter: blur(22px);
    }
    .workspace-core .ultron-orb { inset: 0; cursor: default; }
    .workspace-core .ultron-orb .particle-core { pointer-events: none; touch-action: auto; }
    .workspace-canvas { z-index: 1; }
    .workspace-canvas::after {
      content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
      background: radial-gradient(ellipse at center, transparent 48%, rgba(1,5,9,.08) 72%, rgba(1,5,9,.26) 100%);
    }
    .workspace-widgets { z-index: 1; }
    .artifact-content, .tool-interface-frame { position: relative; z-index: 2; }
    .workspace-canvas:has(.workspace-widgets:empty)::after {
      display: block; content: ""; inset: 0; mask-image: none;
    }
    .artifact-body:has(.workspace-widget) .workspace-core .chat-core,
    body:has(#cameraPreview:not([hidden])) .workspace-core .chat-core { opacity: .75; }
    @keyframes core-arrive { from { opacity: 0; transform: translateY(12px) scale(.96); } to { transform: translateY(0) scale(1); } }
    @media (max-width: 700px) {
      .workspace-core { inset: auto 12px 10px auto; width: min(180px, 48vw); }
      body:not(:has(#cameraPreview:not([hidden]))) .artifact-body:has(#workspaceCanvas:not([hidden]) .workspace-widgets:empty) .workspace-core { right: 50%; }
    }
    @media (prefers-reduced-motion: reduce) { .workspace-core, .workspace-core .chat-core { animation: none; transition: none; } }
  

    .layout, .layout.right-panel-collapsed { --left-width: 0px; }
    .layout > .main-column {
      position: absolute; inset: auto 44px 26px 44px;
      width: auto; height: auto; display: flex; justify-content: center;
      z-index: 4; transition: left .65s ease;
    }
    .layout .chat-shell {
      width: min(100%, 680px); height: auto; display: flex; flex-direction: column;
      background: none; border: 0; box-shadow: none; backdrop-filter: none;
      clip-path: none; overflow: visible; pointer-events: none;
    }
    .chat-shell::before, .chat-shell::after, .chat-shell .chat-header { display: none; }
    .chat-shell .chat-composer { padding: 0; border: 0; background: none; pointer-events: auto; }
    .console-caption { display: flex; align-items: center; gap: 12px; padding: 0 4px 10px; color: #76c4d6; font: 10px 'Exo', sans-serif; letter-spacing: .18em; }
    .console-caption strong { color: #bfeef7; font-size: 12px; letter-spacing: .23em; }
    .console-caption::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #ffad46; box-shadow: 0 0 10px #ff9526; }
    .console-caption button { margin-left: auto; background: rgba(3,24,33,.8); border: 1px solid #58e7fa30; color: #8cd9e8; padding: 6px 10px; font: 9px 'Exo', sans-serif; letter-spacing: .08em; cursor: pointer; }
    .chat-shell .chat-input-frame { padding: 12px; gap: 12px; border: 1px solid rgba(88,231,250,.4); border-radius: 3px; background: linear-gradient(110deg, rgba(8,38,50,.92), rgba(2,18,27,.94)); backdrop-filter: blur(20px); box-shadow: 0 12px 60px #0007, 0 0 28px #58e7fa0a, inset 0 1px #9cf2ff12; }
    .chat-shell .chat-input-frame:focus-within { border-color: #8ef3ff; box-shadow: 0 0 24px #58e7fa20; }
    .chat-shell #chatInput { padding: 9px 0; font-size: 14px; }
    .chat-shell .send-button { padding: 10px 18px; }
    .chat-shell .chat-messages { display: none; max-height: min(42vh, 380px); padding: 18px; margin-bottom: 16px; background: linear-gradient(160deg, rgba(4,26,36,.95), rgba(2,15,24,.95)); border: 1px solid #58e7fa26; backdrop-filter: blur(24px); pointer-events: auto; mask-image: none; border-radius: 3px; }
    .chat-shell.chat-history-open .chat-messages { display: block; animation: console-reveal .28s ease-out; }
    .chat-shell .welcome-message { display: none; }
    .chat-shell .chat-messages:not(:has(.message-row:not(.welcome-message)))::after { content: 'Your conversation will appear here.'; color: #77a9b5; font-size: 12px; }
    @keyframes console-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
    @media (max-width: 700px) {
      .layout, .layout.right-panel-collapsed { padding-bottom: 125px; }
      .layout > .main-column { position: fixed; inset: auto 14px 18px; width: auto; height: auto; }
      .console-caption span { display: none; }
      .chat-shell .chat-messages { max-height: min(18dvh, 150px); }
    }
    @media (prefers-reduced-motion: reduce) { .layout > .main-column { transition: none; } .chat-shell.chat-history-open .chat-messages { animation: none; } }
  

    .layout .chat-shell { width: min(100%, 760px); }
    .console-caption { display: none; }
    .console-caption strong { font-size: 10px; letter-spacing: .16em; opacity: .75; }
    .console-caption span, .console-caption::before { display: none; }
    .console-caption button { border: 0; background: none; font-size: 10px; letter-spacing: 0; color: #82acb6; padding: 5px; }
    .chat-shell .chat-input-frame {
      grid-template-columns: minmax(0, 1fr) 36px;
      align-items: center;
      padding: 8px 12px; gap: 10px; border-radius: 18px; clip-path: none;
      border: 1px solid rgba(148,234,255,.23);
      background: linear-gradient(135deg, rgba(119,219,248,.09), rgba(7,25,35,.48));
      backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
      box-shadow: inset 0 1px rgba(210,250,255,.08), 0 8px 30px #0003;
    }
    .chat-shell .chat-input-frame:focus-within { border-color: rgba(148,234,255,.5); box-shadow: 0 0 20px #67dfff0c; }
    .chat-shell .send-button { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; padding: 0; align-self: center; border-radius: 50%; clip-path: none; background: rgba(97,216,244,.12); border: 1px solid #8deaff28; box-shadow: none; color: #b4eff9; line-height: 1; }
    .chat-shell .send-button svg { display: block; width: 18px; height: 18px; }
    .chat-shell .send-button:hover:not(:disabled) { background: rgba(97,216,244,.22); border-color: #8deaff66; transform: none; }
    .chat-shell .voice-button { display: none; }
    .chat-shell #chatInput { font-size: 13px; }
    .chat-shell .chat-messages {
      max-height: min(18dvh, 150px);
      mask-image: linear-gradient(to bottom, transparent, #000 26px);
      -webkit-mask-image: linear-gradient(to bottom, transparent, #000 26px);
      background: none; border: 0; box-shadow: none; backdrop-filter: none;
      padding: 26px 4px 8px; margin-bottom: 10px; scrollbar-width: none;
      scrollbar-color: #89e6ff25 transparent; pointer-events: auto;
    }
    .chat-shell .chat-messages::before { display: none; }
    .chat-shell .message-row { margin: 0 0 14px; width: 100%; gap: 0; }
    .chat-shell .message-avatar, .chat-shell .message-meta { display: none; }
    .chat-shell .message-content { max-width: 88%; min-width: 0; }
    .chat-shell .message-bubble {
      padding: 13px 17px; border-radius: 18px 18px 18px 5px;
      border: 1px solid rgba(137,232,255,.21);
      background: linear-gradient(135deg, rgba(132,227,255,.12), rgba(4,27,40,.65));
      backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
      box-shadow: inset 0 1px rgba(219,251,255,.1), 0 6px 24px #0002;
      color: #d4edf3; font-size: 13px; line-height: 1.7;
    }
    .chat-shell .message-row.user .message-bubble {
      border-radius: 18px 18px 5px 18px; border-color: rgba(166,224,241,.14);
      background: linear-gradient(135deg, rgba(110,166,190,.1), rgba(8,23,33,.58));
      color: #c4dce4; box-shadow: inset 0 1px rgba(219,251,255,.07), 0 6px 24px #0002;
    }
    .chat-shell .message-row.typing .message-bubble { min-width: 64px; }
    .chat-shell .chat-messages:not(:has(.message-row:not(.welcome-message)))::after { display: block; padding: 14px; background: #09212bb3; border-radius: 14px; }
    .chat-shell .answer-source-chip { border-radius: 9px; letter-spacing: 0; }
  

    .layout .chat-shell { opacity: 0; visibility: hidden; transform: translateY(16px) scale(.98); filter: blur(6px); transition: opacity .32s ease, transform .45s cubic-bezier(.2,.8,.2,1), filter .32s ease, visibility .32s; }
    .layout .chat-shell.chat-active { opacity: 1; visibility: visible; transform: none; filter: none; transition: opacity .32s ease, transform .45s cubic-bezier(.2,.8,.2,1), filter .32s ease; }
    .layout .chat-shell:not(.chat-active) * { visibility: hidden; }
    .chat-launcher { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); pointer-events: auto; border: 0; padding: 12px 18px; background: rgba(3,22,30,.35); border-radius: 20px; color: #719daa; font: 11px 'Exo', sans-serif; letter-spacing: .06em; cursor: pointer; transition: opacity .2s; }
    .main-column:has(.chat-active) .chat-launcher { opacity: 0; visibility: hidden; pointer-events: none; }
    @media (prefers-reduced-motion: reduce) { .layout .chat-shell, .chat-launcher { transition: none; transform: none; filter: none; } .chat-launcher { left: auto; } }
  

    .chat-shell { --terminal-font: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; }
    .chat-shell .chat-input-frame {
      grid-template-columns: 18px minmax(0, 1fr) 32px;
      padding: 9px 15px;
      border-radius: 6px;
      border-color: rgba(118,227,248,.23);
      background: linear-gradient(100deg, rgba(13,44,57,.45), rgba(2,15,23,.7));
      box-shadow: inset 0 0 6px rgba(0,0,0,.22), 0 8px 30px #0003;
    }
    .chat-shell .chat-input-frame:focus-within { border-color: rgba(118,227,248,.23); box-shadow: inset 0 0 6px rgba(0,0,0,.22), 0 8px 30px #0003; }
    .chat-shell .chat-input-frame::before {
      content: '$'; color: #8cecff; font: 16px/28px var(--terminal-font);
      padding: 3px 0; align-self: start;
      text-align: center; text-shadow: 0 0 10px #6feaff45;
    }
    .chat-shell #chatInput { min-height: 34px; padding: 3px 0; font: 16px/28px var(--terminal-font); color: #c3edf5; caret-color: #8eefff; letter-spacing: .015em; }
    .chat-shell #chatInput::placeholder { color: #628a96; }
    .chat-shell .send-button { width: 32px; height: 32px; min-height: 32px; flex-basis: 32px; border-radius: 6px; border-color: rgba(118,227,248,.23); background: rgba(97,216,244,.035); box-shadow: none; }
    .chat-shell .send-button svg { width: 18px; height: 18px; }
    .chat-shell .send-button:hover:not(:disabled) { background: rgba(97,216,244,.1); border-color: rgba(118,227,248,.23); box-shadow: none; }
    .chat-shell .message-bubble, .chat-shell .message-row.user .message-bubble {
      font-family: var(--terminal-font); font-size: 15px; line-height: 1.75;
      border-radius: 5px; box-shadow: inset 2px 0 rgba(118,227,248,.28), 0 6px 24px #0002;
    }
    .chat-shell .message-row.user .message-bubble { color: #9ebdc7; box-shadow: inset 2px 0 rgba(118,227,248,.12); }
    .chat-shell .message-row.user .message-bubble::before { content: '$ '; color: #80d3e4; }
    .chat-shell .message-row.typing .message-bubble { border: 0; background: rgba(4,27,40,.4); box-shadow: none; }
    .chat-shell .typing .typing-dot { display: none; }
    .chat-shell .typing .message-bubble:has(.typing-dot)::after { content: ''; width: 7px; height: 14px; background: #8cecff; animation: terminal-cursor 1s steps(1) infinite; }
    @keyframes terminal-cursor { 50% { opacity: .15; } }
    @media (prefers-reduced-motion: reduce) { .chat-shell .typing .message-bubble:has(.typing-dot)::after { animation: none; } }
  

    .chat-shell .chat-input-frame { position: relative; }
    .chat-shell #chatInput.block-caret-active { caret-color: transparent; }
    .terminal-caret { position: absolute; width: 10px; height: 17px; background: rgba(140,236,255,.65); box-shadow: 0 0 6px #8cecff30; pointer-events: none; z-index: 3; animation: block-caret-blink 1.1s steps(1) infinite; }
    .terminal-caret.is-typing { animation: none; opacity: 1; }
    .terminal-caret[hidden] { display: none; }
    .caret-measure { position: fixed; left: -10000px; top: 0; visibility: hidden; white-space: pre-wrap; overflow-wrap: break-word; border: 0; box-sizing: border-box; }
    @keyframes block-caret-blink { 50% { opacity: 0; } }
    @media (prefers-reduced-motion: reduce) { .terminal-caret { animation: none; } }
  

    .workspace-widget[data-widget-type="image"].entering { animation: none; opacity: 1; transform: none; }
  

    .ww-text-display { width: 100%; height: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px; color: #d0f2f7; font: 14px/1.65 'Exo', sans-serif; user-select: text; }
  

    .layout > .side-column { display: none !important; }
    .interface-launchers {
      position: fixed; top: 20px; right: 20px; z-index: 999;
      display: flex; flex-direction: column; gap: 4px; padding: 5px;
      border: 1px solid rgba(118,227,248,.09); border-radius: 14px;
      background: linear-gradient(180deg, rgba(12,28,34,.38), rgba(3,14,20,.2));
      backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
      box-shadow: inset 0 1px 0 rgba(180,240,255,.035), 0 8px 24px rgba(0,0,0,.12);
    }
    .interface-launchers > button, #quickNoteButton {
      width: 44px; height: 44px; display: grid; place-items: center;
      padding: 0; border: 0; border-radius: 9px; color: rgba(174,222,232,.66);
      background: transparent; backdrop-filter: none; cursor: pointer; box-shadow: none;
      transition: color .18s ease, background .18s ease;
    }
    .interface-launchers > button svg { width: 20px; height: 20px; filter: none; transition: filter .18s ease; }
    .interface-launchers > button:hover, .interface-launchers > button:focus-visible,
    .interface-launchers > button[aria-expanded="true"] { color: #a3f2ff; background: rgba(88,231,250,.055); box-shadow: none; transform: none; }
    .interface-launchers > button:hover svg, .interface-launchers > button:focus-visible svg { filter: drop-shadow(0 0 5px rgba(88,231,250,.4)); }
    .interface-launchers > button:focus-visible { outline: 1px solid rgba(118,227,248,.45); outline-offset: -2px; }
    #quickNoteLauncher { position: relative; width: 44px; height: 44px; margin: 0; }
    #quickNoteButton { position: relative; z-index: 1; }
    #quickNoteButton svg { width: 20px; height: 20px; }
    #quickNoteLauncher:hover #quickNoteButton, #quickNoteLauncher:focus-within #quickNoteButton { color: #a3f2ff; background: rgba(88,231,250,.055); }
    .quick-note-field { position: absolute; top: 0; right: 0; height: 44px; width: min(310px, calc(100vw - 52px)); padding: 0 44px 0 0; display: flex; align-items: center; border: 1px solid rgba(118,227,248,.18); border-radius: 9px; background: rgba(4,20,28,.96); box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; visibility: hidden; transform: translateX(8px) scaleX(.96); transform-origin: right; transition: opacity .18s ease, transform .22s ease, visibility .18s; }
    #quickNoteLauncher:hover .quick-note-field, #quickNoteLauncher:focus-within .quick-note-field { opacity: 1; visibility: visible; transform: none; }
    #quickNoteInput { width: 100%; min-width: 0; height: 100%; padding: 0 12px; border: 0; outline: none; background: transparent; color: #d9f8ff; font: 13px ui-monospace, monospace; }
    #quickNoteInput::placeholder { color: rgba(174,222,232,.45); }
    @media (prefers-reduced-motion: reduce) { .quick-note-field { transition: none; } }
    #interfacesDialog { width: min(600px,90vw); max-height: 82vh; border-radius: 24px; }
    #interfacesDialog[open] { animation: workspace-panel-open .35s cubic-bezier(.34,1.56,.64,1); }
    #interfacesDialog::backdrop { background: rgba(0,0,0,.42); backdrop-filter: blur(6px); }
    #interfacesDialog .dialog-head { padding: 24px 24px 18px; }
    #interfacesDialog .dialog-body { padding: 20px 24px 24px; }
    #interfacesDialog .interface-list { display: grid; gap: 10px; }
    #interfacesDialog #interfacesLibrary > .section-head > h2 { display: none; }
    @media (prefers-reduced-motion: reduce) { #interfacesDialog[open] { animation: none; } }
    .layout > .side-column { top: 20px; left: auto; right: 20px; }
    .side-column .panel-footer {
      justify-content: flex-start;
      border-top: 0;
      border-bottom: 1px solid rgba(85,220,255,.16);
      border-image: none;
    }
    #artifactPanel > .artifact-head, #workspaceToolbar { display: none !important; }
    #artifactPanel > .artifact-body { inset: 0; }
    #openWorkspaceButton {
      position: fixed; top: 20px; left: 20px; z-index: 999;
      width: 56px; height: 56px; padding: 0; display: flex; align-items: center; justify-content: center;
      border: 1px solid rgba(118,227,248,.23); border-radius: 18px;
      background: linear-gradient(135deg, rgba(12,28,34,.84), rgba(3,14,20,.78));
      backdrop-filter: blur(12px); color: #d9f8ff; cursor: pointer;
      box-shadow: 0 10px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(163,240,255,.08);
      transition: transform .25s ease, opacity .25s ease; opacity: .78;
    }
    #openWorkspaceButton:hover, #openWorkspaceButton[aria-expanded="true"] { opacity: 1; transform: translateY(-1px); }
    #openWorkspaceButton.has-name { width: auto; max-width: min(420px, calc(100vw - 40px)); padding: 9px 16px 9px 10px; gap: 12px; }
    .workspace-launcher-icon { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 18px; background: rgba(118,227,248,.06); flex-shrink: 0; }
    .has-name .workspace-launcher-icon { width: 38px; height: 38px; border-radius: 12px; }
    #workspaceButtonName { font: 13px "Exo", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #workspaceButtonName:empty { display: none; }
    #workspaceManagerDialog { width: min(600px, 90vw); max-height: 82vh; border-radius: 24px; }
    #workspaceManagerDialog[open] { animation: workspace-panel-open .35s cubic-bezier(.34,1.56,.64,1); }
    #workspaceManagerDialog::backdrop { background: rgba(0,0,0,.42); backdrop-filter: blur(6px); }
    #workspaceManagerDialog .dialog-head { padding: 24px 24px 18px; }
    #workspaceManagerDialog .dialog-body { padding: 20px 24px 24px; }
    .workspace-panel-eyebrow { display: block; margin-bottom: 8px; color: #7fa6b2; font: 11px ui-monospace, monospace; letter-spacing: 1.6px; text-transform: uppercase; }
    #workspaceManagerFeedback:empty { display: none; }
    @keyframes workspace-panel-open { from { opacity: 0; transform: scale(.92); filter: blur(10px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
    @media (max-width: 600px) { .workspace-capture-row, .workspace-card { flex-direction: column; align-items: stretch; } }
    @media (prefers-reduced-motion: reduce) { #workspaceManagerDialog[open] { animation: none; } }
  
.diagram-tool-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 1px solid rgba(88, 231, 250, 0.22);
    border-radius: 18px;
    background: linear-gradient(135deg,
            rgba(12, 12, 12, 0.84) 0%,
            rgba(20, 20, 20, 0.72) 100%);
    backdrop-filter: blur(12px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.24),
        0 0 24px rgba(88, 231, 250, 0.12),
        inset 0 1px 0 rgba(88, 231, 250, 0.08);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease,
        opacity 0.25s ease;
    opacity: 0.78;
}

.diagram-tool-button-icon {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(238, 238, 238, 0.95);
    background: linear-gradient(135deg,
            rgba(88, 231, 250, 0.16) 0%,
            rgba(220, 220, 220, 0.18) 100%);
    box-shadow:
        inset 0 1px 0 rgba(88, 231, 250, 0.1),
        0 0 16px rgba(88, 231, 250, 0.12);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.diagram-tool-button svg {
    width: 20px;
    height: 20px;
    opacity: 0.92;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.diagram-tool-button:hover,
.diagram-tool-button:focus-visible,
.diagram-tool-button.active {
    transform: translateY(-1px);
    opacity: 1;
    border-color: rgba(88, 231, 250, 0.48);
    background: linear-gradient(135deg,
            rgba(18, 18, 18, 0.92) 0%,
            rgba(30, 30, 30, 0.82) 100%);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.28),
        0 0 28px rgba(88, 231, 250, 0.2),
        inset 0 1px 0 rgba(88, 231, 250, 0.12);
}

.diagram-tool-button:hover .diagram-tool-button-icon,
.diagram-tool-button:focus-visible .diagram-tool-button-icon,
.diagram-tool-button.active .diagram-tool-button-icon {
    background: linear-gradient(135deg,
            rgba(88, 231, 250, 0.28) 0%,
            rgba(88, 231, 250, 0.22) 100%);
    box-shadow:
        inset 0 1px 0 rgba(88, 231, 250, 0.14),
        0 0 18px rgba(88, 231, 250, 0.24);
}

.diagram-tool-button:hover svg,
.diagram-tool-button:focus-visible svg,
.diagram-tool-button.active svg {
    opacity: 1;
    transform: scale(1.03);
}

.diagram-tool-button.diagram-tool-button-created {
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.28),
        0 0 34px rgba(88, 231, 250, 0.22),
        inset 0 1px 0 rgba(88, 231, 250, 0.12);
}

.workspace-widget[data-widget-type="diagram"] {
    max-width: none !important;
    max-height: none !important;
    min-width: 620px;
    min-height: 430px;
}

.workspace-widget-body.diagram {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    padding: 0;
    margin: 0;
    background:
        radial-gradient(circle at 50% 44%, rgba(88, 231, 250, 0.075), transparent 48%),
        linear-gradient(180deg, rgba(10, 10, 10, 0.98) 0%, rgba(3, 3, 3, 0.96) 100%);
}

.diagram-widget-shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    box-sizing: border-box;
}

.diagram-header-row {
    display: flex;
    align-items: center;
}

.diagram-title-input {
    width: 100%;
    border: 1px solid rgba(88, 231, 250, 0.22);
    border-radius: 14px;
    background: rgba(10, 10, 10, 0.88);
    color: rgba(245, 245, 245, 0.96);
    padding: 11px 14px;
    font-family: 'Exo', sans-serif;
    font-size: 15px;
    letter-spacing: 0.03em;
    outline: none;
}

.diagram-title-input:focus {
    border-color: rgba(88, 231, 250, 0.42);
    box-shadow: 0 0 0 1px rgba(88, 231, 250, 0.14), 0 0 18px rgba(88, 231, 250, 0.12);
}

.diagram-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
}

.diagram-palette {
    border: 1px solid rgba(88, 231, 250, 0.16);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.94) 0%, rgba(8, 8, 8, 0.94) 100%);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(88, 231, 250, 0.05);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 7px;
    padding: 8px 7px;
}

.diagram-shape-chip,
.diagram-draw-toggle,
.diagram-erase-toggle,
.diagram-undo-button,
.diagram-color-control {
    width: 100%;
    min-height: 56px;
    height: 56px;
    border: 1px solid rgba(88, 231, 250, 0.22);
    border-radius: 16px;
    background: rgba(12, 12, 12, 0.88);
    color: rgba(232, 232, 232, 0.92);
    box-sizing: border-box;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.diagram-shape-chip,
.diagram-draw-toggle,
.diagram-erase-toggle,
.diagram-undo-button,
.diagram-color-control {
    cursor: pointer;
}

.diagram-shape-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 4px;
    user-select: none;
}

.diagram-shape-chip span,
.diagram-draw-toggle,
.diagram-erase-toggle,
.diagram-undo-button,
.diagram-color-label {
    font-family: 'Exo', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.diagram-shape-chip:hover,
.diagram-draw-toggle:hover,
.diagram-erase-toggle:hover,
.diagram-undo-button:hover,
.diagram-color-control:hover {
    transform: translateY(-1px);
    border-color: rgba(88, 231, 250, 0.36);
    box-shadow: 0 0 18px rgba(88, 231, 250, 0.14);
}

.diagram-shape-chip.is-blue {
    border-color: rgba(220, 220, 220, 0.35);
    background: linear-gradient(160deg, rgba(48, 48, 48, 0.98) 0%, rgba(14, 14, 14, 0.94) 100%);
}

.diagram-shape-chip.is-purple {
    border-color: rgba(220, 220, 220, 0.3);
    background: linear-gradient(160deg, rgba(42, 42, 42, 0.98) 0%, rgba(12, 12, 12, 0.94) 100%);
}

.diagram-shape-chip.is-green {
    border-color: rgba(198, 198, 198, 0.28);
    background: linear-gradient(160deg, rgba(36, 36, 36, 0.98) 0%, rgba(8, 8, 8, 0.94) 100%);
}

.diagram-shape-chip.is-red {
    border-color: rgba(180, 180, 180, 0.28);
    background: linear-gradient(160deg, rgba(28, 28, 28, 0.98) 0%, rgba(5, 5, 5, 0.94) 100%);
}

.diagram-draw-toggle,
.diagram-erase-toggle,
.diagram-undo-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.diagram-draw-toggle.is-active,
.diagram-erase-toggle.is-active {
    border-color: rgba(88, 231, 250, 0.44);
    background: linear-gradient(135deg, rgba(44, 44, 44, 0.95) 0%, rgba(10, 10, 10, 0.88) 100%);
    box-shadow: 0 0 18px rgba(88, 231, 250, 0.1);
    color: #f2f2f2;
}

.diagram-color-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    overflow: hidden;
    user-select: none;
}

.diagram-color-label {
    display: block;
    color: rgba(220, 220, 220, 0.82);
}

.diagram-color-picker {
    width: 42px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.14), 0 8px 16px rgba(88, 231, 250, 0.12);
    appearance: none;
    -webkit-appearance: none;
}

.diagram-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 10px;
}

.diagram-color-picker::-webkit-color-swatch {
    border: 1.5px solid rgba(220, 220, 220, 0.6);
    border-radius: 10px;
}

.diagram-color-picker::-moz-color-swatch {
    border: 1.5px solid rgba(220, 220, 220, 0.6);
    border-radius: 10px;
}

.diagram-shape-preview {
    width: 42px;
    height: 22px;
    border-radius: 10px;
    border: 1.5px solid rgba(220, 220, 220, 0.6);
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.14), 0 8px 16px rgba(88, 231, 250, 0.12);
}

.diagram-shape-preview.is-blue {
    background: linear-gradient(145deg, #343434 0%, #111111 100%);
    border-color: rgba(220, 220, 220, 0.58);
}

.diagram-shape-preview.is-purple {
    background: linear-gradient(145deg, #2a2a2a 0%, #0d0d0d 100%);
    border-color: rgba(216, 216, 216, 0.52);
}

.diagram-shape-preview.is-green {
    background: linear-gradient(145deg, #242424 0%, #080808 100%);
    border-color: rgba(194, 194, 194, 0.5);
}

.diagram-shape-preview.is-red {
    background: linear-gradient(145deg, #1d1d1d 0%, #050505 100%);
    border-color: rgba(168, 168, 168, 0.5);
}

.diagram-canvas-shell {
    min-height: 0;
    display: flex;
    border: 1px solid rgba(88, 231, 250, 0.16);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.94) 0%, rgba(8, 8, 8, 0.94) 100%);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(88, 231, 250, 0.05);
    overflow: hidden;
}

.diagram-canvas-shell.is-draw-mode,
.diagram-canvas-shell.is-draw-mode .diagram-canvas-scroll {
    cursor: crosshair;
}

.diagram-canvas-shell.is-draw-mode .diagram-node-card {
    cursor: default;
}

.diagram-canvas-shell.is-panning,
.diagram-canvas-shell.is-panning .diagram-canvas-scroll,
.diagram-canvas-shell.is-panning .diagram-node-card {
    cursor: grabbing;
}

.diagram-canvas-shell.is-erase-mode,
.diagram-canvas-shell.is-erase-mode .diagram-canvas-scroll,
.diagram-canvas-shell.is-erase-mode .diagram-node-card,
.diagram-canvas-shell.is-erase-mode .diagram-node-port {
    cursor: none;
}

.diagram-canvas-scroll {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 330px;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.96) 0%, rgba(8, 8, 8, 0.98) 100%), linear-gradient(90deg, rgba(88, 231, 250, 0.02) 1px, transparent 1px), linear-gradient(rgba(88, 231, 250, 0.02) 1px, transparent 1px);
    background-size: auto, 28px 28px, 28px 28px;
    cursor: grab;
}

.diagram-canvas-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.diagram-canvas-stage {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.diagram-stroke-layer,
.diagram-edge-layer,
.diagram-node-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.diagram-stroke-layer {
    z-index: 0;
    pointer-events: none;
}

.diagram-edge-layer {
    z-index: 1;
}

.diagram-node-layer {
    z-index: 2;
}

.diagram-erase-cursor {
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(230, 230, 230, 0.86);
    background: rgba(88, 231, 250, 0.07);
    box-shadow:
        0 0 0 1px rgba(12, 12, 12, 0.58),
        0 0 18px rgba(220, 220, 220, 0.16);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.12s ease;
}

.diagram-erase-cursor.is-visible {
    opacity: 1;
}

.diagram-stroke {
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.diagram-stroke.is-drawing {
    opacity: 0.78;
}

.diagram-edge {
    fill: none;
    stroke: rgba(232, 232, 232, 0.82);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.diagram-edge.is-selected {
    stroke: #f2f2f2;
    filter: drop-shadow(0 0 12px rgba(88, 231, 250, 0.24));
}

.diagram-edge-draft {
    fill: none;
    stroke: rgba(220, 220, 220, 0.68);
    stroke-width: 2.2;
    stroke-dasharray: 8 7;
    pointer-events: none;
}

.diagram-edge-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 18;
    pointer-events: stroke;
    cursor: pointer;
}

.diagram-node-card {
    position: absolute;
    width: 188px;
    min-width: 188px;
    min-height: 82px;
    height: auto;
    border-radius: 22px;
    background: linear-gradient(155deg, var(--diagram-node-start, #343434) 0%, var(--diagram-node-end, #111111) 100%);
    border: 1.5px solid var(--diagram-node-stroke, #d8d8d8);
    box-shadow:
        0 18px 30px var(--diagram-node-shadow, rgba(88, 231, 250, 0.1)),
        0 0 0 1px rgba(88, 231, 250, 0.03),
        inset 0 1px 0 rgba(88, 231, 250, 0.12);
    color: var(--diagram-node-text, #f2f2f2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 28px 16px 18px;
    box-sizing: border-box;
    user-select: none;
    cursor: grab;
    overflow: hidden;
    text-align: center;
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.diagram-node-card::before {
    content: '';
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 46%;
    border-radius: 20px 20px 16px 16px;
    background: linear-gradient(180deg, rgba(88, 231, 250, 0.16) 0%, rgba(88, 231, 250, 0) 100%);
    pointer-events: none;
}

.diagram-node-card::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 28px;
    bottom: 14px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--diagram-node-glow, rgba(220, 220, 220, 0.25)) 20%, var(--diagram-node-glow, rgba(220, 220, 220, 0.25)) 80%, transparent 100%);
    pointer-events: none;
}

.diagram-node-card.is-selected {
    border-color: var(--diagram-node-stroke, #d8d8d8);
    box-shadow:
        0 0 0 1px rgba(88, 231, 250, 0.05),
        0 22px 36px var(--diagram-node-shadow, rgba(88, 231, 250, 0.12)),
        0 0 30px var(--diagram-node-glow, rgba(220, 220, 220, 0.32)),
        0 0 12px rgba(88, 231, 250, 0.05);
}

.diagram-node-card.is-connection-target {
    border-color: #f2f2f2;
    box-shadow:
        0 0 0 1px rgba(88, 231, 250, 0.2),
        0 20px 34px var(--diagram-node-shadow, rgba(88, 231, 250, 0.1)),
        0 0 24px rgba(88, 231, 250, 0.14);
}

.diagram-node-label,
.diagram-node-input {
    width: 100%;
    font-family: 'Exo', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.42;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.diagram-node-label {
    pointer-events: none;
}

.diagram-node-input {
    border: 1px solid rgba(88, 231, 250, 0.18);
    box-sizing: border-box;
    border-radius: 12px;
    background: rgba(4, 12, 22, 0.28);
    color: inherit;
    padding: 8px 10px;
    text-align: center;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.08);
    resize: none;
    overflow: hidden;
    min-height: 32px;
    display: block;
}

.diagram-node-input:focus {
    border-color: rgba(88, 231, 250, 0.3);
    box-shadow: 0 0 0 1px rgba(88, 231, 250, 0.08), inset 0 1px 0 rgba(88, 231, 250, 0.08);
}

.diagram-node-port {
    position: absolute;
    right: -8px;
    top: calc(50% - 8px);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(10, 10, 10, 0.9);
    background: var(--diagram-node-accent, #eeeeee);
    box-shadow: 0 0 0 4px rgba(88, 231, 250, 0.06);
    cursor: crosshair;
    z-index: 2;
}

.diagram-node-resize-handle {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 0 0 22px 0;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    cursor: nwse-resize;
    z-index: 3;
}

.diagram-empty-state {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(92%, 340px);
    padding: 18px;
    border: 1px dashed rgba(88, 231, 250, 0.22);
    border-radius: 18px;
    background: rgba(12, 12, 12, 0.72);
    color: rgba(220, 220, 220, 0.84);
    text-align: center;
    line-height: 1.55;
    display: none;
    align-items: center;
    justify-content: center;
}

.diagram-empty-state code {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(26, 26, 26, 0.82);
    color: #e8e8e8;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
}

@media (max-width: 960px) {
    .workspace-widget[data-widget-type="diagram"] {
        min-width: 340px;
        min-height: 400px;
    }

    .diagram-body {
        grid-template-columns: 84px minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .diagram-tool-button {
        top: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
}















.diagram-undo-button:disabled {
    opacity: 0.42;
    cursor: default;
    box-shadow: none;
}

/* Monochrome blueprint theme */
.diagram-tool-button,
.diagram-tool-button:hover,
.diagram-tool-button:focus-visible,
.diagram-tool-button.active {
    background:
        linear-gradient(180deg, rgba(88, 231, 250, 0.075) 0%, transparent 44%),
        linear-gradient(135deg, rgba(22, 22, 22, 0.78) 0%, rgba(5, 5, 5, 0.72) 100%);
    border-color: rgba(88, 231, 250, 0.22);
    color: rgba(245, 245, 245, 0.95);
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(88, 231, 250, 0.1),
        0 0 16px rgba(88, 231, 250, 0.055);
}

.diagram-tool-button:hover,
.diagram-tool-button:focus-visible,
.diagram-tool-button.active {
    border-color: rgba(88, 231, 250, 0.34);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(88, 231, 250, 0.16),
        0 0 24px rgba(88, 231, 250, 0.1);
}

.diagram-tool-button-icon,
.diagram-tool-button:hover .diagram-tool-button-icon,
.diagram-tool-button:focus-visible .diagram-tool-button-icon,
.diagram-tool-button.active .diagram-tool-button-icon {
    background:
        linear-gradient(180deg, rgba(88, 231, 250, 0.11) 0%, transparent 58%),
        rgba(88, 231, 250, 0.045);
    color: rgba(245, 245, 245, 0.95);
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.14);
}

.diagram-tool-button svg {
    filter: drop-shadow(0 0 6px rgba(88, 231, 250, 0.28));
}

.diagram-widget-shell,
.diagram-palette,
.diagram-canvas-shell {
    background:
        linear-gradient(180deg, rgba(88, 231, 250, 0.06) 0%, transparent 30%),
        linear-gradient(145deg, rgba(18, 18, 18, 0.94) 0%, rgba(5, 5, 5, 0.92) 100%);
    border-color: rgba(88, 231, 250, 0.2);
    box-shadow:
        0 22px 52px rgba(0, 0, 0, 0.46),
        inset 0 1px 0 rgba(88, 231, 250, 0.1),
        0 0 28px rgba(88, 231, 250, 0.06);
}

.diagram-title-input,
.diagram-node-input {
    color: rgba(250, 250, 250, 0.96);
}

.diagram-title-input:focus,
.diagram-node-input:focus {
    border-color: rgba(88, 231, 250, 0.34);
    box-shadow: 0 0 0 3px rgba(88, 231, 250, 0.09);
}

.diagram-shape-chip,
.diagram-draw-toggle,
.diagram-erase-toggle,
.diagram-undo-button,
.diagram-color-control {
    background:
        linear-gradient(180deg, rgba(88, 231, 250, 0.06) 0%, transparent 45%),
        rgba(10, 10, 10, 0.58);
    border-color: rgba(88, 231, 250, 0.15);
    color: rgba(232, 232, 232, 0.9);
}

.diagram-shape-chip:hover,
.diagram-draw-toggle:hover,
.diagram-erase-toggle:hover,
.diagram-undo-button:hover,
.diagram-color-control:hover,
.diagram-draw-toggle.is-active,
.diagram-erase-toggle.is-active {
    background:
        linear-gradient(180deg, rgba(88, 231, 250, 0.09) 0%, transparent 45%),
        rgba(20, 20, 20, 0.66);
    border-color: rgba(88, 231, 250, 0.28);
    box-shadow: 0 0 18px rgba(88, 231, 250, 0.08);
}

.diagram-canvas-scroll {
    background:
        linear-gradient(180deg, rgba(10, 10, 10, 0.94) 0%, rgba(0, 0, 0, 0.96) 100%),
        linear-gradient(90deg, rgba(88, 231, 250, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(88, 231, 250, 0.04) 1px, transparent 1px);
    background-size: auto, 28px 28px, 28px 28px;
}

.diagram-node-card {
    border-color: rgba(88, 231, 250, 0.24);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.38),
        0 0 18px rgba(88, 231, 250, 0.07);
}

.diagram-node-card.is-selected,
.diagram-node-card.is-connection-target {
    border-color: rgba(88, 231, 250, 0.48);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.42),
        0 0 24px rgba(88, 231, 250, 0.14);
}

.diagram-empty-state {
    color: rgba(220, 220, 220, 0.68);
}

/* Final contrast pass for generated diagram surfaces */
.workspace-widget-body.diagram {
    background:
        radial-gradient(circle at 50% 44%, rgba(88, 231, 250, 0.075), transparent 48%),
        repeating-linear-gradient(90deg, rgba(88, 231, 250, 0.022) 0 1px, transparent 1px 34px),
        linear-gradient(180deg, rgba(10, 10, 10, 0.98) 0%, rgba(3, 3, 3, 0.96) 100%) !important;
}

.diagram-tool-button-icon,
.diagram-title-input,
.diagram-node-input,
.diagram-color-label,
.diagram-empty-state,
.diagram-shape-chip span {
    color: rgba(238, 238, 238, 0.92) !important;
}

.diagram-title-input,
.diagram-node-input {
    background:
        linear-gradient(180deg, rgba(88, 231, 250, 0.055) 0%, transparent 45%),
        rgba(8, 8, 8, 0.72) !important;
    border-color: rgba(88, 231, 250, 0.22) !important;
}

.diagram-title-input:focus,
.diagram-node-input:focus {
    border-color: rgba(88, 231, 250, 0.38) !important;
    box-shadow:
        0 0 0 1px rgba(88, 231, 250, 0.12),
        0 0 18px rgba(88, 231, 250, 0.1) !important;
}

.diagram-erase-cursor,
.diagram-canvas-shell.is-draw-mode,
.diagram-canvas-shell.is-draw-mode .diagram-canvas-scroll,
.diagram-canvas-shell.is-erase-mode,
.diagram-canvas-shell.is-erase-mode .diagram-canvas-scroll {
    border-color: rgba(88, 231, 250, 0.28) !important;
    box-shadow:
        inset 0 1px 0 rgba(88, 231, 250, 0.08),
        0 0 18px rgba(88, 231, 250, 0.08) !important;
}

.diagram-empty-state {
    border-color: rgba(88, 231, 250, 0.22) !important;
}

.diagram-empty-state code {
    background: rgba(26, 26, 26, 0.82) !important;
    color: #eeeeee !important;
}

/* Diagram-only color restoration */
.diagram-shape-chip.is-blue {
    border-color: rgba(121, 216, 255, 0.42) !important;
    background: linear-gradient(160deg, rgba(18, 55, 101, 0.98) 0%, rgba(10, 31, 66, 0.94) 100%) !important;
}

.diagram-shape-chip.is-purple {
    border-color: rgba(215, 171, 255, 0.42) !important;
    background: linear-gradient(160deg, rgba(74, 32, 117, 0.98) 0%, rgba(34, 16, 62, 0.94) 100%) !important;
}

.diagram-shape-chip.is-green {
    border-color: rgba(146, 242, 199, 0.42) !important;
    background: linear-gradient(160deg, rgba(18, 88, 70, 0.98) 0%, rgba(10, 42, 34, 0.94) 100%) !important;
}

.diagram-shape-chip.is-red {
    border-color: rgba(255, 156, 179, 0.42) !important;
    background: linear-gradient(160deg, rgba(103, 34, 51, 0.98) 0%, rgba(43, 14, 24, 0.94) 100%) !important;
}

.diagram-shape-preview.is-blue {
    background: linear-gradient(145deg, #173f77 0%, #0a2348 100%) !important;
    border-color: rgba(121, 216, 255, 0.68) !important;
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.16), 0 0 14px rgba(121, 216, 255, 0.18) !important;
}

.diagram-shape-preview.is-purple {
    background: linear-gradient(145deg, #52267d 0%, #241144 100%) !important;
    border-color: rgba(215, 171, 255, 0.68) !important;
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.16), 0 0 14px rgba(215, 171, 255, 0.18) !important;
}

.diagram-shape-preview.is-green {
    background: linear-gradient(145deg, #17614f 0%, #0b3027 100%) !important;
    border-color: rgba(146, 242, 199, 0.68) !important;
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.16), 0 0 14px rgba(146, 242, 199, 0.16) !important;
}

.diagram-shape-preview.is-red {
    background: linear-gradient(145deg, #742738 0%, #33111b 100%) !important;
    border-color: rgba(255, 156, 179, 0.68) !important;
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.16), 0 0 14px rgba(255, 156, 179, 0.18) !important;
}

.diagram-draw-toggle.is-active,
.diagram-erase-toggle.is-active {
    border-color: rgba(255, 219, 122, 0.52) !important;
    background: linear-gradient(135deg, rgba(58, 43, 10, 0.95) 0%, rgba(108, 77, 16, 0.88) 100%) !important;
    box-shadow: 0 0 18px rgba(255, 214, 97, 0.16) !important;
    color: #fff6d8 !important;
}

.diagram-color-picker {
    box-shadow: inset 0 1px 0 rgba(88, 231, 250, 0.14), 0 8px 16px rgba(0, 149, 255, 0.12) !important;
}

.diagram-color-picker::-webkit-color-swatch,
.diagram-color-picker::-moz-color-swatch {
    border-color: rgba(126, 223, 255, 0.6) !important;
}

.diagram-node-card {
    filter: none !important;
}

.diagram-stroke,
.diagram-stroke.is-drawing,
.diagram-edge,
.diagram-edge-draft {
    filter: none !important;
}

.diagram-edge {
    stroke: rgba(137, 220, 255, 0.82) !important;
}

.diagram-edge-draft {
    stroke: rgba(137, 220, 255, 0.68) !important;
}

.diagram-edge.is-selected {
    stroke: #ffe68a !important;
    filter: drop-shadow(0 0 12px rgba(255, 230, 138, 0.32)) !important;
}

.diagram-edge-layer marker path {
    fill: rgba(137, 220, 255, 0.88) !important;
}

.workspace-widget {
    padding: 7px 10px 10px !important;
    border-radius: 8px !important;
    background:
        linear-gradient(180deg, rgba(88, 231, 250, 0.078) 0%, rgba(88, 231, 250, 0.03) 22%, rgba(0, 0, 0, 0.28) 100%),
        repeating-linear-gradient(90deg, rgba(88, 231, 250, 0.028) 0 1px, transparent 1px 28px),
        rgba(5, 5, 5, 0.56) !important;
    border: 1px solid rgba(88, 231, 250, 0.3) !important;
    color: rgba(248, 248, 248, 0.96) !important;
    backdrop-filter: blur(18px) saturate(1.04) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.04) !important;
    box-shadow:
        inset 0 1px 0 rgba(88, 231, 250, 0.18),
        inset 0 -1px 0 rgba(88, 231, 250, 0.055),
        inset 0 0 28px rgba(88, 231, 250, 0.035),
        0 18px 46px rgba(0, 0, 0, 0.46),
        0 0 30px rgba(88, 231, 250, 0.08) !important;
}

.workspace-widget::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(88, 231, 250, 0.32), transparent 18%, transparent 82%, rgba(88, 231, 250, 0.22)),
        linear-gradient(180deg, rgba(88, 231, 250, 0.18), transparent 22%, transparent 78%, rgba(88, 231, 250, 0.08));
    opacity: 0.32;
}

.workspace-widget.active,
.workspace-widget.workspace-widget-focused,
.workspace-widget.dragging {
    border-color: rgba(88, 231, 250, 0.42) !important;
    box-shadow:
        inset 0 1px 0 rgba(88, 231, 250, 0.22),
        inset 0 0 34px rgba(88, 231, 250, 0.045),
        0 22px 54px rgba(0, 0, 0, 0.5),
        0 0 38px rgba(88, 231, 250, 0.12) !important;
}

.workspace-widget.workspace-widget-unfocused {
    opacity: 0.68 !important;
    z-index: 850 !important;
    filter: blur(0.6px) brightness(0.86) !important;
    transform: translateY(0) scale(0.76) rotateX(0deg) !important;
    border-color: rgba(88, 231, 250, 0.18) !important;
    box-shadow:
        inset 0 0 14px rgba(88, 231, 250, 0.08),
        0 9px 26px rgba(0, 0, 0, 0.34),
        0 0 14px rgba(88, 231, 250, 0.045) !important;
}

.workspace-widget.dragging,
.workspace-widget.dragging.workspace-widget-unfocused {
    transform: translateY(0) scale(1.02) rotateX(0deg) !important;
    cursor: grabbing !important;
}

.workspace-widget-head {
    min-height: 25px !important;
    height: auto !important;
    margin: 0 0 7px !important;
    padding: 0 0 5px !important;
    box-sizing: border-box;
    cursor: grab;
    background: transparent !important;
    border-bottom-color: transparent !important;
    align-items: flex-start !important;
}

.workspace-widget-head::after {
    height: 1px !important;
    bottom: 0 !important;
    background: linear-gradient(90deg, rgba(88, 231, 250, 0.38) 0%, rgba(88, 231, 250, 0.14) 34%, transparent 86%) !important;
    opacity: 0.7;
}

.workspace-widget-type-label {
    display: block;
    width: calc(100% - 24px) !important;
    max-width: none;
    min-height: initial;
    height: auto !important;
    margin: 8px 0 !important;
    padding: 4px 12px !important;
    box-sizing: content-box;
    border-radius: 0 !important;
    border: 0 !important;
    font-size: 1.4em !important;
    line-height: 1.4 !important;
    letter-spacing: 1px !important;
    text-overflow: ellipsis;
    text-shadow:
        0 0 10px rgba(88, 231, 250, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.3) !important;
    box-shadow:
        inset 0 1px 0 rgba(88, 231, 250, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(88, 231, 250, 0.3) !important;
}

.workspace-widget-type-label::before {
    display: block !important;
}

.workspace-widget-type-label::after {
    bottom: -5px !important;
    height: 1px !important;
    background: #58e7fa !important;
    opacity: 1;
}

.workspace-widget-body {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(88, 231, 250, 0.13) !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(88, 231, 250, 0.075), transparent 58%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.32) 0%, rgba(0, 0, 0, 0.5) 100%) !important;
    color: rgba(246, 246, 246, 0.96) !important;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.62);
    box-shadow:
        inset 0 1px 0 rgba(88, 231, 250, 0.08),
        inset 0 0 24px rgba(0, 0, 0, 0.22) !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(88, 231, 250, 0.35) rgba(0, 0, 0, 0.18);
}

.workspace-widget-body.text {
    padding: 14px 10px 12px !important;
}

.workspace-widget[data-widget-type="text"] .workspace-widget-body.text {
    padding: 8px 3px 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.workspace-widget-body.notes .ww-text-area {
    padding: 8px 3px 10px !important;
}

.workspace-widget-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    display: block;
}

.workspace-widget-body::-webkit-scrollbar-track {
    display: block;
    background: rgba(0, 0, 0, 0.18);
}

.workspace-widget-body::-webkit-scrollbar-thumb {
    display: block;
    background: rgba(88, 231, 250, 0.34);
    border-radius: 999px;
}

.workspace-widget-body.image,
.workspace-widget-body.video,
.workspace-widget-body.website,
.workspace-widget-body.calculator,
.workspace-widget-body.diagram {
    padding: 0 !important;
    overflow: hidden !important;
}

.workspace-widget-body.image {
    margin: 0 !important;
    width: 100% !important;
}

.workspace-widget-body.image img {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.workspace-widget-body.video iframe,
.workspace-widget-body.website iframe,
.workspace-widget-body.calculator iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    display: block !important;
}

.workspace-widget-body.video::after {
    background: linear-gradient(180deg, rgba(88, 231, 250, 0.035), transparent 30%) !important;
}

.ww-text-area {
    padding: 12px !important;
    color: rgba(246, 246, 246, 0.97) !important;
}

.workspace-widget-resize {
    width: 22px !important;
    height: 22px !important;
    opacity: 0.52 !important;
}

.workspace-widget-resize::after {
    content: '';
    display: block !important;
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 9px;
    height: 9px;
    border-right: 1px solid rgba(88, 231, 250, 0.58);
    border-bottom: 1px solid rgba(88, 231, 250, 0.58);
}

.widget-drop-created.active {
    animation: widgetDropSettle 420ms cubic-bezier(0.2, 0.9, 0.24, 1) forwards !important;
}

@keyframes widgetDropSettle {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.workspace-widget { clip-path: none; font-family: 'Exo', sans-serif; font-size: 14px; width: 430px; height: 360px; }
.workspace-widget.workspace-widget-focused { z-index: 1500 !important; }
.workspace-widget-head, .workspace-widget-type-label, .workspace-widget-body { clip-path: none; }
.workspace-widget-type-label { font-weight: 600; background: linear-gradient(90deg, rgba(88,231,250,.13) 0 1px, transparent 1px 100%), linear-gradient(135deg, rgba(88,231,250,.095), rgba(88,231,250,.035)), rgba(0,0,0,.22); }
.workspace-widget-type-label::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(88,231,250,.12), transparent); }
.workspace-widget-corner { position: absolute; width: 10px; height: 10px; border: 1.5px solid rgba(88,231,250,.56); pointer-events: none; z-index: 2; }
.workspace-widget-corner.top-left { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.workspace-widget-corner.top-right { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.workspace-widget-corner.bottom-left { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.workspace-widget-corner.bottom-right { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.workspace-widget-body { font-size: clamp(13px,1.2vw,20px); }
.ww-text-area, .ww-text-display { font: inherit; line-height: 1.55; }
.ww-text-display { padding: 0; }
.workspace-widget-body.notes .ww-text-area { padding: 8px 3px 10px !important; }
.workspace-widget[data-widget-type="diagram"] { min-width: min(620px,calc(100vw - 40px)); min-height: min(430px,calc(100dvh - 100px)); }
.workspace-widget-body.diagram { padding: 0 !important; }


    .workspace-canvas::before { opacity: .48; transition: opacity .6s ease; }
    .workspace-canvas:has(.workspace-widget:hover)::before { opacity: .62; }
    .workspace-core::before {
      content: ''; position: absolute; inset: 9%; border-radius: 50%; pointer-events: none;
      background: radial-gradient(circle, rgba(255,139,43,.055), transparent 70%);
      box-shadow: 0 0 65px rgba(255,127,30,.035);
    }
    .workspace-core::after {
      content: ''; position: absolute; inset: -2%; border-radius: 50%; pointer-events: none;
      border: 1px solid rgba(255,172,80,.07);
      background: conic-gradient(from 28deg, transparent 0 17%, rgba(255,174,83,.24) 17% 20%, transparent 20% 64%, rgba(255,174,83,.14) 64% 67%, transparent 67%);
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1px), #000 calc(100% - 1px));
      mask: radial-gradient(farthest-side, transparent calc(100% - 1px), #000 calc(100% - 1px));
    }
    .interface-launchers { border-color: rgba(118,227,248,.045); background: rgba(3,14,20,.17); box-shadow: none; }
    .interface-launchers > button, #quickNoteButton { color: rgba(174,222,232,.47); }
    .interface-launchers:hover > button, .interface-launchers:focus-within > button { color: rgba(174,222,232,.76); }
    .interface-launchers > button:hover, #quickNoteLauncher:hover #quickNoteButton { color: #a3f2ff; }
    #openWorkspaceButton { opacity: .58; border-color: rgba(118,227,248,.1); background: rgba(3,14,20,.24); box-shadow: none; }
    .workspace-launcher-icon { background: transparent; }
    .chat-launcher { background: transparent; color: rgba(147,190,200,.6); letter-spacing: .09em; }
    .chat-shell .chat-input-frame, .chat-shell .chat-input-frame:focus-within {
      background: rgba(3,16,23,.7); border-color: rgba(118,227,248,.18);
      box-shadow: inset 0 0 6px rgba(0,0,0,.22), 0 8px 30px rgba(0,0,0,.12);
    }
    .chat-shell .message-bubble, .chat-shell .message-row.user .message-bubble {
      border: 1px solid rgba(118,227,248,.07); border-radius: 6px;
      background: rgba(5,22,30,.38); box-shadow: none; color: #c4dce3; line-height: 1.7;
    }
    .chat-shell .message-row.user .message-bubble { background: rgba(5,22,30,.18); color: #9dbbc4; }
    .layout .chat-shell.chat-active { transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1), filter .4s ease; }
    @media (prefers-reduced-motion: reduce) { .layout .chat-shell.chat-active, .workspace-canvas::before { transition: none; } }
  

    .workspace-canvas::before { opacity: .70; }
    .workspace-canvas:has(.workspace-widget:hover)::before { opacity: .75; }
    .holo-environment { opacity: .55; }
    .interface-launchers { border-radius: 14px; background: rgba(5,14,20,.35); border-color: rgba(119,183,197,.12); }
    .interface-launchers > button, #quickNoteButton { border-radius: 9px; }
    #openWorkspaceButton { border-radius: 18px; border-color: rgba(119,183,197,.18); }
    .workspace-launcher-icon { border-radius: 18px; }
    .has-name .workspace-launcher-icon { border-radius: 12px; }
    .quick-note-field { border-radius: 2px; }
    #interfacesDialog, #workspaceManagerDialog, #settingsDialog { border-radius: 24px; border-color: rgba(119,183,197,.28); background: rgba(5,14,20,.96); box-shadow: 0 24px 80px rgba(0,0,0,.6); }
    .chat-shell .chat-input-frame, .chat-shell .chat-input-frame:focus-within { border-radius: 3px; border-color: rgba(119,183,197,.23); background: rgba(4,14,21,.86); }
    .chat-shell .message-bubble, .chat-shell .message-row.user .message-bubble {
      border-radius: 1px; border-width: 0 0 0 1px; border-color: rgba(119,183,197,.25);
      background: linear-gradient(90deg, rgba(6,22,30,.72), rgba(4,14,21,.24));
    }
    .chat-shell .message-row.user .message-bubble { border-color: rgba(255,171,85,.25); }
  

    #workspaceContextMenu { position: fixed; z-index: 1200; width: min(246px, calc(100vw - 16px)); padding: 6px; border: 1px solid rgba(118,227,248,.24); border-radius: 5px; background: rgba(4,17,25,.96); backdrop-filter: blur(18px); box-shadow: 0 14px 40px rgba(0,0,0,.4); }
    #workspaceContextMenu[hidden], #workspaceContextMenu [hidden] { display: none; }
    #workspaceContextMenu button { width: 100%; padding: 11px 12px; border: 0; border-radius: 2px; background: transparent; color: #bfdee5; text-align: left; font: 12px ui-monospace, monospace; cursor: pointer; }
    #workspaceContextMenu button:hover, #workspaceContextMenu button:focus-visible { background: rgba(88,231,250,.08); color: #a3f2ff; }
    #contextNoteForm { padding: 7px; }
    #contextNoteForm label { display: block; margin-bottom: 10px; color: #9ecbd4; font: 11px ui-monospace, monospace; }
    #contextNoteTitle { width: 100%; padding: 10px; border: 1px solid rgba(118,227,248,.2); border-radius: 3px; background: rgba(0,7,12,.5); color: #d9f8ff; font: 13px ui-monospace, monospace; }
    #contextNoteForm button { margin-top: 6px; text-align: right; }
  

    *, *::before, *::after { scrollbar-width: none !important; -ms-overflow-style: none !important; }
    *::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
    *::-webkit-scrollbar-track, *::-webkit-scrollbar-thumb, *::-webkit-scrollbar-corner { background: transparent !important; }
  

    #toolInterfaceFrame, #artifactContent {
      position: absolute; inset: 20px; margin: 0;
      width: calc(100% - 40px); height: calc(100% - 40px);
      min-width: 0; box-sizing: border-box; border-radius: 8px;
    }
    @media (max-width: 700px) {
      #toolInterfaceFrame, #artifactContent { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
    }
  

    input:focus, textarea:focus, [contenteditable]:focus,
    input:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible {
      outline: none !important; box-shadow: none !important;
    }
    .diagram-title-input:focus, .diagram-node-input:focus { border-color: rgba(88,231,250,.22) !important; }
  

    #cameraPreview { display: contents; }
    #cameraPreview[hidden] { display: none; }
    #cameraVideo {
      position: fixed; left: 50%; top: 50%; width: min(98vw, 1680px, 150dvh); height: auto; aspect-ratio: 16 / 10; z-index: 1;
      object-fit: cover; transform: translate(-50%, -50%) scaleX(-1); pointer-events: none;
      opacity: .94; filter: saturate(.9) contrast(1.02);
      -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, rgba(0,0,0,.98) 38%, rgba(0,0,0,.9) 50%, rgba(0,0,0,.72) 62%, rgba(0,0,0,.46) 74%, rgba(0,0,0,.2) 86%, rgba(0,0,0,.04) 96%, transparent 100%), var(--camera-edge-mask);
      mask-image: radial-gradient(ellipse at center, #000 25%, rgba(0,0,0,.98) 38%, rgba(0,0,0,.9) 50%, rgba(0,0,0,.72) 62%, rgba(0,0,0,.46) 74%, rgba(0,0,0,.2) 86%, rgba(0,0,0,.04) 96%, transparent 100%), var(--camera-edge-mask);
      --camera-edge-mask: linear-gradient(to right, transparent, rgba(0,0,0,.04) 3%, rgba(0,0,0,.2) 6%, rgba(0,0,0,.5) 10%, rgba(0,0,0,.8) 14%, rgba(0,0,0,.96) 18%, #000 22%, #000 78%, rgba(0,0,0,.96) 82%, rgba(0,0,0,.8) 86%, rgba(0,0,0,.5) 90%, rgba(0,0,0,.2) 94%, rgba(0,0,0,.04) 97%, transparent), linear-gradient(to bottom, transparent, rgba(0,0,0,.04) 4%, rgba(0,0,0,.2) 8%, rgba(0,0,0,.5) 12%, rgba(0,0,0,.8) 16%, rgba(0,0,0,.96) 20%, #000 24%, #000 76%, rgba(0,0,0,.96) 80%, rgba(0,0,0,.8) 84%, rgba(0,0,0,.5) 88%, rgba(0,0,0,.2) 92%, rgba(0,0,0,.04) 96%, transparent);
      -webkit-mask-composite: source-in;
      mask-composite: intersect;
      animation: camera-reveal 1.2s ease-out both;
    }
    body:has(#cameraPreview:not([hidden])) .layout > .artifact-panel {
      background: rgba(0,0,0,.08);
    }
    .camera-controls {
      position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 1100;
      display: flex; align-items: center; gap: 14px; padding: 6px 8px 6px 12px;
      border: 1px solid rgba(88,231,250,.16); border-radius: 8px;
      background: rgba(5,14,20,.65); backdrop-filter: blur(16px);
      color: #a3d7df; font: 10px ui-monospace, monospace; letter-spacing: .08em;
    }
    .camera-controls span::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: #7be2d2; box-shadow: 0 0 8px #7be2d255; }
    .camera-controls button { padding: 5px 8px; font-size: 11px; border-radius: 5px; }
    @keyframes camera-reveal { from { opacity: 0; } to { opacity: .94; } }
    @media (prefers-reduced-motion: reduce) { #cameraVideo { animation: none; } }
  