:root {
  --license-pink: #ff2d78;
  --license-pink-dark: #d91f62;
  --license-pink-soft: #fff0f5;
  --license-ink: #1c1c1e;
  --license-muted: #8e8e93;
  --license-line: #e5e5ea;
  --license-system-bg: #f2f2f7;
  --ink: #1c1c1e;
  --muted: #8e8e93;
  --line: #e5e5ea;
  --soft: #f2f2f7;
  --panel: #fff;
  --accent: #ff2d78;
  --accent-dark: #d91f62;
  --blue: #007aff;
  --danger: #ff3b30;
  --shadow: 0 -8px 28px rgba(0, 0, 0, 0.08);
}

body {
  background: var(--license-system-bg);
}

body.license-pending {
  overflow: hidden;
}

.license-pending #app {
  visibility: hidden;
}

.license-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  background: var(--license-system-bg);
}

.license-gate[hidden],
.license-status[hidden],
.license-logout[hidden] {
  display: none;
}

.license-panel {
  width: min(100%, 382px);
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.account-gate-panel {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: none;
}

.account-gate-panel::-webkit-scrollbar {
  display: none;
}

.account-gate-panel .license-brand {
  margin-bottom: 22px;
}

.gate-auth-mode {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 10px;
  background: #e9e9ee;
}

.gate-auth-mode button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  color: var(--license-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.gate-auth-mode button.active {
  color: var(--license-ink);
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.license-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 38px;
  text-align: center;
}

.license-mark,
.license-status-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--license-pink);
}

.license-mark {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 8px;
  box-shadow: 0 9px 24px rgba(255, 45, 120, 0.2);
}

.license-mark svg {
  width: 30px;
  height: 30px;
}

.license-brand h1 {
  margin: 0;
  color: var(--license-ink);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.license-brand p {
  margin: 5px 0 0;
  color: var(--license-muted);
  font-size: 13px;
}

.license-label {
  display: block;
  margin: 0 0 8px 4px;
  color: #636366;
  font-size: 12px;
  font-weight: 600;
}

.license-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.license-input-wrap > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--license-pink);
  transform: translateY(-50%);
  pointer-events: none;
}

.account-gate-panel .license-input-wrap input {
  width: 100%;
  height: 54px;
  box-sizing: border-box;
  padding: 0 14px 0 43px;
  border: 1px solid rgba(60, 60, 67, 0.12) !important;
  border-radius: 8px;
  outline: none;
  color: var(--license-ink);
  background: #fff !important;
  font-size: 16px;
  letter-spacing: 0;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.account-gate-panel .license-input-wrap input::placeholder {
  color: #aeaeb2;
}

.account-gate-panel .license-input-wrap input:focus {
  border-color: var(--license-pink) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(255, 45, 120, 0.12) !important;
}

.gate-card-field.hidden,
.gate-credentials.hidden {
  display: none;
}

.gate-card-hint {
  margin: -5px 4px 12px;
  color: var(--license-muted);
  font-size: 11px;
  line-height: 1.55;
}

.license-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--license-pink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s, transform 0.1s;
}

.license-submit:hover {
  background: var(--license-pink-dark);
}

.license-submit:active {
  transform: scale(0.99);
}

.license-submit:disabled {
  cursor: wait;
  opacity: 0.55;
}

.license-submit svg {
  width: 18px;
  height: 18px;
}

.license-message {
  min-height: 20px;
  margin: 13px 4px 0;
  color: var(--license-muted);
  font-size: 13px;
  line-height: 1.5;
}

.license-message.success {
  color: #248a3d;
}

.license-status {
  position: sticky;
  inset: 0 0 auto;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: max(7px, env(safe-area-inset-top)) 58px 7px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.15);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.04);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.license-status-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  color: #fff;
  background: #34c759;
}

.license-status-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.license-status-expiry {
  display: flex;
  align-items: center;
  gap: 9px;
}

.license-status strong {
  color: var(--license-ink);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0;
}

.license-status small {
  color: var(--license-muted);
  font-size: 10px;
  line-height: 1.2;
}

.license-status-fields {
  display: flex;
  align-items: center;
  gap: 15px;
  white-space: nowrap;
}

.license-status-fields > span {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.license-status-fields strong {
  color: var(--license-pink-dark);
  font-variant-numeric: tabular-nums;
}

.license-logout {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: 12px;
  z-index: 9000;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  color: var(--license-pink-dark);
  background: var(--license-pink-soft);
  cursor: pointer;
}

.license-logout svg {
  width: 18px;
  height: 18px;
}

.license-active #app {
  height: calc(100% - 54px);
  margin-top: 0;
}

