/* ===== SHADCN/UI DESIGN TOKENS ===== */
    :root {
      --background: 0 0% 100%;
      --foreground: 240 10% 3.9%;
      --card: 0 0% 100%;
      --card-foreground: 240 10% 3.9%;
      --popover: 0 0% 100%;
      --popover-foreground: 240 10% 3.9%;
      --primary: 240 5.9% 10%;
      --primary-foreground: 0 0% 98%;
      --secondary: 240 4.8% 95.9%;
      --secondary-foreground: 240 5.9% 10%;
      --muted: 240 4.8% 95.9%;
      --muted-foreground: 240 3.8% 46.1%;
      --accent: 240 4.8% 95.9%;
      --accent-foreground: 240 5.9% 10%;
      --destructive: 0 84.2% 60.2%;
      --destructive-foreground: 0 0% 98%;
      --border: 240 5.9% 90%;
      --input: 240 5.9% 90%;
      --ring: 240 5.9% 10%;
      --radius: 0.5rem;
      --pfx: 142 76% 36%;
      --pfx-bg: 142 76% 36% / 0.07;
      --pfx-bd: 142 76% 36% / 0.22;
      --scn: 38 92% 40%;
      --scn-bg: 38 92% 40% / 0.07;
      --scn-bd: 38 92% 40% / 0.22;
      --sfx: 322 65% 46%;
      --sfx-bg: 322 65% 46% / 0.07;
      --sfx-bd: 322 65% 46% / 0.22;
      --acc: 262 83% 52%;
      --acc-glow: 262 83% 52% / 0.06;
      --ok: 142 76% 36%;
      --warn: 38 92% 40%;
      --err: 0 72% 51%;
      --header-bg: 0 0% 100% / 0.95;
      --center-bg: 262 30% 97%;
      --center-border: 262 30% 80%;
      --prompt-bg: 240 5% 96%;
      --viewport-bg: 240 4% 92%;
      --viewport-grid: 240 5% 85%;
      --viewport-figure: 262 83% 52%;
      --viewport-joint: 38 92% 40%;
      --viewport-camera: 142 76% 36%;
      --sidebar-bg: 240 6% 96%;
    }

    [data-theme="dark"] {
      --background: 240 10% 3.9%;
      --foreground: 0 0% 98%;
      --card: 240 10% 3.9%;
      --card-foreground: 0 0% 98%;
      --popover: 240 10% 3.9%;
      --popover-foreground: 0 0% 98%;
      --primary: 240 5.9% 90%;
      --primary-foreground: 240 5.9% 10%;
      --secondary: 240 3.7% 15.9%;
      --secondary-foreground: 0 0% 98%;
      --muted: 240 3.7% 15.9%;
      --muted-foreground: 240 5% 64.9%;
      --accent: 240 3.7% 15.9%;
      --accent-foreground: 0 0% 98%;
      --destructive: 0 62.8% 30.6%;
      --destructive-foreground: 0 0% 98%;
      --border: 240 3.7% 15.9%;
      --input: 240 3.7% 15.9%;
      --ring: 240 4.9% 83.9%;
      --radius: 0.5rem;
      /* Domain colors */
      --pfx: 142 71% 45%;
      --pfx-bg: 142 71% 45% / 0.08;
      --pfx-bd: 142 71% 45% / 0.2;
      --scn: 48 96% 53%;
      --scn-bg: 48 96% 53% / 0.08;
      --scn-bd: 48 96% 53% / 0.2;
      --sfx: 322 65% 55%;
      --sfx-bg: 322 65% 55% / 0.08;
      --sfx-bd: 322 65% 55% / 0.2;
      --acc: 262 83% 58%;
      --acc-glow: 262 83% 58% / 0.1;
      --ok: 142 71% 45%;
      --warn: 38 92% 50%;
      --err: 0 72% 51%;
      --header-bg: 240 10% 3.9% / 0.95;
      --center-bg: 240 17% 5%;
      --center-border: 262 40% 25%;
      --prompt-bg: 240 12% 4%;
      --viewport-bg: 240 12% 5%;
      --viewport-grid: 240 10% 12%;
      --viewport-figure: 262 83% 58%;
      --viewport-joint: 48 96% 53%;
      --viewport-camera: 142 71% 45%;
      --sidebar-bg: 240 10% 6%;
    }

    [data-theme="light"] {
      --background: 0 0% 100%;
      --foreground: 240 10% 3.9%;
      --card: 0 0% 100%;
      --card-foreground: 240 10% 3.9%;
      --popover: 0 0% 100%;
      --popover-foreground: 240 10% 3.9%;
      --primary: 240 5.9% 10%;
      --primary-foreground: 0 0% 98%;
      --secondary: 240 4.8% 95.9%;
      --secondary-foreground: 240 5.9% 10%;
      --muted: 240 4.8% 95.9%;
      --muted-foreground: 240 3.8% 46.1%;
      --accent: 240 4.8% 95.9%;
      --accent-foreground: 240 5.9% 10%;
      --destructive: 0 84.2% 60.2%;
      --destructive-foreground: 0 0% 98%;
      --border: 240 5.9% 90%;
      --input: 240 5.9% 90%;
      --ring: 240 5.9% 10%;
      /* Domain colors */
      --pfx: 142 76% 36%;
      --pfx-bg: 142 76% 36% / 0.07;
      --pfx-bd: 142 76% 36% / 0.22;
      --scn: 38 92% 40%;
      --scn-bg: 38 92% 40% / 0.07;
      --scn-bd: 38 92% 40% / 0.22;
      --sfx: 322 65% 46%;
      --sfx-bg: 322 65% 46% / 0.07;
      --sfx-bd: 322 65% 46% / 0.22;
      --acc: 262 83% 52%;
      --acc-glow: 262 83% 52% / 0.06;
      --ok: 142 76% 36%;
      --warn: 38 92% 40%;
      --err: 0 72% 51%;
      --header-bg: 0 0% 100% / 0.95;
      --center-bg: 262 30% 97%;
      --center-border: 262 30% 80%;
      --prompt-bg: 240 5% 96%;
      --viewport-bg: 240 4% 92%;
      --viewport-grid: 240 5% 85%;
      --viewport-figure: 262 83% 52%;
      --viewport-joint: 38 92% 40%;
      --viewport-camera: 142 76% 36%;
      --sidebar-bg: 240 6% 96%;
    }

    /* ===== RESET & BASE ===== */
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0
    }

    html,
    body {
      height: 100vh;
      margin: 0;
      padding: 0;
      overflow: hidden !important
    }

    body {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      background: hsl(var(--background));
      color: hsl(var(--foreground));
      line-height: 1.6;
      display: flex;
      flex-direction: column;
      height: 100vh;
      overflow: hidden;
      transition: background .3s, color .3s;
      font-size: 14px;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale
    }

    ::-webkit-scrollbar {
      width: 5px;
      height: 5px
    }

    ::-webkit-scrollbar-track {
      background: transparent
    }

    ::-webkit-scrollbar-thumb {
      background: hsl(var(--border));
      border-radius: 99px
    }

    ::-webkit-scrollbar-thumb:hover {
      background: hsl(var(--muted-foreground)/0.4)
    }

    /* ===== HEADER ===== */
    .header {
      height: 52px;
      flex-shrink: 0;
      padding: 0 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid hsl(var(--border));
      background: hsl(var(--header-bg));
      backdrop-filter: blur(16px);
      z-index: 100
    }

    .logo {
      font-size: 18px;
      font-weight: 700;
      letter-spacing: -0.4px;
      background: linear-gradient(135deg, hsl(var(--foreground)), hsl(var(--muted-foreground)));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text
    }

    .header-actions {
      display: flex;
      gap: 8px;
      align-items: center
    }

    .theme-sw {
      width: 44px;
      height: 24px;
      background: hsl(var(--muted));
      border: 1px solid hsl(var(--border));
      border-radius: 12px;
      cursor: pointer;
      display: flex;
      align-items: center;
      padding: 0 3px;
      transition: all .2s
    }

    .theme-sw .dot {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: hsl(var(--foreground));
      transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px
    }

    [data-theme="dark"] .theme-sw .dot {
      transform: translateX(0)
    }

    [data-theme="light"] .theme-sw .dot {
      transform: translateX(20px)
    }

    .hdr-btn {
      font-size: 13px;
      color: hsl(var(--muted-foreground));
      cursor: pointer;
      padding: 8px 16px;
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      background: transparent;
      font-family: inherit;
      font-weight: 500;
      transition: all .15s;
      outline: none
    }

    .hdr-btn:hover {
      background: hsl(var(--accent));
      color: hsl(var(--accent-foreground))
    }

    .hdr-btn:focus-visible {
      outline: none;
      box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring))
    }

    .hdr-btn:active {
      transform: scale(0.98)
    }

    /* ===== BADGES ===== */
    .badge {
      font-size: 11px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 99px;
      display: inline-flex;
      align-items: center;
      line-height: 1.4
    }

    .badge-pfx {
      background: hsl(var(--pfx-bg));
      color: hsl(var(--pfx));
      border: 1px solid hsl(var(--pfx-bd))
    }

    .badge-scn {
      background: hsl(var(--scn-bg));
      color: hsl(var(--scn));
      border: 1px solid hsl(var(--scn-bd))
    }

    .badge-sfx {
      background: hsl(var(--sfx-bg));
      color: hsl(var(--sfx));
      border: 1px solid hsl(var(--sfx-bd))
    }

    /* ===== BENTO CARDS & SUB-CARDS ===== */
    .bento-card {
      background: hsl(var(--card));
      border: 1px solid hsl(var(--border));
      border-radius: 16px;
      padding: 16px;
      transition: border-color .15s, box-shadow .15s
    }

    .bento-card:hover {
      border-color: hsl(var(--ring)/0.2)
    }

    .sg {
      background: hsl(var(--foreground)/0.04);
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      padding: 14px;
      margin-bottom: 12px;
      transition: border-color .15s
    }

    .sg:last-child {
      margin-bottom: 0
    }

    .sg:hover {
      border-color: hsl(var(--ring)/0.2);
      background: hsl(var(--card))
    }

    .sg-title {
      font-size: 11px;
      font-weight: 600;
      color: hsl(var(--foreground));
      text-transform: uppercase;
      letter-spacing: .06em;
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid hsl(var(--border));
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* ===== COLLAPSIBLE SECTIONS ===== */
    .collapse-section {
      background: hsl(var(--card));
      border: 1px solid hsl(var(--border));
      border-radius: 16px;
      overflow: hidden;
      transition: border-color .15s
    }

    .collapse-section:hover {
      border-color: hsl(var(--ring)/0.2)
    }

    .collapse-hdr>span:first-child {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .collapse-hdr {
      padding: 12px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      user-select: none;
      font-size: 14px;
      font-weight: 600;
      transition: background .15s
    }

    .collapse-hdr:hover {
      background: hsl(var(--accent))
    }

    .collapse-body {
      padding: 0 16px 16px;
      display: none
    }

    .collapse-body.open {
      display: block
    }

    .collapse-arrow {
      transition: transform .2s cubic-bezier(0.4, 0, 0.2, 1);
      font-size: 14px;
      color: hsl(var(--muted-foreground))
    }

    .collapse-arrow.open {
      transform: rotate(180deg)
    }

    /* ===== SPOTLIGHT OVERLAY ===== */
    body.spotlight-active .header,
    body.spotlight-active .footer,
    body.spotlight-active .ide-col-left,
    body.spotlight-active .ide-col-right,
    body.spotlight-active .ide-center-top {
      filter: blur(3px) opacity(0.7);
      transition: filter .3s cubic-bezier(0.4, 0, 0.2, 1), opacity .3s cubic-bezier(0.4, 0, 0.2, 1);
      pointer-events: none;
    }

    /* ===== BOTTOM DOCK (IDE TERMINAL & SPOTLIGHT) ===== */
    .dock-wrapper {
      width: 100%;
      height: 25%;
      flex: none;
      background: hsl(var(--muted));
      padding: 16px;
      z-index: 90
    }

    .bottom-dock {
      position: relative;
      width: 100%;
      height: 100%;
      background: hsl(var(--card));
      border: 1px solid hsl(var(--border));
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      box-shadow: 0 -8px 30px -4px hsl(var(--foreground)/0.08), 0 -4px 12px -2px hsl(var(--foreground)/0.04)
    }

    .bottom-dock:focus-within {
      border-color: hsl(var(--ring)/0.3);
      box-shadow: 0 -12px 40px -5px hsl(var(--foreground)/0.12)
    }

    .dock-wrapper.dock-wrapper-minimized {
      height: auto;
      padding-bottom: 32px
    }

    .bottom-dock.dock-minimized {
      position: relative;
      margin: 0 auto;
      width: 320px;
      height: auto;
      padding: 10px 16px;
      cursor: pointer;
      z-index: 150;
      border-color: hsl(var(--border));
      box-shadow: 0 10px 40px -10px hsl(0 0% 0% / 0.2)
    }

    .bottom-dock.dock-minimized:hover {
      border-color: hsl(var(--ring)/0.5)
    }

    .bottom-dock.dock-minimized .dock-layout {
      display: none
    }

    .bottom-dock.dock-fullscreen {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 92vw;
      max-width: 1300px;
      height: 85vh;
      bottom: auto;
      border-radius: 20px;
      border: 1px solid hsl(var(--border));
      background: hsl(var(--card));
      z-index: 1000;
      box-shadow: 0 25px 60px -12px hsl(0 0% 0% / 0.4);
      overflow: hidden;
      padding: 24px;
      display: flex;
      flex-direction: column
    }

    .dock-fullscreen .dock-layout {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 16px;
      min-height: 0
    }

    .dock-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: transparent;
      z-index: 950
    }

    .dock-fullscreen .dock-content {
      height: 100%;
      display: flex;
      flex-direction: column;
      min-height: 0;
      flex: 1
    }

    .dock-fullscreen .out-pane.active {
      height: 100%;
      display: flex;
      flex-direction: column;
      min-height: 0
    }

    .dock-fullscreen .raw-edit,
    .dock-fullscreen .out-box {
      flex: 1;
      height: 100%;
      min-height: 140px;
      resize: vertical
    }

    /* ===== ANTIGRAVITY IDE LAYOUT (3 INDEPENDENT SCROLL COLUMNS) ===== */
    .ide-wrapper {
      flex: 1;
      min-height: 0;
      width: 100%;
      max-width: 100%;
      padding: 0;
      display: grid;
      grid-template-columns: 20% 1fr 20%;
      gap: 0;
      align-items: stretch;
      box-sizing: border-box;
      overflow: hidden
    }

    @media(max-width:1100px) {
      .ide-wrapper {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        padding-bottom: 180px
      }

      .ide-col {
        height: auto !important;
        overflow: visible !important
      }

      .dock-wrapper {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 90;
        padding: 8px;
        background: hsl(var(--muted));
        border-top: 1px solid hsl(var(--border));
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
        height: auto;
      }

      .bottom-dock {
        padding: 8px;
        height: auto;
      }

      .help-txt {
        display: none
      }

      .raw-edit,
      .out-box {
        min-height: 70px;
        height: 70px
      }

      .btn-row {
        flex-wrap: nowrap !important
      }

      .out-tab {
        font-size: 10px;
        padding: 4px
      }
    }

    .ide-col {
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-width: 0;
      height: 100%;
      overflow: hidden
    }

    .ide-col-left {
      background: hsl(var(--sidebar-bg));
      border-right: 1px solid hsl(var(--border));
      padding: 16px;
      overflow-y: auto;
      height: 100%
    }

    .ide-col-left .bento-card {
      border: none;
      box-shadow: none;
      padding: 0;
      background: transparent;
      margin-bottom: 24px
    }

    .ide-col-right {
      background: hsl(var(--sidebar-bg));
      border-left: 1px solid hsl(var(--border));
      padding: 16px;
      overflow-y: auto;
      height: 100%
    }

    .ide-col-right .bento-card {
      border: none;
      box-shadow: none;
      padding: 0;
      background: transparent;
      margin-bottom: 24px
    }

    .ide-col-center {
      background: hsl(var(--muted));
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-width: 0;
      height: 100%;
      overflow: hidden;
      position: relative
    }

    .ide-center-top {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 16px 16px 0;
      display: flex;
      flex-direction: column;
      gap: 12px
    }

    .ide-center-top>* {
      flex-shrink: 0
    }

    /* Icon-Only Dock Buttons */
    .mac-btns {
      display: flex;
      gap: 6px;
      align-items: center
    }

    .mac-btns button {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      padding: 0;
      outline: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s;
      opacity: 0.8;
      color: transparent
    }

    .mac-btns:hover button {
      color: rgba(0, 0, 0, 0.6)
    }

    .mac-btns button:hover {
      opacity: 1;
      transform: scale(1.1)
    }

    .mac-btns button .material-symbols-outlined {
      font-size: 10px;
      font-weight: 800
    }

    .mac-close {
      background-color: #FF5F56;
      border: 1px solid #E0443E
    }

    .mac-min {
      background-color: #FFBD2E;
      border: 1px solid #DEA123
    }

    .mac-max {
      background-color: #27C93F;
      border: 1px solid #1AAB29
    }

    .dock-min-preview {
      display: none;
      font-size: 12px;
      color: hsl(var(--muted-foreground));
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-top: 2px
    }

    .dock-minimized .dock-min-preview {
      display: block
    }

    /* ===== NO VERTICAL BORDER LINES ===== */
    .blk {
      margin-bottom: 14px
    }

    .blk-pfx,
    .blk-scn,
    .blk-sfx {
      border-left: none !important;
      padding-left: 0 !important
    }

    .blk-hdr {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      color: hsl(var(--foreground));
      letter-spacing: .01em;
    }

    .lock-btn {
      width: 22px;
      height: 22px;
      border: 1px solid hsl(var(--border));
      border-radius: calc(var(--radius) - 2px);
      background: transparent;
      color: hsl(var(--muted-foreground));
      font-size: 11px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-left: auto;
      flex-shrink: 0;
      transition: all .15s
    }

    .lock-btn:hover {
      background: hsl(var(--accent));
      color: hsl(var(--foreground))
    }

    .lock-btn.locked {
      background: hsl(var(--acc-glow));
      border-color: hsl(var(--acc));
      color: hsl(var(--acc))
    }

    /* ===== FORM FIELDS ===== */
    .fld {
      margin-bottom: 12px
    }

    .fld:last-child {
      margin-bottom: 0
    }

    .fld-lbl {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: hsl(var(--foreground));
      margin-bottom: 6px;
      font-weight: 500;
    }

    select {
      width: 100%;
      height: 34px;
      padding: 0 32px 0 10px;
      background: hsl(var(--background));
      border: 1px solid hsl(var(--input));
      border-radius: var(--radius);
      color: hsl(var(--foreground));
      font-size: 13px;
      font-family: inherit;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      cursor: pointer;
      transition: border-color .15s, box-shadow .15s;
      outline: none
    }

    select:hover {
      border-color: hsl(var(--ring)/0.5)
    }

    select:focus {
      border-color: hsl(var(--ring));
      box-shadow: 0 0 0 2px hsl(var(--ring)/0.2)
    }

    select:disabled {
      opacity: .5;
      cursor: not-allowed
    }

    select.auto-filled,
    input.auto-filled,
    textarea.auto-filled {
      border-color: hsl(var(--ok)) !important;
      box-shadow: 0 0 0 2px hsl(var(--ok)/0.15) !important;
    }

    textarea,
    input[type="text"] {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid hsl(var(--input));
      border-radius: var(--radius);
      background: hsl(var(--background));
      color: hsl(var(--foreground));
      font-size: 13px;
      font-family: inherit;
      resize: vertical;
      transition: border-color .15s, box-shadow .15s;
      outline: none
    }

    textarea {
      min-height: 40px
    }

    textarea:hover,
    input[type="text"]:hover {
      border-color: hsl(var(--ring)/0.5)
    }

    textarea:focus,
    input[type="text"]:focus {
      border-color: hsl(var(--ring));
      box-shadow: 0 0 0 2px hsl(var(--ring)/0.2)
    }

    textarea::placeholder,
    input::placeholder {
      color: hsl(var(--muted-foreground)/0.6)
    }

    .cust-inp {
      display: none;
      margin-top: 6px
    }

    .cust-inp.show {
      display: block
    }

    .spatial-staging { border-color: hsl(var(--acc)/0.35); }
    .spatial-staging .sub { margin: -4px 0 12px; }
    .spatial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .spatial-group { padding: 10px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--muted)/0.22); }
    .spatial-group-title { margin-bottom: 8px; font-size: 10px; font-weight: 700; color: hsl(var(--acc)); text-transform: uppercase; letter-spacing: .08em; }
    .spatial-group .fld { margin-bottom: 9px; }
    .object-card { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:10px 0; padding:10px; border:1px solid hsl(var(--border)); border-radius:var(--radius); background:hsl(var(--muted)/0.22); }
    .object-card .spatial-group-title { grid-column:1 / -1; }
    @media (max-width: 900px) { .object-card { grid-template-columns:1fr; } }
    @media (max-width: 900px) { .spatial-grid { grid-template-columns: 1fr; } }

    .custom-input { display: none; margin-top: 6px }
    .custom-input.show { display: block }

    .conflict-hl {
      border-color: hsl(var(--err)) !important;
      box-shadow: 0 0 0 2px hsl(var(--err)/0.3) !important;
      background: hsl(var(--err)/0.05) !important;
      transition: all 0.3s
    }

    /* ===== TOGGLE GROUP ===== */
    .tog-grp {
      display: flex;
      gap: 0;
      border-radius: var(--radius);
      overflow: hidden;
      border: 1px solid hsl(var(--border));
      margin-bottom: 8px;
      background: hsl(var(--muted))
    }

    .tog-btn {
      flex: 1;
      padding: 7px 6px;
      border: none;
      background: transparent;
      color: hsl(var(--muted-foreground));
      font-size: 12px;
      font-family: inherit;
      font-weight: 500;
      cursor: pointer;
      transition: all .15s;
      text-align: center
    }

    .tog-btn.active {
      background: hsl(var(--foreground));
      color: hsl(var(--background));
      font-weight: 600
    }

    .tog-btn:hover:not(.active) {
      background: hsl(var(--accent))
    }

    /* ===== SCENE AREA ===== */
    .scene-area {
      transition: border-color .15s
    }

    .scene-area .hdr {
      font-size: 15px;
      font-weight: 700;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 12px;
      letter-spacing: -0.3px
    }

    .scene-area .sub {
      font-size: 12px;
      color: hsl(var(--muted-foreground));
      margin-bottom: 14px;
      line-height: 1.5
    }

    .scene-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px
    }

    .sg {
      background: hsl(var(--foreground)/0.04);
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      padding: 14px;
      transition: border-color .15s
    }

    .sg:hover {
      border-color: hsl(var(--ring)/0.2);
      background: hsl(var(--card))
    }

    /* .sg-title handled globally above */

    /* ===== TEMPLATE SECTION ===== */
    .tpl-section {
      margin: 0 24px 16px
    }

    .tpl-title {
      font-size: 11px;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: hsl(var(--muted-foreground));
      margin-bottom: 10px;
      padding-bottom: 6px;
      border-bottom: 1px solid hsl(var(--border));
      font-weight: 600
    }

    .tpl-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 8px
    }

    .tpl-card {
      background: hsl(var(--card));
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      padding: 12px 14px;
      cursor: pointer;
      transition: all .2s
    }

    .tpl-card:hover {
      border-color: hsl(var(--pfx));
      transform: translateY(-2px);
      box-shadow: 0 4px 12px hsl(0 0% 0%/0.08)
    }

    .tpl-card .tn {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 3px
    }

    .tpl-card .td {
      font-size: 12px;
      color: hsl(var(--muted-foreground))
    }

    .tpl-tag {
      display: inline-block;
      font-size: 10px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 99px;
      margin-top: 6px;
      letter-spacing: .02em
    }

    .tpl-tag.film {
      background: hsl(var(--sfx-bg));
      color: hsl(var(--sfx))
    }

    .tpl-tag.street {
      background: hsl(var(--pfx-bg));
      color: hsl(var(--pfx))
    }

    .tpl-tag.mood {
      background: hsl(var(--scn-bg));
      color: hsl(var(--scn))
    }

    /* ===== COLOR PICKER ===== */
    .color-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
      background: hsl(var(--muted));
      padding: 8px;
      border-radius: var(--radius)
    }

    .sw-wrap {
      position: relative;
      width: 32px;
      height: 32px;
      flex-shrink: 0;
      border-radius: calc(var(--radius) - 2px);
      overflow: hidden;
      border: none
    }

    .color-row input[type="color"] {
      position: absolute;
      top: -6px;
      left: -6px;
      width: 44px;
      height: 44px;
      border: none;
      padding: 0;
      cursor: pointer;
      background: none
    }

    .c-meta {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 3px
    }

    .c-lbl {
      font-size: 11px;
      color: hsl(var(--muted-foreground));
      font-weight: 500
    }

    .c-lbl-inp {
      font-size: 11px;
      color: hsl(var(--foreground));
      font-weight: 500;
      background: hsl(var(--background));
      border: 1px dashed hsl(var(--input));
      padding: 2px 4px;
      border-radius: 2px;
      width: 100%;
      outline: none;
      transition: all 0.2s;
    }

    .c-lbl-inp:focus {
      border-color: hsl(var(--ring));
      border-style: solid;
    }

    .hex-inp {
      background: hsl(var(--background));
      border: 1px solid hsl(var(--input));
      color: hsl(var(--foreground));
      font-size: 12px;
      padding: 4px 8px;
      border-radius: calc(var(--radius) - 2px);
      font-family: 'JetBrains Mono', monospace;
      width: 72px;
      outline: none;
      transition: border-color .15s
    }

    .hex-inp:focus {
      border-color: hsl(var(--ring));
      box-shadow: 0 0 0 2px hsl(var(--ring)/0.2)
    }

    .tog-use {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      color: hsl(var(--muted-foreground));
      font-weight: 500
    }

    /* ===== OUTPUT TABS & DOCK ELEMENTS ===== */
    .dock-layout {
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex: 1;
      min-height: 0;
      height: 100%
    }

    .dock-sidebar {
      display: none
    }

    .out-tabs {
      display: flex;
      flex-direction: row;
      gap: 4px;
      background: hsl(var(--muted)/0.5);
      padding: 3px;
      border-radius: var(--radius);
      overflow-x: auto
    }

    .out-tab {
      height: 30px;
      padding: 0 12px;
      border: none;
      background: transparent;
      color: hsl(var(--muted-foreground));
      font-size: 12px;
      font-weight: 500;
      font-family: inherit;
      cursor: pointer;
      text-align: center;
      border-radius: calc(var(--radius) - 2px);
      transition: all .15s;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      justify-content: center
    }

    .out-tab.active {
      background: hsl(var(--foreground));
      color: hsl(var(--background));
      font-weight: 600
    }

    .out-tab:hover:not(.active) {
      background: hsl(var(--accent))
    }

    .out-pane {
      display: none
    }

    .out-pane.active {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      height: 100%
    }

    .out-box {
      font-size: 12px;
      line-height: 1.6;
      padding: 10px 12px;
      background: hsl(var(--prompt-bg));
      border-radius: var(--radius);
      border: 1px solid hsl(var(--border));
      overflow-y: auto;
      flex: 1;
      min-height: 0;
      height: 100%
    }

    .raw-edit {
      width: 100%;
      flex: 1;
      height: 100%;
      padding: 10px 12px;
      background: hsl(var(--prompt-bg));
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      color: hsl(var(--foreground));
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      line-height: 1.5;
      resize: none;
      white-space: pre-wrap;
      overflow-y: auto;
      outline: none;
      transition: border-color .15s, box-shadow .15s
    }

    .dock-fullscreen .raw-edit,
    .dock-fullscreen .out-box {
      height: 100%;
      flex: 1
    }

    .raw-edit:focus {
      border-color: hsl(var(--ring));
      box-shadow: 0 0 0 2px hsl(var(--ring)/0.2);
      background: hsl(var(--background))
    }

    .plat-lbl {
      font-size: 12px;
      font-weight: 600;
      color: hsl(var(--muted-foreground));
      margin-bottom: 6px
    }

    .plat-desc {
      font-size: 12px;
      color: hsl(var(--muted-foreground)/0.7);
      margin-bottom: 10px
    }

    /* ===== BUTTONS ===== */
    .btn-row {
      display: flex;
      gap: 8px;
      margin-top: 12px;
      flex-wrap: wrap
    }

    .btn-pri,
    .btn-sec,
    .btn-save {
      height: 32px;
      padding: 0 14px;
      border-radius: var(--radius);
      border: none;
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      font-family: inherit;
      transition: all .15s;
      outline: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      white-space: nowrap
    }

    .btn-pri:active,
    .btn-sec:active,
    .btn-save:active {
      transform: scale(0.98)
    }

    .btn-row button {
      flex: 1
    }

    .btn-pri {
      background: hsl(var(--foreground));
      color: hsl(var(--background))
    }

    .btn-pri:hover {
      opacity: .9
    }

    .btn-pri .material-symbols-outlined {
      color: hsl(var(--background))
    }

    .btn-pri:focus-visible {
      box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring))
    }

    .btn-sec {
      background: hsl(var(--muted));
      color: hsl(var(--muted-foreground));
      border: 1px solid hsl(var(--border)) !important
    }

    .btn-sec:hover {
      background: hsl(var(--accent));
      color: hsl(var(--accent-foreground))
    }

    .btn-save {
      background: hsl(var(--ok));
      color: #fff
    }

    .btn-save:hover {
      opacity: .9
    }

    .btn-save .material-symbols-outlined {
      color: #fff
    }

    /* ===== VIEWPORT ===== */
    .viewport-container {
      margin-bottom: 16px;
      background: hsl(var(--card));
      border: 1px solid hsl(var(--border));
      border-radius: calc(var(--radius) + 2px);
      overflow: hidden;
      transition: border-color .15s
    }

    .viewport-header {
      padding: 12px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      transition: background .15s;
      gap: 12px
    }

    .viewport-header:hover {
      background: hsl(var(--accent))
    }

    .viewport-body {
      display: none;
      padding: 0 16px 16px
    }

    .viewport-body.open {
      display: block
    }

    .vp-canvas-wrap {
      position: relative;
      width: 100%;
      aspect-ratio: 4/3;
      background: hsl(var(--viewport-bg));
      border-radius: var(--radius);
      overflow: hidden;
      border: 1px solid hsl(var(--border));
      margin-bottom: 12px
    }

    .vp-canvas-wrap canvas {
      width: 100%;
      height: 100%;
      display: block
    }

    .vp-ctrl {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-bottom: 8px
    }

    .vp-ctrl label {
      font-size: 11px;
      color: hsl(var(--muted-foreground));
      letter-spacing: .03em;
      font-weight: 500
    }

    .vp-ctrl input[type="range"] {
      width: 100%;
      height: 6px;
      -webkit-appearance: none;
      appearance: none;
      background: hsl(var(--muted));
      border-radius: 99px;
      cursor: pointer;
      outline: none
    }

    .vp-ctrl input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: hsl(var(--foreground));
      cursor: pointer;
      border: 2px solid hsl(var(--background));
      box-shadow: 0 1px 3px hsl(0 0% 0%/0.2)
    }

    /* ===== FOOTER ===== */
    .footer {
      height: 36px;
      flex-shrink: 0;
      width: 100%;
      padding: 0 24px;
      border-top: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 20px;
      font-size: 11px;
      color: hsl(var(--muted-foreground));
      background: hsl(var(--background));
      box-sizing: border-box;
      z-index: 100
    }

    .footer a {
      color: hsl(var(--muted-foreground));
      text-decoration: none;
      transition: color .15s
    }

    .footer a:hover {
      color: hsl(var(--foreground))
    }

    .footer-center {
      display: flex;
      align-items: center;
      gap: 4px
    }

    .footer-email {
      cursor: pointer;
      padding: 2px 6px;
      border: none;
      background: hsl(var(--accent));
      color: hsl(var(--foreground));
      font-size: 11px;
      font-family: inherit;
      font-weight: 600;
      transition: all .15s;
      text-decoration: none;
      border-radius: 4px
    }

    .footer-email:hover {
      background: #3b82f6;
      color: #ffffff;
    }

    /* ===== TOAST ===== */
    .toast {
      position: fixed;
      bottom: 20px;
      right: 20px;
      background: hsl(var(--foreground));
      color: hsl(var(--background));
      padding: 10px 20px;
      border-radius: var(--radius);
      font-size: 13px;
      font-weight: 500;
      opacity: 0;
      transform: translateY(12px);
      transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
      pointer-events: none;
      z-index: 9999;
      box-shadow: 0 4px 12px hsl(0 0% 0%/0.15)
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0)
    }

    /* ===== MISC ===== */
    .re-prompt-text {
      font-size: 12px;
      color: hsl(var(--muted-foreground));
      line-height: 1.75;
      font-family: 'JetBrains Mono', monospace;
      white-space: pre-wrap;
      height: 60px;
      overflow: hidden;
      position: relative;
      cursor: default;
      user-select: none
    }

    .re-prompt-text::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 30px;
      background: linear-gradient(transparent, hsl(var(--prompt-bg)));
      pointer-events: none
    }

    @keyframes pulse {

      0%,
      100% {
        box-shadow: 0 0 0 0 hsl(var(--acc)/0.3)
      }

      50% {
        box-shadow: 0 0 0 6px hsl(var(--acc)/0)
      }
    }

    .analyzing {
      animation: pulse 1.2s ease-in-out infinite
    }

    .conflict-warn {
      margin: 0 24px 16px;
      display: none
    }

    .conflict-box {
      background: hsl(var(--err)/0.06);
      border: 1px solid hsl(var(--err)/0.2);
      border-radius: var(--radius);
      padding: 12px 16px
    }

    .conflict-item {
      margin-bottom: 6px;
      font-size: 12px;
      color: hsl(var(--muted-foreground));
      line-height: 1.5
    }

    .conflict-item strong {
      color: hsl(var(--err))
    }

    /* ===== RESPONSIVE ===== */
    @media(max-width:900px) {
      .header {
        padding: 0 14px;
        height: 48px
      }

      .top-bar,
      .collapse-section,
      .tpl-section,
      .scene-area,
      .viewport-container,
      .conflict-warn {
        margin-left: 12px;
        margin-right: 12px
      }

      .main-grid {
        padding: 0 12px 16px;
        gap: 12px
      }

      .footer {
        padding: 16px 14px;
        flex-direction: column;
        gap: 8px;
        text-align: center
      }
    }

    .material-symbols-outlined.icon-sm {
      font-size: 20px;
      line-height: 1;
      color: inherit;
      display: inline-flex;
      align-items: center;
      flex-shrink: 0;
      font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    }

    .material-symbols-outlined {
      color: inherit;
      font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    }


    /* ===== DOCK TOOLBAR (tabs + actions below editor) ===== */
    .dock-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-top: 8px;
      flex-shrink: 0
    }

    .dock-content {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0
    }

    .dock-toolbar .out-tabs {
      flex: none;
      min-width: 0
    }

    .dock-actions {
      display: flex;
      gap: 8px;
      flex-shrink: 0;
      margin-left: auto
    }

    /* ===== DESIGN SYSTEM: ICON + TEXT SPACING ===== */
    .sg-title .material-symbols-outlined,
    .blk-hdr .material-symbols-outlined,
    .scene-area .hdr .material-symbols-outlined,
    .collapse-hdr .material-symbols-outlined,
    .viewport-header .material-symbols-outlined,
    .col-hdr .material-symbols-outlined {
      font-size: 20px;
      color: hsl(var(--foreground));
    }

    /* Typography scale */
    .sg-title {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .06em;
      font-weight: 600;
    }

    .blk-hdr {
      font-size: 13px;
      font-weight: 600;
    }

    .fld-lbl {
      font-size: 13px;
      font-weight: 500;
    }

    .scene-area .hdr {
      font-size: 15px;
      font-weight: 700;
    }

    .scene-area .sub {
      font-size: 12px;
    }

    select,
    textarea,
    input[type="text"] {
      font-size: 13px;
    }

    .btn-pri,
    .btn-sec,
    .btn-save {
      font-size: 13px;
    }

    .collapse-hdr {
      font-size: 13px;
      font-weight: 600;
    }
    /* ===== AUTH STYLES ===== */
    .auth-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      background: hsl(var(--card));
      color: hsl(var(--foreground));
      font-family: inherit;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all .15s;
      white-space: nowrap;
    }
    .auth-btn:hover {
      background: hsl(var(--accent));
      border-color: hsl(var(--muted-foreground)/0.3);
    }
    .auth-btn svg {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
    }
    .user-menu {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .user-avatar {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 2px solid hsl(var(--border));
      object-fit: cover;
      cursor: pointer;
    }
    .user-name {
      font-size: 12px;
      font-weight: 500;
      color: hsl(var(--muted-foreground));
      max-width: 100px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .signout-btn {
      font-size: 12px;
      color: hsl(var(--muted-foreground));
      cursor: pointer;
      padding: 4px 10px;
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      background: transparent;
      font-family: inherit;
      font-weight: 500;
      transition: all .15s;
    }
    .signout-btn:hover {
      background: hsl(var(--destructive)/0.1);
      color: hsl(var(--destructive));
      border-color: hsl(var(--destructive)/0.3);
    }

    /* ===== SAVE TEMPLATE MODAL ===== */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: hsl(0 0% 0%/0.5);
      backdrop-filter: blur(4px);
      z-index: 10000;
      display: none;
      align-items: center;
      justify-content: center;
      animation: fadeIn .2s ease;
    }
    .modal-overlay.show { display: flex; }
    .modal-box {
      background: hsl(var(--card));
      border: 1px solid hsl(var(--border));
      border-radius: calc(var(--radius) * 2);
      padding: 24px;
      width: 380px;
      max-width: 90vw;
      box-shadow: 0 20px 60px hsl(0 0% 0%/0.3);
      animation: scaleIn .2s cubic-bezier(0.4,0,0.2,1);
    }
    @keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
    @keyframes scaleIn { from { opacity: 0; transform: scale(0.95) } to { opacity: 1; transform: scale(1) } }
    .modal-title {
      font-size: 16px;
      font-weight: 700;
      margin-bottom: 4px;
      color: hsl(var(--foreground));
    }
    .modal-desc {
      font-size: 12px;
      color: hsl(var(--muted-foreground));
      margin-bottom: 16px;
    }
    .modal-input {
      width: 100%;
      padding: 10px 14px;
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      background: hsl(var(--background));
      color: hsl(var(--foreground));
      font-family: inherit;
      font-size: 13px;
      outline: none;
      transition: border-color .15s;
    }
    .modal-input:focus {
      border-color: hsl(var(--acc));
      box-shadow: 0 0 0 3px hsl(var(--acc)/0.1);
    }
    .modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 16px;
    }
    .modal-cancel {
      padding: 8px 16px;
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      background: transparent;
      color: hsl(var(--muted-foreground));
      font-family: inherit;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all .15s;
    }
    .modal-cancel:hover { background: hsl(var(--accent)); }
    .modal-save {
      padding: 8px 16px;
      border: none;
      border-radius: var(--radius);
      background: hsl(var(--acc));
      color: #fff;
      font-family: inherit;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all .15s;
    }
    .modal-save:hover { filter: brightness(1.1); }
    .modal-save:disabled { opacity: 0.5; cursor: not-allowed; }

    /* ===== SAVED TEMPLATES ===== */
    .saved-section {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid hsl(var(--border));
    }
    .saved-section-hdr {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .saved-section-title {
      font-size: 12px;
      font-weight: 600;
      color: hsl(var(--muted-foreground));
      text-transform: uppercase;
      letter-spacing: .04em;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .saved-count {
      font-size: 10px;
      font-weight: 600;
      padding: 1px 6px;
      border-radius: 99px;
      background: hsl(var(--acc)/0.12);
      color: hsl(var(--acc));
    }
    .saved-tpl-card {
      background: hsl(var(--card));
      border: 1px solid hsl(var(--border));
      border-radius: var(--radius);
      padding: 10px 12px;
      cursor: pointer;
      transition: all .2s;
      position: relative;
    }
    .saved-tpl-card:hover {
      border-color: hsl(var(--acc));
      transform: translateY(-1px);
      box-shadow: 0 4px 12px hsl(0 0% 0%/0.08);
    }
    .saved-tpl-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .saved-tpl-name {
      font-size: 13px;
      font-weight: 600;
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .saved-tpl-name-input {
      font-size: 13px;
      font-weight: 600;
      flex: 1;
      min-width: 0;
      padding: 2px 6px;
      border: 1px solid hsl(var(--acc));
      border-radius: 4px;
      background: hsl(var(--background));
      color: hsl(var(--foreground));
      font-family: inherit;
      outline: none;
    }
    .saved-tpl-desc {
      font-size: 11px;
      color: hsl(var(--muted-foreground));
      margin-top: 3px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .tpl-actions {
      display: flex;
      gap: 2px;
      flex-shrink: 0;
    }
    .tpl-act-btn {
      width: 26px;
      height: 26px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      background: transparent;
      color: hsl(var(--muted-foreground));
      border-radius: 4px;
      cursor: pointer;
      transition: all .15s;
      padding: 0;
    }
    .tpl-act-btn:hover {
      background: hsl(var(--accent));
      color: hsl(var(--foreground));
    }
    .tpl-act-btn.delete:hover {
      background: hsl(var(--destructive)/0.1);
      color: hsl(var(--destructive));
    }
    .tpl-act-btn .material-symbols-outlined { font-size: 16px; }
    .tpl-tag.saved {
      background: hsl(var(--acc)/0.12);
      color: hsl(var(--acc));
    }
    .saved-empty {
      font-size: 12px;
      color: hsl(var(--muted-foreground));
      text-align: center;
      padding: 16px 8px;
      border: 1px dashed hsl(var(--border));
      border-radius: var(--radius);
    }
    .saved-login-prompt {
      font-size: 12px;
      color: hsl(var(--muted-foreground));
      text-align: center;
      padding: 12px 8px;
    }

    /* ===== SCROLL FIX FOR TEMPLATE SECTION ===== */
    .tpl-scroll-container {
      max-height: 480px;
      overscroll-behavior-y: contain;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
      overflow-y: auto;
      padding-right: 6px;
      padding-bottom: 24px;
      scroll-behavior: smooth;
    }
    .tpl-scroll-container::-webkit-scrollbar {
      width: 6px;
    }
    .tpl-scroll-container::-webkit-scrollbar-thumb {
      background: hsl(var(--border));
      border-radius: 99px;
    }
    .tpl-scroll-container::-webkit-scrollbar-thumb:hover {
      background: hsl(var(--muted-foreground)/0.4);
    }

    /* ===== ENHANCED TOAST ===== */
    .toast {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .toast.toast-success {
      background: hsl(var(--ok)) !important;
    }
    .toast.toast-error {
      background: hsl(var(--err)) !important;
    }
    .toast .toast-icon {
      font-size: 16px;
      flex-shrink: 0;
    }

    /* ===== SAVE TEMPLATE BTN ===== */
    .btn-save-tpl {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px;
      font-size: 13px;
      font-weight: 500;
      font-family: inherit;
      border: 1px solid hsl(var(--acc)/0.4);
      border-radius: var(--radius);
      background: hsl(var(--acc)/0.1);
      color: hsl(var(--acc));
      cursor: pointer;
      transition: all .15s;
      white-space: nowrap;
    }
    .btn-save-tpl:hover {
      background: hsl(var(--acc)/0.2);
      border-color: hsl(var(--acc)/0.6);
    }
    .btn-save-tpl .material-symbols-outlined { font-size: 16px; }

    /* ===== DELETE CONFIRM ===== */
    .delete-confirm {
      display: flex;
      align-items: center;
      gap: 4px;
      background: hsl(var(--destructive)/0.08);
      border: 1px solid hsl(var(--destructive)/0.2);
      border-radius: var(--radius);
      padding: 4px 8px;
      margin-top: 6px;
      animation: scaleIn .15s ease;
    }
    .delete-confirm span {
      font-size: 11px;
      color: hsl(var(--destructive));
      font-weight: 500;
    }
    .delete-confirm button {
      font-size: 11px;
      font-weight: 600;
      font-family: inherit;
      border: none;
      border-radius: 4px;
      padding: 3px 8px;
      cursor: pointer;
      transition: all .1s;
    }
    .del-yes {
      background: hsl(var(--destructive));
      color: #fff;
    }
    .del-no {
      background: transparent;
      color: hsl(var(--muted-foreground));
    }
  
    /* Security & Anti-RE Surface Hardening */
    body {
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
    }
    input, textarea, select, .raw-edit, .out-box, .re-prompt-text, code, pre {
      -webkit-user-select: text;
      -moz-user-select: text;
      -ms-user-select: text;
      user-select: text;
    }
    img, svg {
      -webkit-user-drag: none;
      user-drag: none;
    }
