:root {
  color-scheme: dark;
  --bg: #070b13;
  --bg-deep: #04070d;
  --panel: #0d1422;
  --panel-2: #111a2a;
  --panel-3: #172134;
  --input: #0a111e;
  --border: #29354a;
  --border-strong: #3b4962;
  --text: #edf2ff;
  --muted: #9ba8be;
  --subtle: #6f7c92;
  --pink: #f7259f;
  --pink-hover: #ff47b4;
  --purple: #7c3aed;
  --cyan: #38bdf8;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --header-h: 68px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid rgba(41, 53, 74, 0.85);
  background: rgba(7, 11, 19, 0.94);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  width: min(1440px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 210px;
  font-size: 18px;
  font-weight: 800;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--pink);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  min-height: 38px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.nav-link.active {
  color: var(--pink);
}

.menu-button {
  display: none;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border: 1px solid var(--pink);
  border-radius: 6px;
  background: var(--pink);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.header-cta {
  margin-left: 10px;
}

.nav-logout-mobile {
  display: none;
  width: 100%;
  text-align: left;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--panel-3);
}

.btn-primary {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--pink-hover);
}

.btn-purple {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.btn-danger {
  border-color: #842f3b;
  background: #3a1720;
  color: #ffb7c0;
}

.btn-quiet {
  background: transparent;
}

.btn:disabled {
  border-color: var(--border);
  background: #222b3b;
  color: #6f7b8f;
  cursor: not-allowed;
  opacity: 0.58;
}

.btn:disabled:hover {
  border-color: var(--border);
  background: #222b3b;
  color: #6f7b8f;
}

.page {
  min-height: calc(100vh - var(--header-h));
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--header-h) - 130px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #050814 url("/assets/preview_city_neon.png") center 58% / cover no-repeat;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(3, 7, 15, 0.63);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: 84px 0;
}

.hero-mark {
  width: 86px;
  height: 86px;
  margin-bottom: 22px;
  filter: drop-shadow(0 0 18px rgba(247, 37, 159, 0.4));
}

.eyebrow,
.section-kicker {
  color: var(--pink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 8px 0 18px;
  font-size: clamp(48px, 8vw, 94px);
  line-height: 0.98;
}

.hero p {
  max-width: 650px;
  margin: 0;
  color: #c4cee0;
  font-size: 19px;
  line-height: 1.65;
}

.hero .hero-subtitle {
  max-width: 620px;
  margin: -6px 0 0;
  color: #d6e1f5;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.35;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 38px;
  color: #afbdd2;
  font-size: 13px;
}

.trust-row span::before {
  margin-right: 8px;
  color: var(--green);
  content: "●";
}

.band {
  padding: 68px 0;
  border-bottom: 1px solid var(--border);
}

#licencje {
  scroll-margin-top: var(--header-h);
}

.band-alt {
  background: #09101b;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head h2,
.page-title h1 {
  margin: 6px 0 0;
  font-size: clamp(30px, 5vw, 48px);
}

.section-head p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.feature-grid,
.pricing-grid,
.stat-grid,
.action-grid {
  display: grid;
  gap: 16px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.feature {
  min-height: 190px;
  padding: 24px;
}

.feature-index {
  color: var(--cyan);
  font-family: Consolas, monospace;
  font-size: 12px;
}

.feature h3 {
  margin: 24px 0 10px;
  font-size: 20px;
}

.feature p,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 430px;
  padding: 26px;
}

.pricing-card.featured {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px rgba(247, 37, 159, 0.2);
}

.plan-badge {
  position: absolute;
  top: 0;
  right: 22px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--pink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.pricing-card h3 {
  margin: 4px 0 10px;
  font-size: 24px;
}

.price {
  margin: 18px 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
}

.price small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.plan-note {
  min-height: 58px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(247, 37, 159, 0.35);
  border-radius: 6px;
  background: rgba(247, 37, 159, 0.08);
  color: #f6b6dc;
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  align-items: center;
}

.plan-note-empty {
  visibility: hidden;
}

.feature-list {
  display: grid;
  gap: 12px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 10px;
  color: #cbd5e4;
  font-size: 14px;
}

.feature-list li::before {
  color: var(--green);
  content: "✓";
}

.plan-action-zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.pricing-card .btn {
  width: 100%;
}

.page-hero {
  padding: 62px 0 36px;
  border-bottom: 1px solid var(--border);
  background: #09101b;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.page-title p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
  padding: 40px 0 72px;
}

.form-layout > *,
.page-title > * {
  min-width: 0;
}

.form-card {
  width: 100%;
  max-width: 100%;
  padding: 28px;
}

.form-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.form-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  color: #c5cfdf;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--input);
  color: var(--text);
  padding: 11px 13px;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(247, 37, 159, 0.12);
}

.field-hint {
  color: var(--subtle);
  font-size: 12px;
}

.plan-choice-group {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.plan-choice-group legend {
  margin-bottom: 9px;
  color: #c5cfdf;
  font-size: 13px;
  font-weight: 700;
}

.plan-choice-grid {
  display: grid;
  gap: 8px;
}

.plan-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input);
  cursor: pointer;
}

