
  .buda {
    --ink: #1c1a15;
    --ink-2: #6b6558;
    --ink-3: #9b9484;
    --ink-4: #bdb5a4;
    --paper: #ffffff;
    --grouped: #faf7f1;
    --grouped-2: #f2ecdf;
    --line: #e9e2d4;
    --line-soft: #f1ebe0;
    --accent: #7a6434;
    --shadow-seg: 0 1px 2px rgba(69, 55, 25, 0.07), 0 0 0 0.5px rgba(69, 55, 25, 0.05);
    background: var(--grouped);
  }

  .buda .serif { font-family: "Source Serif 4", Georgia, serif; }

  /* ── sessions ── */
  .bd-sessions .topbar {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    padding: 2px 20px 14px;
  }

  .bd-sessions .workspace {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.008em;
  }

  .bd-sessions .workspace .mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--accent);
    color: #fbf8f1;
    font-size: 11px;
    font-weight: 500;
  }

  .bd-sessions .title {
    padding: 0 20px 16px;
  }

  .bd-sessions .title h1 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.12;
  }

  .bd-sessions .title p {
    margin-top: 6px;
    color: var(--ink-3);
    font-size: 13px;
  }

  .searchfield {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 20px;
    padding: 0 12px;
    height: 38px;
    border-radius: 10px;
    background: var(--grouped-2);
    color: var(--ink-3);
    font-size: 14px;
  }

  .bd-sessions .card { background: var(--paper); }

  .sessionRow {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 11px;
    padding: 12px 16px;
  }

  .sessionRow .sicon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--grouped-2);
    color: var(--ink-2);
  }

  .sessionRow .stitle {
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sessionRow .smeta {
    margin-top: 3px;
    overflow: hidden;
    color: var(--ink-3);
    font-size: 12px;
    letter-spacing: -0.004em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sessionRow .sstate { color: var(--ink-3); font-size: 12px; }
  .sessionRow .sstate.live { color: var(--accent); font-weight: 500; }

  .tabbar {
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 34px;
    left: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: 56px;
    padding-top: 6px;
    border-top: 1px solid color-mix(in srgb, var(--ink) 13%, transparent);
    background: color-mix(in srgb, var(--grouped) 76%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }

  .tabbar + .home {
    background: color-mix(in srgb, var(--grouped) 76%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }

  /* The composer is a card floating on the page, not a surface the indicator sits on: in the app
     the composer wrapper carries no background (`agent-chat-styles.ts` `composerWrap`) and the
     safe-area gap below it shows the page (`tokens.bg`, brandParchment). The shared rule paints
     `.composer + .home` `--paper`, which reads as a full-bleed white band under the card. */
  .buda .composer + .home {
    background: var(--grouped);
  }

  .tabbar a {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding-bottom: 6px;
    color: var(--ink-3);
    font-size: 10.5px;
    letter-spacing: -0.002em;
  }

  .tabbar a.on { color: var(--accent); }

  /* ── session detail ── */
  .bd-session .scroll { padding: 0 16px; }
  .bd-session .card { margin: 0; }

  .bubbleUser {
    margin: 4px 0 0 auto;
    width: 292px;
    padding: 12px 15px;
    border-radius: 16px 16px 4px 16px;
    background: var(--grouped-2);
    color: var(--ink);
    font-size: 14.5px;
    letter-spacing: -0.008em;
    line-height: 1.42;
  }

  .agentText {
    margin-top: 22px;
    width: 300px;
    color: var(--ink);
    font-size: 14.5px;
    letter-spacing: -0.008em;
    line-height: 1.48;
  }

  .steprow {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    column-gap: 10px;
    padding: 10px 16px;
    font-size: 13.5px;
    letter-spacing: -0.006em;
  }

  .steprow + .steprow { border-top: 1px solid var(--line-soft); }
  .steprow .st { display: flex; justify-content: center; padding-top: 2px; }
  .steprow.done { color: var(--ink-2); }
  .steprow.active { color: var(--ink); font-weight: 500; }
  .steprow.active .st { color: var(--accent); }
  .steprow.todo { color: var(--ink-3); }
  .steprow .snote { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; font-weight: 400; }

  .progress {
    display: flex;
    gap: 6px;
    margin: 0 16px 10px;
  }

  .progress i { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--grouped-2); }
  .progress i.on { background: var(--accent); }

  /* bd-session 内容较长：收紧对话留白，给分组标题留出呼吸位，避免滚动区裁切 */
  .bd-session .agentText { margin-top: 14px; }
  .bd-session .grouphead.tight { padding-top: 14px; }

  .artifact {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 11px;
    padding: 13px 16px;
  }

  .artifact .aicon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--grouped-2);
    color: var(--accent);
  }

  .artifact .atitle { font-family: "Source Serif 4", Georgia, serif; font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; }
  .artifact .ameta { margin-top: 3px; color: var(--ink-3); font-size: 12px; }

  .composer {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: 10px;
    margin: 0 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 1px 2px rgba(69, 55, 25, 0.05);
  }

  .composer .ph { color: var(--ink-3); font-size: 14px; }

  .composer .crow { display: flex; align-items: center; justify-content: space-between; }

  .modelchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-2);
    font-size: 12.5px;
    letter-spacing: -0.004em;
  }

  .modelchip .effort {
    border-radius: 4px;
    background: var(--fill-2, rgba(0, 0, 0, 0.06));
    padding: 2px 5px;
    color: var(--ink-3);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
  }


  /* ── artifact ── */
  .bd-artifact .doc { padding: 0 20px; }

  .bd-artifact h2 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 23px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.18;
  }

  .bd-artifact .docmeta { margin-top: 8px; color: var(--ink-3); font-size: 12.5px; }

  .bd-artifact .para { margin-top: 16px; color: var(--ink-2); font-size: 14.5px; letter-spacing: -0.006em; line-height: 1.52; }

  .changed {
    margin-top: 16px;
    padding: 13px 15px 15px;
    border-radius: 12px;
    background: #f7f2e5;
  }

  .changed .clabel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: #7d6534;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .changed p { color: var(--ink); font-size: 14.5px; letter-spacing: -0.006em; line-height: 1.48; }

  .metrics { margin-top: 18px; border-radius: 12px; background: var(--paper); overflow: hidden; }
  .metrics .mrow { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 15px; font-size: 13.5px; }
  .metrics .mrow + .mrow { border-top: 1px solid var(--line-soft); }
  .metrics .mk { color: var(--ink-2); }
  .metrics .mv { font-variant-numeric: tabular-nums; font-weight: 500; }

  /* ── primitives shared by the full Buda screen set ── */
  .buda .card { background: var(--paper); }
  .link { color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
  .link.muted { color: var(--ink-2); font-weight: 400; }

  .sheet {
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 8px 16px 34px;
    border-radius: 20px 20px 0 0;
    background: var(--paper);
    box-shadow: 0 -14px 44px rgba(38, 30, 14, 0.16);
  }
  .grabber { display: block; width: 36px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: var(--grouped-2); }
  .backdrop { position: absolute; z-index: 3; inset: 0; background: rgba(28, 26, 21, 0.32); }

  .switch { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--grouped-2); }
  .switch.on { background: var(--accent); }
  .switch i { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(38, 30, 14, 0.2); }
  .switch.on i { left: 20px; }

  .thumb { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--grouped-2); color: var(--ink-2); }
  .brow { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 11px; align-items: center; padding: 11px 16px; }
  .brow + .brow::before { position: absolute; top: 0; right: 16px; left: 16px; height: 1px; background: var(--line-soft); content: ''; }
  .brow .bt { font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em; }
  .brow .bm { margin-top: 3px; color: var(--ink-3); font-size: 12px; letter-spacing: -0.004em; }

  .avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--grouped-2);
    color: var(--ink-2);
    font-size: 19px;
    font-weight: 500;
  }

  .bd-new h2 {
    padding: 4px 20px 0;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }

  .bd-new .composer { margin-top: 16px; }
  .bd-new .composer p { min-height: 84px; color: var(--ink-3); font-size: 14.5px; line-height: 1.5; }

  .sugg { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 11px; align-items: center; padding: 13px 16px; }
  .sugg + .sugg::before { position: absolute; top: 0; right: 16px; left: 16px; height: 1px; background: var(--line-soft); content: ''; }
  .sugg .st { color: var(--accent); }
  .sugg .sbody { font-size: 14.5px; letter-spacing: -0.008em; line-height: 1.35; }
  .sugg .snote { margin-top: 3px; color: var(--ink-3); font-size: 12px; }

  .bd-you .profile { display: flex; align-items: center; gap: 14px; padding: 6px 20px 22px; }
  .bd-you .profile h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
  .bd-you .profile p { margin-top: 4px; color: var(--ink-3); font-size: 13px; }
  .bd-you .badge { display: inline-flex; align-items: center; height: 24px; margin-top: 8px; padding: 0 9px; border-radius: 7px; background: var(--grouped-2); color: var(--ink-2); font-size: 11.5px; letter-spacing: -0.004em; }

  .sheet .actions .btn { flex: none; }
  .crumb { padding: 0 20px 14px; color: var(--ink-3); font-size: 13px; letter-spacing: -0.004em; }
  .footnote { padding: 4px 20px 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
  .bd-auth .field { background: var(--paper); }

  /* ── design language: editorial workspace ── */
  .buda {
    --radius-card: 16px;
    --radius-row: 14px;
    --btn-r: 14px;
    --btn-h: 48px;
    --btn-h-sm: 36px;
    --btn-pad: 20px;
    --btn-pad-bar: 14px;
    --btn-icon: 36px;
    --btn-min: 96px;
  }

  .buda .btn { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", system-ui, sans-serif; }
  .buda .avatar { border-radius: 50%; }
  .buda .thumb { border-radius: 10px; }
  .buda .card { background: var(--paper); }
  .buda .panel { border-radius: 16px; }
  .buda .send { color: #fbf8f1; }

  .buda .grouphead {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 13px;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-transform: none;
  }

  .buda .grouphead span { color: var(--ink-4); }
  .buda .signout { margin-top: 18px; }

  .bd-auth .authhero h1 { font-family: "Source Serif 4", Georgia, serif; font-weight: 500; letter-spacing: -0.018em; }
  .bd-auth .authhero .wordmark { font-family: "Source Serif 4", Georgia, serif; font-size: 15px; font-style: italic; letter-spacing: 0.08em; text-transform: none; }

  .bd-session .scroll { padding: 0 16px; }

  .footnote { padding: 4px 20px 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }

  /* ── the screen the drawer is pulled over ────────────────── */
  /* the real host slides the content layer right by `drawerWidth` and keeps only its left
     `62px` beside the panel (`NativeDrawerHost` -> `contentLayer` translateX, four corners at
     `DRAWER_SHELL_RADIUS = 24`, hairline on the exposed edge), so the mask always sits on top of
     a real screen instead of a flat fill. The surface runs the full height of the screen - no
     vertical inset, so the edge is one continuous line and the shadow only ever shows on the
     left - while the layer's own padding keeps the conversation's header below the status bar. */
  .bd-under {
    position: absolute; z-index: 1; top: 0; bottom: 0; left: 328px; width: 390px;
    display: flex; flex-direction: column; overflow: hidden;
    padding-top: 54px;
    border-left: 1px solid rgba(27, 23, 18, 0.05);
    border-radius: 24px;
    background: var(--paper);
    /* the content layer carries the drawer's edge shadow and, in the app, sits above the
       drawer rather than under it (`DRAWER_BOX_SHADOW_OFFSET_X = -18`,
       `DRAWER_BOX_SHADOW_BLUR_RADIUS = 34`, `drawerShadowTranslucent`). */
    box-shadow: -6px 0 12px rgba(44, 35, 24, 0.06);
  }
  .bd-under .scroll { padding: 0 16px; }

  /* ── drawer session directory (real mobile drawer) ────────── */
  /* the drawer is a full-screen overlay laid over `.bd-under`, the conversation the drawer was
     pulled over: the veil covers the status bar and the home indicator too, and only the two
     system rows are lifted back above it. */
  .bd-drawer { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; }
  .bd-drawer .panel {
    position: relative; z-index: 0;
    display: flex; flex: none; flex-direction: column;
    width: 328px; min-width: 0; padding: 58px 0 46px; background: var(--grouped);
  }
  /* The app puts no dark scrim over the page it slid aside: `edgeDismiss` is `tokens.bg`
     (brandParchment) at `opacity: 0.08`, from the status bar down. At 8% over the parchment
     band above the content, covering the whole strip changes nothing there. */
  .bd-drawer .veil { position: relative; z-index: 2; flex: 1; background: var(--grouped); opacity: 0.08; }
  .bd-sessions .statusbar,
  .bd-sessions .home { position: relative; z-index: 3; }
  .bd-drawer .ctx { display: flex; align-items: center; gap: 10px; padding: 8px 18px 16px; }
  .bd-drawer .ctxCopy { flex: 1; min-width: 0; }
  .bd-drawer .ctx .mark {
    display: inline-flex; flex: none; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 9px;
    background: var(--accent); color: #fbf8f1; font-size: 13px; font-weight: 500;
  }
  .bd-drawer .ctxName { font-size: 14.5px; font-weight: 500; letter-spacing: -0.012em; }
  .bd-drawer .ctxSpace { margin-top: 2px; color: var(--ink-3); font-size: 12px; }
  .bd-drawer .dnav {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 18px; color: var(--ink-2); font-size: 14.5px; letter-spacing: -0.008em;
  }
  .bd-drawer .dnav svg { flex: none; color: var(--ink-3); }
  .bd-drawer .dhead {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 18px 8px; color: var(--ink-3); font-size: 12.5px; letter-spacing: 0.01em;
  }
  .bd-drawer .dhead .dmore { display: inline-flex; color: var(--ink-4); }
  .bd-drawer .drow { display: flex; align-items: center; gap: 10px; padding: 9px 18px; }
  .bd-drawer .drow .dico { display: inline-flex; flex: none; color: var(--ink-3); }
  .bd-drawer .drow .dtitle {
    flex: 1; min-width: 0; overflow: hidden;
    font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .bd-drawer .drow .dtime { flex: none; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
  .bd-drawer .drow > svg { flex: none; color: var(--ink-4); }
  .bd-drawer .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  /* the panel ends on the account row the source pins under the session directory
     (`NativeDrawerPanel` -> profile row after `NativeDrawerSessionDirectory`), so the drawer
     never trails off into an empty half. */
  .bd-drawer .dprofile {
    display: flex; flex: none; align-items: center; gap: 9px;
    min-height: 56px; margin: auto 10px 0; padding: 8px 11px;
    border-radius: 14px; border: 1px solid var(--line-soft); background: var(--paper);
  }
  .bd-drawer .dprofile .pavatar {
    display: block; flex: none; width: 36px; height: 36px;
    border-radius: 11px; overflow: hidden; background: var(--accent);
  }
  .bd-drawer .dprofile .pavatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .bd-drawer .dprofile .pcopy { flex: 1; min-width: 0; }
  .bd-drawer .dprofile .pname {
    overflow: hidden; font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
    line-height: 18px; text-overflow: ellipsis; white-space: nowrap;
  }
  .bd-drawer .dprofile .psub {
    margin-top: 2px; overflow: hidden; color: var(--ink-3); font-size: 11px;
    line-height: 15px; text-overflow: ellipsis; white-space: nowrap;
  }
  .bd-drawer .dprofile > svg { flex: none; color: var(--ink-3); }

  /* ── assistant process block (buda web wording) ───────────── */
  .processTrigger {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 16px 0 2px; padding: 4px 6px; border-radius: 8px;
    color: var(--ink-2); font-size: 14px;
  }
  .processTrigger .picon {
    display: inline-flex; flex: none; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--grouped-2); color: var(--accent);
  }
  .processTrigger .pchev { display: inline-flex; color: var(--ink-4); }
  .processBody { margin: 2px 0 4px; padding: 2px 0 2px 13px; border-left: 1px solid var(--line); }
  .processRun { padding: 3px 0; color: var(--ink-2); font-size: 14px; }

  /* ── file card in the chat ───────────────────────────────── */
  .fileCard {
    display: flex; flex: none; align-items: center; gap: 11px;
    margin: 0 12px 10px; padding: 11px 13px; border-radius: 14px;
    background: var(--paper); box-shadow: 0 1px 2px rgba(69, 55, 25, 0.05);
  }
  .fileCard .ficon {
    display: flex; flex: none; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--grouped-2); color: var(--accent);
  }
  .fileCard .fcopy { flex: 1; min-width: 0; }
  .fileCard .fname { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
  .fileCard .fpath { margin-top: 2px; color: var(--ink-3); font-size: 12px; }
  .fileCard .feye { display: inline-flex; flex: none; color: var(--ink-3); }

  /* ── file preview panel ──────────────────────────────────── */
  .previewBody { padding: 2px 20px 0; font-size: 14px; line-height: 22px; }
  .previewBody h1 { font-size: 20px; line-height: 27px; font-weight: 500; letter-spacing: -0.015em; }
  .previewBody h2 { margin: 20px 0 6px; font-size: 17px; line-height: 24px; font-weight: 500; letter-spacing: -0.012em; }
  .previewBody .para { margin-top: 8px; }
  .previewRow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; }
  .previewRow .pk { color: var(--ink); }
  .previewRow .pv { flex: none; color: var(--ink-3); font-size: 13px; }
  .processBody .runRow { display: flex; align-items: center; gap: 6px; padding: 3px 0; color: var(--ink-2); font-size: 14px; }
  .processBody .runRow .rchev { display: inline-flex; color: var(--ink-4); }
  .spin {
    display: inline-block; width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid var(--grouped-2); border-top-color: var(--accent);
  }
  .thought { margin: 8px 0; color: var(--ink-3); font-size: 13.5px; line-height: 1.5; }
