/* File search: the Files panel, the store manager, the search playground, and file citations.
 * The citation pill and the source chip themselves are styled in thread.css; only what makes a file one
 * differs here. */
.pill[hidden] { display:none; }
.set-row > input.set-in:not([type=number]), .set-row > select.set-in { width:min(58%, 300px); flex:0 0 auto; }
select.set-in { height:30px; }

/* a cited file has no URL, so it is a button rather than a link; thread.css draws both the same */
button.cite { border:0; cursor:pointer; }
/* a file, not a web page: a hairline ring, drawn inside so the focus ring still has the outline to itself */
.cite.file { box-shadow:inset 0 0 0 1px var(--md-outline); }
.sources button.src { font:inherit; cursor:pointer; text-align:start; }

/* ---------- dialogs ---------- */
/* the store manager and the playground are M3 dialogs: the scrim, surface-container-high, 28px, level 3 */
.modal-back {
  position:fixed; inset:0; z-index:80; display:grid; place-items:center; padding:16px;
  background:color-mix(in srgb, var(--md-scrim-tone) 40%, transparent);
}
.modal {
  width:min(640px, 100%); max-height:min(88vh, 900px); display:flex; flex-direction:column; overflow:hidden;
  background:var(--md-surface-container-high); color:var(--text); border-radius:var(--md-shape-xl);
  box-shadow:var(--md-elev-3);
}
.modal.wide { width:min(1080px, 100%); height:min(88vh, 900px); }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:14px 18px 12px; border-bottom:1px solid var(--border); }
.modal-head h3 { margin:0; font-size:16px; font-weight:600; }
.modal-head p { margin:2px 0 0; font-size:12.5px; color:var(--text-3); }
.modal-x {
  flex:0 0 auto; width:30px; height:30px; border:0; border-radius:8px; cursor:pointer;
  background:transparent; color:var(--text-2); font-size:20px; line-height:1;
}
.modal-x:hover { background:var(--hover); color:var(--text); }
.modal-body { flex:1; min-height:0; overflow:auto; padding:6px 8px 12px; }
.modal-body.two { display:grid; grid-template-columns:minmax(260px, 350px) minmax(0, 1fr); padding:0; overflow:hidden; }
.modal-col { min-height:0; overflow:auto; padding:6px 8px 16px; }
.list-col { border-inline-end:1px solid var(--border); background:var(--side); }
.modal-error { margin:8px 10px; padding:8px 12px; border-radius:10px; background:var(--md-error-container); color:var(--md-on-error-container); font-size:13px; }
.set-actions { flex-wrap:wrap; }
.set-actions button.primary { background:var(--btn); color:var(--btn-fg); border-color:var(--btn); }
.set-actions button.primary:hover { background:var(--btn); color:var(--btn-fg); opacity:.88; }
.set-actions button.danger, .file-acts button.danger { color:var(--md-error); }
.set-actions button:disabled { opacity:.5; cursor:not-allowed; }

/* ---------- store manager ---------- */
.store-item {
  display:block; width:100%; margin-bottom:2px; padding:9px 10px; border:0; border-radius:10px; cursor:pointer;
  background:transparent; color:var(--text); font:inherit; text-align:start;
}
.store-item:hover { background:var(--hover); }
.store-item.on { background:var(--active); }
.store-name { font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.store-meta { font-size:11.5px; color:var(--text-3); }
.store-title { margin:6px 0 8px; font-size:17px; font-weight:600; overflow-wrap:anywhere; }
.file-row { padding:10px 0; border-top:1px solid var(--border); }
.file-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.file-name { font-size:13.5px; font-weight:500; overflow-wrap:anywhere; }
.file-meta { font-size:11.5px; color:var(--text-3); overflow-wrap:anywhere; }
.file-acts { display:flex; flex:0 0 auto; gap:2px; }
.file-acts button {
  padding:4px 8px; border:0; border-radius:7px; cursor:pointer;
  background:transparent; color:var(--text-2); font-size:12.5px;
}
.file-acts button:hover { background:var(--hover); color:var(--text); }
.chips { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.chip {
  padding:1px 7px; border-radius:6px; background:var(--chip); color:var(--text-2);
  font:11.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.file-content, .file-log {
  margin:8px 0 0; padding:10px; border-radius:10px; background:var(--side); max-height:320px; overflow:auto;
  font:12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space:pre-wrap; overflow-wrap:anywhere;
}
.file-content.tall { max-height:none; margin:4px 10px; }
.attr-edit { margin-top:8px; padding:8px 10px; border:1px solid var(--border); border-radius:10px; }
.file-picker { max-width:230px; font-size:12.5px; }

/* ---------- filter and attribute rows ---------- */
.flt { display:flex; flex-direction:column; gap:6px; }
.flt-bar { display:flex; flex-wrap:wrap; gap:6px; }
.flt-row { display:grid; grid-template-columns:minmax(0,1fr) 76px minmax(0,1fr) 28px; gap:6px; align-items:center; margin-bottom:6px; }
.flt-row.kv-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px; }
.flt-json { min-height:120px; padding:6px 9px; font:12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.flt-del {
  height:30px; border:0; border-radius:8px; cursor:pointer;
  background:transparent; color:var(--text-2); font-size:16px;
}
.flt-del:hover { background:var(--hover); color:var(--md-error); }
.flt-add {
  align-self:flex-start; padding:4px 10px; border:1px dashed var(--border); border-radius:8px; cursor:pointer;
  background:transparent; color:var(--text-2); font-size:12.5px;
}
.flt-add:hover { color:var(--text); border-color:var(--text-3); }

/* ---------- playground ---------- */
.play-query { height:auto; min-height:84px; margin-top:2px; padding:8px 9px; resize:vertical; }
.play-sent { margin:10px 0; font-size:12.5px; color:var(--text-2); }
.play-sent summary { cursor:pointer; }
.play-sent pre { margin:6px 0 0; font:12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space:pre-wrap; }
.play-answer { margin:10px 0 14px; padding:12px 14px; border:1px solid var(--border); border-radius:12px; }
.play-answer h5 { margin:0 0 6px; font-size:12px; font-weight:600; color:var(--text-3); }
.play-answer .answer { font-size:15px; line-height:1.6; }
.hit { padding:10px 0; border-top:1px solid var(--border); }
.hit-top { display:flex; align-items:center; gap:10px; }
.hit-top .file-name { flex:1; min-width:0; }
.hit-bar { flex:0 0 auto; width:90px; height:6px; border-radius:3px; background:var(--chip); overflow:hidden; }
.hit-bar i { display:block; height:100%; background:var(--text-2); }
.hit-score { width:44px; font-size:12px; color:var(--text-2); font-variant-numeric:tabular-nums; text-align:right; }
.hit-text { margin-top:6px; font-size:13px; color:var(--text-2); white-space:pre-wrap; overflow-wrap:anywhere; }

@media (max-width: 820px) {
  .modal.wide { height:auto; }
  .modal-body.two { grid-template-columns:1fr; overflow:auto; }
  .modal-col { overflow:visible; }
  .list-col { border-inline-end:0; border-bottom:1px solid var(--border); }
}
