body.inner-page .site-header,
body.inner-page .globalnav-placeholder,
body.inner-page .local-nav,
body.inner-page .site-footer,
body.inner-page .announcement,
body.inner-page #nav-shade,
body.inner-page .skip-link {
  display: none !important;
}

.inner-page-chrome {
  display: none;
}

body.inner-page .inner-page-chrome {
  position: sticky;
  z-index: 10;
  top: 0;
  display: block;
  height: 68px;
  pointer-events: none;
}

body.inner-page .inner-page-desktop-header,
body.inner-page .inner-page-mobile-header {
  pointer-events: none;
}

body.inner-page .inner-page-brand,
body.inner-page .inner-page-desktop-header .home-theme-wide,
body.inner-page .inner-page-mobile-header .home-mobile-topbar > a,
body.inner-page .inner-page-mobile-header .home-mobile-topbar > button {
  pointer-events: auto;
}

body.inner-page .inner-page-brand {
  width: clamp(190px, 25vw, 360px);
  min-width: 183px;
  box-sizing: border-box;
  justify-content: flex-start;
}

body.inner-page .inner-page-brand span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.inner-page .inner-page-mobile-header {
  display: none;
}

body.inner-page {
  --inner-header-height: 68px;
}

body.inner-page #main {
  position: relative;
  padding-top: 0;
}

body.inner-page #main > .immersive-section:not([hidden]) {
  display: block !important;
  visibility: visible !important;
}

body.inner-page #frame-content {
  min-height: var(--canvas-height);
}

body.immersive-current-page #main {
  display: block;
  width: 100%;
  max-width: none;
  min-height: var(--canvas-height);
  margin: 0;
  padding: 0;
}

.immersive-section:not([hidden]) {
  display: block;
  width: 100%;
  min-height: calc(var(--canvas-height) - var(--inner-header-height, 68px));
  margin: 0;
  padding: 0;
  background: transparent;
}

.immersive-page {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: calc(var(--canvas-height) - var(--inner-header-height, 68px));
  margin: 0;
  padding: 12px clamp(20px, 4.2vw, 56px) 30px;
  color: var(--text-primary, #123744);
}

.immersive-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin-bottom: clamp(18px, 3vh, 30px);
}

.code-page-header {
  grid-template-areas: "back shortcuts";
  grid-template-columns: auto minmax(0, 1fr);
}

.code-page-header > .immersive-back {
  grid-area: back;
}

.code-page-header > h1 {
  grid-area: title;
}

.code-page-header > .code-shortcuts {
  grid-area: shortcuts;
}

.code-page-header > .immersive-theme {
  grid-area: theme;
}

