:root {
  --dark-brown: #280b04;
  --shock-orange: #ff2d00;
  --grey-beige: #e6cdb2;
  --beige-soft: #f3dfc6;
  --beige-light: #fff4e5;
  --panel: #e6cdb2;
  --panel-soft: #f3dfc6;
  --ink: #280b04;
  --ink-inverse: #fff4e5;
  --muted: #6b493b;
  --line: rgba(40, 11, 4, 0.18);
  --line-strong: rgba(40, 11, 4, 0.42);
  --brand: #ff2d00;
  --brand-strong: #d72400;
  --granted: #e6cdb2;
  --granted-bg: #e6cdb2;
  --denied: #ff2d00;
  --denied-bg: #ff2d00;
  --warning: #280b04;
  --warning-bg: #ffb199;
  --app-surface: #fff8ee;
  --app-surface-strong: #f7e7d2;
  --app-teal: #0f766e;
  --app-blue: #1d4ed8;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--dark-brown);
  color: var(--ink-inverse);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 45, 0, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(255, 45, 0, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.22;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--beige-light);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 10px 12px;
}

.form-grid label,
.guestlists-toolbar label,
.block-dialog label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 45, 0, 0.22);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(230, 205, 178, 0.18);
  background: rgba(40, 11, 4, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--grey-beige);
  font-size: 18px;
  font-weight: 950;
  text-transform: uppercase;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav a,
.nav-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--grey-beige);
  font-weight: 900;
}

.nav-button {
  background: transparent;
}

.topnav a:hover,
.topnav a.active,
.nav-button:hover {
  border-color: rgba(255, 45, 0, 0.52);
  background: var(--shock-orange);
  color: var(--dark-brown);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(230, 205, 178, 0.26);
  border-radius: 999px;
  color: var(--grey-beige);
  font-size: 13px;
  font-weight: 900;
}

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

.native-only {
  display: none;
}

.native-app .native-only {
  display: grid;
}

.app-page {
  background:
    linear-gradient(180deg, rgba(255, 244, 229, 0.08), rgba(40, 11, 4, 0) 34vh),
    var(--dark-brown);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 12px;
}

.app-brand-block,
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.app-brand-block h1 {
  font-size: clamp(36px, 9vw, 62px);
}

.app-header-actions {
  align-self: flex-start;
}

.icon-button {
  display: inline-grid;
  width: 46px;
  height: 46px;
  min-height: 46px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(230, 205, 178, 0.28);
  background: rgba(255, 244, 229, 0.08);
  color: var(--grey-beige);
}

.icon-button svg,
.tile-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.connection-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 180px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.5);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.22);
  color: var(--beige-light);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.connection-chip.offline {
  border-color: rgba(255, 45, 0, 0.48);
  background: rgba(255, 45, 0, 0.18);
}

.app-home-shell {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 0 34px;
}

.welcome-panel {
  display: grid;
  gap: 8px;
  margin: 8px 0 18px;
  padding: 18px;
  border: 1px solid rgba(230, 205, 178, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--app-surface), var(--app-surface-strong));
  color: var(--ink);
  box-shadow: var(--shadow);
}

.welcome-user {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.welcome-panel h2 {
  margin: 0;
  font-size: clamp(34px, 8vw, 54px);
  line-height: 1;
  text-transform: uppercase;
}

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

.app-tile {
  display: grid;
  min-height: 148px;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(230, 205, 178, 0.24);
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: left;
  text-transform: none;
}

button.app-tile {
  min-height: 148px;
}

.app-tile:hover,
.app-tile:focus-visible {
  background: var(--app-surface-strong);
  outline: 3px solid rgba(255, 45, 0, 0.28);
}

.primary-tile {
  background: var(--brand);
  color: var(--dark-brown);
}

.primary-tile:hover,
.primary-tile:focus-visible {
  background: var(--brand-strong);
}

.tile-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(40, 11, 4, 0.24);
  border-radius: 8px;
  background: rgba(255, 244, 229, 0.52);
}

.tile-label {
  color: inherit;
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.database-dialog label,
.login-connection-panel label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.connection-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.connection-panel-heading h2 {
  margin: 0;
  font-size: 16px;
  text-transform: uppercase;
}

.login-connection-panel {
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 244, 229, 0.44);
}

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

.connection-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.access-shell {
  display: grid;
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  place-items: center;
  padding: 32px 0;
}

.access-panel {
  width: min(900px, 100%);
}

.section-heading {
  margin-bottom: 18px;
}

