:root {
  color-scheme: dark;
  /* Opaque surfaces avoid large-area repainting during Firefox scrolling. */
  --ink: #090611;
  --ink-soft: #100a1b;
  --panel: #191028;
  --panel-solid: #1a102a;
  --panel-hover: #221436;
  --purple: #7c3aed;
  --purple-light: #ad7cff;
  --purple-deep: #3b1767;
  --gold: #e8bd58;
  --gold-light: #ffe2a1;
  --gold-deep: #9b6d17;
  --text: #f8f4ff;
  --muted: #afa4c4;
  --faint: #786d8e;
  --line: #2e241d;
  --line-purple: #2b1e41;
  --red: #ff7c92;
  --green: #69e4aa;
  --blue: #8db8ff;
  --shadow: none;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--ink);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .01em;
}

body::before {
  display: none;
}

.ambient {
  display: none;
}

.ambient-one {
  top: -180px;
  left: -140px;
  background: var(--purple);
}

.ambient-two {
  right: -180px;
  bottom: -220px;
  background: var(--gold);
}

a {
  color: var(--gold-light);
  text-decoration: none;
  transition: none;
}

a:hover {
  color: #fff0c6;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 720;
  line-height: 1.02;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: 5px;
  font-size: 1.22rem;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.muted,
.panel-heading p,
.section-heading p,
.dashboard-hero p {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  color: var(--gold);
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow i {
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--gold);
}

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

.brand:hover {
  color: var(--text);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: #160c25;
  border: 1px solid #716756;
  border-radius: 13px;
  background: var(--gold);
  box-shadow: none;
  font-size: .71rem;
  font-weight: 950;
  letter-spacing: -.04em;
}

.brand-logo {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid #716756;
  border-radius: 13px;
  background: #171116;
}

.brand-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.brand-mark::after {
  position: absolute;
  inset: 1px;
  content: "";
  border: 1px solid #605e65;
  border-radius: 11px;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: .95rem;
  letter-spacing: -.01em;
}

.brand-copy small {
  color: var(--faint);
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 13px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid #261d1a;
  background: #0b0712;
  box-shadow: none;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
  border: 1px solid #281c3d;
  border-radius: 14px;
  background: #110d18;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu[open] summary,
.account-menu summary:hover {
  border-color: #524128;
  background: #1a1417;
}

.menu-caret {
  color: var(--gold);
  font-size: .64rem;
  font-weight: 900;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 230px;
  padding: 8px;
  border: 1px solid #2d2142;
  border-radius: 14px;
  background: #110d18;
}

.account-dropdown a,
.account-dropdown button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 10px 11px;
  color: var(--text);
  border: 0;
  border-radius: 10px;
  background: #110d18;
  font-size: .76rem;
  font-weight: 760;
  letter-spacing: .02em;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
  color: var(--gold-light);
  background: #1a1417;
}

.user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.user-actions > .button-link {
  padding: 7px 10px;
  color: var(--muted);
  border-color: #281c3d;
  border-radius: 9px;
  background: #110d18;
  box-shadow: none;
  font-size: .64rem;
}

.user-actions > .button-link:hover {
  color: var(--text);
  border-color: #524128;
  background: #1a1417;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--gold-light);
  border: 1px solid #443624;
  border-radius: 50%;
  background: var(--purple-deep);
  font-size: .75rem;
  font-weight: 800;
}

.user-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar.has-photo {
  overflow: hidden;
  background: #110d18;
}

.user-copy {
  display: grid;
  min-width: 130px;
}

.user-copy strong {
  font-size: .77rem;
}

.user-copy small {
  color: var(--faint);
  font-size: .62rem;
}

main {
  position: relative;
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 44px clamp(16px, 3.5vw, 52px) 70px;
}

.panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 23px;
  border: 1px solid var(--line-purple);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
  contain: paint;
}

.panel::before {
  display: none;
}

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

.title-row,
.section-heading,
.panel-heading,
.actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-hero {
  align-items: flex-end;
  justify-content: space-between;
  margin: 16px 0 34px;
}

