:root {
  --bg: #f3f6fb;
  --bg-soft: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #f2f6fc;
  --ink: #0f172a;
  --ink-muted: #4b5565;
  --ink-subtle: #6f7d90;
  --line: #d8e1ee;
  --line-strong: #c4d2e7;
  --brand: #1155d8;
  --brand-2: #0a4ac2;
  --accent: #0f766e;
  --success: #0f9d65;
  --warning: #d97706;
  --danger: #dc2626;
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 24px rgba(17, 33, 62, 0.08);
  --shadow-lg: 0 22px 55px rgba(17, 33, 62, 0.15);
  --transition: 220ms ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 540px at 0% -5%, #dfe9fb 0%, rgba(223, 233, 251, 0) 60%),
    radial-gradient(1200px 540px at 100% -10%, #dff4ef 0%, rgba(223, 244, 239, 0) 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 2.5vw, 2.15rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
h5 { font-size: 0.95rem; font-weight: 700; }

p {
  color: var(--ink-muted);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-2);
}

.anchor {
  position: relative;
  top: -82px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 10px;
}

.eyebrow.light {
  color: #dce8ff;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 74px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
}

.logo-icon {
  width: 30px;
  height: 30px;
  color: var(--brand);
}

.brand-text {
  background: linear-gradient(135deg, #0f4fcb, #0f766e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  margin-left: 20px;
  display: flex;
  gap: 26px;
}

.nav-link {
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  border-color: #a0b7e0;
}

.nav-divider {
  display: none;
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.nav-mobile-btn {
  display: none;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-mobile-btn:hover {
  background: var(--surface-3);
  border-color: var(--brand);
  color: var(--brand);
}

.nav-mobile-btn svg {
  width: 18px;
  height: 18px;
}

.nav-mobile-btn.hidden {
  display: none;
}

.nav-auth,
.nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-email {
  padding: 7px 11px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: #304058;
  border-radius: 4px;
}

.btn {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #0f4fc8, #0f62e8);
  box-shadow: 0 8px 16px rgba(15, 79, 200, 0.22);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(15, 79, 200, 0.28);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: #edf3fd;
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1px solid #9eb7de;
}

.btn-outline:hover {
  background: #edf3ff;
}

.btn-lg {
  min-height: 46px;
  padding: 12px 20px;
}

.btn-sm {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  min-height: 32px;
  min-width: 32px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.signal-bar {
  max-width: 1300px;
  margin: 18px auto 0;
  padding: 0 24px;
}

.signal-bar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(120deg, #0c2357, #10306f);
  border-radius: var(--r-md);
  border: 1px solid #274681;
  color: #dbe8ff;
  padding: 12px 16px;
}

.signal-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fbff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  padding: 6px 10px;
}

.signal-bar p {
  color: #dbe8ff;
  font-size: 0.9rem;
}

.free-qr-section {
  padding: 34px 24px 70px;
}

.section-container {
  max-width: 1300px;
  margin: 0 auto;
}

.section-header.enterprise {
  background: linear-gradient(135deg, #ffffff, #f5f9ff);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 30px;
  margin-bottom: 22px;
}

.section-header.enterprise p {
  max-width: 850px;
}

.hero-stats {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid #d4e0f1;
  border-radius: var(--r-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 1.22rem;
  font-weight: 800;
  color: #123f9f;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--ink-subtle);
  font-weight: 600;
}

.free-qr-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  margin-bottom: 18px;
}

.free-qr-controls,
.free-qr-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.free-qr-controls h3,
.free-qr-preview h3 {
  margin-bottom: 8px;
}

.controls-subtitle {
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.free-qr-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qr-preview-box {
  min-height: 330px;
  border-radius: var(--r-md);
  border: 1px dashed #9fb4d2;
  background:
    linear-gradient(45deg, rgba(16, 68, 156, 0.03) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(16, 68, 156, 0.03) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(16, 68, 156, 0.03) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(16, 68, 156, 0.03) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  display: grid;
  place-items: center;
}

#freeQRCanvas {
  max-width: min(86%, 330px);
  max-height: min(86%, 330px);
  width: auto;
  height: auto;
  background: #fff;
  border-radius: 8px;
}

.button-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: inline-block;
  color: #35475f;
  font-weight: 700;
  margin-bottom: 7px;
  font-size: 0.88rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-family: inherit;
  color: var(--ink);
  background: #fbfdff;
  transition: border var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7ea1da;
  box-shadow: 0 0 0 4px rgba(38, 90, 196, 0.11);
  background: #fff;
}

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

.status-message {
  font-size: 0.86rem;
  border-radius: 10px;
  min-height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
}

.status-message.show {
  display: flex;
}

.status-message.success {
  color: #0f7e56;
  background: #e6f7ef;
  border: 1px solid #bde8d3;
}

.status-message.error {
  color: #b82828;
  background: #fce9e9;
  border: 1px solid #f4caca;
}

#freeStatus {
  display: flex;
}

.upgrade-prompt {
  background: linear-gradient(135deg, #0f2d6f, #1249a7 60%, #0f766e 120%);
  border-radius: var(--r-lg);
  border: 1px solid #3f67ae;
  box-shadow: var(--shadow-lg);
  padding: 26px;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.upgrade-prompt h3,
.upgrade-prompt p {
  color: #fff;
}

.upgrade-prompt p {
  opacity: 0.9;
}

.upgrade-actions {
  display: flex;
  gap: 10px;
}

.upgrade-actions .btn-outline {
  color: #dce8ff;
  border-color: rgba(220, 232, 255, 0.5);
}

.upgrade-actions .btn-outline:hover {
  color: #0f2d6f;
  background: #eaf2ff;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  background: rgba(11, 19, 38, 0.5);
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  position: relative;
  width: min(95vw, 460px);
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid #d6e0ee;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise 220ms ease;
}

@keyframes rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  color: #4f6078;
  cursor: pointer;
}

.modal-header {
  position: relative;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e3eaf5;
}

.modal-header p {
  color: var(--ink-subtle);
  font-size: 0.9rem;
}

.auth-form {
  padding: 20px 24px 12px;
}

.auth-toggle {
  margin-top: 6px;
  text-align: center;
  font-size: 0.86rem;
}

.auth-message {
  margin-top: 10px;
  display: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.auth-message.show {
  display: block;
}

.auth-message.success {
  background: #e7f8ef;
  color: #0f7e56;
}

.auth-message.error {
  background: #fbe9e9;
  color: #b82828;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  font-size: 0.82rem;
  color: #6e7f95;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #d9e3f2;
}

.social-auth {
  padding: 14px 24px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.btn-social {
  border: 1px solid #d5dfef;
  background: #f7fafe;
  color: #1f2f44;
}

.btn-social:hover {
  background: #eef4fd;
}

.btn-social svg {
  width: 16px;
  height: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 27px;
}

.app-container {
  max-width: 1300px;
  margin: 24px auto 0;
  padding: 0 24px 40px;
}

.app-container.hidden {
  display: none;
}

.app-header {
  background: linear-gradient(135deg, #ffffff, #f5f9ff);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-top: 34px;
}

.app-header-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.workspace-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eaf2ff;
  border: 1px solid #c7d9f5;
  color: #224b9b;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.app-grid {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 14px;
}

.app-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  height: fit-content;
  position: sticky;
  top: 92px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-item {
  border: 0;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  color: #33465f;
  padding: 11px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.sidebar-item svg {
  width: 18px;
  height: 18px;
}

.sidebar-item:hover,
.sidebar-item.active {
  background: #edf3ff;
  color: #1747a3;
}

.app-content {
  min-width: 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.generator-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
}

.generator-controls,
.generator-preview,
.library-section,
.analytics-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.generator-controls h2 {
  margin-bottom: 16px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 14px;
  margin-bottom: 12px;
}

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

.type-selector input {
  display: none;
}

.type-label {
  border: 1px solid #c8d6ec;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  background: #fff;
}

.type-selector input:checked + .type-label {
  border-color: #6b94d6;
  box-shadow: 0 0 0 3px rgba(34, 89, 183, 0.12);
}

.type-badge {
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 7px;
}

.type-badge.free {
  color: #0f7e56;
  background: #dff7ec;
}

.type-badge.pro {
  color: #a35404;
  background: #ffefd7;
}

.type-label.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.lock-icon {
  margin-left: 4px;
}

.file-upload {
  border: 1px dashed #9db5d8;
  border-radius: 10px;
  background: #f6faff;
  padding: 18px;
  text-align: center;
  color: #5f7595;
}

.file-upload input {
  display: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.preview-box {
  position: sticky;
  top: 92px;
}

.preview-box h3 {
  margin-bottom: 12px;
}

#qrCanvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #ccd8eb;
  background: #fff;
  margin-bottom: 12px;
}

.preview-info {
  border-radius: 10px;
  background: #f6faff;
  border: 1px solid #d7e1f1;
  padding: 10px;
  margin-bottom: 10px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 2px;
  font-size: 0.84rem;
}

.info-item .label {
  color: #62758d;
  font-weight: 700;
}

.info-item .value {
  color: #223145;
  font-weight: 800;
}

.preview-actions {
  display: grid;
}

.link-box {
  border: 1px solid #d8e2f2;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
}

.link-display {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.link-display a {
  flex: 1;
  background: #fff;
  border: 1px solid #d2def0;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 0.8rem;
  word-break: break-all;
}

/* Geolocation Targeting */
.geo-targeting-panel {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.geo-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.geo-rule-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
}

.geo-rule-flag {
  min-width: 30px;
  text-align: center;
  font-size: 1.2rem;
}

.geo-rule-country {
  min-width: 60px;
  font-weight: 600;
}

.geo-rule-url {
  flex: 1;
  color: var(--brand);
  word-break: break-all;
  font-size: 0.75rem;
}

.geo-rule-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background var(--transition);
}

.geo-rule-remove:hover {
  background: rgba(220, 38, 38, 0.1);
}

.geo-add-rule {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.geo-add-rule select,
.geo-add-rule input {
  flex: 1;
  min-width: 0;
}

.geo-add-rule select {
  flex: 0 0 auto;
  min-width: 150px;
}

.library-section,
.analytics-section {
  min-height: 220px;
  text-align: center;
}

.library-section {
  display: block;
  text-align: left;
}

.library-header {
  margin-bottom: 14px;
}

.my-qr-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.my-qr-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
}

.my-qr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.my-qr-slug {
  font-weight: 800;
  color: #1747a3;
  font-size: 0.9rem;
}

.my-qr-date {
  color: var(--ink-subtle);
  font-size: 0.78rem;
}

.my-qr-link,
.my-qr-target {
  display: block;
  font-size: 0.82rem;
  padding: 8px 10px;
  border: 1px solid #d2def0;
  border-radius: 8px;
  background: #fff;
  word-break: break-all;
  margin-bottom: 8px;
}

.my-qr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.my-qr-actions .btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.text-muted {
  color: var(--ink-subtle);
}

.footer {
  margin-top: 60px;
  background: linear-gradient(180deg, #0f203f, #0b172e);
  color: #fff;
}

.footer-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 46px 24px 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.footer-section h4,
.footer-section h5 {
  color: #fff;
  margin-bottom: 12px;
}

.footer-section p {
  color: #b6c5df;
  font-size: 0.9rem;
}

.footer-section a {
  display: block;
  color: #c1d0e8;
  font-size: 0.88rem;
  margin-bottom: 7px;
}

.footer-section a:hover {
  color: #fff;
}

.social-links {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.social-links a {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(193, 208, 232, 0.4);
  display: grid;
  place-items: center;
  margin-bottom: 0;
}

.newsletter-input {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.newsletter-input input {
  background: #0f2548;
  border-color: #284679;
  color: #eef6ff;
}

.newsletter-input input::placeholder {
  color: #a9bddf;
}

.footer-bottom {
  max-width: 1300px;
  margin: 0 auto;
  padding: 18px 24px 30px;
  border-top: 1px solid rgba(193, 208, 232, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-bottom p {
  color: #c5d3e8;
  font-size: 0.86rem;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-badges .badge {
  background: rgba(214, 229, 255, 0.1);
  border-color: rgba(214, 229, 255, 0.35);
  color: #d8e6ff;
}

.hidden {
  display: none !important;
}

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

  .preview-box {
    position: relative;
    top: auto;
  }

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

  .app-sidebar {
    position: relative;
    top: auto;
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
  }
}

@media (max-width: 920px) {
  .nav-container {
    position: relative;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 14px;
    right: 14px;
    margin-left: 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: var(--shadow-md);
    flex-direction: column;
    gap: 8px;
    z-index: 1200;
    max-height: min(70vh, 360px);
    overflow-y: auto;
  }

  .nav-menu.mobile-open {
    display: flex;
  }

  .nav-menu .nav-link {
    display: block;
    padding: 10px;
    border-radius: 8px;
    border-bottom: none;
  }

  .nav-menu .nav-link:hover {
    background: #edf3ff;
    border-color: transparent;
  }

  .nav-divider {
    display: block;
  }

  .nav-mobile-btn {
    display: flex;
  }

  .hamburger {
    display: flex;
    margin-left: auto;
  }

  .free-qr-grid,
  .hero-stats,
  .upgrade-prompt {
    grid-template-columns: 1fr;
  }

  .signal-bar-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .signal-pill {
    flex: 0 0 auto;
  }

  .signal-bar p {
    flex: 1 1 220px;
    min-width: 0;
  }

  .upgrade-prompt {
    padding: 18px;
  }

  .upgrade-copy,
  .upgrade-actions {
    min-width: 0;
  }

  .free-qr-grid,
  .app-grid,
  .generator-grid {
    gap: 12px;
  }

  .app-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar-nav {
    gap: 8px;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .sidebar-item {
    min-height: 42px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

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

@media (max-width: 640px) {
  .nav-container,
  .signal-bar,
  .app-container,
  .free-qr-section,
  .footer-content,
  .footer-bottom {
    padding-left: 14px;
    padding-right: 14px;
  }

  .nav-container {
    height: 66px;
  }

  .nav-features {
    display: none;
  }

  .app-container {
    margin-top: 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 251, 255, 0.96));
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 14px 14px 24px;
  }

  .free-qr-section {
    padding-top: 22px;
    padding-bottom: 42px;
  }

  .free-qr-controls,
  .free-qr-preview,
  .generator-controls,
  .generator-preview,
  .library-section,
  .analytics-section,
  .app-header {
    padding: 14px;
    border-radius: 14px;
  }

  .form-section,
  .link-box,
  .preview-info {
    padding: 10px;
  }

  .app-content,
  .generator-controls,
  .generator-preview,
  .form-section,
  .link-box,
  .preview-box {
    min-width: 0;
  }

  .form-group {
    margin-bottom: 12px;
  }

  #dynamicGroup,
  #dynamicGroup .form-row,
  #dynamicGroup .form-group,
  #dynamicGroup .checkbox-label,
  #dynamicGroup .link-box,
  #dynamicGroup .link-display {
    min-width: 0;
    max-width: 100%;
  }

  #dynamicGroup .checkbox-label {
    margin-top: 0;
    align-items: center;
    width: 100%;
    overflow-wrap: anywhere;
  }

  #dynamicGroup input,
  #dynamicGroup select,
  #dynamicGroup textarea,
  #dynamicGroup button,
  #dynamicGroup a {
    max-width: 100%;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  select,
  textarea {
    padding: 10px 11px;
    font-size: 0.9rem;
  }

  .btn {
    min-height: 42px;
  }

  .btn-sm {
    min-height: 34px;
  }

  .app-grid,
  .generator-grid,
  .free-qr-grid {
    gap: 10px;
  }

  .type-label {
    min-width: 0;
    overflow-wrap: anywhere;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .link-display {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .link-display a {
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .preview-actions,
  .form-actions,
  .upgrade-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .preview-actions .btn,
  .form-actions .btn,
  .upgrade-actions .btn {
    width: 100%;
  }

  .my-qr-item {
    padding: 10px;
  }

  .my-qr-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .nav-auth {
    display: none;
  }

  .nav-user {
    display: none;
  }

  .nav-user:not(.hidden) {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }

  .nav-user:not(.hidden) .user-email {
    max-width: 120px;
    padding: 5px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-user:not(.hidden) .btn {
    font-size: 0.75rem;
    padding: 6px 10px;
    min-height: 34px;
    white-space: nowrap;
  }

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

  .form-row,
  .type-selector,
  .button-group,
  .upgrade-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .footer {
    margin-top: 36px;
  }

  .footer-content {
    padding-top: 30px;
  }

  .footer-bottom {
    padding-top: 14px;
    padding-bottom: 22px;
  }
}

@media (max-width: 420px) {
  .nav-container,
  .signal-bar,
  .app-container,
  .free-qr-section,
  .footer-content,
  .footer-bottom {
    padding-left: 10px;
    padding-right: 10px;
  }

  .nav-features {
    display: none;
  }

  .nav-mobile-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
  }

  .nav-mobile-btn svg {
    width: 16px;
    height: 16px;
  }

  .app-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 255, 0.98));
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 12px 12px 20px;
    margin: 16px auto 0;
  }

  .app-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .app-sidebar {
    display: none;
  }

  .sidebar-nav {
    display: none;
  }

  .app-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 255, 0.95));
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
    box-shadow: var(--shadow-sm);
  }

  .generator-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .generator-controls,
  .generator-preview {
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }

  .generator-controls h2 {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .nav-menu {
    left: 10px;
    right: 10px;
  }

  .nav-user:not(.hidden) {
    gap: 4px;
  }

  .nav-user:not(.hidden) .user-email {
    max-width: 80px;
    padding: 4px 6px;
    font-size: 0.7rem;
  }

  .nav-user:not(.hidden) .btn {
    font-size: 0.7rem;
    padding: 4px 8px;
    min-height: 30px;
  }

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

  .type-label {
    padding: 10px;
    font-size: 0.8rem;
    gap: 5px;
    border-radius: 10px;
  }

  .type-badge {
    font-size: 0.6rem;
    padding: 3px 5px;
  }

  .form-section {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
  }

  .form-group {
    margin-bottom: 8px;
  }

  .form-group label {
    font-size: 0.8rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  select,
  textarea {
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
  }

  .btn {
    border-radius: 10px;
    font-size: 0.85rem;
    padding: 8px 12px;
    min-height: 36px;
  }

  .status-message {
    font-size: 0.8rem;
    min-height: 34px;
    padding: 8px;
  }

  .signal-bar-inner {
    padding: 10px;
    gap: 10px;
  }

  .signal-pill {
    font-size: 0.66rem;
    padding: 5px 8px;
  }

  .preview-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 12px;
  }

  .preview-box h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
  }

  .preview-info {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid var(--line);
  }

  #dynamicGroup .form-row {
    gap: 10px;
  }

  #dynamicGroup .link-box {
    padding: 8px;
  }

  .geo-add-rule {
    flex-direction: column;
  }

  .geo-add-rule select {
    min-width: auto;
  }

  .geo-rule-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  .geo-rule-url {
    flex: 1 1 100%;
    order: 4;
  }

  .geo-rule-remove {
    order: 5;
    margin-left: auto;
  }
}

@media (max-width: 360px) {
  .nav-mobile-btn {
    padding: 6px 8px;
    font-size: 0.7rem;
    border-radius: 5px;
  }

  .nav-mobile-btn svg {
    width: 15px;
    height: 15px;
  }

  .app-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 255, 0.98));
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 10px 10px 16px;
    margin: 14px auto 0;
  }

  .app-header {
    border-radius: 10px;
    padding: 10px;
  }

  .generator-controls,
  .generator-preview {
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
  }

  .generator-controls h2 {
    font-size: 0.95rem;
  }

  .type-label {
    padding: 8px;
    font-size: 0.75rem;
    border-radius: 8px;
  }

  .type-badge {
    font-size: 0.55rem;
    padding: 2px 4px;
  }

  .form-section {
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
  }

  .form-group {
    margin-bottom: 6px;
  }

  .form-group label {
    font-size: 0.75rem;
    margin-bottom: 3px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  select,
  textarea {
    font-size: 0.85rem;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--line);
  }

  .btn {
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 8px;
  }

  .preview-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 8px;
  }

  .preview-box h3 {
    font-size: 0.95rem;
  }

  .preview-info {
    padding: 8px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--line);
  }

  .info-item {
    gap: 4px;
  }

  .info-item .label {
    font-size: 0.7rem;
  }

  .info-item .value {
    font-size: 0.8rem;
  }
}


