/* ==========================================================================
   Generator page
   ========================================================================== */

/* Hero ------------------------------------------------------------------ */

.hero {
  padding: clamp(36px, 5vw, 64px) 0 clamp(24px, 3.5vw, 38px);
  text-align: center;
}

.hero h1 {
  max-width: 820px;
  margin: 0 auto 12px;
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.hero-lead {
  max-width: 600px;
  margin-inline: auto;
  color: var(--muted);
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.7;
}

/* Workspace ------------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.form-panel .panel-head {
  margin-bottom: 26px;
}

@media (min-width: 981px) {
  .form-panel,
  .preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .form-panel form {
    display: flex;
    flex: 1;
    flex-direction: column;
  }

  .form-panel .form-foot {
    margin-top: auto;
  }

  .preview-panel .tag-stage {
    flex: 1;
  }
}

.preview-panel {
  position: sticky;
  top: calc(88px + env(safe-area-inset-top));
}

.workspace-actions {
  width: min(760px, 100%);
  margin: 18px auto 0;
}

.workspace-actions .preview-actions {
  margin-top: 0;
}

.apply-tip {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
}

.form-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.privacy-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.privacy-line svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--success);
}

.input-wrap.has-country input {
  padding-left: 94px;
}

.input-wrap.has-country.has-dial input {
  padding-left: 126px;
}

.country-trigger {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 9px 0 13px;
  border-right: 1px solid var(--border);
  border-radius: 13px 0 0 13px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.country-trigger:hover {
  background: var(--surface-2);
  color: var(--text);
}

.country-trigger:active {
  background: var(--surface-3);
}

.country-trigger:focus-visible {
  outline-offset: -3px;
  border-radius: 13px 0 0 13px;
}

.country-trigger .country-iso {
  display: grid;
  place-items: center;
  min-width: 29px;
  height: 23px;
  padding: 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.country-trigger .country-dial {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.country-chevron {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.phone-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--brand);
  font-size: 12px;
  line-height: 1.5;
}

.phone-preview svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.phone-preview span {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Swatches -------------------------------------------------------------- */

.preview-head {
  margin-bottom: 18px;
}

.preview-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

.lang-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.lang-select:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.lang-select:focus-within {
  border-color: color-mix(in srgb, var(--brand) 62%, transparent);
  box-shadow: 0 0 0 3px var(--ring);
}

.lang-globe {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.lang-select select {
  max-width: 132px;
  height: 42px;
  padding: 0 18px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.lang-select select option {
  background: var(--surface-strong);
  color: var(--text);
}

.lang-chevron {
  position: absolute;
  right: 7px;
  width: 12px;
  height: 12px;
  color: var(--muted);
  pointer-events: none;
}

.swatches {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-top: 0;
}

.swatch {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
}

.swatch::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 0 1px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.swatch[data-accent="ink"] {
  --sw: #0f172a;
}

.swatch[data-accent="ocean"] {
  --sw: #1d4ed8;
}

.swatch[data-accent="violet"] {
  --sw: #6d28d9;
}

.swatch[data-accent="forest"] {
  --sw: #047857;
}

.swatch[data-accent="rose"] {
  --sw: #be123c;
}

.swatch:hover::before {
  transform: scale(1.12);
}

.swatch:active::before {
  transform: scale(0.94);
}

.swatch[aria-pressed="true"]::before {
  transform: scale(1.04);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 2px var(--surface-strong),
    0 0 0 4px var(--sw);
}

/* Tag preview ----------------------------------------------------------- */

.tag-stage {
  --tag-accent: #1d4ed8;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 426px;
  padding: clamp(18px, 3vw, 30px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(160deg, #f9fbff 0%, #eef2fb 100%);
  background:
    radial-gradient(120% 100% at 15% 0%, color-mix(in srgb, var(--tag-accent) 16%, transparent), transparent 58%),
    linear-gradient(160deg, #f9fbff 0%, #eef2fb 100%);
}

.tag-stage[data-accent="ink"] {
  --tag-accent: #0f172a;
}

.tag-stage[data-accent="ocean"] {
  --tag-accent: #1d4ed8;
}

.tag-stage[data-accent="violet"] {
  --tag-accent: #6d28d9;
}

.tag-stage[data-accent="forest"] {
  --tag-accent: #047857;
}

.tag-stage[data-accent="rose"] {
  --tag-accent: #be123c;
}

.tag-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.14) 1px, transparent 0);
  background-size: 16px 16px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%);
  pointer-events: none;
}

[data-theme="dark"] .tag-stage {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, #0e1626 0%, #0a1020 100%);
  background:
    radial-gradient(120% 100% at 15% 0%, color-mix(in srgb, var(--tag-accent) 28%, transparent), transparent 58%),
    linear-gradient(160deg, #0e1626 0%, #0a1020 100%);
}

[data-theme="dark"] .tag-stage::before {
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.16) 1px, transparent 0);
  opacity: 0.4;
}

.tag-stage-glow {
  position: absolute;
  top: -60px;
  right: -50px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: var(--tag-accent);
  filter: blur(100px);
  opacity: 0.14;
  pointer-events: none;
}

.tag-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 326px;
  padding: 18px;
  border: 1px solid #edf1f7;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 54px -30px rgba(15, 23, 42, 0.45), 0 4px 14px -6px rgba(15, 23, 42, 0.1);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.tag-card.is-just-ready {
  animation: tag-pop 0.5s var(--ease);
}

