
  :root {
    --bg: #000000;
    --text: #f5f5f7;
    --text-dim: #8e8e93;
    --text-soft: #aeaeb2;
    --danger: #ff453a;
    --glass: rgba(22,22,24,0.62);
    --glass-strong: rgba(28,28,30,0.78);
    --hairline: rgba(255,255,255,0.08);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }

  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body {
    margin: 0; padding: 0; height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow: hidden;
    overscroll-behavior: none;
  }

  .desktop-lock {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: #000; color: var(--text-dim);
    align-items: center; justify-content: center;
    text-align: center; padding: 32px; font-size: 15px; line-height: 1.5;
  }
  @media (min-width: 700px) {
    .desktop-lock { display: flex; }
    #app { display: none !important; }
  }

  #app {
    height: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
    position: relative;
    background: var(--bg);
  }
  #app::before {
    content: "";
    position: absolute; inset: 0;
    pointer-events: none; z-index: 50;
    background:
      linear-gradient(to right, rgba(0,0,0,.5), transparent 24px, transparent calc(100% - 24px), rgba(0,0,0,.5)),
      linear-gradient(to bottom, rgba(0,0,0,.42), transparent 34px, transparent calc(100% - 42px), rgba(0,0,0,.48));
  }

  /* Top — burger higher, ghosted */
  .top {
    padding: calc(6px + var(--safe-t)) 12px 8px;
    display: flex; align-items: center;
    z-index: 20;
  }
  .menu-btn {
    width: 38px; height: 38px;
    border: none; outline: none; border-radius: 999px;
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.28);
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
  }
  .menu-btn:active {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.65);
  }
  .menu-btn svg {
    width: 17px; height: 17px;
    stroke: currentColor; fill: none;
    stroke-width: 1.6; stroke-linecap: round;
  }

  .feed {
    overflow-y: auto;
    padding: 8px 20px 28px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  .feed::-webkit-scrollbar { width: 0; }

  .msg {
    max-width: 100%;
    margin: 0 0 28px;
    opacity: 0;
    transform: translateY(8px);
    animation: msgIn .42s cubic-bezier(.2,.8,.2,1) forwards;
  }
  .msg.user { display: flex; justify-content: flex-end; }
  .msg.user .bubble {
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 12px 16px;
    border-radius: 18px 18px 6px 18px;
    max-width: 84%;
    font-size: 16px;
    line-height: 1.42;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
  }
  .msg.bot .body {
    font-size: 17px;
    line-height: 1.5;
    color: #f2f2f4;
    letter-spacing: -0.016em;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .msg.bot .actions {
    display: flex; gap: 16px; margin-top: 14px;
    opacity: 0; animation: fadeIn .4s ease .2s forwards;
  }
  .msg.bot .actions button {
    width: 28px; height: 28px;
    border: none; outline: none; background: transparent;
    color: var(--text-dim);
    display: grid; place-items: center; cursor: pointer;
  }
  .msg.bot .actions button:active { color: var(--text); }
  .msg.bot .actions svg {
    width: 17px; height: 17px; stroke: currentColor; fill: none;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  }
  .msg.error .body { color: #ffb3b3; }
  .msg .retry {
    margin-top: 12px;
    border: none; outline: none;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
  }
  .stream-char { opacity: 0; animation: charIn .28s ease forwards; }

  /* Agent status / thinking */
  .agent-status {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 6px 2px 22px;
    opacity: 0;
  }
  .agent-status.on {
    display: flex;
    animation: fadeIn .35s ease forwards;
  }
  .ghost-mark {
    width: 28px; height: 28px; flex-shrink: 0;
    opacity: 0.72;
    animation: ghostFloat 1.9s ease-in-out infinite;
  }
  .ghost-mark svg { width: 28px; height: 28px; display: block; }
  .agent-label {
    min-width: 0;
    font-size: 14px;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, #666 0%, #f0f0f0 42%, #666 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 1.9s linear infinite;
    transition: opacity .25s ease;
  }
  .agent-label.swap { opacity: 0; }

  .empty {
    height: 100%; display: grid; place-items: center;
    text-align: center; padding: 48px 28px; color: var(--text-dim);
  }
  .empty .logo {
    width: 56px; height: 56px; margin: 0 auto 18px;
    opacity: 0.9;
    animation: ghostFloat 3s ease-in-out infinite;
  }
  .empty .logo svg { width: 56px; height: 56px; display: block; }
  .empty h1 {
    margin: 0 0 8px; font-size: 22px; font-weight: 600;
    color: var(--text); letter-spacing: -0.03em;
  }
  .empty p { margin: 0; font-size: 14px; line-height: 1.45; }

  /* Composer lower */
  .composer-wrap {
    padding: 4px 14px calc(2px + var(--safe-b));
    background: transparent;
  }
  .composer {
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
    border-radius: 18px;
    padding: 8px 10px 7px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  }
  .composer textarea {
    width: 100%; border: none; outline: none; resize: none;
    background: transparent; color: var(--text);
    font: inherit; font-size: 16px; line-height: 1.35;
    max-height: 110px; padding: 5px 8px 8px; min-height: 22px;
  }
  .composer textarea::placeholder { color: var(--text-dim); }
  .composer-bar {
    display: flex; align-items: center; gap: 6px; min-height: 34px;
  }
  .tool {
    height: 32px; min-width: 32px;
    border: none; outline: none; border-radius: 999px;
    background: transparent; color: var(--text-soft);
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px; font-size: 13px; font-weight: 500; cursor: pointer;
  }
  .tool:active { background: rgba(255,255,255,0.06); }
  .tool svg {
    width: 17px; height: 17px; stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  .tool.ghost-btn svg { stroke: none; }
  .tool.search {
    background: rgba(255,255,255,0.07);
    color: var(--text);
    padding: 0 11px 0 9px;
  }
  .tool.search.active { background: rgba(255,255,255,0.12); }
  .tool.listening { background: rgba(255,255,255,0.12); color: #fff; }
  .spacer { flex: 1; }
  .send, .stop {
    width: 32px; height: 32px;
    border: none; outline: none; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
  }
  .send {
    background: #f2f2f4;
    box-shadow: 0 6px 16px rgba(0,0,0,0.42);
  }
  .send:active { transform: scale(0.94); }
  .send svg {
    width: 15px; height: 15px; stroke: #111; fill: none;
    stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  }
  .stop { background: #f2f2f4; }
  .stop span { width: 10px; height: 10px; border-radius: 2px; background: #111; }

  /* Glass side panel */
  .scrim {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.32);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
    z-index: 30;
  }
  .scrim.on { opacity: 1; pointer-events: auto; }

  .side {
    position: absolute;
    top: calc(8px + var(--safe-t));
    left: 10px;
    bottom: calc(8px + var(--safe-b));
    width: min(78vw, 300px);
    background: rgba(16,16,18,0.42);
    -webkit-backdrop-filter: blur(34px) saturate(170%);
    backdrop-filter: blur(34px) saturate(170%);
    border-radius: 24px;
    transform: translateX(calc(-100% - 24px));
    transition: transform .34s cubic-bezier(.2,.8,.2,1);
    z-index: 40;
    padding: 14px 10px 10px;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  }
  .side.on { transform: translateX(0); }

  .side-head {
    display: flex; align-items: center;
    padding: 2px 8px 12px;
  }
  .side-head .brand {
    font-size: 18px; font-weight: 650; letter-spacing: -0.03em;
  }
  .side-head .grow { flex: 1; }
  .side-new {
    width: 32px; height: 32px;
    border: none; outline: none; border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-soft);
    display: grid; place-items: center; cursor: pointer;
  }
  .side-new:active { background: rgba(255,255,255,0.1); }
  .side-new svg {
    width: 16px; height: 16px; stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round;
  }
  .side-section {
    margin: 0 10px 8px;
    font-size: 11px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-dim);
  }

  .history {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 0 2px;
    -webkit-overflow-scrolling: touch;
  }
  .history::-webkit-scrollbar { width: 0; }

  .swipe-row {
    position: relative;
    margin-bottom: 6px;
    border-radius: 16px;
    overflow: hidden;
    background: transparent;
  }

  /* Delete underlay on the RIGHT; swipe LEFT reveals it */
  .swipe-actions {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    z-index: 0;
    opacity: 0;
    transition: opacity .15s ease;
  }
  .swipe-row.revealing .swipe-actions,
  .swipe-row.is-open .swipe-actions {
    opacity: 1;
  }
  .swipe-actions button {
    width: 76px;
    border: none;
    outline: none;
    color: #fff;
    display: grid;
    place-items: center;
    gap: 4px;
    cursor: pointer;
    background: #ff3b30;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  .swipe-actions button svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .swipe-actions button span {
    font-size: 11px;
    line-height: 1;
  }

  .chat-item {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 36px;
    align-items: center;
    gap: 4px;
    padding: 12px 8px 12px 14px;
    border-radius: 16px;
    /* solid enough so Delete never bleeds through closed rows */
    background: #1c1c1e;
    transition: transform .22s cubic-bezier(.2,.8,.2,1), background .18s ease;
    will-change: transform;
    touch-action: pan-y;
  }
  .chat-item.active {
    background: #2c2c2e;
  }
  .chat-item.open {
    background: #242426;
  }
  .chat-item .meta {
    min-width: 0;
    cursor: pointer;
    padding: 2px 0;
  }
  .chat-item .title {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .chat-item .sub {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-dim);
  }
  .chat-item .pencil {
    width: 36px;
    height: 36px;
    border: none;
    outline: none;
    border-radius: 11px;
    background: transparent;
    color: rgba(255,255,255,0.38);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, opacity .15s ease;
  }
  .chat-item .pencil:active {
    background: rgba(255,255,255,0.08);
    color: #fff;
  }
  .chat-item.open .pencil {
    opacity: 0.25;
    pointer-events: none;
  }
  .chat-item .pencil svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .side-foot {
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--hairline);
  }
  .side-row {
    border: none; outline: none; width: 100%;
    background: transparent; color: var(--text);
    text-align: left; padding: 12px 10px;
    border-radius: 14px; font-size: 16px;
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
  }
  .side-row:active { background: rgba(255,255,255,0.06); }
  .side-row svg {
    width: 20px; height: 20px; stroke: currentColor; fill: none;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  }

  /* Settings */
  .panel {
    position: absolute; inset: 0;
    background: #000;
    z-index: 45;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.2,.8,.2,1);
    display: flex; flex-direction: column;
    padding: calc(12px + var(--safe-t)) 18px calc(18px + var(--safe-b));
  }
  .panel.on { transform: translateX(0); }
  .panel-head {
    display: flex; align-items: center;
    min-height: 40px; margin-bottom: 6px;
  }
  .back-btn {
    width: 40px; height: 40px;
    border: none; outline: none; border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    display: grid; place-items: center; cursor: pointer;
  }
  .back-btn svg {
    width: 18px; height: 18px; stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round;
  }
  .panel h1 {
    margin: 8px 0 20px 2px;
    font-size: 28px; font-weight: 700; letter-spacing: -0.03em;
  }
  .panel-scroll {
    flex: 1; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
  }
  .panel-scroll::-webkit-scrollbar { width: 0; }
  .group { margin-bottom: 28px; }
  .group h2 {
    margin: 0 0 8px 14px;
    font-size: 12px; font-weight: 500;
    color: var(--text-dim); text-transform: uppercase;
  }
  .card {
    background: rgba(28,28,30,0.96);
    border-radius: 14px;
    overflow: hidden;
  }
  .cell {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; min-height: 50px;
    border: none; outline: none; width: 100%;
    background: transparent; color: var(--text);
    text-align: left; font-size: 16px; cursor: pointer;
  }
  .cell + .cell { box-shadow: inset 0 0.5px 0 rgba(84,84,88,0.45); }
  .cell:active { background: rgba(255,255,255,0.04); }
  .cell .label { flex: 1; }
  .cell .hint { color: var(--text-dim); font-size: 15px; }
  .cell svg.chev {
    width: 14px; height: 14px; stroke: #636366; fill: none;
    stroke-width: 2; stroke-linecap: round;
  }
  .toggle {
    width: 51px; height: 31px; border-radius: 999px;
    background: #39393d; position: relative; flex-shrink: 0;
    transition: background .2s ease;
  }
  .toggle::after {
    content: "";
    position: absolute; top: 2px; left: 2px;
    width: 27px; height: 27px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.28);
    transition: transform .22s cubic-bezier(.2,.8,.2,1);
  }
  .toggle.on { background: #34c759; }
  .toggle.on::after { transform: translateX(20px); }

  .toast {
    position: absolute; left: 50%;
    bottom: calc(100px + var(--safe-b));
    transform: translateX(-50%) translateY(8px);
    background: rgba(28,28,30,0.96); color: var(--text);
    padding: 11px 16px; border-radius: 14px;
    font-size: 14px; opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.5);
    max-width: 86%; text-align: center;
  }
  .toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

  @keyframes msgIn { to { opacity: 1; transform: none; } }
  @keyframes fadeIn { to { opacity: 1; } }
  @keyframes charIn { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
  @keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
  @keyframes ghostFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
  }


.hidden { display: none !important; }
.agent-status { will-change: opacity; }
.agent-label.swap { opacity: 0; }
.msg.bot .body { overflow-wrap: anywhere; }
.msg.bot .body a { color: #d0d0d0; }
.msg.bot .body h1,.msg.bot .body h2,.msg.bot .body h3 { margin: 12px 0 6px; line-height: 1.25; }
.msg.bot .body pre,.msg.bot .body code { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot .body pre { background: #171719; border-radius: 12px; padding: 12px; font-size: 13px; }
.msg.bot .body p { margin: 0 0 10px; }
.msg.bot .body p:last-child { margin-bottom: 0; }
.modal-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 18px; overflow: auto; background: rgba(0,0,0,.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.modal-card { position: relative; width: min(100%, 420px); max-height: 92dvh; overflow-y: auto; padding: 28px 22px 22px; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; background: #121214; color: #f5f5f7; box-shadow: 0 24px 80px rgba(0,0,0,.55); animation: modalIn .22s ease both; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.07); color: #aaa; font-size: 22px; }
.modal-brand-mark { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 14px; background: rgba(255,255,255,.08); font-size: 23px; }
.modal-eyebrow { margin: 0 0 8px; color: #8e8e93; text-align: center; font-size: 10px; letter-spacing: .12em; }
.modal-card h2 { margin: 0; text-align: center; font-size: 24px; }
.modal-subtitle { margin: 8px 0 20px; color: #8e8e93; text-align: center; font-size: 12px; line-height: 1.5; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: 12px; background: #080809; }
.auth-tab { border: 0; border-radius: 9px; padding: 10px; color: #8e8e93; background: transparent; }
.auth-tab.active { color: #fff; background: #29292c; }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form label,.field-label { color: #aaa; font-size: 11px; }
.auth-input { width: 100%; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; outline: none; background: #080809; color: #fff; font: inherit; font-size: 13px; }
.auth-input:focus { border-color: rgba(255,255,255,.4); }
.auth-submit { width: 100%; margin-top: 8px; padding: 12px; border: 0; border-radius: 11px; background: #f2f2f4; color: #111; font-weight: 650; }
.auth-submit:disabled { opacity: .6; }
.auth-separator { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: #8e8e93; font-size: 11px; }
.auth-separator::before,.auth-separator::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.1); }
.auth-google { display: flex; justify-content: center; align-items: center; gap: 9px; width: 100%; padding: 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: #202023; color: #fff; }
.google-g { font-weight: 800; }
.auth-forgot { display: block; margin: 12px auto 0; border: 0; background: transparent; color: #aaa; font-size: 11px; }
.auth-error { min-height: 16px; margin: 10px 0 0; color: #ff9d9d; text-align: center; font-size: 11px; line-height: 1.4; }
.profile-summary { display: flex; align-items: center; gap: 12px; margin: 18px 0; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: #080809; }
.profile-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #29292c; font-size: 17px; font-weight: 700; }
.profile-summary b,.profile-summary small { display: block; }
.profile-summary b { font-size: 13px; }
.profile-summary small { margin-top: 3px; color: #8e8e93; font-size: 11px; overflow-wrap: anywhere; }
.modal-main-action { margin-top: 14px; }
.danger-action { width: 100%; margin-top: 9px; padding: 11px; border: 1px solid rgba(255,69,58,.25); border-radius: 11px; background: rgba(255,69,58,.08); color: #ff8b84; }
.side-user { margin-top: 8px; padding: 12px 10px 0; border-top: 1px solid var(--hairline); color: var(--text-dim); font-size: 12px; overflow-wrap: anywhere; }
.side-row { font-family: inherit; }
.side-row:disabled { opacity: .5; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

.chat-item { border: 0; color: var(--text); text-align: left; font-family: inherit; width: 100%; cursor: pointer; }

body.no-animations *, body.no-animations *::before, body.no-animations *::after { animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }


/* --- Premium polish + sources + chat swipe --- */
.tool.search { display: none !important; }

.sources-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sources-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.sources-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.source-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(28,28,30,0.92);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: background .15s ease, transform .15s ease;
}
.source-card:active { background: rgba(44,44,46,0.95); transform: scale(0.99); }
.source-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #f2f2f4;
  line-height: 1.3;
}
.source-domain {
  font-size: 11.5px;
  color: #7ddea8;
}

pre.code-block {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #0d0d0f;
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
pre.code-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  color: #e8e8ea;
  white-space: pre;
}

.swipe-row {
  position: relative;
  margin-bottom: 6px;
  border-radius: 16px;
  overflow: hidden;
}
.swipe-actions {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity .15s ease;
}
.swipe-row.revealing .swipe-actions,
.swipe-row.is-open .swipe-actions { opacity: 1; }
.swipe-actions .del {
  width: 76px;
  border: none;
  background: #ff3b30;
  color: #fff;
  display: grid;
  place-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}
.swipe-actions .del svg {
  width: 18px; height: 18px;
  stroke: #fff; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.chat-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 12px 8px 12px 14px;
  border: none;
  border-radius: 16px;
  background: #1c1c1e;
  color: inherit;
  text-align: left;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), background .15s ease;
  touch-action: pan-y;
}
.chat-item.active { background: #2c2c2e; }
.chat-item.open { background: #242426; }
.chat-item .meta { min-width: 0; }
.chat-item .title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item .sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-dim);
}
.chat-item .pencil {
  width: 36px; height: 36px;
  border: none; border-radius: 11px;
  background: transparent;
  color: rgba(255,255,255,0.38);
  display: grid; place-items: center;
  cursor: pointer;
}
.chat-item .pencil:active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.chat-item .pencil svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.side {
  background: rgba(16,16,18,0.45) !important;
  -webkit-backdrop-filter: blur(34px) saturate(170%) !important;
  backdrop-filter: blur(34px) saturate(170%) !important;
}

.msg {
  animation: msgIn .42s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.msg.bot .body {
  animation: bodyFade .35s ease both;
}
@keyframes bodyFade {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
