  /* ---------------- model input tab ---------------- */
  /* The input is read, not parsed, so it gets the document's own leading and a
     quieter ground than the JSON blocks; the search bar sits on top of it because
     finding one id in a 200-line screen is the thing you actually do here. */
  .tab-actions-buttons{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

  .sys-prompt{
    display:flex; flex-direction:column; gap:8px;
    margin:0 0 14px; padding:10px 12px;
    border:1px solid var(--line); border-radius:8px; background:var(--panel2);
  }
  .sys-prompt-line{ display:flex; align-items:center; gap:8px; min-width:0; flex-wrap:nowrap; font-size:12px; }
  .sys-prompt-label{ flex-shrink:0; color:var(--ink-dim); }
  .sys-prompt-modules{
    padding:2px 8px; border-radius:6px; background:rgba(106,63,224,0.09); color:#6A3FE0;
    font-family:ui-monospace, Menlo, Consolas, monospace; font-size:11.5px; font-weight:600;
  }
  .sys-prompt-size{ flex-shrink:0; margin-inline-start:auto; font-size:10.5px; color:var(--ink-faint); font-variant-numeric:tabular-nums; }
  .sys-prompt-body{ max-height:44vh; margin-top:2px; }
  .sys-prompt-line .toggle-btn{ flex-shrink:0; white-space:nowrap; }
  .toggle-btn{
    display:inline-flex; align-items:center; padding:4px 10px;
    border:1px solid var(--line); border-radius:6px; background:var(--panel);
    font-family:inherit; font-size:11px; font-weight:600; color:var(--ink-dim); cursor:pointer;
    transition:all .18s ease;
  }
  .toggle-btn:hover{ border-color:var(--blue); color:var(--blue); }
  .toggle-btn[aria-expanded="true"]{ border-color:rgba(106,63,224,0.35); color:#6A3FE0; }

  .input-doc{ display:flex; flex-direction:column; gap:10px; }
  .input-search{ display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:8px; min-width:0; }
  .input-search-field{
    width:100%; min-width:0; padding:8px 12px;
    border:1px solid var(--line); border-radius:7px; background:var(--panel);
    font-family:inherit; font-size:13px; color:var(--ink);
  }
  .input-view{ display:inline-flex; flex-shrink:0; padding:2px; border:1px solid var(--line); border-radius:7px; background:var(--panel2); }
  .input-view-btn{
    min-height:32px; padding:4px 11px; border:0; border-radius:5px; background:transparent;
    font-family:inherit; font-size:11px; font-weight:500; color:var(--ink-dim); cursor:pointer;
  }
  .input-view-btn:hover{ color:var(--ink); }
  .input-view-btn.active{ background:var(--panel); color:var(--ink); font-weight:600; box-shadow:0 0 0 1px var(--line); }
  .input-search-navigation{ display:flex; flex-shrink:0; align-items:center; gap:6px; }
  .input-search-count:empty{ display:none; }
  .input-content{ min-width:0; }
  .markdown-body,.prompt-document{
    padding:18px 20px; overflow:visible;
    border:1px solid var(--line); border-radius:8px; background:#FAFBFD;
    color:var(--ink); font-size:13px; line-height:1.55; overflow-wrap:anywhere;
  }
  .markdown-body > :first-child{ margin-top:0; }
  .markdown-body > :last-child{ margin-bottom:0; }
  .prompt-document{ display:flex; flex-direction:column; align-items:stretch; gap:8px; }
  .prompt-section{ width:100%; min-width:0; padding:11px 13px; border:1px solid var(--line-soft); border-radius:6px; background:var(--panel); }
  .prompt-section-goal{ background:rgba(37,99,235,0.035); }
  .prompt-section-title{ margin:0 0 7px; padding-bottom:5px; border-bottom:1px solid var(--line-soft); font-size:10px; line-height:1.3; font-weight:700; letter-spacing:.075em; color:var(--ink-faint); }
  .prompt-section-goal .prompt-section-title{ color:var(--blue); }
  .prompt-section-body{ min-width:0; }
  .prompt-goal-text{ font-size:14px; line-height:1.5; font-weight:500; }
  .prompt-line{ line-height:1.5; }
  .prompt-none{ color:var(--ink-faint); font-size:12px; font-style:italic; }
  .prompt-memory-group + .prompt-memory-group{ margin-top:9px; padding-top:8px; border-top:1px solid var(--line-soft); }
  .prompt-subtitle{ margin:0 0 4px; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); }
  .prompt-memory-item{ padding-inline-start:11px; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
  .prompt-memory-item::before{ content:"·"; margin-inline-start:-11px; padding-inline-end:6px; color:var(--ink-faint); }
  .prompt-record{ display:flex; gap:8px; align-items:baseline; padding:4px 0; border-bottom:1px solid var(--line-soft); }
  .prompt-record:last-child{ border-bottom:0; }
  .prompt-record-id{ flex-shrink:0; color:var(--ink-faint); font-family:ui-monospace,Menlo,Consolas,monospace; font-size:10.5px; }
  .prompt-record-content{ min-width:0; overflow-wrap:anywhere; }
  .prompt-section-history .prompt-section-body{ display:grid; gap:7px; }
  .prompt-history-step{
    display:grid; grid-template-columns:24px minmax(0,1fr); gap:4px 8px;
    padding:8px 10px; border:1px solid var(--line-soft); border-radius:6px; background:var(--panel2);
  }
  .prompt-history-number{ grid-row:1; color:var(--ink-faint); font:11px ui-monospace,Menlo,Consolas,monospace; }
  .prompt-history-action{ color:var(--ink); font-size:12px; font-weight:600; overflow-wrap:anywhere; }
  .prompt-history-detail{ grid-column:2; display:grid; grid-template-columns:96px minmax(0,1fr); gap:8px; padding:3px 0; font-size:12px; line-height:1.55; }
  .prompt-history-key{ color:var(--ink-dim); font-size:11px; font-weight:500; }
  .prompt-history-value{ min-width:0; color:var(--ink); white-space:pre-wrap; overflow-wrap:anywhere; }
  .prompt-history-sent .prompt-history-value{ font:11px/1.55 ui-monospace,Menlo,Consolas,monospace; }
  .prompt-history-answer .prompt-history-value,
  .prompt-history-said .prompt-history-value{ color:var(--blue); font-weight:500; }
  @media (max-width:600px){
    .prompt-history-detail{ grid-template-columns:minmax(0,1fr); gap:2px; }
  }
  .prompt-history-observed .prompt-history-value{ color:var(--ink); font-weight:500; }
  .prompt-field{ display:grid; grid-template-columns:minmax(68px,auto) minmax(0,1fr); gap:8px; padding:3px 0; }
  .prompt-field-label{ color:var(--ink-faint); font-size:11px; }
  .prompt-field-value{ min-width:0; overflow-wrap:anywhere; }
  .prompt-screen-label{ margin:8px 0 4px; color:var(--ink-faint); font-size:10px; font-weight:600; letter-spacing:.04em; }
  .prompt-screen-node{ padding:3px 0; border-bottom:1px solid var(--line-soft); font-family:ui-monospace,Menlo,Consolas,monospace; font-size:11px; overflow-wrap:anywhere; }
  .prompt-screen-node:last-child{ border-bottom:0; }
  .markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{
    margin:1.35em 0 .55em; color:var(--ink); line-height:1.35; font-weight:600; letter-spacing:-.015em;
  }
  .markdown-body h1{ font-size:1.5em; }
  .markdown-body h2{ padding-bottom:.35em; border-bottom:1px solid var(--line); font-size:1.3em; }
  .markdown-body h3{ font-size:1.12em; }
  .markdown-body p{ margin:.75em 0; white-space:pre-wrap; }
  .markdown-body ul,.markdown-body ol{ margin:.65em 0; padding-inline-start:1.7em; }
  .markdown-body li{ margin:.25em 0; padding-inline-start:.2em; }
  .markdown-body blockquote{ margin:.9em 0; padding:.15em 0 .15em 1em; border-inline-start:3px solid var(--line); color:var(--ink-dim); }
  .markdown-body blockquote > :first-child{ margin-top:0; }
  .markdown-body blockquote > :last-child{ margin-bottom:0; }
  .markdown-body hr{ height:1px; margin:1.2em 0; border:0; background:var(--line); }
  .markdown-body a{ color:var(--blue); text-decoration:underline; text-underline-offset:2px; }
  .markdown-body code{ padding:.15em .35em; border-radius:4px; background:#EEF0F3; font-family:ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace; font-size:.9em; }
  .markdown-body .md-code{ margin:1em 0; padding:13px 15px; overflow:auto; border:1px solid var(--line); border-radius:7px; background:#F1F3F6; font:12px/1.6 ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace; white-space:pre; }
  .markdown-body .md-code code{ padding:0; background:none; font:inherit; }
  .md-table-wrap{ max-width:100%; margin:1em 0; overflow:auto; border:1px solid var(--line); border-radius:7px; }
  .markdown-body table{ width:100%; border-collapse:collapse; font-size:12px; }
  .markdown-body th,.markdown-body td{ min-width:90px; padding:8px 10px; border-bottom:1px solid var(--line); text-align:start; vertical-align:top; }
  .markdown-body th{ background:var(--panel2); font-weight:600; }
  .markdown-body tbody tr:last-child td{ border-bottom:0; }
  .input-doc .text-block{ max-height:none; min-height:50vh; }
  .input-search-nav{ min-width:38px; min-height:38px; }
  @media (max-width:700px){
    .input-search{ grid-template-columns:minmax(0,1fr) auto; }
    .input-view{ grid-column:1; grid-row:2; }
    .input-search-navigation{ grid-column:2; grid-row:2; }
    .input-search-field{ grid-column:1 / -1; grid-row:1; font-size:16px; }
    .input-view-btn{ min-height:36px; }
    .prompt-document{ padding:14px; }
    .sys-prompt-line{ gap:6px; }
    .sys-prompt-label{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .sys-prompt-modules{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .sys-prompt-size{ display:none; }
    .sys-prompt-line .toggle-btn{ padding:4px 7px; font-size:10px; }
    .markdown-body{ padding:16px; }
  }
  .input-search-field::placeholder{ color:var(--ink-faint); }
  .input-search-field:focus{ outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,0.12); }
  .input-search-count{ flex-shrink:0; min-width:62px; font-size:11px; color:var(--ink-faint); text-align:right; }
  .input-search-nav{
    flex-shrink:0; width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center;
    border:1px solid var(--line); border-radius:7px; background:var(--panel);
    font-family:inherit; font-size:12px; color:var(--ink-dim); cursor:pointer;
    transition:all .18s ease;
  }
  .input-search-nav:hover{ border-color:var(--blue); color:var(--blue); background:rgba(37,99,235,0.06); }
  .text-block mark.hit,.markdown-body mark.hit{
    padding:1px 2px; border-radius:3px;
    background:rgba(250,204,21,0.42); color:inherit;
  }
  .text-block mark.hit.current,.markdown-body mark.hit.current{
    background:#F59E0B; box-shadow:0 0 0 2px rgba(245,158,11,0.35);
  }

