:root {
  color: #eef7fb;
  background: #070c11;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 168, 213, .12), transparent 32rem),
    radial-gradient(circle at 88% 8%, rgba(230, 175, 44, .09), transparent 30rem),
    #070c11;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(65, 207, 247, .38);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 56, 72, .8), rgba(11, 20, 28, .8));
  color: #f3bd3a;
  font-family: Georgia, serif;
  font-size: 31px;
  box-shadow: 0 10px 45px rgba(0, 0, 0, .32);
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  color: #45c9ed;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
}

h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 38px);
  letter-spacing: -.035em;
}

.subtitle {
  margin: 6px 0 0;
  color: #8293a2;
}

.health {
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid #23303a;
  border-radius: 999px;
  color: #9aabb7;
  font-size: 12px;
}

.health.online {
  border-color: rgba(60, 210, 143, .3);
  color: #55dda0;
}

.panel {
  border: 1px solid #17242e;
  border-radius: 18px;
  background: rgba(11, 18, 24, .86);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .2);
}

.credentials {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
}

label span {
  display: block;
  margin: 0 0 8px;
  color: #8b9ba7;
  font-size: 12px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 45px;
  padding: 0 14px;
  border: 1px solid #24333e;
  border-radius: 11px;
  outline: none;
  background: #080e13;
  color: #ecf7fb;
}

input:focus {
  border-color: #37bfe6;
  box-shadow: 0 0 0 3px rgba(55, 191, 230, .1);
}

.button {
  min-height: 45px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .16s ease, filter .16s ease;
}

.button:hover,
.icon-button:hover,
.tab:hover {
  filter: brightness(1.13);
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button.primary {
  background: linear-gradient(135deg, #3cc8ee, #168eb4);
  color: #031016;
}

.button.secondary {
  border: 1px solid #2b3a45;
  background: #121c23;
  color: #e8f1f5;
}

.selection-panel {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 18px;
}

.selection-panel > div {
  min-width: 0;
}

.selection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  display: flex;
  max-width: 270px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #25343e;
  border-radius: 10px;
  color: #b8c7d0;
  background: #0b1217;
  font-size: 12px;
}

.choice strong {
  display: block;
  color: #eaf5f9;
}

.choice button {
  border: 0;
  cursor: pointer;
  background: none;
  color: #667986;
}

.catalog {
  margin-top: 28px;
}

.tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  border-bottom: 1px solid #192630;
}

.tab {
  padding: 12px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  color: #8295a2;
  font-weight: 800;
}

.tab.active {
  border-bottom-color: #39c8f0;
  color: #f0f8fb;
}

.catalog-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  color: #758a98;
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid #25343e;
  border-radius: 10px;
  cursor: pointer;
  background: #0d151b;
  color: #cfe1e9;
  font-size: 22px;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #172630;
  border-radius: 15px;
  cursor: pointer;
  background: #0b1217;
  color: #dce9ef;
  text-align: left;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #315568;
}

.card.selected {
  border-color: #41d1f6;
  box-shadow: 0 0 0 2px rgba(65, 209, 246, .12);
}

.preview {
  display: grid;
  aspect-ratio: 1 / 1;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(42, 80, 94, .22), rgba(9, 16, 21, .2)),
    repeating-linear-gradient(45deg, #0c151b, #0c151b 7px, #0e1920 7px, #0e1920 14px);
}

.preview img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  image-rendering: pixelated;
}

.fallback {
  color: #d4a837;
  font-family: Georgia, serif;
  font-size: 42px;
}

.card-copy {
  padding: 10px;
}

.card-copy strong,
.card-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy strong {
  font-size: 12px;
}

.card-copy small {
  margin-top: 4px;
  color: #637783;
  font-size: 10px;
}

.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  max-width: min(420px, calc(100% - 48px));
  margin: 0;
  padding: 13px 16px;
  border: 1px solid #2a3c47;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  background: #101a21;
  color: #dcebf1;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .42);
  transition: opacity .2s ease, transform .2s ease;
}

.notice.visible {
  opacity: 1;
  transform: translateY(0);
}

.notice.error {
  border-color: rgba(255, 99, 99, .38);
  color: #ffaaaa;
}

@media (max-width: 960px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .credentials {
    grid-template-columns: 1fr;
  }

  .selection-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .health {
    display: none;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 24px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