.dashboard-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
}

.dashboard-hero p {
  max-width: 650px;
  margin-bottom: 0;
  font-size: .95rem;
}

.stats-grid {
  display: grid;
  gap: 15px;
  margin-bottom: 24px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  position: relative;
  display: grid;
  min-height: 136px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #261d1a;
  border-radius: 19px;
  background: var(--panel-solid);
  box-shadow: none;
}

.stat-card::after {
  display: none;
}

.stat-card span {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.stat-card strong {
  align-self: end;
  color: var(--gold-light);
  font-size: 2.35rem;
  font-weight: 720;
  line-height: 1;
  letter-spacing: -.06em;
}

.stat-card small {
  color: var(--faint);
  font-size: .67rem;
}

.setup-empty-panel {
  padding: 0;
}

.setup-settings-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 24px 24px;
  padding: 16px;
  border: 1px solid #281c3d;
  border-radius: 14px;
  background: #110d18;
}

.setup-settings-action p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}

.setup-button {
  flex: 0 0 auto;
  color: var(--text);
  border-color: #49336c;
  background: var(--panel-hover);
}

.setup-button:hover {
  color: var(--text);
  border-color: #6f52a0;
  background: #2a1a42;
}

.setup-next-steps {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.setup-next-steps article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #261d1a;
  border-radius: 14px;
  background: var(--panel-solid);
}

.setup-next-steps span {
  color: var(--gold);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .12em;
}

.setup-next-steps strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: .86rem;
}