.admin-heading {
  margin-top: 34px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--shock-orange);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--shock-orange);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(42px, 8vw, 86px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  color: var(--ink);
}

.panel,
.result-card {
  border: 1px solid rgba(230, 205, 178, 0.36);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.scan-form {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(230, 205, 178, 0.36);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.scan-form label,
.form-panel label,
.block-dialog label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.scan-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
}

.scan-row input {
  height: 58px;
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
}

.scanner-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.scanner-status,
.last-scan {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.scanner-status {
  padding: 0 10px;
  background: var(--dark-brown);
  color: var(--grey-beige);
}

.last-scan {
  max-width: 58%;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.danger-button,
.neutral-button {
  padding: 0 16px;
  text-transform: uppercase;
}

.primary-button {
  background: var(--brand);
  color: var(--dark-brown);
}

.primary-button:hover {
  background: var(--brand-strong);
}

.secondary-button,
.neutral-button {
  border: 1px solid var(--line-strong);
  background: var(--beige-light);
  color: var(--ink);
}

.secondary-button:hover,
.neutral-button:hover {
  background: var(--panel-soft);
}

.danger-button {
  background: var(--dark-brown);
  color: var(--grey-beige);
}

.danger-button:hover {
  background: #130501;
}

.result-card {
  min-height: 360px;
  padding: 24px;
  color: var(--ink);
}

.access-result-layout {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.photo-panel {
  min-height: 390px;
}

.photo-frame {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 390px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(40, 11, 4, 0.28);
  border-radius: 8px;
  background: var(--dark-brown);
}

#person-photo {
  width: 100%;
  height: 100%;
  min-height: 390px;
  object-fit: cover;
}

#person-photo[hidden],
.photo-fallback[hidden] {
  display: none;
}

.photo-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 390px;
  place-items: center;
  color: var(--shock-orange);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(76px, 12vw, 138px);
  font-weight: 900;
  text-transform: uppercase;
}

.result-details {
  min-width: 0;
}

.result-status {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.status-dot {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: inset 0 0 0 10px rgba(40, 11, 4, 0.16);
}

.result-card.granted .status-dot {
  background: var(--grey-beige);
  box-shadow:
    inset 0 0 0 10px rgba(40, 11, 4, 0.16),
    0 0 0 3px var(--dark-brown);
}

.result-card.denied .status-dot {
  background: var(--dark-brown);
  box-shadow: inset 0 0 0 10px rgba(255, 45, 0, 0.34);
}

.result-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.result-status h2 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.95;
  text-transform: uppercase;
}

.result-card.granted {
  border-color: var(--grey-beige);
  background: var(--grey-beige);
}

.result-card.denied {
  border-color: var(--shock-orange);
  background: var(--shock-orange);
}

.result-card.denied .result-label,
.result-card.denied dt {
  color: rgba(40, 11, 4, 0.74);
}

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

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

.identity-grid div {
  min-height: 88px;
  padding: 14px;
  border: 1px solid rgba(40, 11, 4, 0.16);
  border-radius: 8px;
  background: rgba(255, 244, 229, 0.52);
}

.result-card.denied .identity-grid div {
  background: rgba(40, 11, 4, 0.08);
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

dd {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.admin-shell {
  padding-bottom: 46px;
}

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

.panel {
  padding: 18px;
  color: var(--ink);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 950;
  text-transform: uppercase;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--shock-orange);
  color: var(--dark-brown);
  font-weight: 950;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.full-field {
  grid-column: 1 / -1;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-heading select {
  min-width: min(100%, 320px);
}

.info-panel {
  min-height: 100%;
}

.role-summary {
  display: grid;
  gap: 12px;
}

.role-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 244, 229, 0.42);
}

.role-summary strong {
  text-transform: uppercase;
}

.role-summary span {
  color: var(--muted);
  font-weight: 800;
}

.backup-panel {
  margin-bottom: 16px;
}

.backup-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}

.backup-import-label {
  display: grid;
  min-width: min(100%, 320px);
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.table-panel {
  margin-top: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.status-badge.ok {
  border: 1px solid var(--dark-brown);
  background: var(--grey-beige);
  color: var(--dark-brown);
}

.status-badge.blocked {
  background: var(--shock-orange);
  color: var(--dark-brown);
}

.status-badge.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 190px;
}

.actions button {
  min-height: 36px;
  padding: 0 12px;
}

.stack-cell {
  display: grid;
  gap: 8px;
}

.cell-secondary {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.link-select {
  min-width: 210px;
  height: 38px;
}

.muted {
  color: var(--muted);
}

.block-dialog {
  width: min(460px, calc(100% - 32px));
  border: 1px solid rgba(230, 205, 178, 0.38);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.block-dialog::backdrop {
  background: rgba(40, 11, 4, 0.72);
}

.block-dialog h2 {
  margin-bottom: 14px;
  color: var(--ink);
}

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

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100% - 40px));
  padding: 12px 14px;
  border: 1px solid rgba(230, 205, 178, 0.34);
  border-radius: 8px;
  background: var(--grey-beige);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 950;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-row td {
  color: var(--muted);
  text-align: center;
}

.thumb-photo,
.thumb-fallback {
  display: inline-grid;
  width: 52px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(40, 11, 4, 0.22);
  border-radius: 6px;
  background: var(--dark-brown);
  color: var(--shock-orange);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 22px;
  line-height: 1;
}

.thumb-photo {
  object-fit: cover;
}

.guestlists-shell {
  padding-bottom: 46px;
}

.guestlists-toolbar {
  display: grid;
  grid-template-columns: 180px minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.guestlist-subtitle {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.login-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
}

.login-shell {
  display: grid;
  width: min(100% - 32px, 500px);
  margin: 0 auto;
  place-items: center;
  padding: 32px 0;
}

.login-panel {
  display: grid;
  width: 100%;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(230, 205, 178, 0.36);
  border-radius: 8px;
  background: var(--grey-beige);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  color: var(--shock-orange);
  font-size: clamp(50px, 12vw, 86px);
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.login-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: var(--shock-orange);
  font-weight: 950;
}

@media (max-width: 760px) {
  .app-header {
    align-items: flex-start;
  }

  .app-header-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
  }

  .connection-chip {
    max-width: 136px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-menu-grid {
    grid-template-columns: 1fr;
  }

  .app-tile,
  button.app-tile {
    min-height: 124px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .shell {
    width: min(100% - 24px, 1180px);
  }

  .access-shell {
    min-height: auto;
  }

  .scan-row,
  .admin-grid,
  .form-grid,
  .guestlists-toolbar,
  .access-result-layout,
  .identity-grid {
    grid-template-columns: 1fr;
  }

  .photo-panel,
  .photo-frame,
  #person-photo,
  .photo-fallback {
    min-height: 320px;
  }

  .scan-row input {
    height: 52px;
    font-size: 18px;
  }

  .scanner-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .last-scan {
    max-width: 100%;
  }

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

  .status-dot {
    width: 44px;
    height: 44px;
  }

  h1 {
    font-size: 42px;
  }
}

@media (max-width: 520px) {
  body::before {
    background-size: 34px 34px;
  }

  .app-header,
  .app-home-shell,
  .shell {
    width: min(100% - 20px, 920px);
  }

  .app-header {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .app-logo {
    width: 46px;
    height: 46px;
  }

  .app-brand-block h1,
  h1 {
    font-size: 36px;
  }

  .welcome-panel,
  .app-tile,
  .scan-form,
  .result-card,
  .panel,
  .login-panel {
    padding: 14px;
  }

  .tile-label {
    font-size: 24px;
  }

  .topbar {
    gap: 10px;
    min-height: auto;
    padding: max(10px, env(safe-area-inset-top)) 10px 10px;
  }

  .brand {
    width: 100%;
    justify-content: space-between;
    font-size: 15px;
  }

  .topnav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .topnav a,
  .nav-button,
  .user-pill {
    justify-content: center;
    min-width: 0;
    padding: 0 8px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-pill {
    grid-column: 1 / -1;
  }

  .inline-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .access-shell {
    padding: 16px 0 24px;
  }

  .section-heading {
    margin-bottom: 12px;
  }

  .scan-row {
    gap: 8px;
  }

  .scan-row input {
    height: 50px;
  }

  .photo-panel,
  .photo-frame,
  #person-photo,
  .photo-fallback {
    min-height: clamp(210px, 44dvh, 300px);
  }

  .result-status {
    min-height: auto;
    gap: 12px;
    padding-bottom: 14px;
  }

  .result-status h2 {
    font-size: 34px;
  }

  .identity-grid div {
    min-height: 74px;
    padding: 12px;
  }

  dd {
    font-size: 16px;
  }

  table {
    min-width: 620px;
  }

  .dialog-actions,
  .connection-actions {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    display: grid;
  }
}

@media (min-width: 1180px) {
  .access-panel {
    width: min(1080px, 100%);
  }

  .access-result-layout {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  }

  .app-header,
  .app-home-shell {
    width: min(1040px, calc(100% - 48px));
  }

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