:root {
  color-scheme: light;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  background-color: #f7f8fa;
  color: #1f2933;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border-radius: 0.25rem;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  z-index: 100;
}

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

.container {
  width: min(100%, 72rem);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-header {
  background: #1f2933;
  color: #ffffff;
  padding-block: 0.75rem;
  border-bottom: 4px solid #fbbf24;
}

.brand {
  font-weight: 600;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-main {
  padding-block: 2rem 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.35);
  background: #2563eb;
  color: #ffffff;
}

.btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #e2e8f0;
  color: #1f2933;
  box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #cbd5e1;
  color: #1f2933;
  box-shadow: none;
}

.btn-outline {
  background: #ffffff;
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: none;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
}

.btn-block {
  width: 100%;
}

.page-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-block: 0 1.5rem;
  font-weight: 600;
  color: #102a43;
}

.controller-location {
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: #486581;
}

.controller-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.controller-meta p {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
}

.qr-id {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.text-warning {
  color: #b45309;
}

.public-checklist {
  margin: 2.5rem 0;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.public-checklist .section-title {
  margin: 0 0 1.25rem;
}

.checklist-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.checklist-item label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.checklist-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.checklist-label {
  font-size: 1rem;
  color: #1f2933;
  font-weight: 500;
}

.checklist-select {
  padding: 0.55rem 2.25rem 0.55rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #1f2933;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  min-width: 8rem;
  text-transform: capitalize;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.checklist-select:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}

.checklist-select:focus-visible {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.checklist-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #475569;
}

.checklist-status--success {
  color: #047857;
}

.checklist-status--error {
  color: #dc2626;
}

.checklist-status--info {
  color: #475569;
}

.controller-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.controller-card {
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.controller-link {
  display: grid;
  grid-template-rows: auto auto auto;
  height: 100%;
  align-items: start;
  padding: 0 0 1rem;
  gap: 0.1rem;
}

.controller-card:hover,
.controller-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.controller-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #e0e8f9;
}

.controller-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #829ab1;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.controller-label {
  padding: 0 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.controller-subtext {
  padding: 0 1rem;
  font-size: 0.92rem;
  color: #486581;
  line-height: 1.35;
  margin-top: -0.2rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-block: 2rem 1rem;
  color: #243b53;
}

.gallery > .section-title {
  margin-block: 1rem 0.5rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.gallery-group {
  margin-bottom: 2rem;
}

.gallery-group__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.gallery-group__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1f2933;
}

.image-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

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

.image-card {
  margin: 0;
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.image-card__media {
  position: relative;
}

.image-trigger {
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  width: 100%;
  cursor: zoom-in;
}

.image-trigger:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 4px;
}

.image-card img {
  width: 100%;
  display: block;
  object-fit: cover;
}

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

.image-group-select__label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.gallery-load-more.is-hidden {
  display: none;
}

.gallery-section {
  margin-top: 2rem;
}

.gallery-section__title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.gallery-section__description {
  margin-top: -0.25rem;
  margin-bottom: 1rem;
  color: #4b5563;
}

.image-card--upload .image-delete {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.92);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.image-card--upload .image-delete:hover,
.image-card--upload .image-delete:focus-visible {
  background: rgba(220, 38, 38, 1);
  transform: translateY(-1px);
  outline: none;
}

.image-card--upload .image-delete:focus-visible {
  outline: 3px solid rgba(248, 113, 113, 0.6);
  outline-offset: 2px;
}

.empty-state {
  background: #eef2ff;
  color: #3730a3;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.hardware-summary {
  margin-top: 2rem;
}

.hardware-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.hardware-grid--stacked {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.hardware-card {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.hardware-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.hardware-card p {
  margin: 0;
  font-size: 0.95rem;
}

.hardware-card--span {
  grid-column: span 2;
}

.hardware-card--stacked {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .hardware-card--span {
    grid-column: span 1;
  }
}

.hardware-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hardware-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hardware-list--columns {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.hardware-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #111827;
  font-weight: 600;
  font-size: 0.85rem;
}

.hardware-details {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hardware-details dt {
  font-weight: 600;
  font-size: 0.85rem;
  color: #4b5563;
}

.hardware-details dd {
  margin: 0;
}

.hardware-note {
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
}

.hardware-admin-fieldset {
  margin-top: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.hardware-admin-fieldset legend {
  font-weight: 600;
  padding: 0 0.5rem;
}

.hardware-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hardware-item-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hardware-item-row .hardware-item-type {
  flex: 2;
}

.hardware-item-row .hardware-item-qty {
  flex: 1;
  min-width: 140px;
}

.hardware-item-remove {
  white-space: nowrap;
}

/* Responsive stacking for narrow screens */
@media (max-width: 700px) {
  .hardware-item-row .hardware-item-type,
  .hardware-item-row .hardware-item-qty {
    flex: 1 1 100%;
    min-width: 0; /* allow inputs to shrink */
  }
  .hardware-item-row .hardware-item-qty {
    max-width: 10rem; /* keep number inputs reasonable */
  }
  .hardware-item-remove {
    flex: 1 1 100%;
    align-self: flex-start;
  }
}

.hardware-add-btn {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
}

.badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.75rem;
  font-weight: 600;
}

.text-capitalize {
  text-transform: capitalize;
}

.sub-gallery-fieldset {
  margin-top: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: #ffffff;
}

.sub-gallery-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.sub-gallery-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* tighter spacing between blocks */
  padding: 0.5rem 0.5rem 0.5rem; /* reduce inner padding, especially bottom */
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: #f8fafc;
}

.sub-gallery-row__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start; /* align label/anchor headings to same top */
}

.sub-gallery-row__header .form-group {
  flex: 1;
  min-width: 220px;
}

.sub-gallery-row__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.sub-gallery-row .hardware-editor {
  gap: 0.35rem;
}

/* Tighter vertical rhythm inside sub-controller rows */
.sub-gallery-row .form-group {
  margin-bottom: 0.35rem; /* reduce space after each block */
}

.sub-gallery-row .form-group:last-child {
  margin-bottom: 0;
}

/* Smaller labels and textarea inside sub-controller editor */
.sub-gallery-row .form-label {
  margin-bottom: 0.35rem;
}

.sub-gallery-row .form-textarea {
  min-height: 4rem;
}

.sub-gallery-add-content,
.sub-gallery-add-pigtail {
  margin-top: 0.25rem;
}

.sub-gallery-add-content,
.sub-gallery-add-pigtail {
  align-self: flex-start;
}

.sub-gallery-remove {
  white-space: nowrap;
  align-self: center;
}

.sub-gallery-add {
  margin-top: 0.75rem;
}

.form-actions--inline .sub-gallery-add,
.form-actions--inline .sub-gallery-import {
  margin-top: 0;
}

.sub-controller-accordion {
  margin-top: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: 0;
}

.sub-controller-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  padding: 1.25rem 1.5rem;
}

.sub-controller-summary::-webkit-details-marker {
  display: none;
}

.sub-controller-summary__hint {
  margin: 0.15rem 0 0;
  color: #475569;
  font-size: 0.95rem;
}

.sub-controller-summary__toggle {
  font-size: 0.9rem;
  color: #1d4ed8;
}

/* Align the "Controllers" title with the toggle in the summary header */
.sub-controller-summary .section-title {
  margin: 0; /* remove extra top margin so it sits level */
}

.sub-controller-content {
  padding: 0 1.5rem 1.5rem;
}

.sub-controller-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.sub-controller-nav__label {
  font-weight: 600;
  color: #475569;
}

.sub-controller-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sub-controller-nav__link {
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  color: #0f172a;
  text-decoration: none;
  background: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sub-controller-nav__link:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.sub-controller-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.sub-controller-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.sub-controller-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.sub-controller-card__location {
  margin: 0.35rem 0 0;
  color: #475569;
  font-size: 0.95rem;
}

.sub-controller-card__actions {
  display: inline-flex;
  gap: 0.35rem;
}

.sub-controller-anchor-link {
  text-decoration: none;
  font-size: 0.85rem;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.sub-controller-anchor-link:hover {
  background: #edeff3;
  color: #0f172a;
}

.sub-controller-card__description {
  margin-top: 0.5rem;
  color: #475569;
}

.sub-controller-card__hardware {
  margin-top: 0.75rem;
}

.hardware-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.data-table {
  margin-top: 2rem;
}

.table-wrapper {
  overflow-x: auto;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.table-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.upload-form input[type="file"] {
  font-size: 0.95rem;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  padding: 0.55rem 0.5rem;
  min-width: 16rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-form input[type="file"]::file-selector-button {
  background: #1d4ed8;
  color: #ffffff;
  border: none;
  border-radius: 0.55rem;
  padding: 0.55rem 1.1rem;
  margin-right: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.upload-form input[type="file"]::file-selector-button:hover,
.upload-form input[type="file"]::file-selector-button:focus-visible {
  background: #2563eb;
  transform: translateY(-1px);
}

.upload-form input[type="file"]:focus-visible {
  outline: none;
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.upload-status {
  font-size: 0.9rem;
  color: #475569;
  margin-top: 0.25rem;
}

.upload-status--success {
  color: #047857;
}

.upload-status--error {
  color: #dc2626;
}

.upload-status--info {
  color: #475569;
}

.column-toggle {
  border-radius: 999px;
}

.upload-disabled {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.controller-details {
  margin-top: 2.5rem;
}

.details-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.details-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.details-grid h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: #1f2933;
}

.detail-body {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
  min-height: 5rem;
  color: #475569;
}

.detail-body em {
  color: #94a3b8;
}

.detail-body--hidden {
  position: relative;
  background: rgba(248, 250, 252, 0.85);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.visibility-note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #b45309;
  font-style: italic;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 32rem;
}

th,
td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: none;
}

th {
  background: #0f172a;
  color: #f8fafc;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  border-bottom: none;
}

.controller-table th,
.controller-table td {
  transition: background-color 0.2s ease;
}

.controller-table th.col-stripe-even:not([style*="background-color"]),
.controller-table td.col-stripe-even:not([style*="background-color"]) {
  box-shadow: inset 0 0 0 9999px rgba(148, 163, 184, 0.12);
}

.controller-table th.col-stripe-odd:not([style*="background-color"]),
.controller-table td.col-stripe-odd:not([style*="background-color"]) {
  box-shadow: inset 0 0 0 9999px rgba(148, 163, 184, 0.04);
}

.controller-table tbody tr:nth-child(odd) td.col-stripe-even:not([style*="background-color"]) {
  box-shadow: inset 0 0 0 9999px rgba(148, 163, 184, 0.18);
}

.controller-table tbody tr:nth-child(odd) td.col-stripe-odd:not([style*="background-color"]) {
  box-shadow: inset 0 0 0 9999px rgba(148, 163, 184, 0.08);
}

tbody tr:nth-child(odd) {
  background: #f9fafb;
}

td {
  font-size: 0.95rem;
}

.controller-table[data-collapsed="true"] [data-hidden="true"] {
  display: none;
}

[data-hidden="true"] {
  transition: opacity 0.2s ease;
}

.back-link {
  margin-top: 3rem;
  display: inline-block;
}

.site-footer {
  background: #1f2933;
  color: #f1f5f9;
  padding-block: 1rem 2rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}

code {
  background: rgba(15, 23, 42, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    text-align: center;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .controller-table {
    table-layout: fixed;
    width: 100%;
    min-width: 55rem;
  }

  th,
  td {
    padding: 0.32rem 0.45rem;
  }

  th {
    font-size: 0.65rem;
    letter-spacing: 0.045em;
  }

  td {
    font-size: 0.74rem;
  }

  .controller-table th,
  .controller-table td {
    white-space: normal;
    word-break: normal;
  }
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(3px);
  padding: clamp(1rem, 4vw, 2rem);
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
}

.lightbox__dialog {
  position: relative;
  margin: 0;
  width: clamp(16rem, 92vw, 72rem);
  max-height: calc(100vh - 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  animation: scaleIn 0.2s ease;
}

.lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: rgba(17, 24, 39, 0.75);
  color: #f9fafb;
  font-size: 2rem;
  line-height: 1;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  cursor: zoom-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: rgba(59, 130, 246, 0.8);
  outline: none;
}

.lightbox__dialog img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 5rem);
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.5);
  cursor: zoom-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.96);
  }
  to {
    transform: scale(1);
  }
}

/* Login form styles */
.login-form {
  max-width: 24rem;
  margin: 2rem auto;
  padding: 2rem;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.login-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #102a43;
  text-align: center;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #334e68;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 1rem;
  color: #334e68;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 1rem;
  color: #334e68;
  background-color: #ffffff;
  transition: border-color 0.2s ease;
}

.form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-button {
  width: 100%;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.375rem;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.form-button:hover,
.form-button:focus-visible {
  background: #2563eb;
  outline: none;
}

.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1f2933;
  resize: vertical;
  min-height: 6rem;
}

.form-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.admin-panel {
  margin-top: 3rem;
  background: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.admin-form .form-group {
  flex: 1;
  min-width: 16rem;
}

.admin-form .form-group.full {
  flex: 1 1 100%;
}

.form-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #1f2933;
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  cursor: pointer;
}

.checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

.form-status {
  font-size: 0.9rem;
  color: #475569;
  margin: 0;
}

.form-status--success {
  color: #047857;
}

.form-status--error {
  color: #dc2626;
}

.form-status--info {
  color: #475569;
}

.error-message {
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: #fee2e2;
  border: 1px solid #f87171;
  border-radius: 0.375rem;
  color: #b91c1c;
  font-size: 0.875rem;
}

.success-message {
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: #dcfce7;
  border: 1px solid #34d399;
  border-radius: 0.375rem;
  color: #047857;
  font-size: 0.875rem;
}

.auth-panel {
  max-width: 28rem;
  margin: 2rem auto;
  padding: 2rem;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.credentials-info {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.875rem;
  color: #64748b;
}

.credentials-info p {
  margin: 0 0 0.5rem;
}

.credentials-info ul {
  margin: 0;
  padding-left: 1rem;
}

.credentials-info li {
  margin-bottom: 0.25rem;
}

/* Header Nav Styles */
.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.space-x-4 > * + * {
  margin-left: 1rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-gray-600 {
  color: #4b5563;
}

.admin-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.admin-link:hover,
.admin-link:focus-visible {
  color: #1d4ed8;
}

.text-gray-700 {
  color: #374151;
}

.bg-gray-200 {
  background-color: #e5e7eb;
}

.bg-gray-300:hover {
  background-color: #d1d5db;
}

.bg-indigo-600 {
  background-color: #4f46e5;
}

.bg-indigo-700:hover {
  background-color: #4338ca;
}

.text-white {
  color: #ffffff;
}

.rounded-md {
  border-radius: 0.375rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.gallery-settings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.gallery-settings__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background-color: #f9fafb;
}

.gallery-settings__order {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gallery-settings__order .btn,
.gallery-settings__order .btn-outline {
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.gallery-settings__label {
  flex: 1 1 auto;
}

.gallery-settings__limit {
  max-width: 10rem;
}

.gallery-settings__name {
  display: block;
  font-weight: 600;
}

.gallery-settings__key {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.125rem 0.375rem;
  background-color: #e5e7eb;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: #374151;
}

.gallery-settings__visibility {
  min-width: 10rem;
}

.form-actions--inline {
  display: inline-flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