.setup-next-steps b {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #07140e;
  border-radius: 50%;
  background: var(--green);
  font-size: .72rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.setup-next-steps article.is-complete {
  border-color: #28553f;
  background: #101a18;
}

.setup-next-steps article.is-complete span {
  color: var(--green);
}

.setup-next-steps small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

.dashboard-manual-deploy {
  margin-bottom: 22px;
}

.dashboard-manual-deploy .panel-number {
  width: auto;
  padding: 0 12px;
}

.settings-hero .ghost-link {
  flex: 0 0 auto;
}

.config-grid {
  margin-bottom: 34px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.config-grid .form-panel {
  padding: 20px;
}

.config-grid .panel-heading {
  gap: 11px;
}

.config-grid .panel-number {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.config-grid .panel-heading h2 {
  font-size: 1.02rem;
}

.config-grid .panel-heading p {
  font-size: .68rem;
}

.config-panel {
  align-self: start;
}

.config-panel:not([open]) {
  padding-bottom: 8px;
}

.config-panel summary {
  cursor: pointer;
  list-style: none;
}

.config-panel summary::-webkit-details-marker {
  display: none;
}

.config-panel summary > div {
  min-width: 0;
  flex: 1;
}

.config-toggle {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: .62rem;
  font-weight: 820;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.config-toggle::after {
  display: inline-block;
  margin-left: 7px;
  content: "+";
  font-size: .9rem;
}

.config-panel[open] .config-toggle::after {
  content: "−";
}

.config-panel:not([open]) .panel-heading {
  margin-bottom: 0;
  border-bottom-color: #0b0712;
}

.form-panel {
  margin-bottom: 0;
  padding: 26px;
  transition: none;
}

.form-panel:hover {
  border-color: #493a26;
  background: var(--panel-hover);
}

.panel-heading {
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-purple);
}

.panel-heading p {
  margin: 4px 0 0;
  font-size: .74rem;
}

.panel-number {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--gold);
  border: 1px solid #3c2f21;
  border-radius: 12px;
  background: #181216;
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .09em;
}

form {
  margin: 0;
}

label {
  display: block;
  margin: 13px 0 5px;
  color: #d9d0e7;
  font-size: .68rem;
  font-weight: 760;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.form-note {
  margin: 16px 0 4px;
  padding: 11px 12px;
  color: #cfc2df;
  border-left: 2px solid var(--gold);
  border-radius: 0 9px 9px 0;
  background: #171116;
  font-size: .75rem;
  line-height: 1.55;
}

input,
select,
textarea,
button {
  width: 100%;
  color: var(--text);
  border: 1px solid #281c3d;
  border-radius: 11px;
  outline: none;
  background: #09050f;
  font: inherit;
  transition: none;
}

input,
select,
textarea {
  display: block;
  margin-top: 6px;
  padding: 11px 12px;
  font-size: .79rem;
  font-weight: 500;
}

input::placeholder,
textarea::placeholder {
  color: #6e627e;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #49336c;
  background: #0d0716;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #a18342;
  background: #0d0717;
  box-shadow: none;
}

button {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  padding: 11px 17px;
  cursor: pointer;
  color: #1b1028;
  border-color: #5e5345;
  background: var(--gold);
  box-shadow: none;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .045em;
}

button:hover {
  border-color: #bbae94;
  background: var(--gold-light);
  box-shadow: none;
  transform: none;
}

button:active {
  transform: none;
}

button.full {
  width: 100%;
}

button.small {
  margin: 0;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: .64rem;
}

button.ghost {
  color: var(--muted);
  border-color: #281c3d;
  background: #110d18;
  box-shadow: none;
}

button.ghost:hover {
  color: var(--text);
  border-color: #524128;
  background: #1a1417;
}

button.danger {
  color: #ffdfe5;
  border-color: #482432;
  background: #21121e;
  box-shadow: none;
}

button.danger:hover {
  border-color: #793c4c;
  background: #321a26;
}

.table-panel {
  padding: 0;
}

.webhook-setup-panel {
  margin-bottom: 24px;
  border-color: #4d3e27;
}

.webhook-setup-body {
  display: grid;
  gap: 18px;
  padding: 22px 24px 25px;
}

.webhook-intro {
  margin: 0;
  color: #d9cde8;
  font-size: .82rem;
  line-height: 1.65;
}

.webhook-copy-grid,
.webhook-settings-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.copy-field {
  display: grid;
  align-items: center;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.copy-field input {
  min-width: 0;
}

.copy-field button {
  margin-top: 6px;
  white-space: nowrap;
}

.webhook-settings-grid article {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid #201631;
  border-radius: 11px;
  background: #0a0610;
}

.webhook-settings-grid span {
  color: var(--faint);
  font-size: .62rem;
  font-weight: 780;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.webhook-settings-grid strong {
  color: #e6dcef;
  font-size: .78rem;
}

.admin-panel {
  margin-bottom: 24px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}

.admin-tabs a {
  padding: 10px 13px;
  color: var(--muted);
  border: 1px solid #2d2142;
  border-radius: 11px;
  background: #10091a;
  font-size: .68rem;
  font-weight: 820;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.admin-tabs a:hover {
  color: var(--text);
  border-color: #4b376c;
}

.branding-preview-grid {
  display: grid;
  gap: 14px;
  margin: 18px 0 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.branding-preview-grid article {
  display: grid;
  gap: 10px;
  min-height: 128px;
  padding: 15px;
  border: 1px solid #261d1a;
  border-radius: 14px;
  background: var(--panel-solid);
}

.branding-preview-grid article > span {
  color: var(--gold);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.branding-preview-grid img {
  display: block;
  max-width: 180px;
  max-height: 54px;
  padding: 8px;
  border: 1px solid #281c3d;
  border-radius: 10px;
  background: #09050f;
}

.branding-preview-grid strong {
  color: var(--muted);
  font-size: .78rem;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-cell strong,
.admin-user-cell small {
  display: block;
}

.admin-user-cell strong {
  color: var(--text);
  font-size: .78rem;
}

.admin-user-cell small {
  color: var(--muted);
  font-size: .68rem;
}

.role-pill {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid #2e241d;
  border-radius: 999px;
  color: var(--muted);
  background: #110d18;
  font-size: .65rem;
  font-weight: 820;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.role-pill.is-admin,
.role-pill.is-active {
  color: var(--green);
  border-color: #28553f;
  background: #101a18;
}

.role-pill.is-revoked {
  color: var(--red);
  border-color: #482432;
  background: #180d19;
}

.admin-actions {
  min-width: 230px;
}

.button-link.small {
  padding: 7px 10px;
  color: #dcd4e8;
  border-color: #382750;
  background: #160d24;
  font-size: .63rem;
}

.section-heading {
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line-purple);
}

.section-heading h2 {
  margin: 0;
  font-size: 1.32rem;
}

.section-heading .eyebrow {
  margin-bottom: 7px;
}

.count-pill {
  padding: 6px 10px;
  color: var(--gold);
  border: 1px solid #31261e;
  border-radius: 999px;
  background: #171116;
  font-size: .62rem;
  font-weight: 780;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 17px;
  border-bottom: 1px solid #1a1227;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #8f839f;
  background: #0a0611;
  font-size: .62rem;
  font-weight: 830;
  letter-spacing: .11em;
  text-transform: uppercase;
}

td {
  color: #dcd4e8;
  font-size: .76rem;
}

tbody tr {
  transition: none;
}

tbody tr:hover {
  background: #110a1e;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody td.muted {
  padding: 30px 18px;
  text-align: center;
}

td > a[href^="/deployments/"] {
  display: inline-flex;
  padding: 4px 8px;
  color: var(--gold-light);
  border: 1px solid #2e241d;
  border-radius: 8px;
  background: #171116;
  font-size: .68rem;
  font-weight: 800;
}

code,
pre {
  color: #e2d4fb;
  border: 1px solid #1e152e;
  border-radius: 8px;
  background: #09050f;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 3px 6px;
  overflow-wrap: anywhere;
  font-size: .68rem;
}

pre {
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
}

.actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.actions form:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.actions input {
  min-width: 190px;
  margin: 0;
}

.deployment-actions {
  min-width: 82px;
}

.deployment-actions form {
  margin: 0;
}

.deployment-actions button {
  white-space: nowrap;
}

.commit-cell {
  min-width: 240px;
}

.commit-cell strong,
.commit-cell small {
  display: block;
}

.commit-cell strong {
  margin-bottom: 5px;
  color: var(--text);
  font-size: .82rem;
  font-weight: 760;
  line-height: 1.35;
}

.commit-cell small {
  color: var(--muted);
  font-size: .68rem;
}

.commit-cell code {
  margin-right: 6px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: #110d18;
  font-size: .67rem;
  font-weight: 820;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.status::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: currentColor;
  box-shadow: none;
}

.status-succeeded,
.status-baseline {
  color: var(--green);
  background: #10131a;
}

.status-failed {
  color: var(--red);
  background: #180d19;
}

.status-running,
.status-queued {
  color: var(--blue);
  background: #12111f;
}

.flash {
  position: relative;
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 13px 16px 13px 42px;
  color: #d9ffeb;
  border: 1px solid #23403a;
  border-radius: 13px;
  background: #12181d;
  box-shadow: none;
  font-size: .78rem;
}

.flash::before {
  position: absolute;
  top: 17px;
  left: 18px;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--green);
  box-shadow: none;
}

.flash.error {
  color: #ffdce4;
  border-color: #4d2735;
  background: #1d101c;
}

.flash.error::before {
  background: var(--red);
  box-shadow: none;
}

.auth-page {
  display: grid;
  place-items: start center;
}

.auth-page main {
  width: 100%;
  max-width: 1240px;
  padding: 28px;
}

.login-shell {
  display: grid;
  min-height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  border: 1px solid #2e241d;
  border-radius: 30px;
  background: #0f0918;
  box-shadow: none;
  grid-template-columns: 1.2fr .8fr;
}

.login-intro {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(30px, 5vw, 72px);
  overflow: hidden;
  border-right: 1px solid #261d1a;
  background: #160d24;
}

.login-intro::after {
  display: none;
}

.login-brand {
  position: relative;
  z-index: 2;
  align-self: flex-start;
}

.login-message {
  position: relative;
  z-index: 2;
  max-width: 610px;
  margin: 70px 0;
}

.login-message h1 {
  font-size: clamp(3rem, 6.2vw, 6.1rem);
  line-height: .94;
}

.login-message h1 em {
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.06em;
}

.login-message p {
  max-width: 520px;
  margin: 24px 0 0;
  color: #b9aec8;
  font-size: clamp(.85rem, 1.3vw, 1rem);
  line-height: 1.75;
}

.feature-list {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
}

.feature-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b9aec7;
  font-size: .67rem;
  font-weight: 650;
}

.feature-list b {
  color: var(--gold);
  font-size: .56rem;
  letter-spacing: .08em;
}

.login-card {
  display: flex;
  width: min(100%, 480px);
  align-self: center;
  justify-self: center;
  flex-direction: column;
  margin: 34px;
  padding: clamp(28px, 5vw, 48px);
  border-color: #33281f;
  background: #140c20;
}

.login-card .panel-heading {
  display: block;
  margin-bottom: 20px;
}

.login-card .panel-heading h2 {
  margin-bottom: 8px;
  font-size: 2rem;
  letter-spacing: -.05em;
}

.login-card .panel-heading p {
  max-width: 320px;
  font-size: .76rem;
  line-height: 1.65;
}

.login-card label {
  margin-top: 17px;
}

.login-card input {
  padding: 13px 14px;
}

.login-card button {
  margin-top: 24px;
  padding: 13px 16px;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--faint);
  font-size: .61rem;
  font-weight: 650;
}

.secure-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: none;
}

.back-link {
  display: inline-block;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 720;
}

.deployment-detail {
  max-width: 960px;
}

.deployment-detail dl {
  display: grid;
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid var(--line-purple);
  border-radius: 15px;
  grid-template-columns: 190px 1fr;
}

.deployment-detail dt,
.deployment-detail dd {
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-purple);
}

.deployment-detail dt {
  color: var(--faint);
  background: #0a0611;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.deployment-detail dd {
  overflow-wrap: anywhere;
  color: #ddd4e9;
  font-size: .75rem;
}

.deployment-detail dt:last-of-type,
.deployment-detail dd:last-of-type {
  border-bottom: 0;
}

.setup-page main {
  width: min(1240px, 100%);
}

.setup-main {
  padding-top: 28px;
}

.setup-brand {
  margin-bottom: 52px;
}

.setup-hero {
  max-width: 820px;
  margin-bottom: 38px;
}

.setup-hero h1,
.setup-complete h1 {
  font-size: clamp(2.6rem, 6vw, 5.1rem);
}

.setup-hero p,
.setup-complete p {
  max-width: 680px;
  color: var(--muted);
  font-size: .92rem;
}

.setup-form {
  display: grid;
  gap: 22px;
}

.setup-section {
  margin: 0;
  padding: 28px;
}

.setup-fields {
  display: grid;
  gap: 2px 18px;
}

.setup-fields.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setup-fields.three-columns {
  grid-template-columns: 1fr 150px 1fr;
}

.setup-fields .span-two {
  grid-column: span 2;
}

.setup-options {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #201631;
  border-radius: 12px;
  background: #0a0610;
  cursor: pointer;
  text-transform: none;
}

.check-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--gold);
}

.check-row span {
  display: grid;
  gap: 3px;
}

.check-row strong {
  color: #ddd4e9;
  font-size: .7rem;
  letter-spacing: .02em;
}

.check-row small {
  color: var(--faint);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
}

.input-action {
  display: grid;
  align-items: center;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.input-action input {
  min-width: 0;
}

.input-action button {
  margin-top: 6px;
  white-space: nowrap;
}

.setup-submit {
  position: sticky;
  bottom: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid #403323;
  border-radius: 16px;
  background: #160d24;
  box-shadow: none;
}

.setup-submit div {
  display: grid;
  gap: 2px;
}

.setup-submit strong {
  font-size: .75rem;
}

.setup-submit span {
  color: var(--faint);
  font-size: .65rem;
}

.setup-submit button {
  margin: 0;
}

.setup-errors {
  margin-bottom: 22px;
  padding: 16px 18px;
  color: #ffdce4;
  border: 1px solid #542a38;
  border-radius: 14px;
  background: #1d101c;
}

.setup-errors strong {
  font-size: .78rem;
}

.setup-errors ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #e8c4cd;
  font-size: .7rem;
}

.setup-complete {
  max-width: 800px;
  margin: 70px auto;
  padding: clamp(30px, 6vw, 65px);
  text-align: center;
}

.setup-complete p {
  margin: 18px auto 28px;
}

.setup-check {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 26px;
  place-items: center;
  color: #12261c;
  border-radius: 50%;
  background: var(--green);
  box-shadow: none;
  font-size: 1.4rem;
  font-weight: 900;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: #1b1028;
  border: 1px solid #5e5345;
  border-radius: 11px;
  background: var(--gold);
  box-shadow: none;
  font-size: .72rem;
  font-weight: 850;
}

.button-link:hover {
  color: #1b1028;
  background: var(--gold-light);
}

.two-factor-card {
  width: min(100%, 520px);
}

.security-shell {
  align-items: start;
  grid-template-columns: 1fr 1fr;
}

.security-shell .login-card {
  align-self: start;
}

.two-factor-card .panel-heading p {
  max-width: 400px;
}

.authenticator-qr {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 15px;
  border: 1px solid #403323;
  border-radius: 16px;
  background: #160d24;
  text-align: center;
}

.qr-frame {
  display: grid;
  width: 240px;
  height: 240px;
  place-items: center;
  padding: 7px;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.qr-frame svg {
  display: block;
  width: 100%;
  height: 100%;
}

.authenticator-qr strong,
.authenticator-qr span {
  display: block;
}

.authenticator-qr strong {
  margin-bottom: 6px;
  color: var(--gold-light);
  font-size: .77rem;
}

.authenticator-qr span {
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.55;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: var(--faint);
  font-size: .58rem;
  font-weight: 780;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--line-purple);
}

.setup-key {
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--line-purple);
  border-radius: 13px;
  background: #090610;
}

.setup-key div {
  display: grid;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-purple);
  gap: 8px;
  grid-template-columns: 82px minmax(0, 1fr);
}