.plan-choice:has(input:checked) {
  border-color: var(--pink);
  background: var(--panel-3);
  box-shadow: 0 0 0 2px rgba(247, 37, 159, 0.1);
}

.plan-choice input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--pink);
}

.plan-choice-body {
  display: grid;
  gap: 3px;
}

.plan-choice-body small {
  color: var(--muted);
  line-height: 1.35;
}

.plan-choice-price {
  color: var(--pink);
  font-weight: 800;
  white-space: nowrap;
}

.selected-plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 13px 15px;
  border-left: 3px solid var(--pink);
  background: var(--panel-3);
  color: var(--muted);
}

.selected-plan-summary strong {
  color: var(--text);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--pink);
}

.checkbox-row a {
  color: var(--pink);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.info-panel {
  width: 100%;
  max-width: 100%;
  padding: 24px;
}

.info-panel h3 {
  margin: 0 0 16px;
}

.info-panel pre {
  max-height: 500px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input);
  color: #d7dfed;
  white-space: pre-wrap;
  font: 13px/1.65 "Segoe UI", sans-serif;
}

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--pink);
  font-weight: 800;
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--panel-2);
  color: #cbd5e4;
  line-height: 1.5;
}

.alert-info {
  border-left-color: var(--cyan);
}

.alert-success {
  border-left-color: var(--green);
}

.alert-warning {
  border-left-color: var(--yellow);
}

.alert-error {
  border-left-color: var(--red);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subtle);
  content: "";
}

.status-active::before,
.status-approved::before {
  background: var(--green);
}

.status-pending::before {
  background: var(--yellow);
}

.status-suspended::before,
.status-in_progress::before {
  background: var(--yellow);
}

.status-error::before,
.status-rejected::before,
.status-revoked::before,
.status-expired::before {
  background: var(--red);
}

.status-completed::before,
.status-resolved::before {
  background: var(--green);
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #080e19;
  padding: 22px 14px;
}

.sidebar-label {
  margin: 8px 12px 10px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 3px;
}

.side-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.side-link:hover,
.side-link.active {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.side-link.active {
  border-left-color: var(--pink);
  color: var(--pink);
}

.sidebar-art {
  min-height: 180px;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #060a12 url("/assets/sidebar_art_neon.png") center / cover no-repeat;
}

.app-main {
  min-width: 0;
  padding: 30px;
}

.app-main-inner {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.app-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.app-page-head h1 {
  margin: 0;
  font-size: 30px;
}

.app-page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.stat-card {
  min-height: 132px;
  padding: 20px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 15px;
  font-size: 25px;
  font-weight: 800;
}

.stat-meta {
  margin-top: 7px;
  color: var(--subtle);
  font-size: 12px;
}

.content-section {
  margin-top: 20px;
  padding: 22px;
}

.content-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.content-section h2 {
  margin: 0;
  font-size: 19px;
}

.action-item {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.action-item h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.action-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: #101827;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.data-table td {
  color: #d6deec;
  font-size: 13px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  gap: 7px;
}

.table-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.admin-search {
  display: flex;
  gap: 8px;
}

.admin-search input {
  min-width: 240px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--input);
  color: var(--text);
  padding: 9px 12px;
}

.admin-search input:focus {
  border-color: var(--pink);
}

.plan-admin-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.plan-admin-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1fr) minmax(220px, 1.5fr) 110px minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.plan-admin-row:last-child {
  border-bottom: 0;
}