@keyframes tag-pop {
  0% {
    transform: scale(0.985);
  }
  55% {
    transform: scale(1.004);
  }
  100% {
    transform: scale(1);
  }
}

@media (hover: hover) and (pointer: fine) {
  .tag-card:hover {
    transform: translateY(-3px) rotate(-0.25deg);
    box-shadow: 0 34px 64px -32px rgba(15, 23, 42, 0.5), 0 6px 18px -8px rgba(15, 23, 42, 0.12);
  }
}

.tag-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  background: color-mix(in srgb, var(--tag-accent) 9%, #fff);
  color: var(--tag-accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tag-chip svg {
  width: 11px;
  height: 11px;
}

.tag-brand {
  color: #8b96a8;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.qr-frame {
  position: relative;
  width: 100%;
  max-width: 252px;
  aspect-ratio: 1;
  margin: 15px auto 14px;
  padding: 9px;
  border: 1px solid #edf1f7;
  border-radius: 17px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #f8fafc;
}

.qr-frame::before,
.qr-frame::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--tag-accent);
  border-color: color-mix(in srgb, var(--tag-accent) 55%, #fff);
  border-radius: 5px;
  pointer-events: none;
}

.qr-frame::before {
  top: -4px;
  left: -4px;
  border-right: 0;
  border-bottom: 0;
}

.qr-frame::after {
  right: -4px;
  bottom: -4px;
  border-top: 0;
  border-left: 0;
}

#qrCanvas {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.tag-card.is-ready #qrCanvas {
  opacity: 1;
}

