@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --color-black: #0a0a0a;
  --color-charcoal: #1a1a1a;
  --color-charcoal-soft: #242424;
  --color-ash: #3a3a3a;
  --color-white: #dfd2ca;
  --color-off-white: #efe6df;
  --color-amber-core: #ff9f40;
  --color-amber-dim: #cc7a2e;
  --color-amber-shadow: #8c5a20;
  --bg: var(--color-black);
  --panel: var(--color-charcoal);
  --panel-soft: var(--color-charcoal-soft);
  --text: var(--color-white);
  --muted: var(--color-off-white);
  --line: var(--color-ash);
  --accent: var(--color-amber-core);
  --accent-strong: var(--color-amber-core);
  --paper: var(--color-white);
  --ink: var(--color-black);
  --warm-ink: #241c18;
  --radius: 8px;
  --max: 1280px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  line-height: 1.6;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--color-amber-dim); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: rgba(10, 10, 10, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: block;
  width: auto;
  height: 58px;
  max-width: min(260px, 38vw);
  object-fit: contain;
}

.brand span {
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.site-nav a,
.link-button {
  color: var(--muted);
  background: none;
  border: 0;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.site-nav a:hover,
.link-button:hover { color: var(--accent); }

.site-nav .logout-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 159, 64, 0.72);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 800;
}

.site-nav .logout-button:hover {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(255, 159, 64, 0.26);
}

.button,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.button.primary,
.nav-button,
.site-nav .nav-button {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
}

.button.primary:hover,
.nav-button:hover,
.site-nav .nav-button:hover {
  color: var(--ink);
  background: var(--color-amber-dim);
  border-color: var(--color-amber-dim);
  box-shadow: 0 0 20px rgba(255, 159, 64, 0.34);
}

.button.secondary {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent);
}

.button.secondary:hover {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255, 159, 64, 0.22);
}

.section-inner {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 58vh;
  display: flex;
  align-items: center;
  padding: 22px 0 20px;
  background:
    url("../../graphics/hns_1.png") left center / auto 100% no-repeat,
    var(--paper);
  color: var(--warm-ink);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(223, 210, 202, 0) 0%, var(--paper) 54%);
}

.hero .section-inner {
  position: relative;
  z-index: 1;
}

.hero-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 48px;
  align-items: center;
}

.hero-grid {
  grid-template-columns: minmax(320px, 1.12fr) minmax(0, 0.88fr);
}

.flipped-band .two-column {
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
}

.flipped-band .two-column > div:last-child {
  justify-self: end;
  text-align: right;
}

.flipped-band .two-column > div:last-child h2 {
  margin-left: auto;
}

.hero h1,
.hero h2,
.hero h3 {
  color: var(--ink);
}

.hero .lead {
  color: var(--warm-ink);
}

.hero .button.secondary {
  color: var(--ink);
  border-color: rgba(10, 10, 10, 0.48);
}

.hero .button.secondary:hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 0 20px rgba(10, 10, 10, 0.18);
}

.hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.hero-media img {
  display: block;
  width: min(100%, 720px);
  height: auto;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  color: var(--text);
  letter-spacing: 0;
}
h1 {
  max-width: 820px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.96;
}
h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}
h3 { font-size: 23px; }

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 19px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button-row.compact {
  margin-top: 18px;
}

.status-panel,
.feature-card,
.dashboard-card,
.auth-card,
.message {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.status-panel,
.feature-card,
.dashboard-card,
.auth-card {
  padding: 24px;
}

.status-panel:hover,
.feature-card:hover,
.dashboard-card:hover,
.auth-card:hover {
  border-color: rgba(255, 159, 64, 0.72);
  box-shadow: 0 0 28px rgba(255, 159, 64, 0.12);
}

.dashboard-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 159, 64, 0.34);
  border-radius: calc(var(--radius) - 2px);
}

.emporium-card {
  position: relative;
  overflow: hidden;
}

.emporium-card .button {
  margin: 6px 0 14px;
}