.plan-admin-row .field {
  min-width: 0;
  margin-bottom: 0;
}

.plan-admin-title {
  display: grid;
  gap: 5px;
  align-self: center;
}

.plan-admin-title span {
  color: var(--muted);
  font-size: 12px;
}

.plan-admin-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  align-self: center;
}

.plan-admin-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.plan-admin-options input {
  accent-color: var(--pink);
}

.gallery-admin-list {
  display: grid;
  gap: 14px;
}

.gallery-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 12, 24, 0.48);
}

.gallery-admin-title {
  display: grid;
  gap: 5px;
  align-self: center;
  min-width: 0;
}

.gallery-admin-title span {
  color: var(--muted);
  font-size: 12px;
}

.gallery-admin-title a,
.gallery-admin-title small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.gallery-admin-title a:hover {
  color: var(--pink);
}

.gallery-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-edit-dialog {
  width: min(640px, calc(100% - 28px));
}

.gallery-preview-dialog {
  width: min(920px, calc(100% - 28px));
}

.gallery-github-dialog {
  width: min(1040px, calc(100% - 28px));
}

.gallery-edit-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.gallery-edit-form .field {
  margin: 0;
}

.gallery-preview-body {
  display: grid;
  place-items: center;
  padding: 18px;
}

.gallery-preview-body img,
.gallery-preview-media {
  width: 100%;
  max-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #050814;
}

.gallery-preview-body img {
  object-fit: contain;
}

.gallery-preview-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.gallery-preview-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery-github-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.gallery-github-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-height: min(62vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.gallery-github-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 12, 24, 0.62);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.gallery-github-card:hover,
.gallery-github-card:focus-visible {
  border-color: rgba(255, 45, 170, 0.45);
}

.gallery-github-card:focus-visible {
  outline: 2px solid rgba(255, 45, 170, 0.42);
  outline-offset: 2px;
}

.gallery-github-card.is-selected {
  border-color: var(--pink);
  background: rgba(255, 45, 170, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 45, 170, 0.3);
}

.gallery-github-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.gallery-github-select input {
  accent-color: var(--pink);
}

.gallery-github-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #050814;
  cursor: pointer;
  overflow: hidden;
}

.gallery-github-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 160ms ease, filter 160ms ease;
}

.gallery-github-preview:hover img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

.gallery-github-card strong,
.gallery-github-card a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-github-card a {
  color: var(--muted);
  font-size: 12px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.audit-id {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-details {
  display: block;
  max-width: 360px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.wallet-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  overflow-x: hidden;
}

.wallet-dialog::backdrop {
  background: rgba(2, 5, 11, 0.78);
}

.wallet-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.wallet-dialog-head h2,
.wallet-dialog-head strong {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-dialog-head .btn {
  flex: 0 0 auto;
}

#wallet-credit-form {
  padding: 20px;
}

.empty-state,
.loading-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 30px;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state .form-actions {
  justify-content: center;
}

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

.gallery-item {
  overflow: hidden;
}

.gallery-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--input);
  color: inherit;
  cursor: pointer;
  overflow: hidden;
}

.gallery-image-button img,
.gallery-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--input);
}

.gallery-image-button img {
  display: block;
  transition: transform 160ms ease, filter 160ms ease;
}

.gallery-image-button:hover img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

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

.gallery-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery-item h2 {
  margin: 0;
  padding: 16px;
  font-size: 17px;
}

.gallery-lightbox {
  width: min(1120px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid rgba(255, 45, 170, 0.38);
  border-radius: 10px;
  background: rgba(5, 8, 20, 0.98);
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.62), 0 0 36px rgba(255, 45, 170, 0.18);
}

.gallery-lightbox::backdrop {
  background: rgba(2, 5, 11, 0.84);
  backdrop-filter: blur(8px);
}

.gallery-lightbox-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  margin: 0;
}

.gallery-lightbox-figure img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 138px);
  object-fit: contain;
  background: #02050b;
}

.gallery-lightbox-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: rgba(8, 13, 26, 0.94);
}

.gallery-lightbox-figure figcaption strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-lightbox-figure figcaption span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 12, 24, 0.78);
  color: var(--text);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-arrow:hover {
  border-color: rgba(255, 45, 170, 0.75);
  background: rgba(255, 45, 170, 0.16);
  color: var(--pink);
}

