:root {
  color-scheme: dark;
  --bg: #07162e;
  --bg-deep: #041022;
  --surface: rgba(13, 31, 60, 0.78);
  --surface-strong: rgba(10, 25, 49, 0.94);
  --surface-light: rgba(255, 255, 255, 0.14);
  --text: #f4f7fb;
  --muted: #a4b4cf;
  --line: rgba(167, 190, 226, 0.16);
  --line-strong: rgba(223, 244, 93, 0.38);
  --accent: #e3ff54;
  --accent-dark: #bfd83a;
  --accent-ink: #0d1b37;
  --control-bg: rgba(255, 255, 255, 0.14);
  --control-border: rgba(214, 230, 255, 0.22);
  --control-border-strong: rgba(227, 255, 84, 0.3);
  --info: #67d7ff;
  --danger: #ff8c9b;
  --success: #8ff7b0;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background:
    radial-gradient(
      circle at top right,
      rgba(103, 215, 255, 0.18),
      transparent 28%
    ),
    linear-gradient(180deg, #0a1d3c 0%, #051225 54%, #040d1d 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: transparent;
}

.app-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 32px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 75% 24%,
      rgba(255, 255, 255, 0.12),
      transparent 18%
    ),
    radial-gradient(
      circle at 82% 34%,
      rgba(103, 215, 255, 0.18),
      transparent 25%
    ),
    linear-gradient(135deg, rgba(14, 34, 70, 0.96), rgba(8, 22, 46, 0.92));
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -60px -90px auto;
  width: 420px;
  height: 420px;
  border: 8px solid rgba(255, 255, 255, 0.85);
  border-radius: 56% 44% 58% 42%;
  filter: blur(1px);
  opacity: 0.75;
}

.hero-topbar,
.hero-content {
  position: relative;
  z-index: 1;
}

.hero-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  font-weight: 700;
}

.user-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
}

.hero-content {
  display: grid;
  gap: 28px;
  align-items: center;
}

.hero-copy {
  max-width: 560px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(227, 255, 84, 0.12);
  color: var(--accent);
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  max-width: 9ch;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.96;
}

.hero-text {
  margin: 18px 0 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-visual {
  position: relative;
  min-height: 340px;
}

.glow-ring {
  position: absolute;
  inset: 26px 16px 18px 18px;
  border: 8px solid rgba(255, 255, 255, 0.76);
  border-radius: 45% 55% 50% 50%;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.4));
}

.visual-stack {
  position: absolute;
  right: 10px;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.device-card,
.device-pill,
.device-token {
  position: relative;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.device-card {
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(12, 21, 37, 0.98),
    rgba(24, 34, 52, 0.92)
  );
}

.device-card-small {
  width: 150px;
  height: 220px;
  padding: 20px;
}

.device-card-tall {
  width: 168px;
  height: 310px;
  padding: 24px;
  background: linear-gradient(
    180deg,
    rgba(20, 30, 48, 0.98),
    rgba(11, 21, 39, 0.95)
  );
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(3, 14px);
  gap: 14px;
  width: max-content;
  margin-top: 42px;
}

.device-grid::before,
.device-grid::after,
.device-card-small::after {
  content: "";
}

.device-grid::before {
  position: absolute;
  inset: auto auto 28px 28px;
  width: 70px;
  height: 90px;
  border-radius: 16px;
  background:
    radial-gradient(circle, rgba(103, 215, 255, 0.8) 0 3px, transparent 4px) 0
      0 / 22px 22px,
    radial-gradient(circle, rgba(255, 255, 255, 0.75) 0 3px, transparent 4px)
      11px 11px / 22px 22px;
}

.device-card-small::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 18px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #68ffb1;
  box-shadow: 0 0 10px rgba(104, 255, 177, 0.8);
}

.device-lock-icon {
  position: absolute;
  inset: 56px 34px auto;
  height: 160px;
  border: 7px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
}

