.model-shop-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 72px;
  font-family: 'DM Sans', sans-serif;
}

.model-shop-page h1,
.model-shop-page h2,
.model-shop-page h3 {
  font-family: 'Sora', sans-serif;
  letter-spacing: 0;
  text-shadow: none;
}

.shop-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.shop-kicker {
  margin: 0 0 10px;
  color: #8ef0d8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shop-header h1 {
  margin: 0;
  text-align: left;
  font-size: clamp(2.5rem, 6vw, 5rem);
}

.shop-copy {
  max-width: 640px;
  margin: 12px 0 0;
  color: #c3ccd8;
  font-size: 1.05rem;
  line-height: 1.6;
}

.settings-link,
.shop-results-row button,
.personal-model-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font:
    700 0.9rem 'DM Sans',
    sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.settings-link {
  min-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
}

.settings-link:hover,
.shop-results-row button:hover,
.personal-model-actions button:hover {
  border-color: rgba(142, 240, 216, 0.55);
  background: rgba(142, 240, 216, 0.12);
}

.shop-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(135px, 1fr));
  gap: 12px;
  padding: 22px 0;
}

.model-vision-badge {
  border-color: rgba(142, 240, 216, 0.34) !important;
  background: rgba(142, 240, 216, 0.1) !important;
  color: #a8f7e5 !important;
}

.shop-controls label {
  display: grid;
  gap: 7px;
  color: #aeb8c8;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.shop-controls input,
.shop-controls select {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(3, 9, 14, 0.78);
  color: #ffffff;
  padding: 0 12px;
  font:
    600 0.95rem 'DM Sans',
    sans-serif;
  outline: none;
}

.shop-controls input:focus,
.shop-controls select:focus {
  border-color: rgba(142, 240, 216, 0.7);
  box-shadow: 0 0 0 3px rgba(142, 240, 216, 0.16);
}

.shop-connections {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 46px;
  margin: -6px 0 20px;
}

.connection-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(142, 240, 216, 0.38);
  border-radius: 8px;
  background: rgba(142, 240, 216, 0.12);
  color: #eafffb;
  font:
    800 0.9rem 'DM Sans',
    sans-serif;
  cursor: pointer;
}

.connection-button:hover:not(:disabled) {
  border-color: rgba(142, 240, 216, 0.68);
  background: rgba(142, 240, 216, 0.18);
}

.connection-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.connection-status {
  color: #aeb8c8;
  font-size: 0.88rem;
  font-weight: 700;
}

.connection-status[data-tone='success'] {
  color: #8ef0d8;
}

.connection-status[data-tone='error'] {
  color: #ff9f9f;
}

.shop-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
}

.shop-results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  margin-bottom: 12px;
}

.shop-results-row p {
  margin: 0;
  color: #c7d1df;
  font-weight: 700;
}

.shop-results-row button {
  min-height: 36px;
  padding: 0 12px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.model-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.02)
    ),
    rgba(5, 12, 17, 0.88);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.model-card-featured {
  box-shadow: 0 20px 50px rgba(48, 185, 225, 0.18);
}

.model-featured-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 4px 7px;
  border: 1px solid rgba(142, 240, 216, 0.4);
  border-radius: 999px;
  color: #8ef0d8;
  font:
    700 0.62rem 'DM Sans',
    sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.model-card-header,
.provider-block,
.personal-model-row > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-card-header {
  justify-content: space-between;
}

.provider-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font:
    800 1rem 'Sora',
    sans-serif;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.22);
}

.provider-logo img {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.provider-logo-auto,
.provider-logo-gemini,
.provider-logo-gemini-api {
  background: rgba(142, 240, 216, 0.16);
}

.provider-logo-nvidia {
  background: rgba(118, 185, 0, 0.2);
}

.provider-name,
.model-code,
.personal-model-row span {
  display: block;
}

.provider-name {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
}

.model-code {
  max-width: 134px;
  overflow: hidden;
  color: #96a2b2;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-add-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #0b1118;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.model-add-button:disabled {
  background: rgba(142, 240, 216, 0.18);
  color: #8ef0d8;
  cursor: default;
}

.model-add-button.is-added {
  width: 58px;
  flex-basis: 58px;
  font-size: 0.75rem;
}

.model-card h2 {
  margin: 14px 0 8px;
  color: #ffffff;
  text-align: left;
  font-size: 1.2rem;
}

.model-card p {
  flex: 1;
  margin: 0;
  overflow: hidden;
  color: #c3ccd8;
  font-size: 0.92rem;
  line-height: 1.45;
}

.model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.model-meta span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #f3f8ff;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 800;
}

.personal-list {
  position: sticky;
  top: 96px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(3, 9, 14, 0.84);
}

.personal-list h2 {
  margin: 0;
  text-align: left;
  font-size: 1.25rem;
}

.personal-list p {
  margin: 8px 0 16px;
  color: #aeb8c8;
  font-size: 0.9rem;
  line-height: 1.5;
}

#personal-model-list {
  display: grid;
  gap: 10px;
}

.personal-model-row {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.personal-model-row strong {
  display: block;
  color: #ffffff;
  font-size: 0.93rem;
}

.personal-model-row span {
  margin-top: 2px;
  color: #aeb8c8;
  font-size: 0.78rem;
}

.personal-model-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.personal-model-actions button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.82rem;
}

.personal-model-actions button:only-child {
  grid-column: 1 / -1;
}

.empty-model-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #c3ccd8;
}

@media (max-width: 920px) {
  .shop-controls,
  .shop-shell {
    grid-template-columns: 1fr;
  }

  .personal-list {
    position: static;
  }
}

@media (max-width: 620px) {
  .model-shop-page {
    width: calc(100% - 24px);
  }

  .shop-header {
    display: grid;
    align-items: start;
    padding-top: 24px;
  }

  .settings-link {
    width: 100%;
  }

  .model-grid {
    grid-template-columns: 1fr;
  }

  .model-card {
    aspect-ratio: auto;
    min-height: 240px;
  }
}
