.passport-app-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(30, 169, 255, 0.12), transparent 30rem),
    radial-gradient(circle at 90% 12%, rgba(141, 227, 79, 0.09), transparent 28rem),
    #05080a;
}

.passport-app-page [hidden] {
  display: none !important;
}

.passport-app-header {
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.passport-app-header .nav-tabs a[aria-current="page"] {
  color: var(--ink);
  background: var(--green);
}

.app-header-action,
.button-primary,
.button-secondary,
.button-quiet,
.text-button,
.back-button,
.app-login button,
.quick-action {
  font: inherit;
}

.app-header-action {
  min-height: 42px;
  padding: 0 18px;
  color: var(--ink);
  background: var(--green);
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.passport-app-main {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 132px 0 120px;
}

.app-auth-gate {
  min-height: calc(100vh - 252px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.7fr);
  align-items: center;
  gap: clamp(44px, 8vw, 104px);
}

.app-auth-copy h1 {
  max-width: 780px;
  margin: 18px 0 22px;
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.app-auth-copy > p:not(.app-eyebrow) {
  max-width: 660px;
  margin: 0;
  color: #aab4b0;
  font-size: clamp(1rem, 1.7vw, 1.24rem);
  line-height: 1.65;
}

.app-eyebrow,
.app-card-kicker {
  margin: 0;
  color: #b7c4bf;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.app-eyebrow span {
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.app-auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.app-auth-points span {
  padding: 9px 13px;
  color: #cfdbd6;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.app-login {
  padding: clamp(26px, 4vw, 42px);
  background:
    linear-gradient(145deg, rgba(11, 34, 42, 0.96), rgba(4, 13, 17, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
}

.app-login-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
}

.app-login-mark img {
  width: 38px;
}

.app-login > p:first-of-type {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-login h2 {
  margin: 0 0 26px;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: 0;
}

.app-login label,
.manual-lookup label,
.app-field-grid label,
.app-textarea-field {
  display: grid;
  gap: 8px;
  color: #dce4e0;
  font-size: 0.82rem;
  font-weight: 750;
}

.app-login input,
.manual-lookup input,
.passport-search input,
.app-field-grid input,
.app-field-grid select,
.app-textarea-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(2, 8, 11, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  outline: none;
  font: inherit;
}

.app-login input:focus,
.manual-lookup input:focus,
.passport-search input:focus,
.app-field-grid input:focus,
.app-field-grid select:focus,
.app-textarea-field textarea:focus {
  border-color: rgba(30, 169, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(30, 169, 255, 0.13);
}

.app-login button {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  color: var(--ink);
  background: var(--green);
  border: 0;
  border-radius: 13px;
  font-weight: 850;
  cursor: pointer;
}

.app-login small {
  display: block;
  margin-top: 15px;
  color: var(--muted);
  line-height: 1.5;
}

.app-form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #ffb9ad;
  font-size: 0.84rem;
}

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

.app-topbar h1 {
  margin: 10px 0 0;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.app-topbar-actions,
.form-actions,
.scanner-actions,
.passport-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button-primary,
.button-secondary,
.button-quiet,
.back-button,
.text-button {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  color: var(--ink);
  background: var(--green);
  border: 1px solid var(--green);
}

.button-primary:hover {
  background: #a1ed6b;
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.button-quiet,
.back-button,
.text-button {
  color: #b7c5bf;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.text-button {
  min-height: 38px;
  border: 0;
}

button:disabled {
  opacity: 0.52;
  cursor: wait;
}

.data-mode-banner {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 10px 14px;
  color: #c8d3ce;
  background: rgba(30, 169, 255, 0.08);
  border: 1px solid rgba(30, 169, 255, 0.23);
  border-radius: 14px;
  font-size: 0.82rem;
}

.data-mode-banner::before {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(30, 169, 255, 0.7);
  content: "";
}

.data-mode-banner.is-demo {
  background: rgba(245, 200, 75, 0.08);
  border-color: rgba(245, 200, 75, 0.25);
}

.data-mode-banner.is-demo::before {
  background: var(--yellow);
  box-shadow: 0 0 14px rgba(245, 200, 75, 0.6);
}

.app-global-message {
  min-height: 0;
  margin: -12px 0 22px;
  color: #cdd8d3;
}

.app-global-message:empty {
  display: none;
}

.app-view[hidden] {
  display: none;
}

.app-hero-card {
  min-height: 330px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 18%, rgba(141, 227, 79, 0.2), transparent 16rem),
    radial-gradient(circle at 68% 120%, rgba(30, 169, 255, 0.22), transparent 24rem),
    linear-gradient(135deg, rgba(8, 32, 39, 0.96), rgba(3, 12, 16, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30px;
}

.app-hero-card h2 {
  max-width: 720px;
  margin: 13px 0 16px;
  font-size: clamp(2.15rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.app-hero-card p:last-child {
  max-width: 610px;
  margin: 0;
  color: #a6b3ad;
  line-height: 1.6;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 38px;
}

.quick-action {
  min-height: 104px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 16px;
  color: var(--text);
  text-align: left;
  background: rgba(8, 23, 29, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
  cursor: pointer;
}

.quick-action:hover {
  border-color: rgba(141, 227, 79, 0.45);
  transform: translateY(-2px);
}

.quick-action strong {
  align-self: end;
  font-size: 0.93rem;
}

.quick-action small {
  align-self: start;
  color: var(--muted);
  font-weight: 500;
}

.quick-icon,
.mobile-nav-icon {
  position: relative;
  display: inline-block;
}

.quick-icon {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  background: rgba(141, 227, 79, 0.11);
  border: 1px solid rgba(141, 227, 79, 0.2);
  border-radius: 12px;
}

.account-tab-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex: 1 0 max-content;
  padding: 0 15px;
  color: #53645d;
  border-radius: 13px;
  font-size: 0.8rem;
  font-weight: 800;
}

.account-tab-link:hover {
  color: #173a20;
  background: #f0f8ed;
}

.passport-workspace-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
  padding: 20px 22px;
  background: #f8fbf7;
  border: 1px solid var(--mv-border);
  border-radius: 16px;
}

.passport-workspace-intro h3 {
  margin: 7px 0 6px;
  color: var(--mv-ink);
  font-size: 1.1rem;
}

.passport-workspace-intro p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--mv-muted);
  line-height: 1.5;
}

.passport-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.passport-workspace-status {
  flex: 0 0 auto;
  padding: 9px 12px;
  color: #b9f18f;
  background: rgba(141, 227, 79, 0.08);
  border: 1px solid rgba(141, 227, 79, 0.26);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.scan-icon::before,
.scan-icon::after {
  position: absolute;
  inset: 11px;
  border: 2px solid currentColor;
  content: "";
}

.scan-icon::after {
  inset: 18px 8px;
  border-width: 2px 0 0;
}

.add-icon::before,
.add-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
  content: "";
}

.add-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.list-icon::before {
  position: absolute;
  inset: 12px 10px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  box-shadow: 0 7px 0 -5px currentColor;
  content: "";
}

.home-icon::before {
  position: absolute;
  inset: 8px;
  border: 2px solid currentColor;
  border-top: 0;
  transform: rotate(45deg);
  content: "";
}

.market-icon::before {
  position: absolute;
  inset: 8px 6px 7px;
  border: 2px solid currentColor;
  border-radius: 3px;
  content: "";
}

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

.app-section-heading-wide {
  margin: 8px 0 28px;
}

.app-section-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  letter-spacing: 0;
}

.app-section-heading p:last-child {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.passport-list {
  display: grid;
  gap: 12px;
}

.passport-list-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(130px, 0.55fr) auto;
  align-items: center;
  gap: 24px;
  padding: 20px 22px;
  color: var(--text);
  text-align: left;
  background: rgba(7, 22, 27, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  cursor: pointer;
}

.passport-list-card:hover {
  border-color: rgba(30, 169, 255, 0.4);
}

.passport-list-card h3 {
  margin: 0 0 6px;
  font-size: 1.04rem;
}

.passport-list-card p,
.passport-list-card small {
  margin: 0;
  color: var(--muted);
}

.passport-list-card strong {
  color: #dbe6e1;
}

.record-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  margin-bottom: 6px;
  color: #cbd7d2;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.record-status::before {
  width: 8px;
  height: 8px;
  background: var(--yellow);
  border-radius: 50%;
  content: "";
}

.record-status.is-published::before {
  background: var(--green);
}

.record-arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--green);
  border-radius: 50%;
  font-size: 1.1rem;
}

.compact-list .passport-list-card:nth-child(n + 4) {
  display: none;
}

.passport-search {
  display: block;
  margin-bottom: 18px;
}

.passport-search input {
  min-height: 56px;
  padding-left: 18px;
  background: rgba(8, 23, 29, 0.72);
}

.empty-passport-list {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(7, 22, 27, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
}

.empty-passport-list h2 {
  color: var(--text);
}

.scanner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.scanner-panel,
.manual-lookup,
.create-passport-form,
.passport-detail-hero,
.detail-panel {
  background: rgba(7, 22, 27, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
}

.scanner-panel {
  padding: 18px;
}

.camera-frame {
  position: relative;
  min-height: 440px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #020607;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
}

.camera-frame video {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.camera-placeholder {
  display: grid;
  justify-items: center;
  max-width: 300px;
  padding: 24px;
  color: #c6d1cc;
  text-align: center;
}

.camera-placeholder p {
  margin: 8px 0 0;
  color: var(--muted);
}

.scan-frame-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  border: 2px solid var(--green);
  border-radius: 13px;
  box-shadow: inset 0 0 0 18px #020607, inset 0 0 0 20px rgba(30, 169, 255, 0.9);
}

.camera-guide {
  width: min(58%, 270px);
  aspect-ratio: 1;
  position: absolute;
  border: 2px solid rgba(141, 227, 79, 0.9);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.camera-placeholder + .camera-guide {
  display: none;
}

.scanner-actions {
  margin-top: 15px;
}

.file-scan-button {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.file-scan-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.scanner-message {
  min-height: 20px;
  margin: 12px 2px 0;
  color: #b9c5c0;
}

.manual-lookup {
  align-self: start;
  padding: clamp(24px, 4vw, 36px);
}

.manual-lookup h2 {
  margin: 11px 0 10px;
  font-size: 2rem;
  letter-spacing: 0;
}

.manual-lookup > p:not(.app-card-kicker) {
  margin: 0 0 25px;
  color: var(--muted);
  line-height: 1.55;
}

.manual-lookup .button-primary,
.manual-lookup .demo-scan {
  width: 100%;
  margin-top: 14px;
}

.create-passport-form {
  padding: clamp(22px, 4vw, 42px);
}

.create-passport-form fieldset {
  margin: 0 0 38px;
  padding: 0;
  border: 0;
}

.create-passport-form legend {
  width: 100%;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.35rem;
  font-weight: 800;
}

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

.app-field-grid select {
  appearance: none;
}

.app-textarea-field {
  margin-top: 18px;
}

.app-textarea-field textarea {
  min-height: 120px;
  padding-top: 13px;
  resize: vertical;
}

.passport-detail {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.passport-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 34px;
  padding: clamp(26px, 5vw, 50px);
  background:
    radial-gradient(circle at 90% 20%, rgba(30, 169, 255, 0.17), transparent 18rem),
    rgba(7, 22, 27, 0.8);
}

.passport-detail-hero h2 {
  margin: 10px 0 8px;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0;
}

.passport-detail-hero p {
  margin: 0;
  color: var(--muted);
}

.passport-id-line {
  margin-top: 24px !important;
  color: #cbd8d2 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.passport-qr-block {
  width: 230px;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 16px;
  color: var(--ink);
  background: #fff;
  border-radius: 20px;
}

.passport-qr-block canvas {
  max-width: 100%;
  height: auto !important;
}

.passport-qr-block span {
  margin-top: 6px;
  color: #4a5551;
  font-size: 0.68rem;
  text-align: center;
  overflow-wrap: anywhere;
}

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

.detail-panel {
  padding: clamp(22px, 4vw, 34px);
}

.detail-panel h3 {
  margin: 0 0 22px;
  font-size: 1.35rem;
}

.detail-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
}

.detail-data-grid div {
  min-width: 0;
}

.detail-data-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-data-grid dd {
  margin: 0;
  color: #e7edea;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.passport-detail-actions {
  margin-top: 24px;
}

@media (max-width: 900px) {
  .passport-app-main {
    padding-top: 116px;
  }

  .app-auth-gate,
  .scanner-layout {
    grid-template-columns: 1fr;
  }

  .app-auth-gate {
    padding: 32px 0;
  }

  .app-auth-copy h1 {
    font-size: clamp(3.2rem, 12vw, 5.8rem);
  }

  .quick-action-grid {
    grid-template-columns: 1fr;
  }

  .quick-action {
    min-height: 112px;
  }

  .app-hero-card {
    min-height: 360px;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .passport-app-page {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .passport-app-header {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 8px 9px 8px 12px;
  }

  .passport-app-header .nav-brand span {
    font-size: 0.88rem;
  }

  .passport-app-header .nav-brand img {
    width: 30px;
    height: 30px;
  }

  .app-header-action {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.78rem;
  }

  .passport-app-main {
    width: min(100% - 20px, 1180px);
    padding-top: 96px;
    padding-bottom: 32px;
  }

  .app-auth-gate {
    min-height: auto;
    gap: 34px;
  }

  .app-auth-copy h1 {
    margin-top: 14px;
    font-size: clamp(2.8rem, 14vw, 4.5rem);
  }

  .app-auth-points {
    margin-top: 22px;
  }

  .app-login {
    padding: 24px;
    border-radius: 22px;
  }

  .app-topbar {
    align-items: center;
  }

  .app-topbar h1 {
    font-size: 2.45rem;
  }

  .app-topbar .app-eyebrow {
    display: none;
  }

  .app-topbar-actions .workspace-identity,
  #installAppInside,
  #appLogout {
    display: none !important;
  }

  .data-mode-banner {
    margin-bottom: 18px;
  }

  .app-hero-card {
    min-height: 390px;
    padding: 26px;
    border-radius: 23px;
  }

  .app-hero-card h2 {
    font-size: 2.55rem;
  }

  .app-hero-card .button-primary {
    width: 100%;
  }

  .quick-action-grid {
    margin-bottom: 42px;
  }

  .app-section-heading {
    align-items: flex-start;
  }

  .app-section-heading-wide {
    flex-direction: column;
  }

  .app-section-heading-wide .button-primary {
    width: 100%;
  }

  .passport-list-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 18px;
  }

  .passport-list-card > div:nth-child(2) {
    display: none;
  }

  .camera-frame {
    min-height: 390px;
  }

  .scanner-actions .button-primary,
  .scanner-actions .button-secondary {
    flex: 1 1 120px;
    justify-content: center;
  }

  .app-field-grid,
  .detail-grid,
  .detail-data-grid,
  .passport-detail-hero {
    grid-template-columns: 1fr;
  }

  .create-passport-form {
    border-radius: 20px;
  }

  .passport-detail-hero {
    border-radius: 22px;
  }

  .passport-qr-block {
    width: 100%;
  }

  .passport-detail-actions .button-primary,
  .passport-detail-actions .button-secondary {
    width: 100%;
  }

}

@media (prefers-reduced-motion: reduce) {
  .quick-action {
    transition: none;
  }
}
