/*
 * Copyright © 2026 US Courier Service, LLC dba USCS.
 * All Rights Reserved. Proprietary and Confidential.
 * Property of US Courier Service, LLC dba USCS and Mark T. Abbruzzese.
 * This notice is incorporated by reference into every line of this code, every binary, every product, and every creation.
 * Unauthorized copying, use, modification, distribution, reverse engineering, AI training, or any exploitation is strictly prohibited and will be prosecuted to the maximum civil and criminal extent of the law.
 * Full LEGAL NOTICES apply. See LEGAL_NOTICES.txt or master notices document. Access constitutes acceptance and constructive notice.
 */

:root {
  color-scheme: light;
  --host-paper: #f6f4ef;
  --host-surface: #fffefa;
  --host-ink: #1b1b1a;
  --host-muted: #716f68;
  --host-line: rgba(28, 27, 25, 0.12);
  --host-accent: #335f59;
  --host-accent-soft: #e4eeeb;
  --host-demo: #17233d;
  --host-focus: #2b6fc8;
  --host-danger: #a13d36;
  --host-shadow: 0 24px 70px rgba(24, 23, 20, 0.16);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--host-paper);
  color: var(--host-ink);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--host-ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.nextgen-host {
  display: grid;
  grid-template-rows: 58px auto minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  background: var(--host-paper);
}

.host-bar {
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-width: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--host-line);
  background: rgba(255, 254, 250, 0.94);
  backdrop-filter: blur(18px) saturate(140%);
}

.host-brand,
.session-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.host-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 24px;
  height: 24px;
  padding: 5px;
  border-radius: 8px;
  background: var(--host-ink);
}

.host-mark i {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: white;
}

.host-mark i:nth-child(1) { height: 7px; opacity: 0.62; }
.host-mark i:nth-child(2) { height: 13px; }
.host-mark i:nth-child(3) { height: 10px; opacity: 0.8; }

.host-wordmark {
  font-size: 16px;
}

.host-release {
  overflow: hidden;
  max-width: 220px;
  padding-left: 10px;
  border-left: 1px solid var(--host-line);
  color: var(--host-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-identity {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  color: var(--host-muted);
  font-size: 12px;
  white-space: nowrap;
}

.host-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
}

#tenant-name {
  color: var(--host-ink);
  font-weight: 700;
}

.actor-role,
.identity-separator {
  color: #9b988f;
}

.host-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.session-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  color: var(--host-muted);
  font-size: 11px;
  white-space: nowrap;
}

.session-state > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bd9236;
  box-shadow: 0 0 0 3px rgba(189, 146, 54, 0.12);
}

[data-state="ready"] .session-state > span {
  background: #31806d;
  box-shadow: 0 0 0 3px rgba(49, 128, 109, 0.12);
}

[data-state="error"] .session-state > span,
[data-state="auth-required"] .session-state > span {
  background: var(--host-danger);
  box-shadow: 0 0 0 3px rgba(161, 61, 54, 0.11);
}

.host-button,
.session-submit,
.session-reset {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--host-ink);
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.host-button:hover,
.session-submit:hover {
  background: #353431;
}

.host-button-secondary,
.session-reset {
  border-color: var(--host-line);
  background: transparent;
  color: var(--host-ink);
}

.session-link {
  justify-self: start;
  margin: -2px 0 2px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--host-accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.identity-flow[hidden],
.demo-banner[hidden] {
  display: none !important;
}

.host-button-secondary:hover,
.session-reset:hover {
  background: rgba(28, 27, 25, 0.055);
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--host-focus) 42%, transparent);
  outline-offset: 2px;
}

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

.demo-banner {
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  background: var(--host-demo);
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  letter-spacing: 0.025em;
  text-align: center;
}

.demo-banner strong {
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.11em;
}

.host-main,
.host-stage,
.frame-mount {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.host-main {
  overflow: hidden;
}

.host-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(44, 119, 107, 0.09), transparent 32%),
    radial-gradient(circle at 82% 76%, rgba(70, 79, 145, 0.07), transparent 34%),
    var(--host-paper);
}

.frame-mount {
  position: absolute;
  inset: 0;
}

.nextgen-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--host-surface);
}

.host-status {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: auto minmax(0, 520px) auto;
  align-items: center;
  gap: 22px;
  width: min(760px, calc(100% - 48px));
  padding: 26px 28px;
  border: 1px solid var(--host-line);
  border-radius: 20px;
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--host-shadow);
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, visibility 180ms ease;
}