.status-panel div,
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.detail-list div {
  align-items: flex-start;
}
.detail-list dt {
  flex: 0 0 auto;
}
.detail-list dd {
  flex: 1 1 auto;
}
.account-status-card .detail-list div {
  align-items: baseline;
}
.account-status-card .detail-list dd {
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}
dt { color: var(--muted); }
dd {
  min-width: 0;
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-band {
  padding: 96px 0;
  border-top: 0;
}
.page-band.alt { background: var(--panel); }
.dark-band {
  background: var(--bg);
  color: var(--muted);
}

.dark-band h1,
.dark-band h2,
.dark-band h3 {
  color: var(--text);
}

.light-band {
  background: var(--paper);
  color: var(--warm-ink);
}

.light-band h1,
.light-band h2,
.light-band h3 {
  color: var(--ink);
}

.light-band .copy-stack,
.light-band p {
  color: var(--warm-ink);
}

.light-band .feature-card {
  background: rgba(10, 10, 10, 0.035);
  border-color: rgba(10, 10, 10, 0.2);
  color: var(--warm-ink);
}

.light-band .feature-card:hover {
  border-color: rgba(140, 90, 32, 0.6);
  box-shadow: 0 0 28px rgba(10, 10, 10, 0.08);
}

.light-band .feature-card p {
  color: var(--warm-ink);
}

.light-band .card-number {
  color: var(--color-amber-shadow);
}
.copy-stack {
  color: var(--muted);
  font-size: 18px;
}

.centered-band {
  padding: 64px 0;
  text-align: center;
}

.narrow-copy {
  max-width: 860px;
}

.narrow-copy h2 {
  margin-inline: auto;
}

.narrow-copy p:not(.eyebrow) {
  max-width: 780px;
  margin-inline: auto;
  font-size: 18px;
}

.pricing-intro h1 {
  max-width: 900px;
  margin-inline: auto;
  color: var(--ink);
}

.pricing-founder-copy {
  max-width: 860px;
  margin-bottom: 42px;
  text-align: center;
}

.pricing-founder-copy h2 {
  margin-inline: auto;
}

.pricing-founder-copy p:not(.eyebrow) {
  max-width: 780px;
  margin-inline: auto;
  color: var(--muted);
  font-size: 18px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.pricing-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.pricing-card:hover {
  border-color: rgba(255, 159, 64, 0.72);
  box-shadow: 0 0 28px rgba(255, 159, 64, 0.12);
  transform: translateY(-2px);
}

.pricing-card h2 {
  margin: 0;
}

.pricing-card p {
  margin-bottom: 0;
}

.featured-tier {
  border-color: rgba(255, 159, 64, 0.72);
  box-shadow: 0 0 32px rgba(255, 159, 64, 0.1);
}

.price-line {
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
}

.tier-list {
  display: grid;
  gap: 10px;
  margin: 4px 0 12px;
  padding-left: 20px;
  color: var(--muted);
}

.pricing-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.feature-grid,
.dashboard-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.dashboard-grid {
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.32fr) minmax(280px, 1fr);
}

.runtime-gateway-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.1fr);
  align-items: center;
  gap: clamp(22px, 4vw, 52px);
  min-height: 260px;
  padding: clamp(28px, 4vw, 48px);
  border-color: rgba(255, 159, 64, 0.7);
  background:
    linear-gradient(90deg, rgba(255, 159, 64, 0.12), rgba(26, 26, 26, 0) 46%),
    var(--panel);
}

.runtime-gateway-card:hover {
  border-color: rgba(255, 159, 64, 0.92);
  box-shadow: 0 0 34px rgba(255, 159, 64, 0.16);
}

.runtime-gateway-copy h2 {
  max-width: 620px;
  margin-bottom: 18px;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 0.95;
}

.runtime-gateway-copy p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
}

.runtime-gateway-install {
  justify-self: stretch;
}

.runtime-gateway-card .app-install-item {
  min-height: 180px;
  padding: 22px;
  border-color: rgba(255, 159, 64, 0.34);
  background: rgba(10, 10, 10, 0.68);
}

.runtime-gateway-card .app-install-item strong {
  font-size: 20px;
}

.runtime-gateway-card .app-install-item span {
  max-width: 640px;
}

.runtime-gateway-card .app-install-actions {
  align-items: stretch;
  max-width: 420px;
  margin-top: 18px;
}