.setup-key div:last-child {
  border-bottom: 0;
}

.setup-key dt {
  color: var(--faint);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.setup-key dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: .75rem;
}

.setup-key code {
  display: block;
  padding: 5px 7px;
  color: var(--gold-light);
  letter-spacing: .07em;
  user-select: all;
}

.authenticator-link {
  display: block;
  padding: 10px 12px;
  color: var(--purple-light);
  border: 1px solid #251a38;
  border-radius: 10px;
  background: #120a1f;
  font-size: .68rem;
  font-weight: 750;
  text-align: center;
}

.cancel-auth {
  text-align: center;
}

.cancel-auth button {
  margin-top: 12px;
}

.security-page {
  max-width: 1100px;
  margin: 0 auto;
}

.security-page > .title-row {
  justify-content: space-between;
  margin: 18px 0 30px;
}

.security-page > .title-row p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.security-grid {
  align-items: start;
}

.security-status {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 20px;
}

.security-status p {
  margin-bottom: 0;
  color: var(--muted);
}

.status-seal {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  place-items: center;
  color: #10251a;
  border-radius: 22px;
  background: var(--green);
  box-shadow: none;
  font-size: .86rem;
  font-weight: 950;
}

.recovery-panel {
  padding: clamp(24px, 5vw, 48px);
}

