    /* ============================================================
   Digi AI — web UI styles (FRAMEWORK)
   Visual: DIGI PDAM AI template (soft sky-blue). Wired to the
   live backend — real auth, SSE pipeline, SQL results.
   ============================================================ */
    :root {
      --blue-50: #f0f7ff;
      --blue-100: #e0eefe;
      --blue-200: #bbdcfd;
      --blue-300: #88c2fb;
      --blue-400: #4fa3f7;
      --blue-500: #2a86ef;
      --blue-600: #1a6cd9;
      --blue-700: #1755b0;
      --blue-800: #18488d;
      --blue-900: #193e74;
      --ink-900: #0b1a2c;
      --ink-700: #2a3a52;
      --ink-500: #5a6b84;
      --ink-400: #8093ad;
      --ink-300: #aebccf;
      --ink-200: #d6dfeb;
      --ink-100: #eaf0f8;
      --ink-50: #f6f9fd;
      --bg: #f4f8fd;
      --surface: #ffffff;
      --primary: var(--blue-500);
      --primary-strong: var(--blue-600);
      --primary-soft: var(--blue-100);
      --radius-sm: 8px;
      --radius: 12px;
      --radius-lg: 16px;
      --radius-xl: 22px;
      --shadow-sm: 0 1px 2px rgba(24, 72, 141, .06), 0 1px 1px rgba(24, 72, 141, .04);
      --shadow-md: 0 6px 18px -6px rgba(24, 72, 141, .16), 0 2px 6px rgba(24, 72, 141, .06);
      --shadow-lg: 0 24px 60px -20px rgba(24, 72, 141, .28), 0 4px 12px rgba(24, 72, 141, .06);
      --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
      --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    }

    * {
      box-sizing: border-box;
    }

    [v-cloak] {
      display: none;
    }

    html,
    body {
      margin: 0;
      padding: 0;
      height: 100%;
    }

    body {
      font-family: var(--font-sans);
      color: var(--ink-900);
      background: var(--bg);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow: hidden;
    }

    #app {
      height: 100dvh;
    }

    button {
      font-family: inherit;
      cursor: pointer;
      border: none;
      background: none;
      color: inherit;
    }

    input,
    textarea {
      font-family: inherit;
      color: inherit;
    }

    /* ============ LOGIN ============ */
    .login-shell {
      position: fixed;
      inset: 0;
      display: grid;
      grid-template-columns: 1fr 1fr;
      background: var(--bg);
    }

    .login-hero {
      position: relative;
      overflow: hidden;
      background: linear-gradient(150deg, #cfe6fd 0%, #e7f2fe 60%, #f0f7ff 100%);
      padding: 56px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      color: var(--ink-900);
    }

    .login-hero::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background-image:
        radial-gradient(900px 600px at 12% 110%, rgba(42, 134, 239, .22), transparent 60%),
        radial-gradient(700px 500px at 95% 0%, rgba(136, 194, 251, .45), transparent 70%);
    }

    .hero-content {
      position: relative;
      z-index: 2;
      max-width: 480px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 16px;
      font-weight: 800;
      font-size: 18px;
      letter-spacing: -.01em;
      position: relative;
      z-index: 2;
      padding: 4px 2px;
    }

    .brand-mark {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      background: #fff;
      display: grid;
      place-items: center;
      overflow: hidden;
      flex-shrink: 0;
      box-shadow: 0 6px 16px -5px rgba(42, 134, 239, .4);
    }

    .brand-mark img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .brand-name {
      display: flex;
      flex-direction: column;
      gap: 5px;
      line-height: 1.2;
    }

    .brand-name b {
      font-weight: 800;
      letter-spacing: -.005em;
    }

    .brand-name span {
      font-size: 11px;
      font-weight: 500;
      color: var(--ink-500);
      letter-spacing: .06em;
      text-transform: uppercase;
    }

    .hero-title {
      font-size: clamp(32px, 3.4vw, 46px);
      font-weight: 800;
      line-height: 1.06;
      letter-spacing: -.025em;
      margin: 32px 0 18px;
      text-wrap: balance;
    }

    .hero-title em {
      font-style: normal;
      color: var(--blue-700);
    }

    .hero-sub {
      font-size: 16.5px;
      line-height: 1.55;
      color: var(--ink-700);
      max-width: 440px;
    }

    .hero-features {
      position: relative;
      z-index: 2;
      display: grid;
      gap: 14px;
      margin-top: 38px;
    }

    .hero-feature {
      display: flex;
      align-items: flex-start;
      gap: 14px;
      padding: 15px 18px;
      background: rgba(255, 255, 255, .7);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255, 255, 255, .9);
      border-radius: var(--radius);
      box-shadow: var(--shadow-sm);
    }

    .hero-feature-icon {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: var(--blue-100);
      color: var(--blue-700);
      display: grid;
      place-items: center;
      flex-shrink: 0;
    }

    .hero-feature-icon svg {
      width: 18px;
      height: 18px;
    }

    .hero-feature-text strong {
      display: block;
      font-weight: 700;
      font-size: 14px;
      margin-bottom: 2px;
    }

    .hero-feature-text span {
      font-size: 13px;
      color: var(--ink-500);
      line-height: 1.4;
    }

    .hero-foot {
      position: relative;
      z-index: 2;
      font-size: 12px;
      color: var(--ink-500);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .hero-foot::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #22c55e;
      box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);
    }

    .ring {
      position: absolute;
      border-radius: 50%;
      border: 1.5px solid rgba(42, 134, 239, .18);
      pointer-events: none;
    }

    .ring.r1 {
      width: 520px;
      height: 520px;
      right: -180px;
      bottom: -180px;
    }

    .ring.r2 {
      width: 360px;
      height: 360px;
      right: -100px;
      bottom: -100px;
      border-color: rgba(42, 134, 239, .12);
    }

    .ring.r3 {
      width: 200px;
      height: 200px;
      right: -20px;
      bottom: -20px;
      border-color: rgba(42, 134, 239, .22);
    }

    .login-form-side {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 40px;
      background: var(--surface);
    }

    .login-card {
      width: 100%;
      max-width: 400px;
    }

    .login-card h2 {
      font-size: 27px;
      font-weight: 800;
      letter-spacing: -.02em;
      margin: 0 0 6px;
    }

    .login-card .muted {
      color: var(--ink-500);
      font-size: 14.5px;
      margin: 0 0 30px;
    }

    .field {
      margin-bottom: 16px;
    }

    .field-label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--ink-700);
      margin-bottom: 7px;
    }

    .input-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }

    .input-wrap svg.lead {
      position: absolute;
      left: 14px;
      width: 18px;
      height: 18px;
      color: var(--ink-400);
      pointer-events: none;
    }

    .input {
      width: 100%;
      height: 48px;
      padding: 0 14px 0 44px;
      border-radius: var(--radius);
      border: 1.5px solid var(--ink-200);
      background: var(--ink-50);
      font-size: 14.5px;
      transition: border-color .15s, background .15s, box-shadow .15s;
      outline: none;
    }

    .input:focus {
      border-color: var(--blue-400);
      background: white;
      box-shadow: 0 0 0 4px rgba(42, 134, 239, .14);
    }

    .input::placeholder {
      color: var(--ink-400);
    }

    .pw-toggle {
      position: absolute;
      right: 8px;
      height: 32px;
      width: 32px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: var(--ink-500);
      transition: background .15s, color .15s;
    }

    .pw-toggle:hover {
      background: var(--ink-100);
      color: var(--ink-700);
    }

    .pw-toggle svg {
      width: 18px;
      height: 18px;
    }

    .btn-primary {
      width: 100%;
      height: 50px;
      margin-top: 6px;
      border-radius: var(--radius);
      background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
      color: white;
      font-weight: 700;
      font-size: 15px;
      box-shadow: 0 8px 22px -8px rgba(42, 134, 239, .55);
      transition: transform .08s ease, box-shadow .15s, filter .15s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }

    .btn-primary:hover {
      filter: brightness(1.05);
      box-shadow: 0 12px 28px -10px rgba(42, 134, 239, .65);
    }

    .btn-primary:active {
      transform: translateY(1px);
    }

    .btn-primary:disabled {
      opacity: .65;
      cursor: not-allowed;
    }

    .spinner {
      width: 18px;
      height: 18px;
      border: 2.5px solid rgba(255, 255, 255, .4);
      border-top-color: white;
      border-radius: 50%;
      animation: spin .8s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .login-foot {
      margin-top: 24px;
      text-align: center;
      font-size: 13px;
      color: var(--ink-500);
    }

    .form-error {
      background: #fff1f2;
      color: #be123c;
      border: 1px solid #fecdd3;
      padding: 10px 14px;
      border-radius: 10px;
      font-size: 13px;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* ============ CHAT ============ */
    .app-shell {
      display: grid;
      grid-template-columns: 290px 1fr;
      height: 100dvh;
      background: var(--bg);
      overflow: hidden;
    }

    .sidebar {
      background: linear-gradient(180deg, #ffffff 0%, #f6fafd 100%);
      border-right: 1px solid var(--ink-200);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      z-index: 30;
    }

    .sidebar-head {
      padding: 18px 16px 14px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      border-bottom: 1px solid var(--ink-100);
    }

    .sidebar-brand {
      display: flex;
      align-items: center;
      gap: 13px;
      padding: 4px 2px;
    }

    .sidebar-brand .brand-mark {
      width: 42px;
      height: 42px;
      border-radius: 50%;
    }

    .sidebar-brand .brand-name {
      gap: 4px;
    }

    .sidebar-brand .brand-name b {
      font-size: 15px;
    }

    .sidebar-brand .brand-name span {
      font-size: 10px;
    }

    .new-chat {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      height: 42px;
      border-radius: 10px;
      background: var(--blue-500);
      color: white;
      font-weight: 600;
      font-size: 14px;
      box-shadow: 0 4px 12px -4px rgba(42, 134, 239, .55);
      transition: filter .15s;
    }

    .new-chat:hover {
      filter: brightness(1.06);
    }

    .new-chat svg {
      width: 16px;
      height: 16px;
    }

    .search-box {
      position: relative;
    }

    .search-box svg {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 16px;
      height: 16px;
      color: var(--ink-400);
    }

    .search-box input {
      width: 100%;
      height: 38px;
      border-radius: 10px;
      border: 1px solid var(--ink-200);
      background: white;
      padding: 0 12px 0 36px;
      font-size: 13.5px;
      outline: none;
      transition: border-color .15s, box-shadow .15s;
    }

    .search-box input:focus {
      border-color: var(--blue-300);
      box-shadow: 0 0 0 3px rgba(42, 134, 239, .12);
    }

    .history {
      flex: 1;
      overflow-y: auto;
      padding: 8px 10px 16px;
    }

    .history::-webkit-scrollbar {
      width: 6px;
    }

    .history::-webkit-scrollbar-thumb {
      background: var(--ink-200);
      border-radius: 3px;
    }

    .history-group-label {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .06em;
      text-transform: uppercase;
      color: var(--ink-400);
      padding: 14px 10px 6px;
    }

    .chat-item {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 10px;
      border-radius: 9px;
      color: var(--ink-700);
      text-align: left;
      font-size: 13.5px;
      transition: background .12s, color .12s;
      position: relative;
    }

    .chat-item:hover {
      background: var(--blue-50);
      color: var(--ink-900);
    }

    .chat-item.active {
      background: var(--blue-100);
      color: var(--blue-900);
      font-weight: 600;
    }

    .chat-item .icn {
      width: 14px;
      height: 14px;
      color: var(--ink-400);
      flex-shrink: 0;
    }

    .chat-item.active .icn {
      color: var(--blue-700);
    }

    .chat-item .title {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .chat-item .del {
      width: 24px;
      height: 24px;
      display: grid;
      place-items: center;
      color: var(--ink-400);
      border-radius: 6px;
      opacity: 0;
      transition: opacity .12s, background .12s, color .12s;
      flex-shrink: 0;
    }

    .chat-item:hover .del {
      opacity: 1;
    }

    .chat-item .del:hover {
      background: rgba(190, 18, 60, .1);
      color: #be123c;
    }

    .chat-item .del svg {
      width: 14px;
      height: 14px;
    }

    .history-empty {
      text-align: center;
      color: var(--ink-400);
      font-size: 13px;
      padding: 32px 12px;
    }

    .sidebar-foot {
      border-top: 1px solid var(--ink-100);
      padding: 12px;
    }

    .user-pill {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      border-radius: 10px;
      transition: background .12s;
      width: 100%;
    }

    .user-pill:hover {
      background: var(--ink-100);
    }

    .avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--blue-300), var(--blue-600));
      color: white;
      font-weight: 700;
      font-size: 13px;
      display: grid;
      place-items: center;
      flex-shrink: 0;
    }

    .user-pill .meta {
      flex: 1;
      text-align: left;
      overflow: hidden;
    }

    .user-pill .meta strong {
      display: block;
      font-size: 13.5px;
      line-height: 1.2;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .user-pill .meta span {
      font-size: 11.5px;
      color: var(--ink-500);
    }

    .user-pill svg {
      width: 16px;
      height: 16px;
      color: var(--ink-400);
      flex-shrink: 0;
    }

    .foot-label {
      text-align: center;
      font-size: 11px;
      color: var(--ink-400);
      font-family: var(--font-mono);
      letter-spacing: .04em;
      padding: 4px;
    }

    /* main */
    .main {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--bg);
      position: relative;
    }

    .topbar {
      height: 60px;
      padding: 0 22px;
      display: flex;
      align-items: center;
      gap: 14px;
      background: rgba(255, 255, 255, .72);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--ink-100);
      flex-shrink: 0;
    }

    .menu-btn {
      width: 38px;
      height: 38px;
      border-radius: 9px;
      display: none;
      place-items: center;
      color: var(--ink-700);
    }

    .menu-btn:hover {
      background: var(--ink-100);
    }

    .menu-btn svg {
      width: 20px;
      height: 20px;
    }

    .topbar-title {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .topbar-title strong {
      font-size: 15px;
      font-weight: 700;
      letter-spacing: -.01em;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .topbar-title span {
      font-size: 12px;
      color: var(--ink-500);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .topbar-title span::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #22c55e;
      box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
      flex-shrink: 0;
    }

    .messages {
      flex: 1;
      overflow-y: auto;
      padding: 30px 0 14px;
    }

    .messages::-webkit-scrollbar {
      width: 8px;
    }

    .messages::-webkit-scrollbar-thumb {
      background: var(--ink-200);
      border-radius: 4px;
    }

    .messages-inner {
      max-width: 780px;
      margin: 0 auto;
      padding: 0 22px;
      display: flex;
      flex-direction: column;
      gap: 24px;
    }

    /* empty state */
    .empty {
      max-width: 780px;
      margin: 0 auto;
      padding: 36px 24px;
      text-align: center;
    }

    .empty-mark {
      width: 64px;
      height: 64px;
      margin: 0 auto 18px;
      border-radius: 18px;
      background: linear-gradient(135deg, var(--blue-400), var(--blue-700));
      display: grid;
      place-items: center;
      box-shadow: 0 12px 32px -10px rgba(42, 134, 239, .6);
    }

    .empty-mark svg {
      width: 32px;
      height: 32px;
      color: white;
    }

    .empty h1 {
      font-size: 27px;
      font-weight: 800;
      letter-spacing: -.025em;
      margin: 0 0 8px;
    }

    .empty h1 .grad {
      background: linear-gradient(135deg, var(--blue-500), var(--blue-800));
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .empty p {
      color: var(--ink-500);
      font-size: 15px;
      margin: 0 0 30px;
      line-height: 1.55;
    }

    .suggestions {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      text-align: left;
    }

    .suggest-card {
      background: white;
      border: 1px solid var(--ink-200);
      border-radius: var(--radius);
      padding: 15px;
      display: flex;
      align-items: center;
      gap: 12px;
      cursor: pointer;
      transition: border-color .15s, transform .1s, box-shadow .15s;
      text-align: left;
    }

    .suggest-card:hover {
      border-color: var(--blue-300);
      box-shadow: var(--shadow-md);
      transform: translateY(-1px);
    }

    .suggest-icon {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: var(--blue-100);
      color: var(--blue-700);
      display: grid;
      place-items: center;
      flex-shrink: 0;
    }

    .suggest-icon svg {
      width: 17px;
      height: 17px;
    }

    .suggest-text {
      font-size: 13.5px;
      font-weight: 600;
      line-height: 1.4;
      color: var(--ink-900);
    }

    /* messages */
    .msg {
      display: flex;
      gap: 14px;
      align-items: flex-start;
      animation: msgIn .3s cubic-bezier(.4, 0, .2, 1);
    }

    @keyframes msgIn {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .msg.user {
      flex-direction: row-reverse;
    }

    .msg-avatar {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      flex-shrink: 0;
      display: grid;
      place-items: center;
    }

    .msg-avatar.bot {
      background: linear-gradient(135deg, var(--blue-400), var(--blue-700));
      color: white;
      box-shadow: 0 4px 10px -3px rgba(42, 134, 239, .5);
    }

    .msg-avatar.bot svg {
      width: 18px;
      height: 18px;
    }

    .msg-avatar.user {
      background: var(--blue-100);
      color: var(--blue-800);
      font-weight: 700;
      font-size: 13px;
      border-radius: 50%;
    }

    .msg-body {
      max-width: calc(100% - 50px);
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
    }

    .msg.user .msg-body {
      align-items: flex-end;
    }

    .msg-name {
      font-size: 12px;
      color: var(--ink-500);
      font-weight: 600;
      padding: 0 2px;
    }

    .msg.user .msg-name {
      display: none;
    }

    .bubble {
      padding: 13px 16px;
      border-radius: 14px;
      font-size: 14.5px;
      line-height: 1.55;
      word-wrap: break-word;
      max-width: 100%;
    }

    .msg.bot .bubble {
      background: white;
      border: 1px solid var(--ink-200);
      border-top-left-radius: 4px;
      color: var(--ink-900);
    }

    .msg.user .bubble {
      background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
      color: white;
      border-top-right-radius: 4px;
      box-shadow: 0 4px 14px -6px rgba(42, 134, 239, .5);
      white-space: pre-wrap;
    }

    .msg-actions {
      display: flex;
      gap: 4px;
      padding: 2px;
      opacity: 0;
      transition: opacity .15s;
    }

    .msg:hover .msg-actions {
      opacity: 1;
    }

    .msg-action {
      width: 26px;
      height: 26px;
      border-radius: 6px;
      display: grid;
      place-items: center;
      color: var(--ink-400);
      transition: background .12s, color .12s;
    }

    .msg-action:hover {
      background: var(--ink-100);
      color: var(--ink-700);
    }

    .msg-action svg {
      width: 14px;
      height: 14px;
    }

    .msg-action.copied {
      color: #16a34a;
    }

    /* pipeline pills */
    .pipe-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 9px;
    }

    .pipe-pill {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 500;
      padding: 3px 10px;
      border-radius: 20px;
      white-space: nowrap;
      background: var(--ink-100);
      color: var(--ink-400);
      transition: background .25s ease, color .25s ease;
    }

    .pipe-pill.start {
      background: var(--blue-100);
      color: var(--blue-700);
      animation: pillpulse 1.2s ease-in-out infinite;
    }

    .pipe-pill.done {
      background: var(--blue-50);
      color: var(--blue-600);
    }

    .pipe-pill.skipped {
      opacity: .5;
    }

    @keyframes pillpulse {
      50% {
        opacity: .5;
      }
    }

    /* follow-up banner */
    .followup-banner {
      display: flex;
      align-items: flex-start;
      gap: 9px;
      margin-bottom: 9px;
      padding: 9px 12px;
      background: var(--blue-50);
      border: 1px solid var(--blue-100);
      border-radius: 10px;
    }

    .followup-banner>svg {
      width: 15px;
      height: 15px;
      color: var(--blue-600);
      flex-shrink: 0;
      margin-top: 1px;
    }

    .followup-text {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }

    .followup-text strong {
      font-size: 12px;
      font-weight: 700;
      color: var(--blue-800);
    }

    .followup-text em {
      font-size: 12.5px;
      color: var(--ink-700);
    }

    /* tabel / sql tabs */
    .panel-tabs {
      display: inline-flex;
      gap: 3px;
      margin-top: 13px;
      background: var(--ink-100);
      padding: 3px;
      border-radius: 9px;
    }

    .panel-tabs button {
      font-family: var(--font-mono);
      font-size: 9.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .05em;
      padding: 4px 12px;
      border-radius: 7px;
      color: var(--ink-500);
      transition: background .12s, color .12s;
    }

    .panel-tabs button.active {
      background: var(--blue-600);
      color: white;
      box-shadow: var(--shadow-sm);
    }

    /* "menampilkan 200 dari N" caption */
    .table-note {
      margin-top: 7px;
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--ink-400);
    }

    /* insight panel */
    .insight-panel {
      margin-top: 12px;
    }

    .insight-panel .answer-text {
      font-size: 14px;
    }

    .insight-loading {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--ink-500);
      padding: 4px 0;
    }

    .spinner-sm {
      width: 15px;
      height: 15px;
      border: 2px solid var(--ink-200);
      border-top-color: var(--blue-500);
      border-radius: 50%;
      animation: spin .8s linear infinite;
      flex-shrink: 0;
    }

    /* metadata chips */
    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-top: 13px;
    }

    .chip {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--ink-500);
      background: var(--ink-50);
      border: 1px solid var(--ink-100);
      padding: 3px 10px;
      border-radius: 7px;
    }

    .chip.view {
      color: var(--blue-700);
      background: var(--blue-50);
      border-color: var(--blue-100);
      font-weight: 500;
    }

    .chip.cache {
      color: #b5872f;
      background: #fbf6e8;
      border-color: #e3d2a8;
    }

    .chip.warn {
      color: #be123c;
      background: #fff1f2;
      border-color: #fecdd3;
    }

    .answer-text {
      word-break: break-word;
    }

    .answer-text .pending {
      color: var(--ink-400);
    }

    .answer-text strong {
      font-weight: 700;
    }

    .answer-text ul,
    .answer-text ol {
      margin: 7px 0;
      padding-left: 20px;
    }

    .answer-text li {
      margin-bottom: 3px;
    }

    .answer-text li::marker {
      color: var(--blue-500);
    }

    .caret {
      display: inline-block;
      width: 6px;
      height: 15px;
      vertical-align: -3px;
      margin-left: 1px;
      background: var(--blue-500);
      animation: blink 1s steps(2) infinite;
    }

    @keyframes blink {
      50% {
        opacity: 0;
      }
    }

    .note-error {
      margin-top: 11px;
      padding: 9px 12px;
      border-radius: 9px;
      font-size: 13px;
      line-height: 1.5;
      background: #fff1f2;
      color: #be123c;
      border: 1px solid #fecdd3;
    }

    /* sql + table */
    .sql-toggle {
      margin-top: 12px;
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--blue-600);
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 0;
    }

    .sql-toggle:hover {
      color: var(--blue-800);
    }

    .sql-toggle .chev {
      transition: transform .2s ease;
    }

    .sql-toggle.open .chev {
      transform: rotate(90deg);
    }

    pre.sql {
      margin: 9px 0 0;
      background: var(--ink-900);
      color: #cfe1f7;
      font-family: var(--font-mono);
      font-size: 11.5px;
      line-height: 1.55;
      padding: 11px 13px;
      border-radius: 10px;
      overflow-x: auto;
    }

    .table-wrap {
      margin-top: 12px;
      border: 1px solid var(--ink-200);
      border-radius: 10px;
      overflow: auto;
      max-height: 320px;
    }

    table {
      border-collapse: collapse;
      width: 100%;
      font-size: 12px;
    }

    thead th {
      position: sticky;
      top: 0;
      background: var(--blue-50);
      color: var(--ink-700);
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .05em;
      text-align: left;
      padding: 7px 10px;
      border-bottom: 1px solid var(--ink-200);
      white-space: nowrap;
    }

    tbody td {
      padding: 6px 10px;
      border-bottom: 1px solid var(--ink-100);
      white-space: nowrap;
    }

    tbody tr:last-child td {
      border-bottom: none;
    }

    tbody tr:nth-child(even) td {
      background: var(--ink-50);
    }

    td.num {
      text-align: right;
      font-family: var(--font-mono);
    }

    .meta-row {
      margin-top: 11px;
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      align-items: center;
      font-family: var(--font-mono);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: var(--ink-400);
    }

    .pill {
      padding: 3px 9px;
      border-radius: 20px;
      border: 1px solid var(--ink-200);
    }

    .pill.ok {
      color: var(--blue-700);
      border-color: var(--blue-200);
      background: var(--blue-50);
    }

    .pill.cache {
      color: #b5872f;
      border-color: #e3d2a8;
      background: #fbf6e8;
    }

    .pill.warn {
      color: #be123c;
      border-color: #fecdd3;
      background: #fff1f2;
    }

    /* composer */
    .composer-wrap {
      padding: 0 22px 20px;
      flex-shrink: 0;
    }

    .composer {
      max-width: 780px;
      margin: 0 auto;
      background: white;
      border: 1.5px solid var(--ink-200);
      border-radius: 16px;
      padding: 8px 8px 8px 14px;
      display: flex;
      align-items: flex-end;
      gap: 6px;
      box-shadow: 0 8px 24px -12px rgba(24, 72, 141, .18);
      transition: border-color .15s, box-shadow .15s;
    }

    .composer:focus-within {
      border-color: var(--blue-400);
      box-shadow: 0 0 0 4px rgba(42, 134, 239, .12), 0 8px 24px -12px rgba(24, 72, 141, .18);
    }

    .composer textarea {
      flex: 1;
      border: none;
      outline: none;
      resize: none;
      background: transparent;
      font-size: 14.5px;
      line-height: 1.5;
      padding: 11px 0;
      max-height: 160px;
      min-height: 24px;
    }

    .composer textarea::placeholder {
      color: var(--ink-400);
    }

    .send-btn {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: var(--blue-500);
      color: white;
      display: grid;
      place-items: center;
      transition: filter .15s, transform .08s, background .15s;
      flex-shrink: 0;
    }

    .send-btn:hover:not(:disabled) {
      filter: brightness(1.08);
    }

    .send-btn:active:not(:disabled) {
      transform: scale(.96);
    }

    .send-btn:disabled {
      background: var(--ink-200);
      cursor: not-allowed;
    }

    .send-btn svg {
      width: 18px;
      height: 18px;
    }

    .composer-hint {
      max-width: 780px;
      margin: 8px auto 0;
      font-size: 11.5px;
      color: var(--ink-400);
      text-align: center;
      padding: 0 22px;
    }

    .backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(11, 26, 44, .45);
      backdrop-filter: blur(2px);
      z-index: 25;
      animation: fadein .18s;
    }

    @keyframes fadein {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

    /* responsive */
    @media (max-width: 1024px) {
      .login-shell {
        grid-template-columns: 1fr;
      }

      .login-hero {
        display: none;
      }

      .app-shell {
        grid-template-columns: 250px 1fr;
      }
    }

    @media (max-width: 768px) {
      .app-shell {
        grid-template-columns: 1fr;
      }

      .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 290px;
        max-width: 84vw;
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.4, 0, .2, 1);
        box-shadow: 0 0 40px rgba(11, 26, 44, .2);
      }

      .sidebar.open {
        transform: translateX(0);
      }

      .backdrop.show {
        display: block;
      }

      .menu-btn {
        display: grid;
      }

      .login-form-side {
        padding: 24px;
      }

      .login-card h2 {
        font-size: 23px;
      }

      .messages {
        padding-top: 16px;
      }

      .messages-inner {
        padding: 0 14px;
        gap: 18px;
      }

      .composer-wrap {
        padding: 0 14px 14px;
      }

      .suggestions {
        grid-template-columns: 1fr;
      }

      .empty {
        padding: 24px 14px;
      }

      .empty h1 {
        font-size: 23px;
      }

      .topbar {
        padding: 0 12px;
      }
    }

    @media (max-height: 720px) {
      .hero-features {
        display: none;
      }
    }
  
