/* Every sheet occupies the space between the header and the external controls. */
body .universo.passport-view {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body .universo.passport-view > .passport {
  display: flex;
  flex: 1 1 0;
  width: min(1500px, calc(100% - 32px));
  max-width: none;
  height: auto;
  min-height: 0;
  margin: 10px auto 0;
  padding: 0;
  background: transparent;
  border-color: #98d5df50;
  border-radius: 24px;
  box-shadow: 0 12px 35px #02071940;
}
body .universo.passport-view .passport-pages {
  container-type: size;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  border-radius: inherit;
  background: url('assets/pasaporte-cosmico.png') center / cover;
}
body .universo.passport-view .passport-page {
  flex: 1 1 0;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  padding: clamp(14px, 3cqh, 30px) clamp(20px, 3.2vw, 48px);
  background: linear-gradient(105deg, #06142cbf, #08182e9c 58%, #07172a52);
}
body .universo.passport-view .passport-page .passport-header {
  flex: none;
  min-height: 0;
  margin: 0 0 clamp(10px, 2.4cqh, 24px);
  gap: 16px;
}
body .universo.passport-view .passport-page .passport-title {
  padding: 9px 15px;
  font-size: clamp(20px, 3.8cqh, 32px);
  line-height: 1.1;
  background: linear-gradient(135deg, #14394d80, #271c4e70);
}
body .universo.passport-view .passport-page .passport-logo {
  width: clamp(125px, 17cqh, 185px);
  height: clamp(30px, 5.3cqh, 48px);
}

/* Identity, discoveries and the chosen action use the full height of the sheet. */
.passport-view .passport-voyage { flex: 1 1 0; min-height: 0; padding-top: 6px; }
.passport-view .voyage-signature {
  flex: none;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 0 0 clamp(11px, 2.2cqh, 24px);
}
.passport-view .passport-voyage .passport-name {
  margin: 0 !important;
  font-size: clamp(30px, 5.6cqh, 52px) !important;
  line-height: 1.08 !important;
}
.passport-view .voyage-coordinates { gap: 12px; padding-left: 24px; }
.passport-view .voyage-coordinates svg { width: clamp(28px, 4.8cqh, 42px); height: clamp(28px, 4.8cqh, 42px); }
.passport-view .voyage-coordinates h3 { font-size: clamp(12px, 2.1cqh, 17px); }
.passport-view .voyage-coordinates strong { font-size: clamp(18px, 3.2cqh, 27px); }
.passport-view .voyage-content {
  flex: 1 1 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  padding: clamp(15px, 3.8cqh, 36px) 0 0;
}
.passport-view :is(.voyage-discoveries, .voyage-story) {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  min-height: min-content;
  align-content: stretch;
}
.passport-view .voyage-discoveries { padding-right: clamp(20px, 3vw, 44px); }
.passport-view .voyage-story { padding-left: clamp(20px, 3vw, 44px); padding-top: 0; border-top: 0; border-left: 1px solid #9ab9d550; }
.passport-view .passport-voyage .voyage-heading {
  font-size: clamp(22px, 3.8cqh, 34px);
  line-height: 1.2;
  gap: 10px;
  margin: 0 0 clamp(10px, 2cqh, 20px);
}
.passport-view .voyage-heading svg { width: clamp(24px, 4cqh, 35px); height: clamp(24px, 4cqh, 35px); }
.passport-view .voyage-sky { align-self: center; gap: clamp(15px, 2vw, 29px); min-height: 0; }
.passport-view .voyage-portrait { width: clamp(110px, 28cqh, 235px); height: clamp(110px, 29cqh, 245px); }
.passport-view .voyage-main-world { width: clamp(90px, 24cqh, 204px); height: clamp(90px, 24cqh, 204px); }
.passport-view .voyage-sky h3 { font-size: clamp(13px, 2.2cqh, 18px); }
.passport-view .passport-voyage .voyage-planet-name { font-size: clamp(18px, 3cqh, 27px); line-height: 1.3; margin-top: 5px; }
.passport-view .voyage-secondary { margin-top: clamp(10px, 2.8cqh, 24px); gap: 10px; }
.passport-view .voyage-secondary h3 { font-size: clamp(12px, 1.9cqh, 16px); }
.passport-view .voyage-secondary p { font-size: clamp(13px, 2.4cqh, 20px); margin-top: 4px; }
.passport-view .voyage-other-world { width: clamp(24px, 4.3cqh, 37px); height: clamp(24px, 4.3cqh, 37px); }
.passport-view .voyage-strength { margin-top: clamp(10px, 2.2cqh, 22px); padding-top: clamp(10px, 2.3cqh, 22px); }
.passport-view .voyage-strength h3 { font-size: clamp(16px, 2.8cqh, 24px); margin: 0 0 7px; }
.passport-view .voyage-strength p { font-size: clamp(14px, 2.5cqh, 21px); line-height: 1.5; }
.passport-view .voyage-mission { align-self: center; padding: clamp(12px, 2.5cqh, 25px) 20px; background: linear-gradient(90deg, #c1e77c12, transparent); }
.passport-view .voyage-mission h3, .passport-view .voyage-learning h3 { font-size: clamp(14px, 2.3cqh, 19px); margin-bottom: 6px; }
.passport-view .voyage-mission-action { font-size: clamp(17px, 3cqh, 27px); line-height: 1.5; }
.passport-view .voyage-learning { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 20px; margin-top: clamp(14px, 3cqh, 30px); padding: clamp(12px, 2.3cqh, 24px) 0 0; border-top: 1px solid #9ab9d540; }
.passport-view .voyage-learning > div { gap: 9px; }
.passport-view .voyage-learning p { font-size: clamp(14px, 2.4cqh, 20px); line-height: 1.4; }
.passport-view .voyage-learning > div > span { font-size: clamp(20px, 3.3cqh, 28px); width: 24px; }

/* The collection stretches evenly, leaving space for every destination. */
.passport-view .passport-collection-heading { flex: none; margin: 0 0 5px; }
.passport-view .passport-page .passport-page-title { font-size: clamp(24px, 4.4cqh, 38px); line-height: 1.2; margin: 0; }
.passport-view .passport-page .passport-page-intro { display: block; flex: none; margin: 0 0 clamp(8px, 2cqh, 20px); font-size: clamp(12px, 2cqh, 17px); line-height: 1.35; }
.passport-view .passport-page .passport-stations { flex: 1 1 0; min-height: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); padding: 8px; gap: clamp(14px, 2.8cqh, 28px); }
.passport-view .passport-page .passport-stamp { min-height: 0; padding: 9px; gap: clamp(3px, .8cqh, 8px); justify-content: center; }
.passport-view .passport-page .passport-stamp small { font-size: clamp(17px, 3cqh, 25px); }
.passport-view .passport-page .passport-stamp b { font-size: clamp(11px, 1.8cqh, 15px); line-height: 1.25; }
.passport-view .passport-page .passport-stamp em { font-size: clamp(9px, 1.5cqh, 12px); }
.passport-view .passport-page .passport-stamp .stamp-emblem { width: clamp(38px, 9cqh, 78px); height: clamp(38px, 9cqh, 78px); padding: clamp(8px, 1.8cqh, 16px); margin: clamp(2px, .7cqh, 7px) 0; }

/* The closing is a full-page message, with a clear and generous typographic scale. */
.passport-view .passport-closing { min-height: 0; justify-content: space-evenly; gap: clamp(8px, 1.5cqh, 16px); padding: clamp(8px, 2cqh, 20px) 0; }
.passport-view .passport-closing > span { font-size: clamp(42px, 11cqh, 94px); }
.passport-view .passport-closing > .tag { font-size: clamp(13px, 2.5cqh, 21px); line-height: 1.35; margin: 0; letter-spacing: .08em; }
.passport-view .passport-closing h2 { font-size: clamp(34px, 7.7cqh, 69px); line-height: 1.13; margin: 0; text-shadow: 0 3px 22px #030b1b; }
.passport-view .passport-closing > p:not(.tag) { max-width: 900px; font-size: clamp(17px, 3cqh, 27px); line-height: 1.5; margin: 0; }
.passport-view .passport-closing blockquote { font-size: clamp(19px, 3.8cqh, 33px); line-height: 1.4; margin: 0; }

@media (max-width: 800px) {
  body .universo.passport-view > .passport { width: calc(100% - 16px); margin-top: 6px; border-radius: 17px; }
  body .universo.passport-view .passport-page { padding: 12px; }
  body .universo.passport-view .passport-page .passport-header { gap: 8px; margin-bottom: 10px; }
  body .universo.passport-view .passport-page .passport-title { font-size: clamp(15px, 3.1cqh, 21px); padding: 7px 9px; gap: 5px; }
  body .universo.passport-view .passport-page .passport-logo { width: 88px; height: 26px; }
  .passport-view .voyage-signature { align-items: center; gap: 10px; padding-bottom: 10px; }
  .passport-view .passport-voyage .passport-name { font-size: clamp(20px, 4.4cqh, 30px) !important; }
  .passport-view .voyage-coordinates { flex: 0 0 auto; gap: 6px; padding-left: 9px; border-left: 1px solid #9ab9d540; }
  .passport-view .voyage-coordinates svg { width: 23px; height: 23px; }
  .passport-view .voyage-coordinates h3 { font-size: 10px; }
  .passport-view .voyage-coordinates strong { font-size: 13px; }
  .passport-view .voyage-content { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(min-content, 1.08fr) minmax(min-content, 1fr); gap: 12px; padding-top: 12px; }
  .passport-view .voyage-discoveries { padding: 0; }
  .passport-view .voyage-story { border-left: 0; border-top: 1px solid #9ab9d540; padding: 10px 0 0; }
  .passport-view .passport-voyage .voyage-heading { font-size: clamp(18px, 3.6cqh, 24px); line-height: 1.2; margin-bottom: 6px; gap: 7px; }
  .passport-view .voyage-heading svg { width: 22px; height: 22px; }
  .passport-view .voyage-sky { gap: 13px; }
  .passport-view .voyage-portrait { width: clamp(62px, 13cqh, 90px); height: clamp(68px, 14cqh, 96px); }
  .passport-view .voyage-main-world { width: clamp(53px, 11.5cqh, 78px); height: clamp(53px, 11.5cqh, 78px); }
  .passport-view .voyage-sky h3 { font-size: 11px; }
  .passport-view .passport-voyage .voyage-planet-name { font-size: clamp(14px, 2.8cqh, 19px); line-height: 1.2; margin-top: 3px; }
  .passport-view .voyage-secondary { margin-top: 7px; gap: 7px; }
  .passport-view .voyage-secondary h3 { font-size: 10px; }
  .passport-view .voyage-secondary p { font-size: clamp(11px, 2.2cqh, 14px); line-height: 1.2; margin-top: 2px; }
  .passport-view .voyage-other-world { width: 21px; height: 21px; }
  .passport-view .voyage-strength { margin-top: 6px; padding-top: 6px; }
  .passport-view .voyage-strength h3 { font-size: clamp(12px, 2.4cqh, 16px); line-height: 1.2; margin-bottom: 3px; }
  .passport-view .voyage-strength p { font-size: clamp(11px, 2.2cqh, 14px); line-height: 1.35; }
  .passport-view .voyage-mission { padding: 7px 11px; }
  .passport-view .voyage-mission h3, .passport-view .voyage-learning h3 { font-size: clamp(11px, 2.2cqh, 14px); line-height: 1.2; margin-bottom: 3px; }
  .passport-view .voyage-mission-action { font-size: clamp(12px, 2.6cqh, 17px); line-height: 1.35; }
  .passport-view .voyage-learning { gap: 10px; margin-top: 6px; padding-top: 7px; }
  .passport-view .voyage-learning > div { gap: 5px; }
  .passport-view .voyage-learning > div > span { width: 16px; font-size: 18px; }
  .passport-view .voyage-learning p { font-size: clamp(11px, 2.2cqh, 14px); line-height: 1.3; }
  .passport-view .passport-page .passport-page-title { font-size: clamp(21px, 4cqh, 27px); }
  .passport-view .passport-page .passport-page-intro { font-size: 11px; margin-bottom: 7px; line-height: 1.25; }
  .passport-view .passport-page .passport-stations { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 5px; }
  .passport-view .passport-page .passport-stamp { padding: 5px; gap: 2px; border-radius: 14px; }
  .passport-view .passport-page .passport-stamp small { font-size: clamp(12px, 2.5cqh, 16px); line-height: 1.1; letter-spacing: 0; }
  .passport-view .passport-page .passport-stamp b { font-size: clamp(9px, 1.7cqh, 11px); line-height: 1.15; }
  .passport-view .passport-page .passport-stamp em { font-size: 8px; line-height: 1.15; }
  .passport-view .passport-page .passport-stamp .stamp-emblem { width: clamp(28px, 6cqh, 42px); height: clamp(28px, 6cqh, 42px); padding: 6px; margin: 2px 0; }
  .passport-view .passport-closing { padding: 10px 0; gap: 10px; }
  .passport-view .passport-closing > span { font-size: clamp(42px, 11cqh, 72px); }
  .passport-view .passport-closing > .tag { font-size: clamp(12px, 2.5cqh, 16px); line-height: 1.35; letter-spacing: .06em; }
  .passport-view .passport-closing h2 { font-size: clamp(28px, 6cqh, 42px); line-height: 1.13; overflow-wrap: normal; }
  .passport-view .passport-closing > p:not(.tag) { font-size: clamp(14px, 2.8cqh, 19px); line-height: 1.45; }
  .passport-view .passport-closing blockquote { font-size: clamp(17px, 3.4cqh, 23px); line-height: 1.35; }
}

/* On short phones the emblem and learning caption share a row. */
@media (max-width: 800px) and (max-height: 650px) {
  body .universo.passport-view .passport-page { padding: 8px 10px; }
  body .universo.passport-view .passport-page .passport-header { margin-bottom: 6px; }
  body .universo.passport-view .passport-page .passport-title { font-size: 14px; padding: 6px 7px; }
  body .universo.passport-view .passport-page .passport-logo { width: 74px; height: 23px; }
  .passport-view .passport-page .passport-page-title { font-size: 19px; }
  .passport-view .passport-page .passport-page-intro { font-size: 10px; margin-bottom: 4px; }
  .passport-view .passport-page .passport-stations { gap: 8px; padding: 3px; }
  .passport-view .passport-page .passport-stamp { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 2px 6px; align-content: center; align-items: center; padding: 5px 7px; border-radius: 12px; }
  .passport-view .passport-page .passport-stamp small { grid-column: 1 / -1; font-size: 12px; line-height: 1.1; }
  .passport-view .passport-page .passport-stamp .stamp-emblem { grid-column: 1; grid-row: 2; width: 26px; height: 26px; padding: 5px; margin: 0; }
  .passport-view .passport-page .passport-stamp b { grid-column: 2; grid-row: 2; font-size: 9px; line-height: 1.15; text-align: left; }
  .passport-view .passport-page .passport-stamp em { grid-column: 1 / -1; grid-row: 3; font-size: 8px; line-height: 1.1; }
}

/* Landscape windows retain all eight seals with a horizontal composition. */
@media (min-width: 801px) and (max-height: 500px) {
  body .universo.passport-view .passport-page { padding: 8px 16px; }
  body .universo.passport-view .passport-page .passport-header { margin-bottom: 6px; }
  body .universo.passport-view .passport-page .passport-title { font-size: 16px; padding: 6px 9px; }
  body .universo.passport-view .passport-page .passport-logo { width: 105px; height: 26px; }
  .passport-view .passport-page .passport-page-title { font-size: 20px; }
  .passport-view .passport-page .passport-page-intro { font-size: 11px; margin-bottom: 4px; }
  .passport-view .passport-page .passport-stations { gap: 10px; padding: 4px; }
  .passport-view .passport-page .passport-stamp { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 2px 7px; align-content: center; align-items: center; padding: 5px 7px; border-radius: 12px; }
  .passport-view .passport-page .passport-stamp .stamp-emblem { grid-column: 1; grid-row: 1 / 4; width: 28px; height: 28px; padding: 5px; margin: 0; }
  .passport-view .passport-page .passport-stamp small { grid-column: 2; grid-row: 1; font-size: 12px; line-height: 1.1; text-align: left; }
  .passport-view .passport-page .passport-stamp b { grid-column: 2; grid-row: 2; font-size: 9px; line-height: 1.15; text-align: left; }
  .passport-view .passport-page .passport-stamp em { grid-column: 2; grid-row: 3; font-size: 8px; line-height: 1.1; text-align: left; }
}

@media (max-width: 800px) and (max-height: 580px) {
  .passport-view .passport-page .passport-stamp { grid-template-columns: 22px minmax(0, 1fr); gap: 1px 5px; padding: 3px 5px; }
  .passport-view .passport-page .passport-stamp .stamp-emblem { grid-column: 1; grid-row: 1 / 4; width: 22px; height: 22px; padding: 4px; }
  .passport-view .passport-page .passport-stamp small { grid-column: 2; grid-row: 1; font-size: 11px; line-height: 1.05; text-align: left; }
  .passport-view .passport-page .passport-stamp b { grid-column: 2; grid-row: 2; font-size: 8.5px; line-height: 1.15; }
  .passport-view .passport-page .passport-stamp em { grid-column: 2; grid-row: 3; font-size: 8px; line-height: 1.1; text-align: left; }
}

/* Keep hover explanations inside narrow or short passport sheets. */
@media (min-width: 801px) and (max-width: 1100px) {
  .passport-view .passport-page .passport-stamp:nth-child(4n + 1) .passport-stamp-tooltip { left: 0; right: auto; transform: none; }
  .passport-view .passport-page .passport-stamp:nth-child(4n) .passport-stamp-tooltip { left: auto; right: 0; transform: none; }
}
@media (min-width: 801px) and (max-height: 500px) {
  .passport-view .passport-page .passport-stamp:nth-child(-n + 4) .passport-stamp-tooltip { top: 0; bottom: auto; }
  .passport-view .passport-page .passport-stamp:nth-child(n + 5) .passport-stamp-tooltip { top: auto; bottom: 0; }
}
