    :root {
      --paper: #f8f8f6;
      --surface: #ffffff;
      --ink: #141414;
      --muted: #8b8b87;
      --line: #e9e9e5;
      --soft: #f0f0ed;
      --sidebar: 292px;
      --ease: cubic-bezier(.23,1,.32,1);
    }
    * { box-sizing: border-box; }
    html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
    body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", 'IBM Plex Sans Arabic', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow: hidden; }
    button, input, textarea { font: inherit; }
    button { border: 0; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
    .app { display: flex; height: 100vh; min-height: 620px; direction: ltr; }
    .sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); height: 100%; max-height: 100vh; box-sizing: border-box; background: #f1f1ee; border-right: 1px solid var(--line); padding: 24px 15px 17px; display: flex; flex-direction: column; transition: width .28s var(--ease), flex-basis .28s var(--ease), padding .28s var(--ease); direction: ltr; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; overflow: hidden; }
    .sidebar.collapsed { width: 0; flex-basis: 0; padding-left: 0; padding-right: 0; overflow: hidden; border: 0; }
    .brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 21px; direction: ltr; border-bottom: 1px solid #deded9; -webkit-user-select: none; user-select: none; flex-shrink: 0; }
    .brand { display: flex; align-items: center; direction: ltr; font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -.05em; font-size: 22px; color: var(--ink); white-space: nowrap; -webkit-user-select: none; user-select: none; }
    .brand-mark { display: none; }
    .collapse-btn, .icon-btn { width: 34px; height: 34px; border-radius: 10px; background: transparent; display: grid; place-items: center; color: #676762; transition: background .18s, color .18s, transform .18s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
    .collapse-btn:hover, .icon-btn:hover { background: #e6e6e2; color: var(--ink); }
    .collapse-btn:active, .icon-btn:active, .send:active { transform: scale(.95); }
    .new-chat { display: flex; align-items: center; justify-content: flex-start; width: 100%; background: transparent; color: var(--ink); border-radius: 0; padding: 16px 8px; font-size: 14px; font-weight: 700; margin-bottom: 20px; direction: ltr; border-bottom: 1px solid #deded9; transition: color .18s, padding-left .18s; -webkit-touch-callout: none !important; -webkit-user-select: none !important; -moz-user-select: none !important; -ms-user-select: none !important; user-select: none !important; -webkit-tap-highlight-color: transparent !important; touch-action: manipulation; outline: none; flex-shrink: 0; }
    .new-chat:hover { color: #777771; padding-left: 11px; }
    .new-chat:active { background: rgba(0,0,0,0.04); }
    .new-chat span, .new-chat svg, .new-chat path { display: flex; gap: 9px; align-items: center; pointer-events: none; -webkit-touch-callout: none !important; -webkit-user-select: none !important; user-select: none !important; -webkit-tap-highlight-color: transparent !important; }
    .new-chat::selection, .new-chat *::selection { background: transparent !important; color: inherit !important; }
    .section-label { color: #8c8c87; font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .08em; padding: 0 8px 10px; text-transform: uppercase; font-weight: 500; -webkit-user-select: none; user-select: none; flex-shrink: 0; }
    .chat-list { display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 2px; margin-bottom: 8px; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.15) transparent; -webkit-overflow-scrolling: touch; }
    .chat-list::-webkit-scrollbar { width: 4px; }
    .chat-list::-webkit-scrollbar-track { background: transparent; }
    .chat-list::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 4px; }
    .chat-list::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }
    .chat-item-wrap {
      display: flex;
      align-items: center;
      border-radius: 9px;
      position: relative;
      transition: background .18s;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
      cursor: pointer;
    }
    .chat-item-wrap:hover, .chat-item-wrap.active {
      background: #e2e2dd;
    }
    .chat-item-wrap:active {
      background: #dadad4;
    }
    .chat-item-btn {
      flex: 1;
      min-width: 0;
      text-align: left;
      border: 0;
      background: transparent;
      padding: 10px 6px 10px 12px;
      color: #383834;
      font-size: 14.5px;
      line-height: 1.45;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: color .18s;
      font-family: inherit;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }
    .chat-item-wrap.active .chat-item-btn {
      color: var(--ink);
      font-weight: 600;
    }
    .chat-item-more {
      width: 26px;
      height: 26px;
      flex: 0 0 26px;
      margin-right: 6px;
      border-radius: 6px;
      border: 0;
      background: transparent;
      color: #71716c;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      opacity: 0;
      transition: opacity .18s, background .15s, color .15s;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }
    .chat-item-wrap:hover .chat-item-more,
    .chat-item-wrap.active .chat-item-more,
    .chat-item-more:focus {
      opacity: 1;
    }
    .chat-item-more:hover {
      background: rgba(0, 0, 0, 0.08);
      color: var(--ink);
    }
    .sidebar-footer { margin-top: auto; flex-shrink: 0; border-top: 1px solid #deded9; padding: 15px 8px 0; color: #8f8f89; font-size: 11px; display: flex; align-items: center; justify-content: space-between; direction: ltr; }
    .sidebar-footer-actions { display: flex; align-items: center; gap: 2px; }
    .footer-icon-btn { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #8f8f89; text-decoration: none; transition: background .16s, color .16s; }
    .footer-icon-btn:hover { background: #e2e2dd; color: var(--ink); }
    .footer-icon-btn.account-linked { color: #16a34a; }
    .footer-icon-btn.account-linked:hover { background: #dcfce7; color: #15803d; }
    .status { display: flex; align-items: center; gap: 6px; }
    .dot { width: 6px; height: 6px; border-radius: 50%; background: #58a36a; }
    .main { flex: 1; min-width: 0; display: flex; flex-direction: column; direction: ltr; position: relative; }
    .topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 29px; direction: ltr; }
    .topbar-right { display: flex; gap: 7px; align-items: center; }
    .open-sidebar { opacity: 1; pointer-events: auto; }
    .sidebar:not(.collapsed) + .main .open-sidebar { opacity: 0; pointer-events: none; }
    .topbar-actions {
      position: relative;
      display: flex;
      align-items: center;
    }

    .more-menu {
      position: fixed;
      width: 168px;
      background: #ffffff;
      border: 1px solid #e2e2dd;
      border-radius: 10px;
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
      padding: 5px;
      display: none;
      flex-direction: column;
      gap: 2px;
      z-index: 10001;
      animation: rise 0.16s ease;
      touch-action: manipulation;
      -webkit-user-select: none;
      user-select: none;
    }

    .more-menu.show {
      display: flex;
    }

    .menu-item {
      display: flex;
      align-items: center;
      gap: 9px;
      width: 100%;
      padding: 8px 10px;
      border-radius: 7px;
      font-size: 13.5px;
      font-weight: 500;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", sans-serif;
      color: #27272a;
      background: transparent;
      border: 0;
      cursor: pointer;
      text-align: left;
      transition: background 0.15s ease, color 0.15s ease;
    }

    .menu-item:hover {
      background: #f4f4f1;
    }

    .menu-item svg {
      flex-shrink: 0;
      stroke: currentColor;
    }

    .menu-item.danger {
      color: #ef4444;
    }

    .menu-item.danger:hover {
      background: #fef2f2;
      color: #dc2626;
    }

    .menu-item.danger svg {
      stroke: #ef4444;
    }

    /* Modals */
    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.45);
      backdrop-filter: blur(2px);
      z-index: 1000;
      display: none;
      place-items: center;
      padding: 16px;
      animation: rise 0.2s ease;
    }

    .modal-backdrop.show {
      display: grid;
    }

    .modal-box {
      display: none;
      background: #ffffff;
      border: 1px solid #e4e4e0;
      border-radius: 12px;
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
      width: 100%;
      max-width: 400px;
      padding: 22px 24px;
      direction: ltr;
      text-align: left;
      animation: rise 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal-box.active {
      display: block;
    }

    .modal-box h3 {
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", sans-serif;
      font-size: 17px;
      font-weight: 600;
      color: #141414;
      margin: 0 0 8px;
    }

    .modal-box p {
      font-size: 14px;
      line-height: 1.5;
      color: #71717a;
      margin: 0 0 20px;
    }

    .modal-input-wrap {
      margin-bottom: 20px;
    }

    .modal-input {
      width: 100%;
      padding: 9px 12px;
      font-size: 14.5px;
      font-family: inherit;
      border: 1px solid #d4d4ce;
      border-radius: 8px;
      outline: none;
      background: #fafaf8;
      color: #141414;
      transition: border-color 0.15s, box-shadow 0.15s;
    }

    .modal-input:focus {
      border-color: #141414;
      background: #ffffff;
      box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.07);
    }

    .modal-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
    }

    .modal-btn {
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 13.5px;
      font-weight: 500;
      cursor: pointer;
      border: 0;
      transition: background 0.15s, opacity 0.15s, transform 0.1s;
    }

    .modal-btn:active {
      transform: scale(0.97);
    }

    .modal-btn.cancel {
      background: #f4f4f1;
      color: #3f3f46;
    }

    .modal-btn.cancel:hover {
      background: #eaeaee;
    }

    .modal-btn.primary {
      background: #141414;
      color: #ffffff;
    }

    .modal-btn.primary:hover {
      background: #27272a;
    }

    .modal-btn.danger {
      background: #ef4444;
      color: #ffffff;
    }

    .modal-btn.danger:hover {
      background: #dc2626;
    }

    .model-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.55); border-radius: 30px; padding: 8px 11px; color: #70706b; font-size: 11px; }
    .model-pill b { color: var(--ink); font-weight: 700; }
    .model-dot { width: 6px; height: 6px; border-radius: 50%; background: #111; }
    .conversation { flex: 1; overflow-y: auto; padding: 40px 24px 160px; direction: ltr; }
    .hero { max-width: 760px; margin: 14vh auto 0; text-align: center; }
    .eyebrow { font-family: 'DM Mono', monospace; letter-spacing: .12em; color: #9b9b95; font-size: 10px; text-transform: uppercase; direction: ltr; }
    .hero h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(39px, 5vw, 64px); letter-spacing: -.07em; line-height: .99; margin: 0 0 19px; font-weight: 400; direction: ltr; }
    .hero p { max-width: 420px; margin: 0 auto; color: #8a8a84; line-height: 1.9; font-size: 14px; font-weight: 400; }
    .hero-content { display: inline; }
    .skeleton { display: none; background: linear-gradient(90deg, #ecece8 25%, #f7f7f4 50%, #ecece8 75%); background-size: 200% 100%; animation: shimmer 1.35s ease-in-out infinite; }
    .hero.is-loading .hero-content { display: none; }
    .hero.is-loading .skeleton { display: block; margin-left: auto; margin-right: auto; }
    .skeleton-title { width: min(290px, 62vw); height: clamp(43px, 5vw, 68px); border-radius: 8px; }
    .skeleton-copy { width: min(330px, 74vw); height: 15px; border-radius: 5px; }
    .suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 670px; margin: 44px auto 0; text-align: right; }
    .suggestion { background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 13px; padding: 15px; min-height: 86px; transition: transform .2s var(--ease), box-shadow .2s, border .2s; }
    .suggestion:hover { transform: translateY(-3px); border-color: #c9c9c2; box-shadow: 0 9px 23px rgba(20,20,20,.05); }
    .suggestion small { color: #9b9b94; display: block; margin-bottom: 11px; font-family: 'DM Mono', monospace; direction: ltr; text-align: left; }
    .suggestion span { font-size: 12px; color: #454541; }
    .messages { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 21px; }
    .message { display: flex; gap: 0; align-items: flex-start; animation: rise .3s var(--ease) both; }
    .message.user { justify-content: flex-end; }
    .message.agent { justify-content: flex-start; }
    .avatar { display: none; }
    .bubble { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", 'IBM Plex Sans Arabic', sans-serif; max-width: min(640px, 86%); border-radius: 14px; padding: 13px 18px; font-size: 16px; line-height: 1.85; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
    .user .bubble { background: var(--ink); color: white; border: 1px solid var(--ink); border-radius: 8px; font-size: 15.5px; }
    .agent .bubble { background: transparent; border: 0; border-radius: 0; padding: 6px 0; color: #141414; font-size: 16.5px; font-weight: 400; line-height: 1.85; word-break: break-word; }
    .thinking-shimmer {
      display: inline-block;
      font-size: 15px;
      font-weight: 500;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", sans-serif;
      background: linear-gradient(90deg, #9b9b94 0%, #141414 50%, #9b9b94 100%);
      background-size: 200% 100%;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      animation: textLightSweep 1.6s infinite linear;
      margin: 8px 0;
      letter-spacing: -.01em;
    }
    
    /* Error Card (ChatGPT-style with Retry) */
    .chat-error-card {
      margin: 12px 0 6px;
      padding: 14px 18px;
      background: #fdf6f6;
      border: 1px solid #fee2e2;
      border-radius: 12px;
      max-width: min(640px, 94%);
      display: flex;
      flex-direction: column;
      gap: 10px;
      animation: rise .25s var(--ease) both;
    }
    .chat-error-header {
      display: flex;
      align-items: center;
      gap: 9px;
      color: #dc2626;
      font-size: 14px;
      font-weight: 600;
    }
    .chat-error-header svg {
      flex-shrink: 0;
    }
    .chat-error-msg {
      font-size: 13.5px;
      color: #57534e;
      line-height: 1.5;
    }
    .chat-error-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 2px;
    }
    .error-retry-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px;
      border-radius: 8px;
      background: #ffffff;
      border: 1px solid #fca5a5;
      color: #b91c1c;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background .14s, border-color .14s, transform .1s;
      user-select: none;
    }
    .error-retry-btn:hover {
      background: #fee2e2;
      border-color: #f87171;
    }
    .error-retry-btn:active {
      transform: scale(.96);
    }

    
    /* Tool Lines */
    .tool-line {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 6px 0;
      font-size: 14.5px;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", sans-serif;
      line-height: 1.5;
    }
    
    .tool-line.running .tool-text {
      background: linear-gradient(90deg, #9b9b94 0%, #141414 50%, #9b9b94 100%);
      background-size: 200% 100%;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      animation: textLightSweep 1.6s infinite linear;
      font-weight: 500;
    }
    
    .tool-line.done {
      color: #141414;
    }
    
    .tool-line.done .check-icon {
      width: 14px;
      height: 14px;
      stroke: #141414;
      flex-shrink: 0;
    }
    
    .tool-line.done .tool-text {
      color: #141414;
      background: none;
      -webkit-text-fill-color: initial;
    }

    /* Loop Steps (Reasoning & Planning) with Accordion */
    .loop-step {
      margin: 6px 0;
      font-size: 14.5px;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", sans-serif;
      line-height: 1.5;
    }

    .step-header {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      cursor: pointer;
      user-select: none;
      border-radius: 6px;
      padding: 2px 6px;
      transition: background 0.15s ease;
    }

    .loop-step.done .step-header:hover {
      background: rgba(0, 0, 0, 0.05);
    }

    .loop-step.running .step-title {
      background: linear-gradient(90deg, #9b9b94 0%, #141414 50%, #9b9b94 100%);
      background-size: 200% 100%;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      animation: textLightSweep 1.6s infinite linear;
      font-weight: 500;
    }

    .loop-step.done .step-title {
      color: #141414;
      font-weight: 500;
    }

    .loop-step.done .check-icon {
      width: 14px;
      height: 14px;
      stroke: #141414;
      flex-shrink: 0;
    }

    .step-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: 0;
      padding: 2px;
      cursor: pointer;
      color: #8b8b87;
      transition: color 0.15s ease;
    }

    .step-header:hover .step-toggle {
      color: #141414;
    }

    .step-chevron {
      transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
      display: block;
      transform-origin: center;
    }

    .loop-step.collapsed .step-chevron {
      transform: rotate(0deg);
    }

    .loop-step:not(.collapsed) .step-chevron {
      transform: rotate(180deg);
    }

    .step-body {
      display: none;
      margin: 6px 0 10px 22px;
      max-width: 640px;
      padding: 11px 15px;
      background: #f4f4f1;
      border-left: 2px solid #d4d4ce;
      border-radius: 0 8px 8px 0;
      color: #383835;
      font-size: 13.5px;
      line-height: 1.65;
      word-break: break-word;
      animation: rise 0.2s ease;
    }

    .loop-step:not(.collapsed) .step-body {
      display: block;
    }

    /* Full Markdown Styles */
    .agent .bubble[dir="rtl"] {
      direction: rtl;
      text-align: right;
    }
    .agent .bubble[dir="ltr"] {
      direction: ltr;
      text-align: left;
    }

    .agent .bubble h1, .agent .bubble h2, .agent .bubble h3, .agent .bubble h4, .agent .bubble h5 {
      color: #141414;
      font-weight: 700;
      margin: 18px 0 8px;
      line-height: 1.35;
    }
    .agent .bubble h1 { font-size: 1.45em; border-bottom: 1px solid #e8e8e3; padding-bottom: 6px; }
    .agent .bubble h2 { font-size: 1.3em; border-bottom: 1px solid #eeeeea; padding-bottom: 5px; }
    .agent .bubble h3 { font-size: 1.15em; }
    
    .agent .bubble p {
      margin: 0 0 10px;
      line-height: 1.85;
    }
    .agent .bubble p:last-child { margin-bottom: 0; }
    
    /* Elegant font styling for English terms in Arabic text */
    .en-phrase {
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", sans-serif;
      font-weight: 500;
      letter-spacing: -0.01em;
    }
    
    .agent .bubble ul, .agent .bubble ol {
      margin: 8px 0 14px;
      line-height: 1.85;
    }
    .agent .bubble[dir="rtl"] ul, .agent .bubble[dir="rtl"] ol {
      padding-right: 24px;
      padding-left: 0;
    }
    .agent .bubble[dir="ltr"] ul, .agent .bubble[dir="ltr"] ol {
      padding-left: 24px;
      padding-right: 0;
    }
    .agent .bubble li { margin-bottom: 4px; }
    .agent .bubble strong, .agent .bubble b { color: #141414; font-weight: 700; }
    .agent .bubble em, .agent .bubble i { font-style: italic; }
    
    .agent .bubble a {
      color: #2563eb;
      text-decoration: underline;
      text-underline-offset: 3px;
    }
    .agent .bubble a:hover { color: #1d4ed8; }
    
    .agent .bubble hr {
      border: 0;
      height: 1px;
      background: #e2e2dd;
      margin: 18px 0;
    }

    .agent .bubble blockquote {
      border-left: 3px solid #141414;
      margin: 12px 0;
      padding: 6px 16px;
      color: #555550;
      background: rgba(0,0,0,0.02);
      border-radius: 0 6px 6px 0;
    }

    /* Inline Code */
    .agent .bubble :not(pre) > code {
      font-family: 'DM Mono', monospace;
      font-size: 0.88em;
      background: #ededeb;
      color: #b91c1c;
      padding: 2px 6px;
      border-radius: 4px;
      word-break: break-word;
    }

    /* Code Blocks with Copy Button */
    .code-block-wrapper {
      margin: 14px 0;
      border-radius: 10px;
      background: #18181b;
      overflow: hidden;
      border: 1px solid #27272a;
      box-shadow: 0 4px 14px rgba(0,0,0,0.08);
      direction: ltr;
      text-align: left;
    }
    .code-block-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 14px;
      background: #202024;
      border-bottom: 1px solid #2e2e33;
      font-family: 'DM Mono', monospace;
      font-size: 11.5px;
      color: #a1a1aa;
    }
    .code-lang {
      text-transform: uppercase;
      letter-spacing: .05em;
      font-weight: 500;
    }
    .code-actions {
      display: inline-flex;
      align-items: center;
      gap: 7px;
    }
    .playground-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: #141414;
      border: 1px solid #3f3f46;
      border-radius: 5px;
      color: #38bdf8;
      padding: 3px 9px;
      font-size: 11px;
      font-weight: 600;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
      cursor: pointer;
      transition: all .18s;
    }
    .playground-btn:hover {
      background: #27272a;
      color: #7dd3fc;
      border-color: #52525b;
    }
    .playground-btn svg {
      fill: currentColor;
    }
    .copy-code-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: transparent;
      border: 1px solid #3f3f46;
      border-radius: 5px;
      color: #d4d4d8;
      padding: 3px 8px;
      font-size: 11px;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
      cursor: pointer;
      transition: all .18s;
    }
    .copy-code-btn:hover {
      background: #2e2e33;
      color: #ffffff;
      border-color: #52525b;
    }
    .copy-code-btn.copied {
      color: #10b981;
      border-color: #10b981;
    }
    .code-block-wrapper pre {
      margin: 0;
      padding: 14px 16px;
      overflow-x: auto;
      font-family: 'DM Mono', monospace;
      font-size: 13.5px;
      line-height: 1.55;
      color: #f4f4f5;
      background: transparent;
    }
    .code-block-wrapper pre code {
      background: transparent;
      padding: 0;
      color: inherit;
      font-size: inherit;
      border-radius: 0;
    }

    /* Tables */
    .agent .bubble table {
      width: 100%;
      border-collapse: collapse;
      margin: 16px 0;
      font-size: 14px;
      line-height: 1.5;
      overflow-x: auto;
      display: block;
    }
    .agent .bubble th, .agent .bubble td {
      border: 1px solid #e2e2dd;
      padding: 9px 13px;
      text-align: left;
    }
    .agent .bubble th {
      background: #f1f1ee;
      font-weight: 700;
      color: #141414;
    }
    .agent .bubble tr:nth-child(even) {
      background: #fafaf8;
    }
    
    @keyframes textLightSweep {
      0% { background-position: 100% 0; }
      100% { background-position: -100% 0; }
    }
    
    .composer-wrap { position: absolute; bottom: 18px; left: 0; right: 0; padding: 8px 24px 12px; background: none; }
    .composer {
      max-width: 640px;
      margin: 0 auto;
      background: white;
      border: 1px solid #deded9;
      box-shadow: 0 4px 16px rgba(20,20,20,.05);
      border-radius: 12px;
      padding: 8px 10px 8px 10px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      direction: ltr;
      transition: border-color 0.16s, box-shadow 0.16s;
    }
    .composer:focus-within {
      border-color: #b0b0a8;
      box-shadow: 0 4px 20px rgba(20,20,20,.08);
    }
    .composer-previews {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      padding: 4px 6px 10px;
      border-bottom: 1px solid #f0f0ec;
    }
    .preview-item {
      position: relative;
      width: 58px;
      height: 58px;
      border-radius: 9px;
      overflow: hidden;
      border: 1px solid #dfdfea;
      background: #f4f4f0;
      flex-shrink: 0;
      animation: rise 0.18s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }
    .preview-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      background: #f0f0eb;
    }
    .preview-item .del-btn {
      position: absolute;
      top: 3px;
      right: 3px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: rgba(20, 20, 20, 0.72);
      color: #ffffff;
      border: 0;
      display: grid;
      place-items: center;
      cursor: pointer;
      padding: 0;
      z-index: 2;
      transition: background 0.12s ease;
    }
    .preview-item .del-btn:hover {
      background: #141414;
    }

    /* Document Previews in Composer */
    .preview-doc-item {
      position: relative;
      height: 46px;
      padding: 4px 26px 4px 8px;
      border-radius: 8px;
      border: 1px solid #e0e0dc;
      background: #fafaf8;
      display: flex;
      align-items: center;
      gap: 9px;
      flex-shrink: 0;
      max-width: 220px;
    }
    .preview-doc-badge {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .preview-doc-badge.pdf { background: #fee2e2; color: #dc2626; }
    .preview-doc-badge.word { background: #dbeafe; color: #2563eb; }
    .preview-doc-badge.excel { background: #dcfce7; color: #16a34a; }
    .preview-doc-badge.code { background: #fef3c7; color: #d97706; }
    .preview-doc-badge.text { background: #f1f5f9; color: #475569; }

    .preview-doc-info {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      line-height: 1.25;
    }
    .preview-doc-name {
      font-size: 12px;
      font-weight: 500;
      color: var(--ink);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 140px;
    }
    .preview-doc-meta {
      font-size: 10px;
      color: #8e8e86;
      font-family: var(--font-mono, monospace);
    }
    .preview-doc-item .del-btn {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: rgba(20, 20, 20, 0.08);
      color: #71716b;
      border: 0;
      display: grid;
      place-items: center;
      cursor: pointer;
      padding: 0;
      transition: background 0.12s ease, color 0.12s ease;
    }
    .preview-doc-item .del-btn:hover {
      background: #e2e2dc;
      color: #141414;
    }

    /* Minimalist User Message Document Badges in Bubble */
    .user-bubble-docs {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
    }
    .user-doc-card {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 12px;
      border-radius: 7px;
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #ffffff;
      font-size: 12px;
      max-width: 260px;
      user-select: none;
    }
    .user-doc-icon {
      flex-shrink: 0;
      color: rgba(255, 255, 255, 0.65);
    }
    .user-doc-info {
      display: flex;
      flex-direction: column;
      gap: 1px;
      overflow: hidden;
      line-height: 1.25;
    }
    .user-doc-name {
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: #ffffff;
      font-size: 12px;
    }
    .user-doc-size {
      font-size: 10.5px;
      color: rgba(255, 255, 255, 0.45);
      font-family: var(--font-mono, monospace);
    }
    .composer-bar {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 100%;
    }
    .attach-btn {
      width: 32px;
      height: 32px;
      flex: 0 0 32px;
      border-radius: 7px;
      color: #71716b;
      background: transparent;
      border: 0;
      display: grid;
      place-items: center;
      cursor: pointer;
      transition: color .14s, background .14s;
      padding: 0;
    }
    .attach-btn:hover {
      color: var(--ink);
      background: #f4f4f1;
    }
    textarea {
      resize: none;
      border: 0;
      outline: 0;
      flex: 1;
      min-height: 34px;
      max-height: 120px;
      padding: 7px 4px 7px;
      color: var(--ink);
      background: transparent;
      font-size: 15.5px;
      line-height: 1.6;
      text-rendering: optimizeLegibility;
      direction: ltr;
    }
    textarea::placeholder { color: #aaa9a3; }
    .send { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 7px; color: var(--ink); background: transparent; border: 0; display: grid; place-items: center; transition: color .14s, background .14s; }
    .send:hover { color: #777771; background: #f4f4f1; }
    .send.stop { color: #ef4444; cursor: pointer; }
    .send.stop:hover { color: #dc2626; background: #fef2f2; }
    .send.stop:active { opacity: 0.8; }

    /* Minimalist User Message Images Grid */
    .user-images-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
    }
    .user-bubble-img {
      width: 72px;
      height: 72px;
      border-radius: 8px;
      object-fit: cover;
      border: 1px solid rgba(255, 255, 255, 0.12);
      cursor: pointer;
      display: block;
      flex-shrink: 0;
      transition: opacity 0.14s ease;
    }
    .user-bubble-img:hover {
      opacity: 0.85;
    }

    .app.is-working .new-chat,
    .app.is-working .chat-item-btn,
    .app.is-working .chat-item-more,
    .app.is-working #moreBtn,
    .app.is-working .attach-btn {
      opacity: 0.45;
      cursor: not-allowed !important;
      pointer-events: none !important;
    }
    .composer-note { max-width: 760px; margin: 10px auto 0; text-align: center; color: #aaa9a3; font-size: 10px; letter-spacing: .01em; }

    /* Playground Side Panel */
    .playground-panel {
      width: 0;
      flex: 0 0 0;
      background: #ffffff;
      border-left: 0 solid var(--line);
      display: flex;
      flex-direction: column;
      height: 100vh;
      overflow: hidden;
      transition: width .28s var(--ease), flex-basis .28s var(--ease);
      z-index: 100;
    }

    .playground-panel.open {
      width: min(720px, 50vw);
      flex: 0 0 min(720px, 50vw);
      border-left-width: 1px;
    }

    @media (max-width: 900px) {
      .playground-panel.open {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        flex-basis: 100vw;
        box-shadow: -10px 0 30px rgba(0,0,0,0.15);
      }
    }

    .playground-header {
      height: 56px;
      border-bottom: 1px solid #e8e8e3;
      padding: 0 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #fafaf8;
      flex-shrink: 0;
    }

    .playground-header-left {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .pg-back-btn {
      display: none;
    }

    .playground-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", sans-serif;
      font-weight: 600;
      font-size: 13.5px;
      color: #141414;
    }

    .playground-title svg {
      color: #0ea5e9;
    }

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

    .pg-btn {
      width: 30px;
      height: 30px;
      border-radius: 7px;
      background: transparent;
      border: 0;
      display: grid;
      place-items: center;
      color: #676762;
      cursor: pointer;
      transition: background .15s, color .15s;
    }

    .pg-btn:hover {
      background: #eaeaee;
      color: #141414;
    }

    .playground-content {
      flex: 1;
      background: #ffffff;
      position: relative;
    }

    #playgroundIframe {
      width: 100%;
      height: 100%;
      border: 0;
      background: #ffffff;
    }
    .summary-card { border: 1px solid var(--line); background: #fafaf8; border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-size: 12px; color: #777770; }
    .summary-card strong { color: var(--ink); display: block; font-size: 10px; font-family: 'DM Mono'; letter-spacing: .08em; margin-bottom: 7px; direction: ltr; text-align: left; }
    @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
    @keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
    /* Refined editorial pass */
    .brand { font-family: 'Space Grotesk', sans-serif; font-size: 21px; font-weight: 400; letter-spacing: -.065em; }
    .brand-mark { display: none; }
    .brand-row { padding-bottom: 31px; }
    .collapse-btn { width: 32px; height: 32px; }
    .new-chat { justify-content: flex-start; padding: 14px 15px; gap: 10px; }
    .new-chat span:last-child { display: flex; }
    .section-label { margin-top: 3px; }
    .sidebar-footer { color: #8f8f89; }
    .status { display: none; }
    .topbar-right .model-pill { display: none; }
    .hero .eyebrow, .suggestions { display: none; }
    .hero p { display: block; }
    .composer-note { display: none; }
    .icon-btn svg, .collapse-btn svg, .new-chat svg, .send svg { display: block; }
    @media (max-width: 768px) {
      /* Mobile layout - viewport locked, conversation scrolls */
      html, body {
        height: 100%;
        height: 100dvh;
        overflow: hidden;
        margin: 0;
        padding: 0;
      }
      .app {
        height: 100%;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        position: relative;
      }
      .sidebar {
        position: fixed;
        z-index: 1000;
        inset: 0 auto 0 0;
        height: 100%;
        height: 100dvh;
        box-sizing: border-box;
        box-shadow: 14px 0 40px rgba(0,0,0,.14);
        max-width: 82vw;
      }
      .sidebar.collapsed {
        width: 0;
        transform: translateX(-100%);
      }
      /* Always show 3 dots on mobile without hover */
      .chat-item-more {
        opacity: 1 !important;
      }
      .sidebar,
      .sidebar * {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
      }
      .chat-item-wrap,
      .chat-item-btn,
      .chat-item-more,
      .new-chat,
      .icon-btn,
      .collapse-btn {
        touch-action: manipulation !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
      }
      .chat-item-wrap:active {
        background: #dadad4 !important;
      }
      .main {
        height: 100%;
        height: 100dvh;
        min-width: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
      }
      .topbar {
        height: 56px;
        padding: 0 14px;
        flex-shrink: 0;
      }
      /* Pinned conversation area */
      .conversation {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px 14px 100px !important;
      }
      /* Messages and code blocks centered on mobile */
      .messages {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        gap: 16px;
      }
      .message {
        width: 100% !important;
      }
      .message.agent {
        justify-content: center !important;
      }
      .agent-content {
        width: 100% !important;
        max-width: 100% !important;
      }
      .agent .bubble {
        width: 100% !important;
        max-width: 100% !important;
        padding: 4px 0 !important;
      }
      .user .bubble {
        max-width: 88% !important;
        font-size: 15px;
      }
      .code-block-wrapper {
        margin: 12px auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }
      .code-block-wrapper pre {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
      }
      /* Pinned ChatGPT-style Type Bar */
      .composer-wrap {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
        background: linear-gradient(transparent, var(--paper) 28%) !important;
        z-index: 40 !important;
        pointer-events: none !important;
      }
      .composer {
        pointer-events: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 7px 10px 7px 14px !important;
        box-shadow: 0 2px 14px rgba(20,20,20,.08) !important;
      }
      .hero {
        margin-top: 6vh;
        padding: 0 12px;
      }
      .hero h1 {
        font-size: 34px;
        margin-bottom: 12px;
      }
      .suggestions {
        grid-template-columns: 1fr;
        margin-top: 24px;
      }
      .suggestion {
        min-height: auto;
      }
      /* Full-screen mobile Playground */
      .playground-panel.open {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        flex-basis: 100vw !important;
        z-index: 9999 !important;
        background: #ffffff !important;
        border: 0 !important;
        box-shadow: none !important;
      }
      .pg-back-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 7px;
        color: #141414;
      }
      .playground-header {
        height: 52px;
        padding: 0 10px 0 6px;
      }
      .model-pill {
        display: none;
      }
    }

    /* ══════════════════════════════════════════════════════════════════════════
       MINIMALIST ELEGANT WEATHER WIDGET (Clean / Quiet Luxury)
       ══════════════════════════════════════════════════════════════════════════ */
    .weather-widget-container {
      margin: 16px 0 8px 0;
      width: 100%;
      max-width: 420px;
      user-select: none;
    }

    /* Minimalist Segmented City Switcher */
    .weather-slider-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
      padding: 3px;
      background: #f1f1ed;
      border-radius: 24px;
      gap: 4px;
    }

    .weather-slider-chips {
      display: flex;
      align-items: center;
      gap: 2px;
      flex: 1;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .weather-slider-chips::-webkit-scrollbar {
      display: none;
    }

    .weather-chip {
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
      background: transparent;
      color: #71716b;
      border: 0;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.12s ease, color 0.12s ease;
    }
    .weather-chip:hover {
      color: var(--ink);
    }
    .weather-chip.active {
      background: #ffffff;
      color: var(--ink);
      font-weight: 600;
      box-shadow: 0 1px 3px rgba(20, 20, 20, 0.04);
    }

    .weather-slider-nav {
      display: flex;
      align-items: center;
      gap: 2px;
      padding-right: 2px;
    }
    .weather-nav-btn {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: transparent;
      color: #71716b;
      border: 0;
      display: grid;
      place-items: center;
      cursor: pointer;
      transition: background 0.12s ease, color 0.12s ease;
    }
    .weather-nav-btn:hover {
      background: #e4e4de;
      color: var(--ink);
    }

    /* Minimalist Card */
    .weather-bubble-card {
      position: relative;
      background: #ffffff;
      border: 1px solid #e2e2dd;
      border-radius: 12px;
      padding: 18px 20px 16px;
      box-shadow: 0 1px 3px rgba(20, 20, 20, 0.02);
      transition: border-color 0.15s ease;
    }
    .weather-bubble-card:hover {
      border-color: #cecec8;
    }

    /* Top: City & Local Time */
    .weather-card-top {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      margin-bottom: 12px;
    }
    .weather-location-info {
      display: flex;
      align-items: baseline;
      gap: 8px;
    }
    .weather-city-name {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 18px;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: var(--ink);
    }
    .weather-country-name {
      font-size: 12.5px;
      color: #92928c;
      font-weight: 400;
    }
    .weather-time-badge {
      font-family: 'DM Mono', monospace;
      font-size: 11.5px;
      color: #8c8c85;
      letter-spacing: -0.01em;
    }

    /* Center: Big Temperature & Minimalist Icon */
    .weather-card-center {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 4px 0 16px;
    }
    .weather-main-group {
      display: flex;
      align-items: baseline;
      gap: 12px;
    }
    .weather-temp-degrees {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 40px;
      font-weight: 700;
      letter-spacing: -0.045em;
      color: var(--ink);
      line-height: 1;
    }
    .weather-condition-text {
      font-size: 13.5px;
      font-weight: 500;
      color: #666660;
    }

    .weather-icon-wrap {
      width: 44px;
      height: 44px;
      display: grid;
      place-items: center;
      opacity: 0.92;
    }
    .weather-icon-wrap svg {
      width: 40px;
      height: 40px;
    }

    /* Bottom: Elegant Meta Line (Feels like, Wind, Humidity) */
    .weather-card-bottom {
      display: flex;
      align-items: center;
      gap: 14px;
      padding-top: 12px;
      border-top: 1px solid #f2f2ee;
      font-size: 12px;
      color: #85857e;
    }
    .weather-meta-item {
      display: flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
    }
    .weather-meta-item strong {
      color: #2b2b28;
      font-weight: 600;
    }
    .weather-meta-dot {
      color: #d6d6d0;
      user-select: none;
    }

    /* ══════════════════════════════════════════════════════════════════════════
       MINIMALIST CURRENCY CONVERSION WIDGET (Quiet Luxury / Clean)
       ══════════════════════════════════════════════════════════════════════════ */
    .currency-widget-container {
      margin: 18px 0 8px 0;
      width: 100%;
      max-width: 420px;
      user-select: none;
    }

    .currency-card {
      position: relative;
      background: #ffffff;
      border: 1px solid #e2e2dd;
      border-radius: 12px;
      padding: 18px 20px 14px;
      box-shadow: 0 1px 3px rgba(20, 20, 20, 0.02);
      transition: border-color 0.15s ease;
    }
    .currency-card:hover {
      border-color: #cecec8;
    }

    /* Top: Base Amount */
    .currency-card-top {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      padding-bottom: 12px;
      border-bottom: 1px solid #f2f2ee;
    }
    .currency-base-info {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .currency-base-label {
      font-size: 11.5px;
      font-weight: 500;
      color: #92928c;
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }
    .currency-base-amount {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 24px;
      font-weight: 700;
      letter-spacing: -0.03em;
      color: var(--ink);
    }
    .currency-badge {
      font-family: 'DM Mono', monospace;
      font-size: 11px;
      font-weight: 500;
      color: #059669;
      background: #ecfdf5;
      border: 1px solid #a7f3d0;
      padding: 3px 8px;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .currency-live-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #10b981;
      animation: pulseDot 2s infinite ease-in-out;
    }
    @keyframes pulseDot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.4; transform: scale(0.85); }
    }

    /* Conversions List */
    .currency-conversions-list {
      display: flex;
      flex-direction: column;
      padding: 6px 0;
    }
    .currency-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 0;
      border-bottom: 1px solid #f8f8f5;
    }
    .currency-row:last-child {
      border-bottom: 0;
    }
    .currency-target-info {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .currency-target-symbol {
      width: 32px;
      height: 32px;
      border-radius: 9px;
      background: #f6f6f2;
      color: #383834;
      font-weight: 600;
      font-size: 13.5px;
      display: grid;
      place-items: center;
      font-family: 'Space Grotesk', sans-serif;
    }
    .currency-target-names {
      display: flex;
      flex-direction: column;
    }
    .currency-target-code {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 14.5px;
      font-weight: 700;
      color: var(--ink);
    }
    .currency-rate-sub {
      font-size: 11.5px;
      color: #92928c;
    }

    .currency-converted-amount {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 19px;
      font-weight: 700;
      letter-spacing: -0.025em;
      color: var(--ink);
      text-align: right;
    }

    /* Footer: Update Time */
    .currency-card-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: 10px;
      margin-top: 2px;
      border-top: 1px solid #f2f2ee;
      font-size: 11px;
      color: #9c9c96;
    }
    .currency-footer-date {
      font-family: 'DM Mono', monospace;
    }

    /* ══════════════════════════════════════════════════════════════════════════
       INTERACTIVE FINANCIAL / STOCK CHART & EXPANDED MODAL (Bloomberg/Linear style)
       ══════════════════════════════════════════════════════════════════════════ */
    .chart-widget-container {
      margin: 16px 0 8px 0;
      width: 100%;
      max-width: 440px;
      user-select: none;
    }

    .chart-compact-card {
      position: relative;
      background: #ffffff;
      border: 1px solid #e2e2dd;
      border-radius: 12px;
      padding: 16px 18px 14px;
      box-shadow: 0 1px 3px rgba(20, 20, 20, 0.02);
      cursor: pointer;
      transition: border-color 0.15s ease;
    }
    .chart-compact-card:hover {
      border-color: #cecec8;
    }

    /* Top: Ticker, Title, Expand Icon */
    .chart-card-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .chart-title-group {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .chart-main-title {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 16.5px;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: var(--ink);
    }
    .chart-sub-title {
      font-size: 12px;
      color: #8c8c85;
    }

    .chart-expand-hint {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      font-weight: 500;
      color: #71716b;
      background: #f1f1ec;
      padding: 3px 8px;
      border-radius: 5px;
      transition: background 0.12s ease, color 0.12s ease;
    }
    .chart-compact-card:hover .chart-expand-hint {
      background: #e4e4de;
      color: var(--ink);
    }

    /* Value & Change */
    .chart-value-row {
      display: flex;
      align-items: baseline;
      gap: 10px;
      margin-bottom: 12px;
    }
    .chart-headline-value {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 26px;
      font-weight: 700;
      letter-spacing: -0.035em;
      color: var(--ink);
      line-height: 1;
    }
    .chart-change-pill {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 12.5px;
      font-weight: 600;
      padding: 2px 7px;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }
    .chart-change-pill.positive {
      color: #059669;
      background: #ecfdf5;
    }
    .chart-change-pill.negative {
      color: #dc2626;
      background: #fef2f2;
    }

    /* Compact SVG Preview Sparkline */
    .chart-preview-svg {
      width: 100%;
      height: 70px;
      overflow: visible;
    }

    /* ─── FULL EXPANDED HIGH-RES MODAL ─── */
    .chart-modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 99999;
      background: rgba(18, 18, 18, 0.45);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      animation: modalFadeIn 0.2s ease-out both;
    }
    @keyframes modalFadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    .chart-modal-dialog {
      position: relative;
      background: #ffffff;
      border: 1px solid rgba(220, 220, 214, 0.9);
      border-radius: 20px;
      width: 100%;
      max-width: 820px;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16), 0 4px 16px rgba(0, 0, 0, 0.06);
      padding: 28px 32px 24px;
      display: flex;
      flex-direction: column;
    }

    .chart-modal-close-btn {
      position: absolute;
      top: 22px;
      right: 24px;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: #f2f2ee;
      color: #555550;
      border: 0;
      display: grid;
      place-items: center;
      cursor: pointer;
      transition: background 0.12s ease, color 0.12s ease;
      z-index: 10;
    }
    .chart-modal-close-btn:hover {
      background: #e2e2dc;
      color: var(--ink);
    }

    /* Modal Top: Title, Current Value, Timeframe Pills */
    .chart-modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      padding-bottom: 16px;
      border-bottom: 1px solid #f2f2ee;
      padding-right: 40px;
    }
    .chart-modal-title-wrap h2 {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 24px;
      font-weight: 700;
      letter-spacing: -0.03em;
      color: var(--ink);
      margin: 0;
    }
    .chart-modal-title-wrap p {
      font-size: 13px;
      color: #8c8c85;
      margin: 3px 0 0 0;
    }

    .chart-modal-price-line {
      display: flex;
      align-items: baseline;
      gap: 12px;
      margin-top: 10px;
    }
    .chart-modal-price {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 34px;
      font-weight: 700;
      letter-spacing: -0.04em;
      color: var(--ink);
      line-height: 1;
    }

    /* Timeframe Selector Pills */
    .chart-timeframe-bar {
      display: flex;
      align-items: center;
      gap: 4px;
      background: #f1f1ed;
      padding: 3px;
      border-radius: 10px;
    }
    .chart-tf-btn {
      padding: 5px 10px;
      border-radius: 7px;
      font-size: 11.5px;
      font-weight: 600;
      background: transparent;
      color: #71716b;
      border: 0;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .chart-tf-btn.active {
      background: #ffffff;
      color: var(--ink);
      box-shadow: 0 1px 4px rgba(20, 20, 20, 0.08);
    }

    /* High-Res Interactive Canvas / SVG Area */
    .chart-modal-canvas-wrap {
      position: relative;
      width: 100%;
      height: 280px;
      margin: 20px 0 16px;
    }
    .chart-modal-svg {
      width: 100%;
      height: 100%;
      overflow: visible;
    }

    /* Key Metrics Grid */
    .chart-modal-metrics-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 12px;
      padding: 16px 0;
      border-top: 1px solid #f2f2ee;
      border-bottom: 1px solid #f2f2ee;
    }
    .chart-metric-card {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .chart-metric-label {
      font-size: 11.5px;
      color: #92928c;
      font-weight: 500;
    }
    .chart-metric-value {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 15px;
      font-weight: 700;
      color: var(--ink);
    }

    /* Table Breakdown if present */
    .chart-modal-table-wrap {
      margin-top: 16px;
      overflow-x: auto;
    }
    .chart-financial-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12.5px;
    }
    .chart-financial-table th {
      text-align: left;
      padding: 8px 12px;
      border-bottom: 1px solid #e8e8e2;
      color: #8c8c85;
      font-weight: 600;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }
    .chart-financial-table td {
      padding: 10px 12px;
      border-bottom: 1px solid #f2f2ee;
      color: var(--ink);
      font-weight: 500;
    }
    .chart-financial-table tr:last-child td {
      border-bottom: 0;
    }

    /* ─── Multi-Company Watchlist List Rows ─── */
    .chart-companies-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 8px;
    }
    .chart-company-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 9px 12px;
      border-radius: 10px;
      background: #fafaf7;
      border: 1px solid #f1f1eb;
      transition: background 0.15s, border-color 0.15s;
    }
    .chart-company-row:hover {
      background: #f4f4ee;
      border-color: #e5e5dc;
    }
    .chart-company-left {
      display: flex;
      flex-direction: column;
      gap: 1px;
    }
    .chart-company-name {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 13.5px;
      font-weight: 700;
      color: var(--ink);
    }
    .chart-company-ticker {
      font-size: 11px;
      color: #92928c;
      font-weight: 500;
    }
    .chart-company-right {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .chart-company-price {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 14.5px;
      font-weight: 700;
      color: var(--ink);
      text-align: right;
    }
    .chart-company-sparkline {
      width: 60px;
      height: 24px;
    }

    /* ─── Bar / Column Chart Styles ─── */
    .chart-bar-container {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 8px;
      height: 90px;
      padding-top: 10px;
    }
    .chart-bar-col {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1;
      height: 100%;
      justify-content: flex-end;
      gap: 4px;
    }
    .chart-bar-fill {
      width: 100%;
      max-width: 32px;
      border-radius: 4px 4px 0 0;
      background: var(--ink);
      transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .chart-bar-val {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 10.5px;
      font-weight: 600;
      color: #64645e;
    }
    .chart-bar-lbl {
      font-size: 11px;
      color: #8c8c85;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 50px;
      text-align: center;
    }

    /* ─── Donut Allocation Styles ─── */
    .chart-donut-wrap {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 8px 0;
    }
    .chart-donut-svg {
      width: 90px;
      height: 90px;
      flex-shrink: 0;
    }
    .chart-donut-legend {
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1;
    }
    .chart-legend-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11.5px;
    }
    .chart-legend-left {
      display: flex;
      align-items: center;
      gap: 6px;
      color: #555550;
    }
    .chart-legend-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
    }
    .chart-legend-pct {
      font-family: 'Space Grotesk', sans-serif;
      font-weight: 700;
      color: var(--ink);
    }

    /* ─── Minimalist Workspace Tool Approval Card ─── */
    .tool-approval-card {
      margin: 12px 0 10px;
      padding: 16px 18px;
      background: #ffffff;
      border: 1px solid #deded9;
      border-radius: 12px;
      max-width: min(560px, 100%);
      box-shadow: 0 2px 10px rgba(0,0,0,0.03);
      display: flex;
      flex-direction: column;
      gap: 10px;
      animation: rise .22s var(--ease) both;
    }
    .tool-approval-card.resolved {
      opacity: 0.85;
      background: #fafaf8;
    }
    .approval-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .approval-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: #71716b;
      font-family: 'DM Mono', monospace;
    }
    .approval-badge svg {
      color: #141414;
    }
    .approval-action-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--ink);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .approval-param-preview {
      background: #f7f7f5;
      border: 1px solid #e5e5e0;
      border-radius: 8px;
      padding: 8px 12px;
      font-family: 'DM Mono', monospace;
      font-size: 12px;
      color: #2b2b27;
      white-space: pre-wrap;
      word-break: break-all;
      max-height: 110px;
      overflow-y: auto;
    }
    .approval-buttons {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 2px;
    }
    .approval-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 34px;
      padding: 0 14px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: all .14s ease;
      user-select: none;
    }
    .approval-btn.approve {
      background: var(--ink);
      color: #ffffff;
      border: 1px solid var(--ink);
    }
    .approval-btn.approve:hover {
      opacity: .9;
      transform: translateY(-1px);
    }
    .approval-btn.deny {
      background: #ffffff;
      color: #71716b;
      border: 1px solid #deded9;
    }
    .approval-btn.deny:hover {
      color: #dc2626;
      border-color: #fca5a5;
      background: #fef2f2;
    }
    .approval-status-label {
      font-size: 13px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .approval-status-label.approved {
      color: #059669;
    }
    .approval-status-label.denied {
      color: #dc2626;
    }

    /* ── Scroll-to-bottom floating button ─────────────────────────── */
    .scroll-to-bottom-btn {
      position: absolute;
      bottom: 130px;
      left: 50%;
      transform: translateX(-50%) translateY(12px);
      z-index: 50;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      border: 1px solid #deded9;
      background: #fff;
      box-shadow: 0 3px 14px rgba(20,20,20,.12);
      cursor: pointer;
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease, box-shadow .15s;
      color: #444;
    }
    .scroll-to-bottom-btn.visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateX(-50%) translateY(0);
    }
    .scroll-to-bottom-btn:hover {
      background: #f5f5f2;
      box-shadow: 0 4px 18px rgba(20,20,20,.16);
    }
    .scroll-to-bottom-btn:active {
      background: #ebebeb;
    }
    .scroll-to-bottom-btn svg {
      display: block;
    }
    @media (max-width: 768px) {
      .scroll-to-bottom-btn {
        bottom: 90px;
        width: 36px;
        height: 36px;
      }
    }