.device-lock-icon::before,
.device-lock-icon::after {
  content: "";
  position: absolute;
}

.device-lock-icon::before {
  top: -70px;
  left: 28px;
  width: 56px;
  height: 66px;
  border: 7px solid rgba(255, 255, 255, 0.92);
  border-bottom: 0;
  border-radius: 34px 34px 0 0;
}

.device-lock-icon::after {
  left: 38px;
  bottom: 30px;
  width: 46px;
  height: 24px;
  border-right: 7px solid var(--accent);
  border-bottom: 7px solid var(--accent);
  transform: rotate(38deg);
}

.device-token {
  width: 72px;
  height: 72px;
  margin-bottom: 32px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 50% 52%,
    #25a6d8 0 24%,
    #0680ac 25% 48%,
    #21324f 49% 100%
  );
}

.device-token::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.device-pill {
  width: 140px;
  height: 240px;
  border-radius: 36px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(231, 236, 242, 0.96)
  );
}

.content {
  display: grid;
  gap: 24px;
  padding-top: 28px;
}

.content:has(#rolloutForm:not([hidden])) {
  max-width: 1080px;
  margin: 0 auto;
}

.form {
  display: grid;
}

.panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-soft {
  background: rgba(12, 28, 54, 0.72);
}

.panel-hero {
  background:
    linear-gradient(180deg, rgba(12, 28, 54, 0.96), rgba(9, 21, 42, 0.95)),
    linear-gradient(90deg, rgba(103, 215, 255, 0.05), transparent);
}

.section-heading {
  display: grid;
  gap: 6px;
}

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

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-panel {
  gap: 20px;
}

.work-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.work-header-copy h2 {
  margin: 0;
  font-size: 1.35rem;
}

.work-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.work-header-user {
  color: var(--muted);
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
}

.field-serial {
  max-width: 180px;
}

label,
.field-label {
  font-weight: 700;
}

input,
select,
textarea,
button {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--control-border);
  padding: 12px 14px;
  background: var(--control-bg);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

select option {
  color: #0b1831;
  background: #eef3fb;
}

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

input::placeholder,
textarea::placeholder {
  color: rgba(214, 225, 244, 0.44);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 3px solid rgba(227, 255, 84, 0.24);
  outline-offset: 2px;
  border-color: var(--control-border-strong);
}

.inline-fields {
  display: grid;
  gap: 14px;
}

.capture-layout {
  display: grid;
  gap: 18px;
}

.capture-field {
  align-self: start;
}

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

#dataButtons > span {
  display: grid;
  gap: 8px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.selected-file,
