:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #17191c;
  --muted: #717780;
  --line: #e2e6e9;
  --accent: #087b83;
  --accent-dark: #075d63;
  --soft: #f1f4f5;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(27, 37, 44, 0.07);
}

[data-theme="dark"] {
  --bg: #121416;
  --panel: #1b1e20;
  --text: #f1f3f4;
  --muted: #9ba2a7;
  --line: #2c3236;
  --accent: #72c4c8;
  --accent-dark: #9bd9dc;
  --soft: #24282b;
  --danger: #ff8f86;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.theme {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 1.2rem;
}

.tools {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.count,
input,
select {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 16px;
  white-space: nowrap;
}

.count strong {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.count span {
  color: var(--muted);
  font-size: 0.85rem;
}

input,
select {
  width: 100%;
  padding: 0 15px;
  outline: none;
}

input::placeholder {
  color: var(--muted);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px rgba(8, 123, 131, 0.16),
    var(--shadow);
}

.status {
  display: none;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--muted);
}

.status.error {
  display: block;
  border-color: rgba(180, 35, 24, 0.3);
  color: var(--danger);
}

.status.info {
  display: block;
}

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

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(27, 37, 44, 0.12);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 800;
}

.card h2 {
  overflow: hidden;
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(8, 123, 131, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.description {
  min-height: 66px;
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.code-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.code-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  font-size: 0.86rem;
  font-weight: 800;
}

.note {
  min-height: 38px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.81rem;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.action {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
}

.copy {
  background: var(--soft);
  color: var(--text);
}

.open {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.open:hover {
  background: var(--accent-dark);
}

footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  padding: 11px 15px;
  border-radius: 999px;
  background: #17191c;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

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

  .count {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(100% - 22px, 480px);
    padding-top: 22px;
  }

  .head {
    margin-bottom: 22px;
  }

  h1 {
    font-size: 2.9rem;
  }

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

  .count {
    grid-column: auto;
    justify-content: flex-start;
  }

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

  .description,
  .note {
    min-height: auto;
  }
}

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