/* Shared model picker: explicit selection, useful rates and touch-sized actions. */
#model-overlay { align-items: center; padding: 32px; }
#model-overlay .mp-modal { max-width: 680px; max-height: min(840px, calc(100dvh - 64px)); }
.mp-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 18px 8px 24px; }
.mp-heading h2 { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 650; letter-spacing: -.3px; }
.mp-icon { flex: 0 0 auto; width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 11px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.mp-icon svg { width: 20px; height: 20px; }
.mp-icon:hover { background: var(--raise); color: var(--text); }
.mp-icon:disabled { opacity: .4; cursor: default; }
.mp-search-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#model-overlay #model-search { flex: 0 0 auto; margin: 0 24px 16px; border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; background: var(--bg); color: var(--text); font-size: 15px; min-height: 46px; }
.mp-tools { flex: 0 0 auto; padding: 0 24px; border-bottom: 1px solid var(--border); }
.mp-scopes { display: flex; gap: 6px; margin-bottom: 16px; }
.mp-scopes button { border: 0; border-radius: 9px; padding: 10px 13px; min-height: 44px; font: 600 13px var(--font); color: var(--muted); background: none; cursor: pointer; }
.mp-scopes button:hover { background: var(--raise); }
.mp-scopes button[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.mp-filters { display: grid; grid-template-columns: 1fr 1fr 1.25fr 1.1fr; gap: 10px; }
.mp-filter { min-width: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.mp-filter select { min-width: 0; min-height: 42px; width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 8px 6px; background: var(--panel); font: 13px var(--font); color: var(--text); cursor: pointer; }
.mp-filter select:disabled { color: var(--muted); cursor: default; }
.mp-count { padding: 12px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
#model-overlay #model-list { padding: 4px 12px 12px; min-height: 0; overscroll-behavior: contain; }
.mp-group { margin: 16px 12px 7px; font-size: 12px; font-weight: 600; line-height: 1.5; color: var(--muted); }
.mp-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; align-items: center; border: 1px solid transparent; border-radius: 13px; padding: 2px 5px 2px 0; margin: 3px 0; content-visibility: auto; contain-intrinsic-size: auto 91px; }
.mp-row:hover { background: var(--raise); }
.mp-row.selected { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 34%, var(--border)); }
.mp-pick { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 82px; width: 100%; border: 0; padding: 12px; border-radius: 12px; background: transparent; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.mp-pick:disabled { opacity: .6; cursor: not-allowed; }
.mp-pick .bot-ico { width: 32px; height: 32px; flex-shrink: 0; }
.mp-pick .mod-badge { display: none; }
.mp-body { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.mp-name-line { display: flex; min-width: 0; gap: 7px; align-items: baseline; }
.mp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 620; line-height: 1.4; }
.mp-kind { color: var(--muted); font-size: 11px; line-height: 1.5; white-space: nowrap; }
.mp-row.selected .mp-kind { color: var(--accent); font-weight: 650; }
.mp-price { color: var(--muted); font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.mp-destination { color: var(--muted); font-size: 11px; line-height: 1.4; }
.mp-favorite[aria-pressed="true"] { color: var(--accent); }
.mp-favorite[aria-pressed="true"] svg { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.mp-details { grid-column: 1 / -1; margin: 0 10px 10px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 12px; line-height: 1.6; }
.mp-details[hidden] { display: none; }
.mp-detail-label { display: block; margin-bottom: 4px; font-size: 11px; }
.mp-details code { display: block; user-select: text; overflow-wrap: anywhere; color: var(--text); font-size: 12px; }
.mp-details p { margin: 8px 0 0; }
.mp-empty { padding: 36px 16px; text-align: center; }
.mp-empty strong { font-size: 15px; font-weight: 600; color: var(--text); }
.mp-empty p { margin: 10px 0 18px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.mp-reset, .mp-more { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; min-height: 44px; font: 600 13px var(--font); color: var(--text); background: var(--panel); cursor: pointer; }
.mp-more { display: block; width: calc(100% - 16px); margin: 14px 8px 4px; }
#model-overlay :is(button, select, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#model-overlay .model-compare-bar { flex-shrink: 0; padding: 14px 20px; }
@media (max-width: 600px) {
  #model-overlay { padding: 12px; }
  #model-overlay .mp-modal { max-height: calc(100dvh - 24px); border-radius: 16px; }
  .mp-heading { padding: 12px 12px 8px 18px; }
  .mp-heading h2 { font-size: 18px; }
  #model-overlay #model-search { margin: 0 16px 12px; font-size: 16px; }
  .mp-tools { padding: 0 16px; }
  .mp-scopes { gap: 2px; margin-bottom: 12px; }
  .mp-scopes button { padding: 10px 11px; }
  .mp-filters { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mp-filter { gap: 3px; }
  .mp-filter select { min-height: 44px; font-size: 14px; }
  #model-overlay #model-list { padding-left: 5px; padding-right: 5px; }
  .mp-row { grid-template-columns: minmax(0, 1fr) 44px 44px; padding-right: 0; }
  .mp-pick { padding: 11px 8px; gap: 8px; }
  .mp-pick .bot-ico { width: 28px; height: 28px; }
  .mp-name { font-size: 13px; }
  .mp-kind { font-size: 10px; }
  .mp-price { font-size: 11px; }
  .mp-group { margin-left: 10px; }
  #model-overlay .model-compare-bar { flex-wrap: wrap; gap: 10px; }
}
@media (max-height: 540px) and (min-width: 601px) {
  #model-overlay .mp-modal { max-height: calc(100dvh - 20px); }
  .mp-heading { padding-top: 4px; padding-bottom: 0; }
  #model-overlay #model-search { margin-bottom: 8px; }
  .mp-scopes { margin-bottom: 6px; }
  .mp-count { padding: 6px 0; }
}

@media (max-height: 540px) {
  #model-overlay .mp-modal { overflow-y: auto; overscroll-behavior: contain; }
  #model-overlay #model-list { flex: 0 0 auto; overflow: visible; }
}

#chip-row .chip-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
