:root {
  color-scheme: dark;
  --ink: #f8fbff;
  --soft-ink: #d7e7ff;
  --muted: #95a3c5;
  --line: rgba(126, 239, 255, 0.18);
  --line-hot: rgba(238, 91, 255, 0.38);
  --surface: #090617;
  --panel: rgba(18, 12, 39, 0.84);
  --panel-strong: rgba(24, 15, 55, 0.94);
  --field: rgba(5, 12, 30, 0.72);
  --aqua: #25f4ff;
  --aqua-dark: #0bb7c6;
  --pink: #ee5bff;
  --violet: #8d6bff;
  --lime: #b8ff6f;
  --red: #ff5578;
  --gold: #ffd166;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  --glow-aqua: 0 0 22px rgba(37, 244, 255, 0.32);
  --glow-pink: 0 0 24px rgba(238, 91, 255, 0.25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  background:
    radial-gradient(circle at 12% 8%, rgba(37, 244, 255, 0.18), transparent 28%),
    radial-gradient(circle at 85% 14%, rgba(238, 91, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #070512 0%, #120a2a 48%, #061622 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 75%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
summary {
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: rgba(4, 5, 15, 0.72);
  color: var(--ink);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 244, 255, 0.08), rgba(238, 91, 255, 0.08));
  box-shadow: var(--glow-aqua);
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37, 244, 255, 0.72);
  border-radius: 12px;
  background: rgba(37, 244, 255, 0.12);
  color: var(--aqua);
  font-weight: 950;
  text-shadow: 0 0 16px rgba(37, 244, 255, 0.9);
  box-shadow: inset 0 0 18px rgba(37, 244, 255, 0.16), var(--glow-aqua);
}

.brand-logo {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border: 1px solid rgba(37, 244, 255, 0.42);
  border-radius: 14px;
  box-shadow: var(--glow-aqua), var(--glow-pink);
}

.brand h1,
.topbar h2,
.section-heading h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 1.35rem;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 7px;
  color: var(--aqua);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(37, 244, 255, 0.62);
}

.panel-kicker {
  margin: 0;
}

.nav {
  display: grid;
  gap: 9px;
}

.nav-button,
.primary-button,
.secondary-button,
.icon-button,
.link-button,
.tab {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  font-weight: 850;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-button span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(149, 163, 197, 0.28);
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--soft-ink);
}

.nav-button.active,
.nav-button:hover {
  border-color: var(--line);
  background: linear-gradient(135deg, rgba(37, 244, 255, 0.12), rgba(141, 107, 255, 0.12));
  color: var(--ink);
  box-shadow: var(--glow-aqua);
}

.nav-button.active span {
  border-color: rgba(37, 244, 255, 0.7);
  color: var(--aqua);
}

.source-panel {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 12, 39, 0.66);
}

.auth-panel {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 12, 39, 0.66);
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.55;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: var(--field);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 244, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(37, 244, 255, 0.13), var(--glow-aqua);
}

::placeholder {
  color: rgba(149, 163, 197, 0.66);
}

.primary-button {
  padding: 10px 15px;
  background: linear-gradient(135deg, var(--aqua), var(--violet));
  color: #06111e;
  box-shadow: var(--glow-aqua);
}

.primary-button:hover {
  filter: brightness(1.08);
}

.primary-button.hot {
  background: linear-gradient(135deg, var(--pink), var(--aqua));
  box-shadow: var(--glow-pink);
}

.secondary-button,
.icon-button,
.link-button,
.tab {
  padding: 10px 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft-ink);
}

.secondary-button:hover,
.icon-button:hover,
.link-button:hover,
.tab:hover {
  border-color: rgba(37, 244, 255, 0.56);
  color: var(--ink);
  box-shadow: var(--glow-aqua);
}

.danger {
  color: var(--red);
}

.hidden-action {
  display: none;
}

.file-import-button {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft-ink);
  font-size: 1rem;
  font-weight: 850;
}

.file-import-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sidebar-file-button {
  width: 100%;
  background: linear-gradient(135deg, rgba(37, 244, 255, 0.16), rgba(238, 91, 255, 0.12));
  color: var(--ink);
}

