@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;
  padding: 0;
  background: var(--bg);
  color: var(--warm-ink);
}

.hero::before {
  content: none;
}

.hero .section-inner {
  width: 100%;
  max-width: none;
  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 {
  display: block;
}

.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 {
  margin: 0;
  position: relative;
}

.hero-media img {
  display: block;
  width: 100%;
  height: clamp(340px, 38vw, 520px);
  object-fit: cover;
  object-position: 50% 50%;
}

/* Sits in the open road/sky gap between the two hero figures. Text is
   light-on-photo (not the warm-white-background ink colors used elsewhere
   in .hero), with a soft radial scrim behind it for legibility -- fades out
   before reaching either character so it never overlaps them. */
.hero-overlay-copy {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(620px, 44vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 36px 30px;
  border: 1px solid rgba(223, 210, 202, 0.18);
  border-radius: var(--radius);
  background: rgba(10, 10, 10, 0.52);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(3px);
  transform: translate(-50%, -48%);
  pointer-events: none;
}

.hero-overlay-copy::before {
  content: none;
}

.hero-overlay-copy h1 {
  margin: 0 0 14px;
  color: var(--paper);
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1.18;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  max-width: 18ch;
}

.hero-overlay-copy h1 span,
.hero-overlay-copy .lead span {
  color: var(--accent);
}

.hero-overlay-copy .lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  max-width: 54ch;
  font-size: clamp(14px, 1.2vw, 18px);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

@media (max-width: 760px) {
  .hero-overlay-copy {
    position: static;
    width: 100%;
    max-width: none;
    padding: 28px 20px 34px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    transform: none;
  }

  .hero-overlay-copy h1 {
    font-size: 32px;
    text-shadow: none;
  }

  .hero-overlay-copy .lead {
    font-size: 16px;
    color: var(--muted);
    text-shadow: none;
  }
}

.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);
}

.community-band {
  background:
    linear-gradient(135deg, rgba(255, 159, 64, 0.16), rgba(10, 10, 10, 0) 44%),
    var(--paper);
  color: var(--warm-ink);
}

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

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

.community-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.84fr) minmax(0, 1.16fr);
  gap: 48px;
  align-items: center;
}

.community-band [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.72;
  pointer-events: none;
}

.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);
}

.email-verification-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 32px;
}

.email-verification-card .eyebrow,
.email-verification-card .runtime-notice {
  grid-column: 1 / -1;
}

.email-verification-card h2 {
  max-width: 760px;
  margin-bottom: 4px;
}

.email-verification-card > p:not(.eyebrow):not(.runtime-notice) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.email-verification-card .button-row {
  grid-column: 2;
  grid-row: 2 / span 2;
  margin-top: 0;
}

.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;
  align-self: start;
  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: 260px;
  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: 100%;
  height: auto;
  margin-top: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 159, 64, 0.35);
  box-shadow: 0 16px 38px rgba(10, 10, 10, 0.28);
  object-fit: cover;
}

.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;
  color: var(--accent-strong);
}

.form-message:empty {
  margin: 0;
}

.form-message:not(:empty) {
  margin: 12px 0;
  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-catalog-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
}

.model-catalog-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.model-catalog-section-head h3 {
  margin: 0 0 4px;
  color: var(--accent);
}

.model-catalog-section-head p {
  margin: 0;
}

.model-catalog-section-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

/* Master-detail shelf layout */
#personaShelfList {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.shelf-list-nav {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.shelf-list-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background 0.12s;
}

.shelf-list-row:hover {
  background: var(--bg-alt);
}

.shelf-list-row.active {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}

.shelf-list-new {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  border-bottom: none;
}

.shelf-row-title {
  font-size: 14px;
  font-weight: 600;
}

.shelf-row-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.shelf-editor-panel {
  padding: 14px;
}

.shelf-editor-panel .mini-item {
  color: var(--text-muted);
  font-size: 14px;
}

.persona-shelf-editor {
  border: none;
  border-radius: 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  padding: 20px;
  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;
  scrollbar-width: none;
}

.model-card textarea::-webkit-scrollbar {
  display: none;
}

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

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

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

.persona-shelf-placement {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(80px, 120px);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: fit-content;
}

.persona-shelf-placement legend {
  padding: 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.persona-shelf-mode {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.persona-shelf-mode label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.persona-shelf-existing,
.persona-shelf-new {
  display: contents;
}

.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 form: A/B/C/D/E/F grid. No !important -- the 820px breakpoint's
   .model-card rule (later in this file) needs to be able to collapse this to
   a single column without a specificity fight. */
.store-item-form {
  grid-template-columns: 1fr 1fr;
  gap: 27px;
}

/* A — full width meta row */
.store-item-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

/* B — left: thumbnail + description stacked */
.store-item-left-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}

/* C — shelf placement rides in the meta row. display:contents lets the two
   labels sit as direct flex children alongside Item Key/Title/Type, while the
   wrapper still carries [hidden] for non-persona items ([hidden] is
   !important, so it wins over contents). */
.store-item-shelf-inline {
  display: contents;
}

/* Locked once a persona package exists -- readonly, not disabled, so the value
   is still submitted. */
.store-item-meta input[readonly] {
  color: var(--muted);
  border-style: dashed;
  cursor: not-allowed;
}

.store-item-meta select[name="persona_shelf_id"] {
  width: 220px;
}

.store-item-meta input[name="shelf_sort_order"] {
  width: 90px;
  min-height: 38px;
}


/* E — right: package */
.store-item-package-panel {
  display: grid;
  gap: 8px;
  align-content: start;
}

/* Four short pickers two-up. Columns are sized to their content, not to a
   fraction of the panel -- 1fr handed each cell ~407px to hold a ~106px
   button, and the leftover grew with the viewport. */
.package-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: start;
  gap: 14px 40px;
  margin-top: 4px;
}