.label-text {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.comparison-panel,
.ocr-panel {
  padding: 18px;
  border: 1px solid rgba(165, 188, 220, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.comparison-panel {
  display: grid;
  gap: 12px;
}

.ocr-panel {
  gap: 10px;
}

.preview,
.crop-preview {
  display: block;
  width: 100%;
  border: 1px solid rgba(165, 188, 220, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  object-fit: contain;
}

.preview {
  max-height: 420px;
}

.crop-preview {
  max-height: 180px;
}

.form-footer,
.session-actions {
  display: flex;
  justify-content: flex-start;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.primary-button {
  border: 0;
  padding: 0 22px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px rgba(227, 255, 84, 0.18);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--control-border);
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.compact-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
}

.action-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.admin-panel,
.session-panel {
  gap: 22px;
}

.csv-admin-panel {
  display: grid;
  gap: 16px;
  padding-top: 8px;
}

.csv-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.session-test-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(165, 188, 220, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.user-form {
  display: grid;
  gap: 16px;
}

.user-table-wrap {
  overflow-x: auto;
  padding-top: 4px;
}

.user-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(165, 188, 220, 0.12);
  text-align: left;
  vertical-align: middle;
}

.user-table th {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-row {
  background: rgba(255, 255, 255, 0.03);
}

.user-name-cell {
  min-width: 180px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(227, 255, 84, 0.12);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.message {
  min-height: 28px;
  padding: 2px 4px 0;
  color: var(--muted);
  font-weight: 700;
  white-space: pre-wrap;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.required-hint {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.csv-modal {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid rgba(165, 188, 220, 0.14);
  border-radius: 24px;
  background: rgba(8, 20, 40, 0.98);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.csv-modal::backdrop {
  background: rgba(1, 7, 15, 0.7);
}

.csv-modal-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 18px;
  max-height: calc(100dvh - 24px);
  padding: 22px;
  overflow: hidden;
}

.csv-modal-header,
.csv-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.csv-modal-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-height: 0;
  overflow: auto;
}

.csv-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.csv-modal-toolbar {
  align-items: end;
  justify-content: flex-start;
}

.csv-separator-field {
  width: 110px;
}

.csv-filter-field {
  width: min(360px, 100%);
}

.csv-preview-wrap {
  overflow: auto;
  max-height: min(420px, 42dvh);
  border: 1px solid rgba(165, 188, 220, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.csv-preview-table {
  width: max-content;
  min-width: max(100%, 520px);
  border-collapse: collapse;
}

.csv-preview-table th,
.csv-preview-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(165, 188, 220, 0.1);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.csv-preview-table th {
  position: sticky;
  top: 0;
  background: rgba(15, 32, 62, 0.98);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.csv-column-sort-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.csv-first-column-controls {
  min-width: 240px;
}

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

.csv-column-search {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.csv-sort-button {
  min-height: 38px;
  min-width: 64px;
  padding: 0 10px;
}

#csvEditor {
  min-height: 420px;
  max-height: min(420px, 28dvh);
  overflow: auto;
  white-space: pre;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.94rem;
  line-height: 1.45;
}

@media (min-width: 760px) {
  .hero-content {
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  }

  .capture-layout {
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
    align-items: start;
  }

  .inline-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
  }

  .inline-fields-tight {
    grid-template-columns: minmax(0, 1.7fr) auto;
  }

  .inline-fields-three {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 180px;
  }

  .inline-fields-rollout {
    grid-template-columns:
      150px minmax(180px, 1fr) minmax(180px, 1fr)
      96px minmax(220px, 1fr);
  }

  .user-form {
    grid-template-columns: 1.1fr 1.2fr 1.2fr 180px auto;
    align-items: end;
  }
}

@media (max-width: 759px) {
  .app-shell {
    width: min(100%, calc(100% - 14px));
    padding-top: 8px;
  }

  .hero,
  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .hero::before {
    width: 290px;
    height: 290px;
  }

  .hero-topbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .hero h1 {
    max-width: 11ch;
  }

  .hero-visual {
    min-height: 220px;
  }

  .visual-stack {
    right: 0;
    gap: 8px;
    transform: scale(0.7);
    transform-origin: bottom right;
  }

  .content {
    gap: 16px;
    padding-top: 16px;
  }

  .work-header,
  .work-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-fields,
  .inline-fields-three,
  .inline-fields-rollout,
  .inline-fields-tight,
  .user-form,
  .capture-layout {
    grid-template-columns: 1fr;
  }

  .image-source-actions,
  .csv-admin-actions,
  .form-footer,
  .session-actions,
  .user-row-actions {
    grid-template-columns: 1fr;
  }

  .form-footer,
  .session-actions,
  .user-row-actions {
    display: grid;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .upload-button {
    min-height: 50px;
  }

  .preview {
    max-height: 280px;
  }

  .crop-preview {
    max-height: 140px;
  }

  .selected-file,
  .required-hint,
  .section-heading p,
  .message {
    font-size: 0.95rem;
  }

  .user-table {
    min-width: 680px;
  }

  .csv-modal {
    width: min(100vw, calc(100vw - 10px));
    max-height: calc(100dvh - 10px);
    border-radius: 18px;
  }

  .csv-modal-shell {
    max-height: calc(100dvh - 10px);
    padding: 16px;
  }

  .csv-preview-wrap {
    max-height: 36dvh;
  }

  .csv-preview-table {
    min-width: 420px;
  }

  #csvEditor {
    min-height: 260px;
    max-height: 24dvh;
  }
}
/* Rollout CH */
.compact-hero {
  padding-block: 22px;
}
.compact-hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
}
.language-picker {
  display: flex;
  gap: 6px;
}
.language-picker button {
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  font-size: 1.45rem;
  padding: 4px 7px;
  cursor: pointer;
}
.rollout-heading {
  min-width: 0;
  flex: 1;
}
.compact-hero .hero-topbar {
  align-items: center;
}
.compact-hero h1 {
  white-space: nowrap;
  font-size: clamp(1rem, 2.5vw, 2.2rem);
}
.language-picker button {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #102344;
  font-size: 0.78rem;
  font-weight: 800;
}
.language-picker img {
  width: 32px;
  height: 20px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.18);
}
.login-panel {
  padding-top: 14px;
}
.login-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  margin: 0 0 14px;
}
#status.status-error {
  color: #ff6b6b;
  font-weight: 700;
}
#status.status-warning {
  color: #ffd166;
  font-weight: 700;
}
.compact-location-input {
  min-height: 48px;
  height: 48px;
  padding: 12px 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.location-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--control-border);
  padding: 12px 14px;
  background: var(--control-bg);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: left;
  cursor: pointer;
}
.location-picker-button > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-picker-chevron {
  flex: 0 0 auto;
  color: var(--muted);
}
.location-picker-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(1, 8, 20, 0.76);
  overscroll-behavior: contain;
}
.location-picker-sheet {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  width: min(680px, 100%);
  max-height: min(720px, calc(100dvh - 32px));
  padding: 18px;
  border: 1px solid var(--control-border);
  border-radius: 18px;
  background: #0d203e;
  box-shadow: var(--shadow);
}
.location-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.location-picker-header h2 {
  margin: 0;
  font-size: 1.15rem;
}
.location-picker-close {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.8rem;
}
.location-picker-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.location-picker-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.location-choice {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.location-choice:active,
.location-choice:hover {
  background: rgba(227, 255, 84, 0.12);
}
.location-choice strong,
.location-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-choice strong {
  flex: 0 0 auto;
}
.location-choice small {
  color: var(--muted);
}
.location-picker-open {
  overflow: hidden;
}
.submit-busy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(227, 255, 84, 0.08);
}
.submit-busy > span:last-child {
  display: grid;
  gap: 3px;
}
.submit-busy small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.busy-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: busy-spin 0.75s linear infinite;
}
@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}
.submission-busy button:disabled,
.submission-busy input:disabled,
.submission-busy select:disabled,
.submission-busy textarea:disabled {
  cursor: wait;
  opacity: 0.55;
}
.user-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color, #ddd);
}
.user-edit-row > div {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}
.user-edit-row button {
  min-width: 110px;
}
#csvDialog {
  width: min(900px, 94vw);
  border: 0;
  border-radius: 14px;
}
#csvEditor {
  width: 100%;
  font-family: monospace;
  margin: 12px 0;
}
#connectionCheckResult {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  background: #07152b;
  color: #eaf1ff;
  padding: 12px;
  border-radius: 10px;
}
#logDialog {
  width: min(1200px, 96vw);
  border: 0;
  border-radius: 14px;
}
.log-filters {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.log-table-wrap {
  max-height: 70vh;
  overflow: auto;
}
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.log-table th,
.log-table td {
  padding: 7px;
  border-bottom: 1px solid #ccd5e3;
  text-align: left;
  vertical-align: top;
}
.log-table details pre {
  max-width: 520px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .app-shell {
    padding-top: 0;
  }
  .compact-hero {
    padding: 10px 14px;
  }
  .compact-hero .hero-topbar {
    gap: 8px;
  }
  .compact-hero .rollout-heading {
    width: 100%;
    align-self: stretch;
    text-align: left;
  }
  .compact-hero h1 {
    font-size: clamp(0.72rem, 3.1vw, 1rem);
  }
  .content {
    padding-top: 10px;
  }
  .auth-panel {
    padding: 12px;
  }
  .user-edit-row {
    grid-template-columns: 1fr;
  }
  .language-picker {
    gap: 3px;
  }
  .language-picker button {
    padding: 2px;
    gap: 2px;
  }
  .language-picker img {
    width: 25px;
    height: 15px;
  }
  .language-picker span {
    font-size: 0.65rem;
  }
}

/* Refined compact layout */
.content:has(#rolloutForm:not([hidden])) {
  max-width: none;
  width: 100%;
}
.header-tools {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 5px;
  align-self: start;
}
.header-user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 0.78rem;
  line-height: 1.1;
}
.header-user .compact-button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 0.75rem;
}
.language-picker {
  gap: 4px;
}
.language-picker button {
  padding: 3px 5px;
  border-width: 1px;
  border-radius: 6px;
  opacity: 0.82;
}
.language-picker button:hover,
.language-picker button[aria-pressed="true"] {
  opacity: 1;
  background: #fff;
}
.language-picker img {
  width: 27px;
  height: 16px;
}
.capture-form-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  gap: 20px;
  align-items: end;
}
.rollout-primary-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: end;
}
.admin-sections {
  display: grid;
  gap: 24px;
  width: 100%;
}
.rollback-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 12px;
}
.rollback-controls button {
  width: auto;
}
#rollbackStatus.status-error {
  color: var(--danger);
  font-weight: 700;
}
.custom-file {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
}
.custom-file {
  display: flex;
  min-height: 40px;
}
.capture-form-grid .capture-layout {
  grid-template-columns: 1fr;
  align-content: end;
}
.capture-form-grid {
  align-items: start;
}
.capture-form-grid {
  grid-template-columns:
    minmax(190px, 0.8fr) minmax(150px, 0.65fr) minmax(280px, 1.25fr)
    minmax(190px, 0.8fr);
  align-items: end;
}
.capture-form-grid .rollout-primary-fields {
  display: contents;
}
.capture-form-grid .capture-layout {
  align-self: end;
}
.capture-form-grid .capture-layout .field-label {
  display: block;
}
.capture-form-grid .custom-file {
  display: block;
}
.custom-file .secondary-button {
  min-height: 36px;
  padding: 6px 12px;
}
.language-picker button {
  padding: 1px 4px;
  line-height: 1;
  min-height: 24px;
}
.language-picker img {
  width: 24px;
  height: 14px;
}
.language-picker span {
  font-size: 0.68rem;
}
.custom-file .secondary-button {
  min-height: 38px;
  padding: 8px 14px;
  cursor: pointer;
}
#selectedImageName {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
@media (max-width: 760px) {
  .capture-form-grid,
  .rollout-primary-fields {
    grid-template-columns: 1fr;
  }
  .capture-form-grid .rollout-primary-fields {
    display: grid;
  }
  .header-user {
    font-size: 0.7rem;
  }
  .header-user .compact-button {
    padding: 3px 7px;
  }
  .rollback-controls {
    grid-template-columns: 1fr;
  }
  .rollback-controls button {
    width: 100%;
  }
  .location-picker-overlay {
    align-items: end;
    padding: 0;
  }
  .location-picker-sheet {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 14px 14px max(14px, env(safe-area-inset-bottom));
    border-radius: 0;
  }
  #locationFilter {
    font-size: 16px;
  }
  .location-picker-list {
    max-height: 55dvh;
  }
  .location-choice {
    min-height: 46px;
    font-size: 0.9rem;
  }
  .location-choice small {
    flex: 1;
  }
}
