/* Owned by package WEB (docs/COMPUTE.md section 10): serverless endpoints and batches, cloud storage, the model-fit
 * filter and badges, API-key spending caps, the host "accept workers" switch. */

/* ----------------------------------------------------------------------- model fit (explore, listing) */
.fits-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 8px; font-size: 11px; color: #4e5c70; min-width: 0; }
.fits-row > .icon { color: var(--brand); flex: none; }
.fits-chip { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; padding: 2px 7px; border-radius: 5px; background: #eef5e8; border: 1px solid #d6e8c8; color: #36572a; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fits-chip small { font-weight: 600; color: #5e7a52; font-size: 10px; }
.fits-chip:hover { background: #e2efd8; text-decoration: none; }
.fits-more { font-weight: 800; color: #45536a; padding: 2px 4px; white-space: nowrap; }
.model-filter { position: relative; }
.model-filter .input-wrap { position: relative; }
.model-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow: auto; background: #fff; border: 1px solid #d5dce5; border-radius: 9px; box-shadow: 0 10px 28px rgba(12, 20, 34, 0.14); padding: 4px; list-style: none; margin: 0; }
.model-list li { margin: 0; }
.model-list button { width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 9px; border-radius: 6px; font-size: 12.5px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.model-list button:hover, .model-list button:focus-visible { background: #f0f5ea; }
.model-list button small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.model-list .model-none { padding: 8px 9px; font-size: 12px; color: var(--muted); }
.model-chosen { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
.model-chosen strong { color: var(--ink); }
.model-chosen .chip-remove { color: #45536a; }
.model-chosen .chip-remove:hover { background: #e9edf2; }
.model-filter .chips { margin-top: 6px; }
.model-filter .chip { padding: 4px 8px; }

.detail-layout > .detail-main { min-width: 0; } /* the models table scrolls inside its panel instead of widening the page */
.model-table td .muted.tiny { display: block; }
.model-table .num-col { font-variant-numeric: tabular-nums; }
.fit-cell { white-space: nowrap; }
.fit-cell .pill { margin-right: 3px; }
.fit-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.fit-toolbar .field { flex: 1 1 180px; }
.fit-toolbar .select { flex: 0 1 160px; }

/* ----------------------------------------------------------------------------------- pools */
.pool-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 8px 0 4px; }
.batch-progress { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfd; }
.batch-progress .budget-bar { height: 12px; }
.batch-progress .note { margin: 0; }
.task-body { margin: 4px 0 8px; background: #0c1422; color: #e3eaf2; border-radius: 9px; padding: 10px 12px; font: 11.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 340px; overflow: auto; }
.result-snippet { font-size: 11px; display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-panel .batch-progress { margin-bottom: 0; }
.rental-actions .btn-ghost.danger-text { color: var(--danger); }

/* --------------------------------------------------------------------------- storage_sync editor */
.sync-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: start; }
.sync-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; width: 100%; }
.sync-row .field { min-width: 0; }
.sync-opts { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: center; width: 100%; }
.sync-opts .check-row { padding: 4px 0; }
.sync-interval { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #45536a; }
.sync-interval .field { width: 84px; }

/* ---------------------------------------------------------------------------------- storage page */
.st-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.st-stat { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 3px; min-width: 0; background: #fbfcfd; }
.st-stat > span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); font-weight: 800; }
.st-stat strong { font: 700 18px "Space Grotesk", sans-serif; letter-spacing: -0.02em; }
.st-stat strong small { font-size: 12px; font-weight: 600; color: var(--muted); }
.st-stat small { font-size: 11.5px; color: #4b586c; }
.st-stat .budget-bar { margin-top: 6px; }
.crumb-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; color: #45536a; }
.crumb:hover { background: #f0f3f6; color: var(--ink); text-decoration: none; }
.crumb-sep { color: #a7b1bf; }
.st-table .st-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.st-table .st-name.mono { font-weight: 600; font-size: 12px; }
.st-folder .icon { color: #7fa85b; }
.st-more { margin-top: 12px; }
.upload-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.upload-item { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px dashed #d7dee7; border-radius: 9px; font-size: 12.5px; }
.upload-item.done { border-style: solid; border-color: #d6e8c8; background: #f7fbf3; }
.upload-item.failed { border-style: solid; border-color: #f2c9c6; background: #fffafa; }
.upload-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.upload-item .budget-bar { width: 100%; }
.st-help-list { padding-left: 18px; font-size: 12.5px; color: #3f4b5c; display: grid; gap: 6px; margin: 10px 0; }

/* ---------------------------------------------------------------------- API keys: spending caps */
.cap-meter { display: grid; gap: 4px; min-width: 150px; font-size: 11.5px; }
.cap-meter .budget-bar { height: 7px; }
.cap-meter strong { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------- host: accept workers */
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink); cursor: pointer; }
.switch-row input { accent-color: #5c8a3c; width: 16px; height: 16px; }
.hl-facts .switch-row { margin-bottom: 2px; }

/* -------------------------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .pool-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 630px) {
  .pool-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-stats { grid-template-columns: minmax(0, 1fr); }
  .sync-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sync-row [data-sync-local] { grid-column: 1 / -1; }
  .upload-item { grid-template-columns: minmax(0, 1fr) auto; }
  .upload-item .budget-bar { grid-column: 1 / -1; }
  .result-snippet { max-width: 220px; }
}