.runtime-gateway-card .app-install-actions .table-action,
.runtime-gateway-card .app-install-actions .table-action:first-child {
  width: 100%;
  min-height: 52px;
}

.runtime-gateway-card .app-install-actions .table-action:first-child {
  font-size: 17px;
}

.runtime-gateway-card .app-install-actions .table-action + .table-action {
  margin-left: 0;
}

.account-management-card {
  display: grid;
  gap: 18px;
}

.account-management-card h2 {
  font-size: clamp(30px, 3.8vw, 48px);
}

.account-management-grid {
  display: grid;
  gap: 18px;
}

.settings-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.settings-form h3 {
  margin-bottom: 2px;
  font-size: 22px;
}

.settings-form .button {
  justify-self: start;
  margin-top: 4px;
}

.admin-wide-section {
  padding-bottom: 28px;
}

.admin-wide-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 138px;
  border-color: rgba(255, 159, 64, 0.44);
}

.admin-wide-card h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3.2vw, 42px);
}

.admin-wide-card p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.admin-wide-card .button {
  flex: 0 0 auto;
}

.card-number {
  display: block;
  margin-bottom: 24px;
  color: var(--accent-strong);
  font-weight: 800;
}

.proprietor-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  text-align: center;
}

.proprietor-heading h3 {
  margin: 0;
  font-size: 28px;
}

.proprietor-portrait {
  flex: 0 0 auto;
  width: 202px;
  aspect-ratio: 1;
  border: 5px solid var(--color-amber-core);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(255, 159, 64, 0.18), 0 16px 38px rgba(10, 10, 10, 0.24);
}

.proprietor-copy {
  text-align: center;
}

.runtime-card {
  display: flex;
  flex-direction: column;
}

.runtime-card-art {
  display: block;
  width: min(100%, 260px);
  height: auto;
  margin: auto auto 0;
  padding-top: 18px;
  object-fit: contain;
}

.auth-shell {
  min-height: calc(100vh - 75px);
  display: grid;
  place-items: center;
  padding: 48px 18px;
}
.auth-card {
  width: min(480px, 100%);
}
body[data-auth-mode="create"] .auth-shell {
  align-items: start;
  padding-block: 28px;
}
body[data-auth-mode="create"] .auth-card {
  width: min(1160px, calc(100% - 36px));
  min-height: min(720px, calc(100vh - 132px));
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.tab-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.tab-button.active {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
}
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form-head {
  margin-bottom: 16px;
}
.auth-form-head h1 {
  margin-bottom: 8px;
}
body[data-auth-mode="create"] .auth-form-head h1 {
  max-width: none;
  font-size: clamp(46px, 5vw, 62px);
  line-height: 0.98;
}
.create-account-layout {
  display: grid;
  grid-template-columns: minmax(400px, 0.95fr) minmax(480px, 1.05fr);
  gap: 32px;
  align-items: start;
}

body[data-auth-mode="create"] .create-account-layout {
  min-height: 460px;
}
.create-account-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.create-account-fields label,
.initials-grid label {
  margin: 0;
}
.create-account-fields .wide-field {
  grid-column: 1 / -1;
}
.create-account-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
label {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 14px;
}
input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 159, 64, 0.12);
}

::placeholder { color: rgba(232, 230, 227, 0.48); }

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 159, 64, 0.12);
}

