html { scroll-behavior: smooth }
    body { background: #050505; color: #fff; font-family: Manrope, Arial, sans-serif; overflow-x: hidden }
    .container-x { width: min(1360px, calc(100% - 80px)); margin: 0 auto }
    @media (max-width: 767px) { .container-x { width: calc(100% - 32px) } }
    .mono { font-family: "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase }
    .grid-bg {
      background-image: linear-gradient(rgba(36, 36, 36, .45) 1px, transparent 1px), linear-gradient(90deg, rgba(36, 36, 36, .45) 1px, transparent 1px);
      background-size: 48px 48px;
    }
    .cross { position: absolute; width: 17px; height: 17px; opacity: .55; pointer-events: none }
    .cross:before, .cross:after { content: ""; position: absolute; background: #666 }
    .cross:before { width: 17px; height: 1px; top: 8px; left: 0 }
    .cross:after { width: 1px; height: 17px; left: 8px; top: 0 }
    .corners { position: relative }
    .corners:before, .corners:after { content: ""; position: absolute; width: 10px; height: 10px; border-color: #666; pointer-events: none }
    .corners:before { left: -1px; top: -1px; border-left: 1px solid; border-top: 1px solid }
    .corners:after { right: -1px; bottom: -1px; border-right: 1px solid; border-bottom: 1px solid }
    .ticks { height: 5px; background-image: repeating-linear-gradient(90deg, #383838 0 1px, transparent 1px 10px) }
    *:focus-visible { outline: 1px solid #C6FF00; outline-offset: 2px }
    .scroll-thin { scrollbar-width: thin; scrollbar-color: #383838 transparent }
    .scroll-thin::-webkit-scrollbar { width: 6px }
    .scroll-thin::-webkit-scrollbar-thumb { background: #383838 }

    /* Workspace sizing */
    @media (min-width: 1024px) {
      .workspace { height: clamp(620px, calc(100vh - 128px), 880px) }
      .workspace > * { min-height: 0 }
    }
    @media (max-width: 1023px) {
      #conversation { height: 74vh; min-height: 520px }
      #contextPanel:not(.is-open) .ctx-body { display: none }
      #solutionPanel {
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
        width: min(380px, 92vw); transform: translateX(100%); transition: transform .22s ease;
        border-left: 1px solid #383838; background: #0B0B0B
      }
      #solutionPanel.is-open { transform: none }
    }
    @media (min-width: 1024px) { .lg-hide { display: none !important } }

    .msg-body p + p { margin-top: .6rem }
    .typing:after { content: "▍"; animation: blink 1s steps(1) infinite; margin-left: 2px }
    @keyframes blink { 50% { opacity: 0 } }
    .flash { animation: flash 1.2s ease 1 }
    @keyframes flash { 0%, 100% { box-shadow: none } 30% { box-shadow: inset 0 0 0 1px #A3A3A3 } }

    dialog { background: #0B0B0B; color: #fff; border: 1px solid #383838; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px) }
    dialog::backdrop { background: rgba(5, 5, 5, .82) }
    .field { width: 100%; background: #050505; border: 1px solid #242424; color: #fff; padding: 10px 12px; font-size: 14px }
    .field:focus { outline: none; border-color: #8A8A8A }
    .field[aria-invalid="true"] { border-color: #F87171 }

    .desktop-nav-sm { display: none }
    @media (max-width: 899px) {
      .desktop-nav { display: none !important }
      .desktop-nav-sm { display: flex !important }
    }
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto }
      *, *:before, *:after { animation: none !important; transition: none !important }
    }
