:root {
  --tag-orange: #f04a12;
  --tag-cyan: #1eafff;
  --tag-dark: #0b1118;
  --tag-panel: #101a24;
  --tag-panel-soft: #142231;
  --tag-text: #f7f8fa;
  --tag-muted: #a8b3c1;
  --tag-border: rgba(255, 255, 255, .12);
  --tag-danger: #ff6b6b;
  --tag-success: #41d38a;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.tag-page {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    linear-gradient(145deg, rgba(240, 74, 18, .18), transparent 34%),
    linear-gradient(25deg, rgba(30, 175, 255, .16), transparent 32%),
    var(--tag-dark);
  color: var(--tag-text);
}

.tag-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.tag-panel {
  width: min(100%, 720px);
  border: 1px solid var(--tag-border);
  border-radius: 8px;
  background: rgba(16, 26, 36, .94);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .32);
  padding: 26px;
}

.tag-panel-center {
  text-align: center;
}

.tag-panel-narrow {
  max-width: 430px;
}

.tag-panel-wide {
  max-width: 880px;
}

.tag-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tag-text);
  font-weight: 800;
  letter-spacing: .2px;
  text-decoration: none;
}

.tag-brand strong {
  color: var(--tag-orange);
}

.tag-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
}

.tag-brand-inline {
  margin-bottom: 14px;
}

.tag-kicker {
  margin: 32px 0 10px;
  color: var(--tag-orange);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.tag-panel h1 {
  margin: 0;
  font-size: clamp(1.8rem, 7vw, 3rem);
  line-height: 1.08;
}

.tag-admin-header h1 {
  max-width: 620px;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.tag-copy {
  max-width: 460px;
  margin: 16px auto 0;
  color: var(--tag-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.tag-loader {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 48px;
  margin: 34px auto 8px;
}

.tag-loader span {
  display: block;
  width: 9px;
  height: 18px;
  border-radius: 999px;
  background: var(--tag-orange);
  animation: tagPulse .82s ease-in-out infinite;
}

.tag-loader span:nth-child(2) {
  height: 30px;
  background: var(--tag-cyan);
  animation-delay: .12s;
}

.tag-loader span:nth-child(3) {
  animation-delay: .24s;
}

@keyframes tagPulse {
  0%,
  100% {
    transform: scaleY(.6);
    opacity: .55;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.tag-actions {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.tag-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 8px;
  padding: 14px 18px;
  color: #fff;
  background: var(--tag-orange);
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
  box-shadow: 0 12px 28px rgba(240, 74, 18, .24);
}

.tag-action:hover {
  transform: translateY(-1px);
  background: #ff5b25;
}

.tag-action-secondary {
  background: var(--tag-panel-soft);
  box-shadow: none;
}

.tag-action-secondary:hover {
  background: #1b3146;
}

.tag-note,
.tag-status {
  min-height: 22px;
  color: var(--tag-muted);
  font-size: .92rem;
  line-height: 1.45;
}

.tag-note {
  margin: 18px 0 0;
}

.tag-status {
  margin: 0;
}

.tag-status[data-tone="error"] {
  color: var(--tag-danger);
}

.tag-status[data-tone="success"] {
  color: var(--tag-success);
}

.tag-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

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

.tag-field {
  display: grid;
  gap: 8px;
}

.tag-field span,
.tag-toggle-row > span {
  color: var(--tag-muted);
  font-size: .92rem;
  font-weight: 700;
}

.tag-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--tag-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: var(--tag-text);
  font: inherit;
  outline: none;
  padding: 12px 14px;
}

.tag-field input:focus {
  border-color: rgba(30, 175, 255, .75);
  box-shadow: 0 0 0 3px rgba(30, 175, 255, .16);
}

.tag-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 12px 18px;
}

.tag-button-primary {
  color: #fff;
  background: var(--tag-orange);
  box-shadow: 0 12px 28px rgba(240, 74, 18, .22);
}

.tag-button-primary:hover {
  background: #ff5b25;
}

.tag-button-ghost {
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  background: rgba(255, 255, 255, .06);
}

.tag-button:disabled {
  cursor: wait;
  opacity: .65;
}

.tag-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tag-toggle-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 0;
}

.tag-toggle-row input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.tag-toggle {
  position: relative;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  transition: background .18s ease;
}

.tag-toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}

.tag-toggle-row input:checked + .tag-toggle {
  background: var(--tag-orange);
}

.tag-toggle-row input:checked + .tag-toggle::after {
  transform: translateX(26px);
}

.tag-submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

@media (min-width: 760px) {
  .tag-panel {
    padding: 34px;
  }

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

  .tag-grid-form .tag-field:nth-child(-n + 3),
  .tag-toggle-row,
  .tag-submit-row {
    grid-column: 1 / -1;
  }

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

@media (max-width: 560px) {
  .tag-shell {
    place-items: stretch;
    padding: 14px;
  }

  .tag-panel {
    display: flex;
    min-height: calc(100vh - 28px);
    flex-direction: column;
    justify-content: center;
    padding: 22px;
  }

  .tag-admin-header {
    display: grid;
  }

  .tag-panel h1 {
    font-size: 2rem;
  }
}