.gallery-lightbox-close {
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

.gallery-lightbox-arrow {
  top: 50%;
  width: 48px;
  height: 64px;
  border-radius: 8px;
  font-size: 42px;
  transform: translateY(-50%);
}

.gallery-lightbox-prev {
  left: 14px;
}

.gallery-lightbox-next {
  right: 14px;
}

.gallery-lightbox-arrow:disabled {
  opacity: 0.28;
  cursor: default;
}

.support-form {
  max-width: 680px;
}

.support-panel-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  align-items: start;
  gap: 20px;
}

.support-panel-grid .support-form,
.support-panel-grid .support-inbox {
  max-width: none;
  margin-top: 0;
}

.support-inbox,
.admin-conversation-panel,
.device-panel .content-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.support-ticket-list {
  display: grid;
  gap: 12px;
}

.support-ticket {
  width: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
}

.support-ticket > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-ticket p {
  color: var(--muted);
  white-space: pre-wrap;
}

.support-ticket-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
}

.support-ticket-button:hover {
  border-color: var(--pink);
  background: var(--panel-3);
}

.support-ticket-button > span {
  display: grid;
  gap: 8px;
}

.support-ticket-button > span:last-child {
  justify-items: end;
}

.support-ticket-button small,
.support-message small,
.timeline-item small {
  color: var(--subtle);
}

.support-conversation {
  display: grid;
  gap: 18px;
}

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.conversation-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-conversation-panel .conversation-head > div {
  display: block;
}

.message-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.support-message {
  width: min(86%, 720px);
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input);
}

.support-message-admin {
  justify-self: end;
  border-color: rgba(247, 37, 159, 0.55);
  background: rgba(247, 37, 159, 0.08);
}

.support-message p {
  margin: 7px 0 10px;
  color: #d4ddec;
  line-height: 1.55;
  white-space: pre-wrap;
}

.reply-form {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.device-panel {
  display: grid;
  gap: 20px;
}

.device-panel .content-section {
  margin-top: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--border);
}

.detail-grid > div {
  min-width: 0;
  padding: 15px;
  background: var(--input);
}

.detail-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.reset-counter {
  display: grid;
  min-width: 68px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--pink);
  border-radius: 6px;
  color: var(--pink);
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-item > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--pink);
  border-radius: 50%;
  color: var(--pink);
  font-weight: 800;
}

.timeline-item p {
  margin: 5px 0;
  color: var(--muted);
}

.device-reset-dialog {
  width: min(620px, calc(100% - 28px));
}

#device-reset-form {
  padding: 20px;
}

.faq-layout {
  width: min(900px, calc(100% - 40px));
}

.faq-list {
  border-top: 1px solid var(--border);
}

.faq-list details {
  border-bottom: 1px solid var(--border);
}

.faq-list summary {
  padding: 20px 42px 20px 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.faq-list details[open] summary {
  color: var(--pink);
}

.faq-list p {
  max-width: 760px;
  margin: -4px 0 20px;
  color: var(--muted);
  line-height: 1.65;
}

.status-page {
  display: grid;
  min-height: calc(100vh - var(--header-h));
  place-items: center;
  padding: 50px 20px;
  text-align: center;
}

.status-page-inner {
  width: min(640px, 100%);
}

.status-code {
  color: var(--pink);
  font-size: clamp(72px, 16vw, 150px);
  font-weight: 900;
  line-height: 0.9;
}

.status-page h1 {
  margin: 14px 0 10px;
  font-size: 34px;
}

.status-page p {
  margin: 0 auto 24px;
  color: var(--muted);
  line-height: 1.6;
}

.status-page .form-actions {
  justify-content: center;
}

.document {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

.document h1 {
  margin-top: 0;
  font-size: 38px;
}

.document h2 {
  margin-top: 34px;
  font-size: 20px;
}

.document p,
.document li {
  color: #b8c3d5;
  line-height: 1.75;
}

.document pre {
  max-height: 520px;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: #d7dfed;
  white-space: pre-wrap;
  font: 14px/1.7 "Segoe UI", sans-serif;
}

.tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input);
}

