/* Compact iOS-style model picker, anchored to the model button. */
#page-home .model-selector { grid-template-columns:minmax(0,1fr) 19px; }
#page-home .model-selector-action {
  display:grid;place-items:center;width:19px;height:19px;padding:0;border:0;
  background:transparent;color:inherit;font-size:24px;font-weight:400;line-height:1;
  transform:translateY(-4px);
}
.model-popover,
.model-popover[open] {
  position:fixed;inset:auto;left:var(--model-popover-left,12px);top:var(--model-popover-top,60px);
  right:auto;bottom:auto;transform:none;min-width:0;
  width:var(--model-popover-width,320px);height:auto;
  max-width:calc(100vw - 24px);max-height:var(--model-popover-height,510px);
  margin:0;padding:8px;border:1px solid #ffffffb8;border-radius:27px;
  color:#101b16;
  background:linear-gradient(155deg,rgba(250,255,252,.84) 0%,rgba(255,255,255,.89) 38%,rgba(255,255,255,.94) 100%);
  box-shadow:0 22px 55px #102d223a,0 2px 9px #102d2212,inset 0 1px #ffffffcb;
  backdrop-filter:blur(28px) saturate(1.5);-webkit-backdrop-filter:blur(28px) saturate(1.5);
  overflow:hidden;
}
.model-popover[open] { display:block;animation:model-popover-appear .25s cubic-bezier(.2,.85,.25,1) both; }
.model-popover:not([open]) { display:none; }
.model-popover::backdrop { background:rgba(7,29,16,.16);backdrop-filter:none;-webkit-backdrop-filter:none; }
.model-popover[open]::backdrop { animation:model-backdrop-in .2s ease both; }
.model-list {
  display:block;min-height:0;max-height:calc(var(--model-popover-height,510px) - 16px);
  padding:0 2px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.model-list::-webkit-scrollbar { display:none; }
.model-family { display:block;margin:0;padding:0; }
.model-family + .model-family { margin-top:3px;padding-top:3px; }
.model-family-free { margin-top:8px!important;padding-top:8px!important;border-top:1px solid #153d2a18; }
.model-option,
.model-option.selected,
.model-option.locked {
  display:grid;grid-template-columns:minmax(0,1fr) 22px;align-items:center;gap:4px;
  width:100%;min-height:68px;margin:0;padding:10px 10px;
  border:0;border-radius:15px;background:transparent;box-shadow:none;
  color:#101b16;text-align:left;opacity:1;
  transition:background .18s ease,transform .18s ease;
}
.model-option:hover,.model-option:focus-visible { background:#ffffff81;outline:none; }
.model-option:active { transform:scale(.985);background:#ffffffaa; }
.model-option.selected { background:#ffffff74; }
.model-option-copy { display:flex;flex-direction:column;align-items:flex-start;min-width:0; }
.model-option-title { display:flex;align-items:center;flex-wrap:wrap;gap:6px;width:100%; }
.model-option strong {
  display:inline;font-size:16px;line-height:1.22;font-weight:490;letter-spacing:-.025em;
  white-space:normal;overflow:visible;text-overflow:clip;color:#0e1712;
}
.model-option .model-option-copy small {
  display:block;max-width:100%;margin:4px 0 0;color:#7b8580;
  font-size:12px;line-height:1.3;font-weight:400;white-space:normal;
  overflow:visible;text-overflow:clip;
}
.model-tier-badge {
  display:inline-flex;align-items:center;justify-content:center;flex:none;
  min-height:21px;padding:2px 6px;border-radius:7px;
  color:#fff;font-size:10px;line-height:1;font-weight:700;letter-spacing:.025em;
}
.model-tier-badge.pro { background:linear-gradient(130deg,#9050e9,#7633dc); }
.model-tier-badge.lite { background:linear-gradient(130deg,#4c9dd8,#4485c8); }
.model-option-check { justify-self:end;opacity:0;color:#14965a;font-size:18px;font-weight:600; }
.model-option.selected .model-option-check { opacity:1; }
:root[data-theme=dark] .model-popover {
  border-color:#bbebce48;color:#edf8ef;
  background:linear-gradient(155deg,rgba(45,75,55,.9),rgba(28,44,34,.94) 50%,rgba(23,35,29,.95));
  box-shadow:0 20px 55px #0009,inset 0 1px #ffffff22;
}
:root[data-theme=dark] .model-option,
:root[data-theme=dark] .model-option strong { color:#f0f7f1; }
:root[data-theme=dark] .model-option .model-option-copy small { color:#b1c2b6; }
:root[data-theme=dark] .model-option:hover,
:root[data-theme=dark] .model-option:focus-visible,
:root[data-theme=dark] .model-option.selected { background:#ffffff16; }
:root[data-theme=dark] .model-family-free { border-top-color:#d9ffe424; }
@keyframes model-popover-appear {
  from { opacity:0;transform:translateY(-9px) scale(.97); }
  to { opacity:1;transform:translateY(0) scale(1); }
}
@media(max-width:350px) {
  .model-option,.model-option.selected,.model-option.locked { min-height:63px;padding:8px; }
  .model-option strong { font-size:14px; }
  .model-option .model-option-copy small { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) { .model-popover[open],.model-option { animation:none;transition:none; } }