/* iOS-style map workspace. */
.app {
  grid-template-columns: minmax(0, 1fr) 420px !important;
}

.map-wrap {
  border-right: 0 !important;
}

.map {
  background: #e5e5ea;
}

.panel {
  border-left: 1px solid rgba(60, 60, 67, 0.16) !important;
  background: #fff !important;
}

.panel-inner {
  padding: 22px 22px 32px !important;
}

.brand {
  padding-bottom: 20px !important;
}

.logo {
  width: 42px !important;
  height: 42px !important;
  border-radius: 8px !important;
  background: var(--license-pink) !important;
  box-shadow: none !important;
}

.brand h1 {
  color: var(--license-ink);
  font-size: 20px !important;
}

.brand p,
.eyebrow,
.field-name,
label {
  color: var(--license-muted) !important;
}

.secure {
  color: #248a3d !important;
}

.section {
  padding: 20px 0 !important;
  border-top-color: var(--license-line) !important;
}

.section-title h2 {
  color: var(--license-ink);
  font-size: 14px !important;
}

input {
  border-color: transparent !important;
  border-radius: 8px !important;
  background: var(--license-system-bg) !important;
}

input:focus {
  border-color: var(--license-pink) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(255, 45, 120, 0.1) !important;
}

.btn,
.icon-btn,
.search-result,
.favorite-delete {
  border-radius: 8px !important;
}

.btn.primary,
.icon-btn.primary {
  background: var(--license-pink) !important;
}

.btn.primary:hover,
.icon-btn.primary:hover {
  background: var(--license-pink-dark) !important;
}

.btn.secondary {
  border-color: transparent !important;
  background: var(--license-system-bg) !important;
}

.location-readout {
  padding: 13px !important;
  border-color: transparent !important;
  border-radius: 8px !important;
  background: var(--license-system-bg) !important;
}

.location-icon,
.favorite-pin {
  border-radius: 8px !important;
  color: var(--blue) !important;
  background: #eaf3ff !important;
}

.favorite-item,
.favorite-empty {
  border-color: var(--license-line) !important;
  border-radius: 8px !important;
}

.favorite-delete {
  color: var(--danger) !important;
  background: #fff1f0 !important;
}

.search-box,
.search-results {
  border-color: rgba(60, 60, 67, 0.14) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}

.search-box {
  background: rgba(255, 255, 255, 0.94) !important;
}

.map-status,
.map-tip {
  border-color: rgba(60, 60, 67, 0.12) !important;
  color: var(--license-ink) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08) !important;
}

.map-status::before {
  background: #34c759 !important;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.14) !important;
}

.map-tip svg,
.support-link {
  color: var(--blue) !important;
}

.step.active .step-no {
  color: var(--license-pink-dark) !important;
  background: var(--license-pink-soft) !important;
}

.step:not(.active) .step-no {
  color: #636366 !important;
  background: var(--license-system-bg) !important;
}

.notice {
  border-radius: 8px !important;
  background: rgba(28, 28, 30, 0.94) !important;
}

@media (max-width: 820px) {
  .license-status {
    padding-left: 56px;
    padding-right: 56px;
  }

  .license-active #app {
    height: auto;
    min-height: calc(100% - 54px);
  }

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

  .map-wrap {
    position: relative !important;
    top: auto !important;
  }

  .panel {
    border-left: 0 !important;
    border-top: 1px solid var(--license-line) !important;
    border-radius: 8px 8px 0 0 !important;
  }

  .panel-inner {
    padding: 18px 17px 32px !important;
  }
}

@media (max-width: 480px) {
  .license-gate {
    padding-left: 14px;
    padding-right: 14px;
  }

  .license-panel {
    width: 100%;
    padding: 20px 21px;
  }

  .license-brand {
    margin-bottom: 20px;
  }

  .license-status {
    min-height: 54px;
    justify-content: flex-start;
    padding: max(7px, env(safe-area-inset-top)) 52px 7px 12px;
    padding-right: 52px;
  }

  .license-status-icon {
    display: none;
  }

  .license-logout {
    top: max(8px, env(safe-area-inset-top));
  }

  .license-status-fields {
    display: flex;
    gap: 7px;
  }

  .license-status-fields strong,
  .license-status-fields small {
    font-size: 11px;
  }

  .license-active #app {
    min-height: calc(100% - 54px);
    margin-top: 0;
  }

  .map-wrap {
    position: relative !important;
    top: auto !important;
  }
}

@media (max-width: 360px) {
  .license-status-fields {
    gap: 4px;
  }

  .license-status-fields strong,
  .license-status-fields small {
    font-size: 10px;
  }
}