.tab {
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  background: var(--panel-3);
  color: var(--text);
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: 82px;
  right: 18px;
  display: grid;
  width: min(390px, calc(100% - 36px));
  gap: 10px;
}

.toast {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 7px;
  background: #101827;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
  color: #dbe4f2;
  line-height: 1.45;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

.toast.warning {
  border-left-color: var(--yellow);
}

.site-footer {
  padding: 34px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  color: var(--subtle);
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.turnstile-box {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.attachment-link:hover {
  border-color: rgba(255, 45, 170, 0.65);
  color: var(--pink);
}

.download-panel,
.release-list,
.release-admin-list {
  display: grid;
  gap: 14px;
}

.release-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(6, 12, 24, 0.52);
}

.release-card p {
  grid-column: 1 / -1;
  margin: 0;
}

.old-release-panel {
  justify-self: end;
  width: min(100%, 560px);
}

.old-release-panel summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-left: auto;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 45, 170, 0.08);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

.old-release-panel summary:hover {
  border-color: rgba(255, 45, 170, 0.62);
  color: var(--pink);
}

.old-release-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.release-card-old {
  background: rgba(6, 12, 24, 0.34);
}

.release-password {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid rgba(255, 45, 170, 0.28);
  border-radius: 8px;
  background: rgba(255, 45, 170, 0.07);
}

.release-password span {
  color: var(--muted);
}

.release-password code {
  color: var(--text);
  word-break: break-all;
}

@media (max-width: 1000px) {
  .feature-grid,
  .pricing-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    min-height: 0;
  }

  .gallery-github-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-layout {
    grid-template-columns: 1fr;
  }

  .support-panel-grid {
    grid-template-columns: 1fr;
  }

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

  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .plan-admin-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-admin-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-inner {
    width: min(100% - 24px, 1180px);
  }

  .public-nav {
    position: absolute;
    top: calc(var(--header-h) - 1px);
    right: 12px;
    left: 12px;
    display: none;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #080e19;
  }

  .public-nav.open {
    display: grid;
  }

  .nav-logout-mobile {
    display: block;
  }

  .menu-button {
    position: absolute;
    top: 14px;
    right: 12px;
    z-index: 45;
    display: inline-grid !important;
    place-items: center;
    visibility: visible;
    opacity: 1;
  }

  .brand {
    min-width: 0;
  }

  .header-cta {
    display: none;
  }

  .hero {
    min-height: calc(100svh - var(--header-h) - 130px);
    background-position: 62% center;
  }

  .hero-content {
    padding: 56px 0;
  }

  .hero h1 {
    font-size: 52px;
  }

  .hero p {
    font-size: 16px;
  }

  .trust-row {
    display: grid;
    gap: 10px;
  }

  .section-head,
  .page-title,
  .app-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-grid,
  .action-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .admin-search {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-search input {
    width: 100%;
    min-width: 0;
  }

  .plan-admin-row {
    grid-template-columns: 1fr;
  }

  .gallery-admin-row {
    grid-template-columns: 1fr;
  }

  .gallery-admin-actions {
    justify-content: flex-start;
  }

  .gallery-github-grid {
    grid-template-columns: 1fr;
  }

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

  .gallery-lightbox {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
  }

  .gallery-lightbox-figure img {
    max-height: calc(100dvh - 150px);
  }

  .gallery-lightbox-arrow {
    width: 40px;
    height: 54px;
    font-size: 34px;
  }

  .gallery-lightbox-prev {
    left: 8px;
  }

  .gallery-lightbox-next {
    right: 8px;
  }

  .gallery-lightbox-figure figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .side-link {
    flex: 0 0 auto;
  }

  .sidebar-label,
  .sidebar-art {
    display: none;
  }

  .app-main {
    padding: 22px 14px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .container,
  .document {
    width: min(100% - 24px, 1180px);
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero-actions,
  .form-actions {
    display: grid;
  }

  .hero-actions .btn,
  .form-actions .btn {
    width: 100%;
  }

  .form-card,
  .info-panel,
  .content-section {
    padding: 18px;
  }

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

  .support-ticket-button,
  .conversation-head {
    align-items: stretch;
    flex-direction: column;
  }

  .support-ticket-button > span:last-child {
    justify-items: start;
  }

  .support-message {
    width: 100%;
  }
}