.immersive-page-header h1 {
  min-width: 0;
  margin: 0;
  color: var(--text-primary, #123744);
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: clamp(18px, 2.7vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}

.immersive-back {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  min-width: 0;
  color: var(--text-primary, #123744);
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.immersive-back-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 17px;
}

.immersive-header-tools {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 9px;
  min-width: 0;
}

.immersive-theme {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 2px solid var(--border-color, #a5e7f3);
  border-radius: 50%;
  background: var(--bg-card, #d5f5fa);
  color: var(--text-primary, #123744);
  cursor: pointer;
}

.immersive-theme svg,
.code-list-search svg {
  width: 19px;
  height: 19px;
}

.code-shortcuts {
  display: flex;
  justify-content: end;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.code-shortcuts[hidden] {
  display: none !important;
}

.code-shortcuts a {
  color: var(--text-primary, #123744);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.code-list-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(100%, 390px);
  min-height: 40px;
  box-sizing: border-box;
  margin: 0 0 17px;
  padding: 7px 13px;
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 14px;
  background: var(--bg-secondary, #fff);
  color: var(--text-secondary, #426b78);
}

.code-list-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary, #123744);
  font: inherit;
  font-size: 14px;
}

.immersive-code-workspace {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.code-category-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(18px, 3vw, 34px);
}

.code-category-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.code-category {
  min-width: 0;
}

.code-category h2 {
  margin: 0 0 4px 8px;
  color: var(--text-primary, #123744);
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 700;
  line-height: 1.25;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(65px, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  min-height: 43px;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 4px 7px 4px 13px;
  overflow: hidden;
  border-radius: 18px;
  background: #59d3eb;
  color: #07151a;
}

.code-row-value {
  min-width: 0;
  overflow: hidden;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: clamp(13px, 1.65vw, 17px);
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.code-row-expiry {
  color: #07151a;
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: clamp(9px, 1vw, 11px);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.code-row-methods {
  display: flex;
  align-items: center;
  gap: 3px;
}

.code-row-methods button {
  display: grid;
  width: clamp(24px, 3.2vw, 31px);
  height: clamp(24px, 3.2vw, 31px);
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.code-row-methods img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.code-row.is-expired {
  background: #a5e7f3;
  color: #123744;
}

.code-legacy-controls {
  display: none !important;
}

.immersive-code-workspace > .empty-state {
  margin: 25px auto;
  text-align: center;
}

.redeem-copy {
  position: relative;
  width: min(100%, 1050px);
  margin: clamp(12px, 2.5vh, 26px) 0 0;
}

.redeem-copy h2 {
  margin: 0 auto clamp(18px, 3vh, 28px);
  color: var(--text-primary, #123744);
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: clamp(20px, 3.7vw, 36px);
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  text-wrap: balance;
}

.immersive-redeem-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(100%, 690px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Prevent the legacy form panel from adding a mismatched block behind the input. */
.theme-deep-sea #redeem-form.immersive-redeem-form {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.immersive-redeem-form .redeem-prompt {
  grid-column: 1 / -1;
  margin: 0 0 1px;
  color: var(--text-primary, #123744);
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 700;
}

.immersive-redeem-form input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  box-sizing: border-box;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  outline: 0;
  background: #123744;
  color: #e5faff;
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: 16px;
  text-align: center;
}

.immersive-redeem-form input::placeholder {
  color: #d0e9ee;
  opacity: 1;
}

.immersive-redeem-form input:focus-visible {
  outline: 3px solid var(--accent-color, #159bb8);
  outline-offset: 2px;
}

.immersive-redeem-form .redeem-submit {
  min-width: 166px;
  min-height: 48px;
  padding: 10px 20px;
  border: 0;
  border-radius: 25px;
  background: #59d3eb;
  color: #07151a;
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.immersive-redeem-form .field-error {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 6px 13px;
  border-radius: 20px;
  background: #ff4b4f;
  color: #fff;
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.redeem-error {
  position: absolute;
  top: calc(0px - clamp(130px, calc(5vh + 94px), 160px));
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 13px;
  border-radius: 20px;
  background: #59d3eb;
  color: #07151a;
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 700;
  line-height: 1.2;
}

.redeem-error[hidden],
.immersive-redeem-form .field-error[hidden] {
  display: none !important;
}

.field-error img {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  object-fit: contain;
}

.redeem-disclaimer {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--text-primary, #123744);
  font-family: Cookie, "Noto Sans", sans-serif;
  font-size: clamp(11px, 1.25vw, 13px);
  font-weight: 700;
  line-height: 1.55;
}

.redeem-submit-mobile {
  display: none;
}

@media all {
  body.inner-page {
    --inner-header-height: 52px;
  }

  body.inner-page .inner-page-desktop-header {
    display: none;
  }

  body.inner-page .inner-page-mobile-header {
    position: absolute;
    inset: 0 0 auto;
    display: block;
    padding-top: 14px;
  }

  body.inner-page .inner-page-mobile-header .home-mobile-topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    width: calc(100% - 64px);
    max-width: 440px;
    height: 33px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0 7px;
    border: 2px solid var(--text-primary, #123744);
    border-radius: 999px;
    background: var(--bg-card, #d5f5fa);
    color: var(--text-primary, #123744);
  }

  body.inner-page .inner-page-mobile-header .home-mobile-topbar > a {
    display: grid;
    width: 35px;
    height: 28px;
    place-items: center;
  }

  body.inner-page .inner-page-mobile-header .home-mobile-topbar > a img {
    display: block;
    width: 37px;
    height: 28px;
    object-fit: contain;
  }

  body.inner-page .inner-page-mobile-header .home-mobile-topbar strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text-primary, #123744);
    font: 700 18px/1 Cookie, "Noto Sans", sans-serif;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.inner-page .inner-page-mobile-header .home-theme-mini {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary, #123744);
  }

  body.inner-page .inner-page-mobile-header .home-theme-mini span,
  body.inner-page .inner-page-mobile-header .home-theme-mini svg {
    display: block;
    width: 25px;
    height: 25px;
  }

  body.inner-page #main {
    padding-top: 53px;
  }

  body.inner-page .inner-page-chrome {
    height: 52px;
  }

  .immersive-page {
    padding: 12px clamp(16px, 5vw, 28px) 28px;
  }

  body.immersive-current-page #main {
    padding-top: 0;
  }

  .immersive-page-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto;
    gap: 6px;
    min-height: 38px;
    margin-bottom: 22px;
  }

  .redeem-page-header {
    margin-bottom: 19px;
  }

  .code-page-header {
    grid-template-areas: "back shortcuts";
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 0;
  }

  .immersive-page-header h1 {
    font-size: clamp(15px, 4vw, 21px);
  }

  .immersive-back {
    gap: 5px;
    font-size: clamp(11px, 3vw, 14px);
  }

  .immersive-back-icon {
    width: 23px;
    height: 23px;
    font-size: 24px;
  }

  .immersive-theme {
    width: 31px;
    height: 31px;
  }

  .code-shortcuts {
    justify-content: start;
    min-height: 20px;
    margin-top: 4px;
  }

  .code-shortcuts a {
    font-size: 11px;
  }

  .code-page-header > .code-shortcuts[hidden] {
    display: none !important;
  }

  .code-page-header > .code-shortcuts {
    justify-content: end;
  }

  .code-list-search {
    width: 100%;
    margin-bottom: 15px;
  }

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

  .code-category-column {
    gap: 8px;
  }

  .code-row {
    grid-template-columns: minmax(52px, 1fr) auto auto;
    gap: 5px;
    min-height: 38px;
    margin-bottom: 7px;
    padding: 4px 6px 4px 11px;
  }

  .code-row-value {
    font-size: clamp(12px, 3.6vw, 16px);
  }

  .code-row-expiry {
    font-size: clamp(8px, 2.4vw, 10px);
  }

  .code-row-methods {
    gap: 2px;
  }

  .code-row-methods button {
    width: clamp(22px, 7vw, 29px);
    height: clamp(22px, 7vw, 29px);
  }

  .redeem-copy {
    margin-top: 12px;
  }

  .redeem-copy h2 {
    margin-bottom: 21px;
    font-size: clamp(21px, 6vw, 31px);
    text-align: center;
  }

  .redeem-error {
    position: static;
    width: fit-content;
    margin: -8px auto 13px;
    padding: 5px 12px;
    font-size: clamp(12px, 3.3vw, 15px);
  }

  .redeem-desktop-break {
    display: none;
  }

  .immersive-redeem-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: 100%;
  }

  .immersive-redeem-form .redeem-prompt {
    text-align: center;
  }

  .immersive-redeem-form input {
    min-height: 48px;
  }

  .immersive-redeem-form .redeem-submit {
    width: min(100%, 240px);
    min-height: 47px;
    justify-self: center;
  }

  .redeem-submit-desktop {
    display: none;
  }

  .redeem-submit-mobile {
    display: inline;
  }

  .redeem-disclaimer {
    margin: 17px auto 0;
    text-align: center;
  }
}

@media not all {
  .redeem-copy {
    width: min(100%, 1050px);
    margin-top: clamp(12px, 2.5vh, 28px);
  }
}

@media (max-width: 360px) {
  .immersive-page-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .immersive-back span:last-child {
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .code-row {
    grid-template-columns: minmax(43px, 1fr) auto auto;
    gap: 3px;
  }

  .code-row-expiry {
    font-size: 8px;
  }
}

/* Keep inner-page controls and text legible in both Deep Sea themes. */
body.inner-page {
  color: var(--text-primary, #123744);
}

body.inner-page .inner-page-brand,
body.inner-page .inner-page-mobile-header .home-mobile-topbar {
  border-color: var(--text-primary, #123744);
  background: var(--bg-card, #d5f5fa);
  color: var(--text-primary, #123744);
}

body.inner-page .inner-page-mobile-header .home-mobile-topbar strong,
body.inner-page .inner-page-mobile-header .home-theme-mini,
body.inner-page .inner-page-desktop-header .home-theme-wide {
  color: var(--text-primary, #123744);
}

body.inner-page .code-list-search {
  border-color: var(--border-color, #a5e7f3);
  background: transparent;
  color: var(--text-secondary, #426b78);
}

body.inner-page .code-list-search input {
  color: var(--text-primary, #123744);
}

body.inner-page .code-list-search input::placeholder {
  color: var(--text-secondary, #426b78);
  opacity: 1;
}

body.inner-page .immersive-page,
body.inner-page .immersive-page h1,
body.inner-page .immersive-page h2,
body.inner-page .immersive-page h3,
body.inner-page .immersive-page .immersive-back,
body.inner-page .immersive-page .redeem-disclaimer {
  color: var(--text-primary, #123744);
}

/* Routed pages use normal document flow; only the home screen is centered. */
body.inner-page #frame-content {
  display: block !important;
  width: var(--canvas-width) !important;
  height: auto !important;
  min-height: 0 !important;
  align-items: initial !important;
  justify-content: flex-start !important;
}

body.inner-page #main {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.inner-page .inner-page-chrome {
  position: sticky !important;
  z-index: 10;
  top: 0 !important;
  flex: 0 0 var(--inner-header-height, 68px) !important;
  width: 100%;
  height: var(--inner-header-height, 68px) !important;
  min-height: var(--inner-header-height, 68px);
  margin: 0 !important;
}

body.inner-page #main > [data-page][hidden] {
  display: none !important;
}

body.inner-page #main > [data-page]:not([hidden]) {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  flex: 0 0 auto !important;
  visibility: visible !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  transform: none !important;
  translate: none !important;
}

body.inner-page #main > .immersive-section:not([hidden]) {
  padding: 0 !important;
}

body.inner-page #main > [data-page]:not([hidden]) > .immersive-page {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  transform: none !important;
  translate: none !important;
}

body.inner-page .immersive-page-header {
  position: relative !important;
  inset: auto !important;
  margin-top: 0 !important;
  transform: none !important;
  translate: none !important;
}

body.inner-page #main > #page-howto,
body.inner-page #main > #page-website,
body.inner-page #main > #page-faq,
body.inner-page #main > #page-info,
body.inner-page #main > #page-policy {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  padding: clamp(20px, 3.5vw, 44px) clamp(16px, 4vw, 52px) 44px !important;
}