/* Sits under the package files, not in the music block -- this button submits
   the whole package, not just the tracks. */
.package-upload-row {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin: 12px 0 4px;
}

.package-upload-row .muted-text {
  font-size: 12px;
  line-height: 1.5;
}

/* D — left: gallery images */
.store-item-gallery-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

/* Persona background authoring is deliberately a separate full-width panel.
   Gallery, package files, and Music keep their established two-column layout. */
.store-item-background-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 4px;
}

.persona-background-thumb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.persona-background-thumb-button {
  position: relative;
  display: grid;
  width: 132px;
  padding: 5px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.persona-background-thumb-button:hover,
.persona-background-thumb-button.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 159, 64, 0.2);
}

.persona-background-thumb-button img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

.persona-background-thumb-button span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persona-background-thumb-button em {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.78);
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.persona-background-thumb-button.staged {
  border-style: dashed;
}

.persona-background-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.persona-background-actions .muted-text {
  align-self: center;
}

.persona-background-editor {
  display: grid;
  grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.persona-background-editor[hidden] {
  display: none;
}

.persona-background-editor-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.persona-background-editor-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: end;
}

.persona-background-editor-fields input[type="text"],
.persona-background-editor-fields textarea {
  width: 100%;
}

.persona-background-cues-field,
.persona-background-editor-actions {
  grid-column: 1 / -1;
}

.persona-background-default {
  align-self: center;
}

.gallery-thumb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.gallery-thumb-button {
  padding: 0;
  border: none;
  background: none;
  line-height: 0;
  cursor: zoom-in;
  border-radius: 4px;
}

.gallery-thumb-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-thumb-button:hover .gallery-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 159, 64, 0.25);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.82);
}

.image-lightbox.hidden {
  display: none;
}

.image-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
}

.image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

/* Explicit column + row placement, scoped to the wide layout. Two things live
   here on purpose: the package panel spans both left-column rows instead of
   stretching row 2 and stranding a gap above the gallery, and none of these
   grid-column values can be unconditional -- an item with grid-column: 2
   forces an implicit second track into existence even when
   grid-template-columns collapses to a single 1fr below this breakpoint,
   which is what silently defeated the 820px mobile rule. */
@media (min-width: 821px) {
  .store-item-left-col { grid-column: 1; grid-row: 2; }
  .store-item-gallery-panel { grid-column: 1; grid-row: 3; }
  .store-item-package-panel {
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: start;
  }
  .store-item-meta { grid-row: 1; }
  .store-item-background-panel { grid-row: 4; }
  .store-item-footer { grid-row: 5; }

  /* Non-persona items hide all three persona panels via [hidden], leaving
     column 2 empty. :has() tracks that toggle live, so switching the Type
     dropdown reflows this with no JS change. */
  .store-item-form:not(:has(.store-item-package-panel:not([hidden]))) .store-item-left-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .persona-background-editor {
    grid-template-columns: 1fr;
  }

  .persona-background-editor-fields {
    grid-template-columns: 1fr;
  }

  .persona-background-cues-field,
  .persona-background-editor-actions {
    grid-column: 1;
  }
}

/* F — full width footer */
.store-item-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.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;
  justify-items: start;
}

.persona-music-tracks-existing {
  display: grid;
  gap: 8px;
  margin: 4px 0 8px;
}

[data-persona-music-rows] > .button-row {
  align-items: end;
  margin-top: 12px;
}

[data-persona-music-rows] input[type="text"] {
  min-height: 38px;
  width: 200px;
}

/* Bottom-align so Save/Remove sit on the same line as the Load File buttons;
   the art and title stay optically centred against the taller file fields. */
.persona-music-track-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto auto auto;
  align-items: end;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
}

.persona-music-track-row .persona-music-track-art,
.persona-music-track-row .persona-music-track-title {
  align-self: center;
}

.persona-music-track-art {
  width: 40px;
  height: 40px;
  border-radius: calc(var(--radius) - 2px);
  object-fit: cover;
  background: var(--bg);
}

.persona-music-track-art-empty {
  display: block;
  border: 1px dashed var(--line);
}

.persona-music-track-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* File pickers. The native control is clipped rather than display:none so it
   stays keyboard reachable; the label in front of it is the visible button. */
.file-field {
  display: grid;
  gap: 6px;
  justify-items: start;
  min-width: 0;
}

.file-field-label {
  color: var(--muted);
  font-size: 13px;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  cursor: pointer;
}

.file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.file-picker-preview {
  flex: none;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: border-color 0.2s ease;
}

.file-picker:hover .file-picker-preview {
  border-color: var(--accent);
}

.file-picker-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  white-space: nowrap;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

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

.file-picker input[type="file"]:focus-visible + .file-picker-button {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 159, 64, 0.35);
}

/* Empty until a file is actually staged -- no "no file chosen" placeholder. */
.file-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.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,
  .community-panel,
  .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;
  }
  .email-verification-card {
    grid-template-columns: 1fr;
  }
  .email-verification-card .button-row,
  .email-verification-card .runtime-notice {
    grid-column: 1;
    grid-row: auto;
  }
  .email-verification-card .button-row {
    margin-top: 8px;
  }
  .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: 220px;
  }
  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%;
  }
}