.qr-empty {
  position: absolute;
  inset: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1.5px dashed #dbe3ef;
  border-radius: 10px;
  background: #fbfcfe;
  text-align: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tag-card.is-ready .qr-empty {
  visibility: hidden;
  opacity: 0;
}

.qr-empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 5px;
  border-radius: 13px;
  background: #eef4ff;
  background: color-mix(in srgb, var(--tag-accent) 8%, #fff);
  color: color-mix(in srgb, var(--tag-accent) 72%, #fff);
}

.qr-empty-icon svg {
  width: 21px;
  height: 21px;
}

.qr-empty strong {
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

.qr-empty span:last-child {
  color: #64748b;
  font-size: 10.5px;
}

.tag-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.plate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  max-width: 100%;
  padding: 4px 13px 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 100%);
  box-shadow: 0 8px 18px -10px rgba(30, 64, 175, 0.75), inset 0 0 0 1px rgba(15, 23, 42, 0.12);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  line-height: 1.35;
  white-space: nowrap;
}

.plate-badge.is-placeholder {
  border-color: #fff;
  background: #f1f5f9;
  box-shadow: none;
  color: #5f6b7f;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.tag-owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 550;
}

.owner-avatar {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--tag-accent);
  background: linear-gradient(135deg, var(--tag-accent), color-mix(in srgb, var(--tag-accent) 55%, #0f172a));
  color: #fff;
  font-size: 8.5px;
  font-weight: 700;
}

.tag-note {
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 9px;
  border-radius: 7px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
  overflow-wrap: anywhere;
}

.tag-scan {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag-scan svg {
  width: 11px;
  height: 11px;
  color: var(--tag-accent);
}

.tag-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding-top: 9px;
  border-top: 1px dashed #e8edf5;
  color: #64748b;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.tag-footer-brand {
  color: #8b96a8;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.preview-note {
  max-width: 330px;
  margin: 11px auto 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
  text-align: center;
}

/* International plate badge --------------------------------------------- */

.plate-badge {
  overflow: hidden;
}

.plate-badge .plate-cc {
  display: none;
}

.plate-badge.is-intl {
  gap: 9px;
  padding-left: 0;
  background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
  box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.plate-badge.is-intl .plate-cc {
  display: inline-flex;
  align-self: stretch;
  align-items: center;
  padding: 0 7px;
  background: #1d4ed8;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.plate-badge.is-intl .plate-text {
  padding: 0 10px;
}

.plate-badge.is-long {
  font-size: 17px;
  letter-spacing: 0.05em;
}

.plate-badge.is-intl.is-long {
  font-size: 15px;
}

/* Country picker -------------------------------------------------------- */

body.has-dialog {
  overflow: hidden;
}

.country-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(760px, 84svh);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.country-dialog::backdrop {
  background: rgba(2, 6, 23, 0.54);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.country-dialog[open] {
  animation: country-in 0.26s var(--ease);
}

@keyframes country-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.country-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}

.country-dialog-kicker {
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.country-dialog h2 {
  margin-top: 3px;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.country-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.country-close:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.country-close svg {
  width: 17px;
  height: 17px;
}

.country-search {
  position: relative;
  margin: 16px 20px 0;
}

.country-search input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  outline: 0;
  background: var(--surface-3);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.country-search input:focus {
  border-color: color-mix(in srgb, var(--brand) 62%, transparent);
  background: var(--surface-strong);
  box-shadow: 0 0 0 4px var(--ring);
}

.country-search input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.country-search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.country-result {
  min-height: 17px;
  margin: 8px 22px 0;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.country-list {
  max-height: calc(84svh - 190px);
  padding: 2px 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.country-group-label {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 8px 6px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.country-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 8px;
  border-radius: 12px;
  text-align: left;
  transition: background-color 0.16s ease;
}

.country-row:hover {
  background: var(--surface-2);
}

.country-row:active {
  background: var(--surface-3);
}

.country-row[aria-selected="true"] {
  background: color-mix(in srgb, var(--brand) 7%, transparent);
}

.country-row[aria-selected="true"] .country-check {
  opacity: 1;
}

.country-row .country-iso {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.country-name {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.country-name strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-name small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-row .country-dial {
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.country-check {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--brand);
  opacity: 0;
}

.country-check svg {
  width: 16px;
  height: 16px;
}

.country-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 34px 24px 42px;
  text-align: center;
}

.country-empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 5px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--muted);
}

.country-empty-icon svg {
  width: 20px;
  height: 20px;
}

.country-empty strong {
  font-size: 14px;
}

.country-empty span:last-child {
  color: var(--muted);
  font-size: 12px;
}

/* Preview actions ------------------------------------------------------- */

.preview-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  margin-top: 0;
}

.preview-actions .btn {
  min-height: 50px;
}

.btn-icon-only {
  width: 50px;
  padding: 0;
}

.sub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 7px;
}

.preview-panel.is-highlight {
  animation: preview-highlight 0.9s var(--ease);
}

@keyframes preview-highlight {
  0% {
    outline: 0 solid color-mix(in srgb, var(--brand) 38%, transparent);
    outline-offset: 2px;
  }
  45% {
    outline: 4px solid color-mix(in srgb, var(--brand) 38%, transparent);
    outline-offset: 2px;
  }
  100% {
    outline: 4px solid transparent;
    outline-offset: 2px;
  }
}

/* Recent ---------------------------------------------------------------- */

.recent-section {
  padding-top: 8px;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.recent-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 9px 9px 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease);
}

.recent-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.recent-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.recent-plate {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.recent-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-del {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.recent-del:hover {
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  color: var(--danger);
}

.recent-del svg {
  width: 15px;
  height: 15px;
}

/* Mobile dock ----------------------------------------------------------- */

.mobile-bar {
  position: fixed;
  z-index: 70;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: calc(12px + env(safe-area-inset-left));
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 9px 9px 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-strong);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
}

.mobile-bar.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mobile-bar-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.mobile-bar-info strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-bar-info span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.mobile-bar .btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 12.5px;
}

/* ==========================================================================
   Print
   ========================================================================== */

.print-sheet {
  display: none;
}

.print-tip {
  display: none;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  html,
  body {
    background: #fff !important;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page-bg,
  .site-header,
  main,
  .site-footer,
  .mobile-bar,
  .toast-region,
  .offline-banner,
  .skip-link,
  .noscript-card {
    display: none !important;
  }

  .print-sheet {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 4mm;
  }

  .print-poster {
    display: block;
    width: 130mm;
    height: auto;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-tip {
    display: block;
    flex: 0 0 100%;
    margin: 1mm 0 0;
    color: #64748b;
    font-size: 2.6mm;
    letter-spacing: 0.03em;
    text-align: center;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

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

  .preview-panel {
    position: static;
  }

  .tag-stage {
    min-height: 0;
  }

  .tag-card {
    max-width: 350px;
  }
}

@media (max-width: 920px) {
  html {
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body.has-mobile-bar .toast-region {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 920px) and (min-width: 761px) {
  .mobile-bar {
    display: flex;
  }

  body.has-mobile-bar {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
}



@media (max-width: 760px) {
  .mobile-bar {
    display: flex;
  }

  body.has-mobile-bar {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .panel {
    border-radius: 24px;
  }

  .tag-stage {
    border-radius: 20px;
  }

  .preview-actions .btn {
    min-height: 48px;
  }

}

@media (max-width: 360px) {
  .form-panel .panel-head .pill {
    display: none;
  }
}

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

  .sub-actions {
    gap: 8px;
  }

  .sub-actions .btn-quiet {
    padding: 0 10px;
    font-size: 12px;
  }

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

  .preview-actions .btn-primary {
    grid-column: 1 / -1;
  }

  .btn-icon-only {
    width: auto;
  }

  .sub-actions {
    gap: 0;
  }

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

  .form-panel .panel-head,
  .preview-head {
    gap: 10px;
  }

  .preview-head {
    flex-wrap: wrap;
  }

  .swatches {
    padding-top: 0;
  }
}

@media (max-width: 560px) {
  .country-dialog {
    width: 100%;
    max-width: none;
    max-height: 88svh;
    margin: auto 0 0;
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
  }

  .country-list {
    max-height: calc(88svh - 190px);
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  .input-wrap.has-country input {
    padding-left: 88px;
  }

  .input-wrap.has-country.has-dial input {
    padding-left: 118px;
  }

  .country-trigger {
    gap: 5px;
    padding-left: 10px;
  }

  .country-trigger .country-iso {
    min-width: 27px;
  }

  .preview-controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .lang-select select {
    max-width: 118px;
  }
}

/* ==========================================================================
   Fallbacks
   ========================================================================== */

.noscript-card {
  position: fixed;
  z-index: 200;
  bottom: 20px;
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--danger);
  box-shadow: var(--shadow-lg);
  color: #fff;
  font-size: 13px;
  transform: translateX(-50%);
}

/* RTL output preview and print ------------------------------------------ */

#tagCard[dir="rtl"] .tag-chip,
#tagCard[dir="rtl"] .tag-scan,
#tagCard[dir="rtl"] .tag-footer,
#tagCard[dir="rtl"] .plate-badge {
  letter-spacing: 0;
}

#tagCard[dir="rtl"] .tag-note {
  text-align: right;
}

[dir="rtl"] .print-tip {
  letter-spacing: 0;
}