.status-text {
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.app-shell {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  color: #ffffff;
  text-shadow: 0 0 34px rgba(238, 91, 255, 0.42);
}

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

.toolbar select {
  min-width: 150px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
  align-items: start;
}

.paste-import {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.paste-import summary {
  padding: 14px 17px;
  color: var(--soft-ink);
  font-weight: 900;
}

.paste-body {
  display: grid;
  gap: 12px;
  padding: 0 17px 17px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.show-list,
.target-grid {
  display: grid;
  gap: 12px;
}

.show-card,
.target-card,
.editor,
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.show-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.show-card.active {
  outline: 3px solid rgba(37, 244, 255, 0.15);
  border-color: rgba(37, 244, 255, 0.68);
  box-shadow: var(--shadow), var(--glow-aqua);
}

.show-card:hover,
.target-card:hover {
  border-color: rgba(238, 91, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: var(--shadow), var(--glow-pink);
}

.show-thumb {
  width: 88px;
  aspect-ratio: 1;
  border: 1px solid rgba(37, 244, 255, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(37, 244, 255, 0.9), rgba(238, 91, 255, 0.86)),
    linear-gradient(45deg, #10102a, #27124c);
  object-fit: cover;
  box-shadow: var(--glow-aqua);
}

.show-card h4,
.target-card h4 {
  margin: 0 0 7px;
  font-size: 1rem;
  color: #ffffff;
}

.show-card p,
.target-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.badge {
  padding: 4px 8px;
  border: 1px solid rgba(149, 163, 197, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft-ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.badge.strong {
  border-color: rgba(37, 244, 255, 0.42);
  background: rgba(37, 244, 255, 0.12);
  color: var(--aqua);
}

.badge.warn {
  border-color: rgba(255, 209, 102, 0.38);
  background: rgba(255, 209, 102, 0.12);
  color: var(--gold);
}

.editor,
.panel {
  padding: 18px;
}

.editor {
  display: grid;
  gap: 13px;
  position: sticky;
  top: 20px;
  background: var(--panel-strong);
}

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

.target-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.target-card {
  padding: 16px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.target-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.target-type {
  color: var(--pink);
  font-weight: 900;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.copy-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  display: grid;
  gap: 14px;
}

.output-panel {
  min-width: 0;
}

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

.tab.active {
  border-color: rgba(37, 244, 255, 0.74);
  background: linear-gradient(135deg, rgba(37, 244, 255, 0.22), rgba(238, 91, 255, 0.2));
  color: #ffffff;
  box-shadow: var(--glow-aqua);
}

.link-button {
  display: grid;
  place-items: center;
  text-decoration: none;
}

#copyOutput {
  min-height: 420px;
  line-height: 1.48;
}

.roadblock-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  border-radius: 12px;
  background: rgba(255, 209, 102, 0.08);
  color: var(--soft-ink);
  font-size: 0.84rem;
  line-height: 1.4;
}

.roadblock-panel strong {
  color: var(--gold);
}

.queue-panel {
  margin-top: 22px;
}

.autofill-panel,
.target-manager {
  margin-top: 22px;
}

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

.field-copy {
  min-height: 58px;
  display: grid;
  gap: 5px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft-ink);
  text-align: left;
}

.field-copy span {
  color: var(--aqua);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.field-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-copy.copied {
  border-color: rgba(184, 255, 111, 0.68);
  box-shadow: 0 0 18px rgba(184, 255, 111, 0.18);
}

.autofill-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.submission-queue {
  display: grid;
  gap: 10px;
}

.queue-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 150px minmax(180px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.queue-row h4 {
  margin: 0 0 5px;
  font-size: 0.96rem;
}

.queue-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.queue-actions {
  display: flex;
  gap: 8px;
  justify-content: end;
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--soft-ink);
  font-weight: 850;
}

.mini-button:hover {
  border-color: rgba(37, 244, 255, 0.56);
  color: var(--ink);
}

.target-form {
  display: grid;
  gap: 12px;
}

.target-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.target-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.target-row h4 {
  margin: 0 0 4px;
}

.target-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.city-panel {
  min-height: 70vh;
}

.city-toolbar {
  margin-bottom: 18px;
}

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

.city-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.city-card img,
.city-card-image {
  width: 100%;
  aspect-ratio: 1.1;
  display: block;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(37, 244, 255, 0.55), rgba(238, 91, 255, 0.45));
}

.city-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.city-card h4,
.city-card p {
  margin: 0;
}

.city-card h4 {
  font-size: 1.05rem;
}

.city-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .source-panel {
    margin-top: 0;
  }

  .layout,
  .copy-layout,
  .target-grid,
  .city-grid,
  .field-grid,
  .autofill-actions,
  .target-row,
  .queue-row {
    grid-template-columns: 1fr;
  }

  .editor {
    position: static;
  }
}

@media (max-width: 680px) {
  .app-shell,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-heading,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .two-col,
  .tabs {
    grid-template-columns: 1fr;
  }

  .show-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .show-thumb {
    width: 64px;
  }
}