.recovery-warning {
  margin-bottom: 24px;
  padding: 14px 16px;
  color: #ffe8b0;
  border: 1px solid #3c2f21;
  border-radius: 12px;
  background: #1a1417;
  font-size: .75rem;
}

.recovery-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recovery-grid code {
  padding: 12px;
  color: var(--gold-light);
  font-size: .82rem;
  letter-spacing: .12em;
  text-align: center;
  user-select: all;
}

.ghost-link {
  color: var(--muted);
  border-color: #281c3d;
  background: #110d18;
  box-shadow: none;
}

.ghost-link:hover {
  color: var(--text);
  background: #1a1417;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: 430px;
    border-right: 0;
    border-bottom: 1px solid #261d1a;
  }

  .login-message {
    margin: 60px 0;
  }
}

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

  .config-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    display: block;
  }

  .setup-next-steps {
    grid-template-columns: 1fr;
  }

  .setup-settings-action {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-button {
    justify-content: center;
  }

  .topbar {
    align-items: flex-start;
  }

  .user-copy {
    display: none;
  }

  .user-actions {
    gap: 6px;
  }

  .account-dropdown {
    right: 0;
  }

  .setup-fields.three-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  main,
  .auth-page main {
    padding: 18px 12px 44px;
  }

  .topbar {
    min-height: 64px;
    padding: 10px 13px;
  }

  .brand-copy small,
  .user-avatar {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    min-height: 115px;
    padding: 15px;
  }

  .stat-card strong {
    font-size: 1.85rem;
  }

  .login-shell {
    min-height: auto;
    border-radius: 22px;
  }

  .login-intro {
    min-height: 360px;
    padding: 28px;
  }

  .login-message {
    margin: 50px 0 30px;
  }

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

  .login-card {
    width: auto;
    margin: 16px;
    padding: 25px 20px;
  }

  .security-page > .title-row {
    display: block;
  }

  .security-page > .title-row .button-link {
    margin-top: 18px;
  }

  .security-status {
    align-items: flex-start;
  }

  .recovery-grid {
    grid-template-columns: 1fr;
  }

  .authenticator-qr {
    text-align: center;
  }

  .qr-frame {
    width: min(240px, 100%);
    height: auto;
    aspect-ratio: 1;
    justify-self: center;
  }

  .section-heading {
    padding: 18px;
  }

  .config-toggle {
    font-size: 0;
  }

  .config-toggle::after {
    margin-left: 0;
    font-size: 1rem;
  }

  th,
  td {
    padding: 12px;
  }

  .deployment-detail dl {
    grid-template-columns: 1fr;
  }

  .deployment-detail dt,
  .deployment-detail dd {
    border-bottom: 0;
  }

  .deployment-detail dd {
    border-bottom: 1px solid var(--line-purple);
  }

  .setup-brand {
    margin-bottom: 35px;
  }

  .setup-fields.two-columns,
  .setup-fields.three-columns {
    grid-template-columns: 1fr;
  }

  .setup-fields .span-two {
    grid-column: auto;
  }

  .webhook-copy-grid,
  .webhook-settings-grid,
  .branding-preview-grid {
    grid-template-columns: 1fr;
  }

  .copy-field {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .copy-field button:last-child:not(:nth-child(2)) {
    grid-column: 2;
  }

  .setup-section {
    padding: 21px 18px;
  }

  .input-action {
    grid-template-columns: 1fr;
  }

  .input-action button {
    justify-self: start;
    margin-top: 0;
  }

  .setup-submit {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .setup-submit button {
    width: 100%;
  }
}

/* Large native-resolution displays amplify every painted layer. */
@media (min-width: 2500px), (min-height: 1800px) {
  body {
    background: #0b0712;
  }

  body::before,
  .panel::before,
  .stat-card::after {
    display: none;
  }

  .topbar,
  .panel,
  .stat-card,
  button,
  .button-link,
  .brand-mark {
    box-shadow: none;
  }

  .topbar {
    position: static;
  }

  .panel,
  .stat-card {
    background: var(--panel-solid);
  }

  .form-panel,
  input,
  select,
  textarea,
  button,
  a,
  tbody tr {
    transition: none;
  }

  button:hover,
  button:active {
    transform: none;
  }
}