.table-action {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.table-action:hover {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(255, 159, 64, 0.2);
}

.table-action.danger {
  border-color: rgba(186, 56, 56, 0.55);
  color: #d14f4f;
}

.table-action.danger:hover {
  background: #d14f4f;
  border-color: #d14f4f;
  color: #fff;
  box-shadow: 0 0 16px rgba(209, 79, 79, 0.2);
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-action + .table-action {
  margin-left: 8px;
}

.form-message {
  min-height: 0;
  margin: 12px 0;
  color: var(--accent-strong);
}

.form-message:not(:empty) {
  padding: 10px 12px;
  border: 1px solid rgba(255, 158, 58, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 158, 58, 0.08);
}

.form-message[data-type="error"]:not(:empty) {
  border-color: rgba(255, 109, 109, 0.45);
  background: rgba(255, 109, 109, 0.1);
  color: #ff9d9d;
}

.form-note {
  margin: 14px 0 0;
  color: var(--muted);
}

.recovery-copy {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

.form-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.terms-panel {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

body[data-auth-mode="create"] .terms-panel {
  min-height: 430px;
}

.terms-panel h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
}

.terms-copy {
  min-height: 210px;
  max-height: 260px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.terms-copy p {
  margin: 0 0 12px;
}

.terms-copy h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.terms-copy p:last-child {
  margin-bottom: 0;
}

.initials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.initials-grid label {
  margin: 0;
  min-width: 0;
}

.initials-grid span {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.initials-grid input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  margin-top: 2px;
}

.runtime-notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 159, 64, 0.52);
  border-radius: var(--radius);
  background: rgba(255, 159, 64, 0.1);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.runtime-notice.blocked {
  border-color: rgba(255, 154, 154, 0.55);
  background: rgba(255, 154, 154, 0.1);
  color: #ff9a9a;
}

.site-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.site-dialog.hidden {
  display: none !important;
}

.site-dialog-panel {
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

.site-dialog-title {
  color: var(--accent);
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-dialog-copy {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-line;
}

.site-dialog-input {
  width: 100%;
  margin-top: 16px;
}

.site-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.site-dialog-btn {
  min-height: 40px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.site-dialog-btn.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.site-dialog-btn.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #111;
}

.site-dialog-btn.danger {
  border: 1px solid rgba(255, 154, 154, 0.7);
  background: transparent;
  color: #ff9a9a;
}

.settings-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(180px, 0.8fr));
  gap: 18px 24px;
  align-items: end;
  margin: 0 0 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.settings-panel > div:first-child {
  align-self: center;
}

.settings-panel h2 {
  margin: 0;
  font-size: 28px;
}

.settings-panel label {
  margin: 0;
}

.settings-panel .button {
  justify-self: start;
}

.settings-panel .form-message {
  grid-column: 1 / -1;
  margin: 0;
}

.toggle-row {
  min-height: 44px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  min-height: 0;
  width: 18px;
  height: 18px;
  padding: 0;
}

.inline-action {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.admin-panel {
  width: min(1900px, calc(100% - 24px));
  padding-bottom: 72px;
}

.admin-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.admin-jump-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-weight: 800;
}

.admin-jump-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.system-status-panel {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.model-catalog-panel {
  display: grid;
  gap: 12px;
}

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

.model-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.model-card label {
  margin: 0;
}

.model-card textarea {
  min-height: 88px;
  resize: vertical;
}

.model-card-wide {
  grid-column: span 2;
}

.model-card .toggle-row {
  align-self: end;
}

.model-card-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.gateway-test-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.6fr) minmax(120px, 0.4fr) auto;
  gap: 14px;
  align-items: end;
}

.gateway-test-form label {
  margin: 0;
}

.gateway-test-result {
  display: grid;
  gap: 10px;
}

.result-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
}

.result-box strong {
  color: var(--text);
}

.system-status-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 12px;
}

.system-status-head h2 {
  margin: 0;
  font-size: 28px;
}

.status-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-chip.success {
  color: #9be7bd;
  border-color: rgba(155, 231, 189, 0.45);
  background: rgba(155, 231, 189, 0.1);
}

.status-chip.fail {
  color: #ff9a9a;
  border-color: rgba(255, 154, 154, 0.45);
  background: rgba(255, 154, 154, 0.1);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  font-size: 26px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px auto;
  gap: 14px;
  align-items: end;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.admin-toolbar label {
  margin: 0;
}

.toolbar-count {
  min-height: 38px;
  display: flex;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.admin-subsection {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin: 36px 0 14px;
}

.admin-subsection h2 {
  margin: 0;
  font-size: 28px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.user-detail-panel {
  margin: 24px 0 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.user-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.user-detail-head h2 {
  margin: 0 0 6px;
  font-size: 30px;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

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

.detail-grid h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
}

.mini-item strong {
  color: var(--text);
  font-size: 14px;
}

.store-item {
  margin-top: 12px;
}

.store-item-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.store-item:has(.store-item-thumb) {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
}

.store-item-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.store-item .table-action {
  justify-self: start;
  margin-top: 6px;
}

.store-item:has(.store-item-thumb) .table-action {
  grid-column: 2;
}

.store-item-image-admin {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.store-item-image-preview {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.store-item-image-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

.store-item-image-actions {
  display: grid;
  gap: 8px;
}

.app-install-item {
  gap: 6px;
}

.app-install-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.app-install-actions .table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 190px);
  min-height: 38px;
  text-align: center;
}

.app-install-actions .table-action:first-child {
  width: min(100%, 220px);
  min-height: 50px;
  font-size: 15px;
  font-weight: 850;
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(255, 159, 64, 0.22);
}

.app-install-actions .table-action:first-child:hover {
  color: var(--ink);
  background: var(--color-amber-dim);
  border-color: var(--color-amber-dim);
  box-shadow: 0 0 24px rgba(255, 159, 64, 0.34);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: auto;
}

.admin-table th,
.admin-table td {
  padding: 12px 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.admin-table th:first-child,
.admin-table td:first-child {
  white-space: nowrap;
}

.admin-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.admin-table td:nth-child(7),
.admin-table td:nth-child(8),
.admin-table td:nth-child(9) {
  white-space: nowrap;
}

.admin-table td:nth-child(10) {
  min-width: 300px;
  white-space: normal;
}

.user-admin-table {
  min-width: 1580px;
}

.user-admin-table td:nth-child(10) {
  min-width: 370px;
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.audit-table {
  min-width: 980px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-badge.success {
  color: #9be7bd;
  border-color: rgba(155, 231, 189, 0.45);
  background: rgba(155, 231, 189, 0.1);
}

.status-badge.fail {
  color: #ff9a9a;
  border-color: rgba(255, 154, 154, 0.45);
  background: rgba(255, 154, 154, 0.1);
}

details summary {
  color: var(--accent);
  cursor: pointer;
}

.dashboard-hero { padding: 72px 0 36px; }
.dashboard-hero h1 {
  max-width: none;
  font-size: clamp(34px, 5vw, 64px);
}

.dashboard-hero [data-user-field="name"] {
  white-space: nowrap;
}

.active-development-band {
  padding: 18px 0 42px;
}

.active-development-band h2 {
  max-width: 720px;
  margin-bottom: 12px;
  font-size: clamp(24px, 2.8vw, 34px);
}

.active-development-band p:not(.eyebrow) {
  max-width: 820px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.active-development-band p:last-child {
  margin-bottom: 0;
}

.dashboard-grid { padding-bottom: 72px; }
.dashboard-card.muted { opacity: 0.78; }
.message {
  max-width: 760px;
  padding: 18px;
}
.message.user {
  margin-left: auto;
  background: var(--panel-soft);
}
.message strong {
  display: block;
  margin-bottom: 8px;
}
.message p {
  margin: 0;
  color: var(--muted);
}
.check-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 48px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.site-footer a {
  color: inherit;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
}
.document-page {
  max-width: 860px;
}
.document-page h2 {
  margin-top: 32px;
}
.document-meta {
  margin-top: -8px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .site-header,
  .site-nav,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero-grid,
  .two-column,
  .feature-grid,
  .pricing-grid,
  .create-account-layout,
  .create-account-fields,
  .initials-grid,
  .dashboard-grid,
    .settings-grid,
    .settings-panel,
    .metric-grid,
  .admin-toolbar,
  .model-card,
  .gateway-test-form,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .runtime-gateway-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .runtime-gateway-copy h2 {
    font-size: 44px;
  }
  .runtime-gateway-card .app-install-actions {
    max-width: none;
  }
  .account-management-grid,
  .admin-wide-card {
    grid-template-columns: 1fr;
  }
  .admin-wide-card {
    align-items: flex-start;
    flex-direction: column;
  }
  h1 { font-size: 44px; }
  .hero-media { order: -1; }
  .flipped-band .two-column > div:last-child {
    justify-self: stretch;
    text-align: left;
  }
  .flipped-band .two-column > div:last-child h2 {
    margin-left: 0;
  }
  .proprietor-portrait {
    width: 173px;
  }
  body[data-auth-mode="create"] .auth-card {
    width: min(560px, calc(100% - 24px));
  }
  .create-account-actions {
    justify-content: stretch;
  }
  .create-account-actions .button {
    width: 100%;
  }
}