[data-state="ready"] .host-status {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.host-status p,
.host-status h1 {
  margin: 0;
}

#status-kicker,
.session-eyebrow {
  margin-bottom: 7px;
  color: var(--host-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.host-status h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 35px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

#status-detail {
  max-width: 560px;
  margin-top: 9px;
  color: var(--host-muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-orbit {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(51, 95, 89, 0.24);
  border-radius: 50%;
}

.status-orbit::before,
.status-orbit i {
  position: absolute;
  display: block;
  content: "";
  border-radius: 50%;
}

.status-orbit::before {
  inset: 11px;
  background: var(--host-accent);
}

.status-orbit i:first-child {
  inset: -5px;
  border: 1px solid rgba(51, 95, 89, 0.13);
  animation: host-pulse 1.8s ease-in-out infinite;
}

.status-orbit i:last-child {
  top: 3px;
  left: 21px;
  width: 6px;
  height: 6px;
  background: var(--host-surface);
  box-shadow: 0 0 0 2px var(--host-accent);
}

.session-dialog {
  width: min(488px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--host-line);
  border-radius: 22px;
  background: var(--host-surface);
  color: var(--host-ink);
  box-shadow: 0 34px 100px rgba(15, 15, 14, 0.3);
}

.session-dialog::backdrop {
  background: rgba(19, 24, 31, 0.54);
  backdrop-filter: blur(12px);
}

.session-window {
  display: grid;
  padding: 34px;
}

.session-brand {
  margin-bottom: 34px;
  font-size: 17px;
}

.session-window h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

#session-description,
.session-required-note {
  color: var(--host-muted);
  font-size: 13px;
  line-height: 1.55;
}

#session-description {
  margin: 12px 0 5px;
}

.session-required-note {
  margin: 0 0 20px;
  padding: 10px 12px;
  border-left: 3px solid var(--host-accent);
  background: var(--host-accent-soft);
}

.session-window label {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 750;
}

.session-window input {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid rgba(28, 27, 25, 0.22);
  border-radius: 10px;
  background: white;
  color: var(--host-ink);
}

.session-window input:focus {
  border-color: var(--host-focus);
}

.session-error,
.session-info {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.session-error {
  color: var(--host-danger);
  font-weight: 650;
}

.session-info {
  color: var(--host-muted);
}

.session-submit {
  min-height: 46px;
  margin-top: 10px;
  background: var(--host-accent);
}

.session-reset {
  min-height: 40px;
  margin-top: 8px;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--host-paper);
  color: var(--host-ink);
  text-align: center;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

@keyframes host-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 860px) {
  .nextgen-host {
    grid-template-rows: 54px 38px minmax(0, 1fr);
  }

  .host-bar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 0 12px;
  }

  .host-identity,
  .host-release {
    display: none;
  }

  .host-actions {
    min-width: 0;
  }

  .session-state {
    display: inline-flex;
    min-width: 0;
  }

  .session-state b {
    overflow: hidden;
    max-width: 18ch;
    text-overflow: ellipsis;
  }

  .demo-banner {
    align-items: center;
    gap: 5px;
    font-size: 9px;
    line-height: 1.15;
  }

  .host-status {
    grid-template-columns: auto 1fr;
    gap: 16px;
    width: min(620px, calc(100% - 24px));
    padding: 22px;
  }

  .host-status .host-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .nextgen-host {
    grid-template-rows: auto 38px minmax(0, 1fr);
  }

  .host-bar {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 72px;
    padding: 8px 10px;
  }

  .host-wordmark {
    display: none;
  }

  .host-actions {
    flex-wrap: wrap;
  }

  .session-state {
    flex: 1 0 100%;
    justify-content: flex-end;
    margin-right: 0;
  }

  .host-button {
    padding: 6px 10px;
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  .host-button {
    min-height: 32px;
    padding-inline: 10px;
  }

  .host-status {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .status-orbit {
    width: 40px;
    height: 40px;
  }

  .status-orbit i:last-child {
    left: 17px;
  }

  .session-window {
    padding: 26px 22px;
  }

  .session-window h2 {
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --host-line: rgba(0, 0, 0, 0.36);
  }

  .host-button,
  .session-submit,
  .session-reset,
  .session-window input {
    border-width: 2px;
  }
}
