:root {
  --ima-green: #2ca982;
  --ima-green-dark: #1f7f63;
  --ima-mint: #e9f7f3;
  --ima-ink: #17322c;
  --ima-muted: #62716d;
  --ima-line: #dce8e4;
  --ima-surface: #ffffff;
  --ima-soft: #f6faf8;
  --ima-warning: #f0a33a;
  --ima-success: #2ca982;
}

* {
  box-sizing: border-box;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  color: var(--ima-ink);
  background:
    radial-gradient(circle at top left, rgba(44, 169, 130, 0.12), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--ima-line);
  backdrop-filter: blur(16px);
}

.app-header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 118px;
  height: auto;
  flex: 0 0 auto;
}

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

.brand-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--ima-ink);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--ima-muted);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ima-muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.app-nav a:hover,
.app-nav a.active {
  background: var(--ima-mint);
  color: var(--ima-green-dark);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ima-ink);
  cursor: pointer;
}

.menu-button span,
.menu-button::before,
.menu-button::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

/* PWA Install-Button im Header (versteckt bis "beforeinstallprompt") */
.install-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ima-green);
  border-radius: 4px;
  background: var(--ima-mint);
  color: var(--ima-green-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.install-button:hover {
  background: var(--ima-green);
  color: #fff;
}
.install-button::before {
  content: "⤓";
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}
.install-button.hidden { display: none !important; }

.main {
  flex: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.login-main {
  width: min(1120px, calc(100% - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 440px);
  align-items: center;
  gap: 44px;
  padding-top: 48px;
}

.eyebrow {
  color: var(--ima-green-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title-app {
  max-width: 740px;
  margin: 10px 0 16px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.02;
  font-weight: 820;
}

.hero-title-app span {
  color: var(--ima-green);
}

.lead {
  max-width: 720px;
  margin: 0;
  color: var(--ima-muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.hero-points {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-point,
.metric,
.card,
.panel,
.form-card,
.choice-card,
.sample-card,
.status-card {
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(23, 50, 44, 0.06);
}

.hero-point {
  padding: 16px;
  min-height: 112px;
}

.hero-point strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ima-green-dark);
  font-size: 15px;
}

.hero-point p {
  margin: 0;
  color: var(--ima-muted);
  font-size: 14px;
  line-height: 1.45;
}

.form-card {
  padding: clamp(20px, 4vw, 32px);
}

.form-card h1,
.form-card h2,
.panel h1,
.panel h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
}

.form-card > p,
.panel > p {
  margin: 0 0 22px;
  color: var(--ima-muted);
  line-height: 1.55;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

.field label {
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfded9;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ima-ink);
  background: #fff;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ima-green);
  box-shadow: 0 0 0 4px rgba(44, 169, 130, 0.14);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ima-muted);
  font-size: 14px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--ima-green);
}

.link {
  color: var(--ima-green-dark);
  font-weight: 750;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0 16px;
  background: #fff;
  color: var(--ima-ink);
  font: inherit;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 50, 44, 0.12);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--ima-green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ima-green-dark);
}

.btn-secondary {
  border-color: var(--ima-line);
}

.btn-ghost {
  color: var(--ima-green-dark);
  background: var(--ima-mint);
}

.btn-full {
  width: 100%;
}

/* Kompakter Header-Button (z. B. "+ Neue Probe") - schmal, eckig */
.btn-compact {
  min-height: 38px;
  padding: 0 12px;
  gap: 6px;
  font-size: 14px;
  font-weight: 750;
  border-radius: 4px;
  flex: 0 0 auto;
}
.btn-compact .btn-icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
}
.btn-compact.btn-primary {
  box-shadow: none;
}

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

.page-head h1 {
  margin: 6px 0 8px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
}

.page-head p {
  max-width: 720px;
  margin: 0;
  color: var(--ima-muted);
  line-height: 1.55;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 20px;
}

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

.metric {
  padding: 18px;
}

.metric span {
  color: var(--ima-muted);
  font-size: 13px;
  font-weight: 720;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ima-green-dark);
  font-size: 31px;
  line-height: 1;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.section-title {
  margin: 0 0 16px;
  font-size: 22px;
}

.project-list,
.stack {
  display: grid;
  gap: 12px;
}

.sample-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: var(--ima-surface);
}

.project-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.project-card p {
  margin: 0;
  color: var(--ima-muted);
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 10px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ima-mint);
  color: var(--ima-green-dark);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.warning {
  background: #fff5e5;
  color: #9a6219;
}

.status-pill.done {
  background: #eaf7ee;
  color: #267641;
}

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

.choice-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: clamp(20px, 4vw, 30px);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.choice-card:hover {
  border-color: var(--ima-green);
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(23, 50, 44, 0.12);
}

.choice-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--ima-mint);
  color: var(--ima-green-dark);
  font-size: 30px;
  font-weight: 900;
}

.choice-card h2 {
  margin: 0 0 10px;
  font-size: 25px;
}

.choice-card p {
  margin: 0 0 22px;
  color: var(--ima-muted);
  line-height: 1.55;
}

.choice-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.scan-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: #fff;
}

.scan-mode-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ima-muted);
  font: inherit;
  font-weight: 780;
  cursor: pointer;
}

.scan-mode-tab.active {
  background: var(--ima-green);
  color: #fff;
}

.scanner {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 2px dashed rgba(44, 169, 130, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(44,169,130,0.12) 1px, transparent 1px),
    linear-gradient(rgba(44,169,130,0.12) 1px, transparent 1px),
    #fbfefd;
  background-size: 34px 34px;
  overflow: hidden;
  touch-action: manipulation;
}

.scanner-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
  background: #10231f;
}

.scanner.camera-active {
  background: #10231f;
}

.scanner.camera-active .scanner-video {
  display: block;
}

.scanner.camera-active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(16, 35, 31, 0.12), rgba(16, 35, 31, 0.42));
  pointer-events: none;
}

.scanner::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 22%;
  z-index: 3;
  height: 3px;
  background: var(--ima-green);
  box-shadow: 0 0 18px rgba(44, 169, 130, 0.7);
  animation: scanline 2.8s ease-in-out infinite;
}

@keyframes scanline {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(180px); }
}

.scanner-box {
  position: relative;
  z-index: 2;
  width: min(340px, 78vw);
  aspect-ratio: 1.65;
  border: 5px solid var(--ima-green);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.scanner[data-scan-mode="qr"] .scanner-box {
  width: min(250px, 72vw);
  aspect-ratio: 1;
}

.scanner.camera-active .scanner-box {
  background: transparent;
  box-shadow: 0 0 0 999px rgba(16, 35, 31, 0.32);
}

.scanner-text {
  position: absolute;
  z-index: 4;
  bottom: 24px;
  left: 16px;
  right: 16px;
  text-align: center;
  color: var(--ima-muted);
  font-weight: 700;
}

.scanner.camera-active .scanner-text {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
}

.scanner-hint {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 16px;
  right: 16px;
  text-align: center;
  font-weight: 600;
  color: var(--ima-muted);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.scanner.camera-active .scanner-hint {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  opacity: 1;
}

.camera-tools {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.camera-select,
.camera-zoom {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: var(--ima-soft);
  color: var(--ima-muted);
  font-size: 14px;
  font-weight: 700;
}

.camera-select span,
.camera-zoom span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.camera-select select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfded9;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ima-ink);
  font: inherit;
}

.camera-zoom strong {
  color: var(--ima-green-dark);
}

.camera-zoom input {
  width: 100%;
  accent-color: var(--ima-green);
}

.camera-tip {
  margin: 0;
}

.scanner.scan-success .scanner-box {
  border-color: #15c27a;
  box-shadow: 0 0 0 999px rgba(21, 194, 122, 0.28), 0 0 28px rgba(21, 194, 122, 0.85);
  animation: scan-success-pulse 0.6s ease-out;
}

.scanner.scan-success::after {
  display: none;
}

@keyframes scan-success-pulse {
  0%   { transform: scale(0.92); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.scanner-fallback {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e6;
  color: #6b4f00;
}

.scanner-fallback p {
  margin: 0 0 10px;
  font-weight: 600;
}

.scanner-fallback.hidden {
  display: none;
}

.scan-confirmation {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(44, 169, 130, 0.32);
  border-radius: 8px;
  background: #fbfefd;
}

.scan-confirmation.hidden {
  display: none;
}

.scan-confirmation .notice {
  margin: 10px 0 12px;
}

.detected-sample-id {
  padding: 16px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ima-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: center;
}

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

.location-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}

.location-row input {
  flex: 1 1 220px;
  min-width: 0;
}

.location-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.location-map {
  margin-top: 10px;
  width: 100%;
  height: 320px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  overflow: hidden;
  background: #eef3f1;
  z-index: 0;
}

.location-hint {
  display: block;
  margin-top: 6px;
  color: var(--ima-muted);
  font-size: 0.85rem;
}

.notice {
  padding: 14px 16px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: var(--ima-soft);
  color: var(--ima-muted);
  line-height: 1.5;
}

.id-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 46px;
  padding: 10px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: var(--ima-soft);
}

.id-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ima-line);
  color: var(--ima-green-dark);
  font-size: 13px;
  font-weight: 800;
}

.id-chip button {
  border: 0;
  background: transparent;
  color: #8a3e3e;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ima-line);
  border-radius: 8px;
  background: #fff;
}

.tab-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--ima-muted);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.tab-button.active {
  background: var(--ima-green);
  color: #fff;
}

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

.sample-card {
  padding: 16px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfece8;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ima-green);
}

.success-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: stretch;
}

.success-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--ima-green);
  color: #fff;
  font-size: 42px;
  font-weight: 900;
}

.status-card {
  padding: 20px;
}

.status-card strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  color: var(--ima-green-dark);
}

.sample-detail-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 14px;
  margin: 20px 0 0;
  color: var(--ima-muted);
}

.sample-detail-list dt {
  font-weight: 800;
  color: var(--ima-ink);
}

.sample-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.footer {
  border-top: 1px solid var(--ima-line);
  background: #fff;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ima-muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

/* Projekte-Tile (kompakter Container, leitet zur Projektliste weiter) */
.projects-tile {
  display: none; /* Desktop zeigt die volle Liste */
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--ima-line);
  border-radius: 6px;
  background: var(--ima-soft);
  color: var(--ima-ink);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.projects-tile:hover {
  background: var(--ima-mint);
  border-color: var(--ima-green);
}
.projects-tile-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--ima-line);
  font-size: 22px;
}
.projects-tile-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.projects-tile-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ima-ink);
}
.projects-tile-meta {
  font-size: 13px;
  color: var(--ima-muted);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.projects-tile-meta strong { color: var(--ima-green-dark); font-weight: 800; }
.projects-tile-meta .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ima-green);
  display: inline-block;
}
.projects-tile-meta .dot.ok   { background: #2ca982; }
.projects-tile-meta .dot.warn { background: #f0a33a; }
.projects-tile-chevron {
  font-size: 24px;
  font-weight: 800;
  color: var(--ima-muted);
  line-height: 1;
}

@media (max-width: 900px) {
  .login-main,
  .dashboard-grid,
  .success-hero {
    grid-template-columns: 1fr;
  }

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

  .hero-points,
  .metrics,
  .sample-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .app-header-inner {
    min-height: 68px;
  }

  .brand img {
    width: 96px;
  }

  .brand-copy {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .app-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    display: none;
    padding: 10px;
    border: 1px solid var(--ima-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(23, 50, 44, 0.14);
  }

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

  .app-nav a {
    justify-content: flex-start;
  }

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

  .project-card {
    grid-template-columns: 1fr;
  }

  .button-row,
  .form-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row .btn,
  .form-row .btn {
    width: 100%;
  }

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

@media (max-width: 430px) {
  .main,
  .login-main,
  .app-header-inner,
  .footer-inner {
    width: min(100% - 20px, 1180px);
  }

  .main {
    padding-top: 20px;
  }

  .form-card,
  .panel,
  .choice-card {
    padding: 16px;
  }
}

/* =========================================================
   APP-MODE (Mobile only) – aufgeräumtes, app-ähnliches UI
   Greift nur bis 760px, Browser-Ansicht bleibt unverändert.
   ========================================================= */
@media (max-width: 760px) {
  body.app-body {
    background: #f5f8f7;
    -webkit-tap-highlight-color: transparent;
  }

  /* --- Header: kompakt, nur Logo + Seitentitel ----------- */
  .app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--ima-line);
    backdrop-filter: none;
  }
  .app-header-inner {
    min-height: 68px;
    padding: 0 4px;
    gap: 12px;
  }
  .brand { gap: 12px; }
  .brand img { width: 88px; }
  .brand-copy { display: grid; gap: 0; }
  .brand-title { display: none; }
  .brand-subtitle {
    font-size: 20px;
    font-weight: 800;
    color: var(--ima-ink);
    letter-spacing: -0.01em;
  }
  /* Hamburger weg – wir nutzen Bottom-Tab-Bar */
  .menu-button { display: none !important; }

  /* Install-Button auf Mobile als kleiner Icon-Button */
  .install-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0;
    gap: 0;
  }
  .install-button::before {
    font-size: 18px;
  }

  /* --- Bottom Tab Bar (aus .app-nav) --------------------- */
  .app-nav[data-app-nav] {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    margin: 0;
    background: #ffffff;
    border: 0;
    border-top: 1px solid var(--ima-line);
    border-radius: 0;
    box-shadow: 0 -6px 20px rgba(23, 50, 44, 0.06);
    z-index: 50;
  }
  .app-nav[data-app-nav] a {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 58px;
    padding: 8px 4px 6px;
    border-radius: 4px;
    background: transparent;
    color: var(--ima-muted);
    font-size: 11px;
    font-weight: 650;
    text-align: center;
    line-height: 1.1;
    letter-spacing: 0.01em;
  }
  .app-nav[data-app-nav] a::before {
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: 24px 24px;
            mask-size: 24px 24px;
    transition: background-color 0.2s ease;
  }

  /* Minimalistische Line-Icons (Stroke 1.5, currentColor) als data-URI */
  .app-nav[data-app-nav] a[href*="dashboard"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11.5 12 4l9 7.5'/><path d='M5 10.5V20h14v-9.5'/><path d='M10 20v-5h4v5'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11.5 12 4l9 7.5'/><path d='M5 10.5V20h14v-9.5'/><path d='M10 20v-5h4v5'/></svg>");
  }
  .app-nav[data-app-nav] a[href*="method-choice"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='8.5'/><path d='M12 8v8M8 12h8'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='8.5'/><path d='M12 8v8M8 12h8'/></svg>");
  }
  .app-nav[data-app-nav] a[href*="qr-scan"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3.5' y='3.5' width='6' height='6' rx='1'/><rect x='14.5' y='3.5' width='6' height='6' rx='1'/><rect x='3.5' y='14.5' width='6' height='6' rx='1'/><path d='M14.5 14.5h2v2M20.5 14.5v2M14.5 18.5h2v2M20.5 20.5h-2'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3.5' y='3.5' width='6' height='6' rx='1'/><rect x='14.5' y='3.5' width='6' height='6' rx='1'/><rect x='3.5' y='14.5' width='6' height='6' rx='1'/><path d='M14.5 14.5h2v2M20.5 14.5v2M14.5 18.5h2v2M20.5 20.5h-2'/></svg>");
  }
  .app-nav[data-app-nav] a[href*="manual-id"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='6' width='18' height='12' rx='2'/><path d='M7 10h.01M11 10h.01M15 10h.01M7 14h10'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='6' width='18' height='12' rx='2'/><path d='M7 10h.01M11 10h.01M15 10h.01M7 14h10'/></svg>");
  }
  .app-nav[data-app-nav] a[href*="sample-data"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M9 3h6M10 3v6.5L5.5 18a2 2 0 0 0 1.8 3h9.4a2 2 0 0 0 1.8-3L14 9.5V3'/><path d='M8 14h8'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M9 3h6M10 3v6.5L5.5 18a2 2 0 0 0 1.8 3h9.4a2 2 0 0 0 1.8-3L14 9.5V3'/><path d='M8 14h8'/></svg>");
  }
  .app-nav[data-app-nav] a[href*="results"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20h16'/><path d='M7 20v-7M12 20V8M17 20v-5'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20h16'/><path d='M7 20v-7M12 20V8M17 20v-5'/></svg>");
  }
  .app-nav[data-app-nav] a[href*="offer"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 3h9l4 4v14H6z'/><path d='M14 3v5h5'/><path d='M9 13h6M9 17h4'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 3h9l4 4v14H6z'/><path d='M14 3v5h5'/><path d='M9 13h6M9 17h4'/></svg>");
  }
  .app-nav[data-app-nav] a[href*="success"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='8.5'/><path d='m8.5 12.5 2.5 2.5 4.5-5'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='8.5'/><path d='m8.5 12.5 2.5 2.5 4.5-5'/></svg>");
  }
  .app-nav[data-app-nav] a.active {
    background: var(--ima-mint);
    color: var(--ima-green-dark);
  }
  .app-nav[data-app-nav] a.active::before {
    background-color: var(--ima-green-dark);
  }

  /* Platz für die Tab-Bar schaffen */
  .app-shell { padding-bottom: 76px; }

  /* --- Footer auf dem Handy ausblenden ------------------- */
  .footer { display: none; }

  /* --- Main: weniger Polster, ruhiger -------------------- */
  .main,
  .login-main {
    width: 100%;
    padding: 14px 14px 24px;
    gap: 14px;
  }

  /* --- Login: alles Marketing-Zeug verstecken ------------ */
  .login-main > section:first-child { display: none; }
  .login-main {
    grid-template-columns: 1fr;
    padding-top: 18px;
  }
  .form-card {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 4px 0 0;
  }
  .form-card h1 { font-size: 24px; margin-bottom: 4px; }
  .form-card > p { margin-bottom: 16px; font-size: 14px; }

  /* --- Page-Head: nur Titel, Erklärungstext weg ---------- */
  .page-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
  }
  .page-head .eyebrow,
  .page-head > div > p { display: none; }
  .page-head h1 {
    font-size: 22px;
    margin: 0;
    line-height: 1.2;
  }
  /* "Zurück"-Button als kleiner Pfeil */
  .page-head > .btn-secondary {
    min-height: 40px;
    width: 40px;
    padding: 0;
    font-size: 0;
    border-radius: 50%;
    flex: 0 0 40px;
  }
  .page-head > .btn-secondary::before {
    content: "‹";
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: var(--ima-ink);
  }

  /* --- Karten: flacher, kein Schatten, bündige Optik ----- */
  .hero-point,
  .metric,
  .card,
  .panel,
  .choice-card,
  .sample-card,
  .status-card,
  .form-card,
  .project-card {
    box-shadow: none;
    border-radius: 6px;
  }
  .panel { padding: 14px; }

  /* --- Dashboard: Metriken in 3er-Reihe, kompakt --------- */
  .metrics {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }
  .metric { padding: 12px 10px; text-align: center; }
  .metric span { font-size: 11px; }
  .metric strong { font-size: 22px; margin-top: 4px; }

  /* --- Schnellaktionen: größere App-Buttons -------------- */
  .stack { gap: 10px; }
  .btn {
    min-height: 52px;
    border-radius: 4px;
    font-size: 16px;
  }
  .btn-primary { box-shadow: 0 4px 12px rgba(44, 169, 130, 0.2); }
  .btn:hover { transform: none; box-shadow: none; }

  /* Header-Compact-Button auf Mobile noch knapper */
  .btn-compact {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
  .btn-compact .btn-label { font-weight: 750; }

  /* --- Methodenwahl: große, gleichmäßig verteilte Tap-Kacheln --- */
  .choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Füllt die freie Höhe zwischen Page-Head und Bottom-Nav */
    min-height: calc(100vh - 230px);
    gap: 14px;
    align-content: stretch;
  }
  .choice-card {
    min-height: 0;
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 14px;
    padding: 22px 20px;
    border-radius: 6px;
  }
  .choice-icon {
    width: 64px;
    height: 64px;
    margin: 0;
    font-size: 28px;
    flex: 0 0 64px;
    border-radius: 6px;
  }
  .choice-card h2 {
    font-size: 22px;
    margin: 0;
    line-height: 1.15;
  }
  .choice-card p {
    font-size: 14px;
    margin: 0;
    color: var(--ima-muted);
    line-height: 1.5;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .choice-card .btn { display: none; } /* ganze Karte ist klickbar */
  /* dezenter Hinweispfeil rechts unten */
  .choice-card::after {
    content: "›";
    align-self: flex-end;
    margin-top: auto;
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    color: var(--ima-green-dark);
  }

  /* --- Projektliste: kompakter --------------------------- */
  .project-card { padding: 14px; gap: 10px; }
  .project-card h3 { font-size: 15px; }
  .project-card .btn { min-height: 44px; }

  /* Auf dem Handy: volle Projektliste verstecken,
     stattdessen einen Container/Tab anzeigen, der weiterleitet.
     Greift NUR im Dashboard, wo die .projects-tile direkt vor der Liste steht. */
  .panel .projects-tile ~ .project-list { display: none; }
  .projects-tile { display: flex; }
  .panel .section-title { margin-bottom: 10px; font-size: 18px; }

  /* --- Notice: dezent ------------------------------------ */
  .notice {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 6px;
  }

  /* --- Scanner: gross, fokussiert ------------------------ */
  .dashboard-grid { gap: 12px; }
  .scan-mode-tabs { margin-bottom: 10px; }
  .scan-mode-tab { min-height: 44px; }
  .scanner { min-height: 60vh; border-radius: 14px; }
  .scanner-box { width: min(300px, 82vw); }
  .scanner[data-scan-mode="qr"] .scanner-box { width: min(220px, 70vw); }
  .camera-tools { margin-top: 10px; }
  .camera-tip { font-size: 12px; }

  /* --- Sample-Grid: einspaltig --------------------------- */
  .sample-grid { grid-template-columns: 1fr; }

  /* --- Erfolgs-Hero ruhiger ------------------------------ */
  .success-hero { gap: 12px; }
  .success-mark { width: 64px; height: 64px; font-size: 34px; margin-bottom: 12px; }

  /* --- Felder: größer, fingerfreundlich ------------------ */
  .field input,
  .field select,
  .field textarea {
    min-height: 52px;
    border-radius: 4px;
    font-size: 16px; /* verhindert iOS-Zoom */
  }
  .field label { font-size: 14px; }

  /* --- Tabs in Pillen-Form ------------------------------- */
  .tabs { width: 100%; }
  .tab-button { min-height: 44px; }
}

/* Sehr schmale Geräte: zusätzlicher Feinschliff ------------ */
@media (max-width: 380px) {
  .brand img { width: 74px; }
  .brand-subtitle { font-size: 17px; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metric strong { font-size: 19px; }
  .app-nav[data-app-nav] a { font-size: 10px; }
  .app-nav[data-app-nav] a::before {
    width: 22px;
    height: 22px;
    -webkit-mask-size: 22px 22px;
            mask-size: 22px 22px;
  }
}

/* Mobile Feinschliff für die Methodenwahl: weniger Leerraum, stärkere App-Karten */
@media (max-width: 760px) {
  .method-choice-main {
    min-height: calc(100svh - 68px - 76px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 16px 14px 18px;
  }

  .method-choice-main .page-head {
    margin-bottom: 12px;
  }

  .method-choice-main .page-head h1 {
    max-width: 270px;
    font-size: clamp(21px, 6vw, 25px);
    line-height: 1.14;
  }

  .method-choice-main .choice-grid {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(150px, 1fr));
    gap: 12px;
    align-content: stretch;
  }

  .method-choice-main .choice-card {
    position: relative;
    min-height: 150px;
    height: auto;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 24px;
    grid-template-rows: auto auto;
    align-content: center;
    align-items: center;
    column-gap: 14px;
    row-gap: 4px;
    padding: 18px 16px;
    border-color: rgba(31, 127, 99, 0.16);
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(233, 247, 243, 0.8), rgba(255, 255, 255, 0.96) 42%),
      #ffffff;
    box-shadow: 0 10px 24px rgba(23, 50, 44, 0.07);
  }

  .method-choice-main .choice-card::after {
    content: ">";
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    margin: 0;
    color: var(--ima-green-dark);
    font-size: 26px;
    font-weight: 850;
    line-height: 1;
  }

  .method-choice-main .choice-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 62px;
    height: 62px;
    margin: 0;
    border-radius: 8px;
    background: #e4f5f0;
    color: var(--ima-green-dark);
    font-size: 25px;
    box-shadow: inset 0 0 0 1px rgba(44, 169, 130, 0.08);
  }

  .method-choice-main .choice-card h2 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-size: clamp(17px, 4.8vw, 20px);
    line-height: 1.18;
  }

  .method-choice-main .choice-card p {
    grid-column: 2;
    grid-row: 2;
    max-width: 34ch;
    margin: 0;
    color: #52635e;
    font-size: 13px;
    line-height: 1.45;
    -webkit-line-clamp: 3;
            line-clamp: 3;
  }

  .method-choice-main .choice-card .btn {
    display: none;
  }
}

@media (max-width: 380px) {
  .method-choice-main {
    padding: 14px 12px 16px;
  }

  .method-choice-main .choice-grid {
    grid-template-rows: repeat(2, minmax(132px, 1fr));
    gap: 10px;
  }

  .method-choice-main .choice-card {
    min-height: 132px;
    grid-template-columns: 54px minmax(0, 1fr) 20px;
    column-gap: 12px;
    padding: 15px 13px;
  }

  .method-choice-main .choice-icon {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .method-choice-main .choice-card p {
    -webkit-line-clamp: 2;
            line-clamp: 2;
  }
}

/* =========================================================
   Probeentnahme-Test: gezielter Responsive-Feinschliff
   für die reduzierte 3-Seiten-App.
   ========================================================= */
.overview-main,
.sample-entry-main,
.success-main {
  width: min(1080px, calc(100% - 32px));
}

.sample-entry-main .form-card {
  align-self: start;
}

.sample-entry-main .workflow-panel {
  position: sticky;
  top: 96px;
  align-self: start;
}

.scanner-actions {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .sample-entry-main .workflow-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  body.app-body {
    background: #f5f8f7;
  }

  .app-shell {
    padding-bottom: 0;
  }

  .app-header {
    position: sticky;
    background: #fff;
  }

  .app-header-inner {
    width: 100%;
    min-height: 64px;
    padding: 0 12px;
    gap: 10px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand img {
    width: 78px;
  }

  .brand-copy {
    display: grid;
    min-width: 0;
  }

  .brand-title {
    display: none;
  }

  .brand-subtitle {
    display: block;
    overflow: hidden;
    color: var(--ima-ink);
    font-size: 18px;
    font-weight: 820;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-compact {
    min-height: 38px;
    max-width: 150px;
    padding: 0 10px;
    font-size: 13px;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }

  .btn-compact .btn-icon {
    flex: 0 0 auto;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .install-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
  }

  .header-actions .install-button span {
    display: none;
  }

  .overview-main,
  .sample-entry-main,
  .success-main {
    width: 100%;
    padding: 14px 12px 28px;
  }

  .page-head {
    display: block;
    margin: 2px 0 14px;
  }

  .page-head .eyebrow {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
  }

  .page-head h1 {
    font-size: 24px;
    line-height: 1.16;
  }

  .page-head > div > p {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.4;
  }

  .overview-main .panel,
  .success-main .panel,
  .success-main .status-card {
    padding: 14px;
    border-radius: 8px;
    background: #fff;
  }

  .sample-toolbar {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .sample-toolbar .section-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
  }

  .sample-toolbar .status-pill {
    margin-top: 0;
  }

  .project-card {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
    border-radius: 8px;
  }

  .project-card h3 {
    font-size: 17px;
    overflow-wrap: anywhere;
  }

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

  .sample-entry-main .dashboard-grid {
    display: block;
  }

  .sample-entry-main .form-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .sample-entry-main .workflow-panel {
    display: none;
  }

  .sample-entry-main .form-grid {
    gap: 12px;
  }

  .scan-mode-tabs {
    gap: 3px;
    margin-bottom: 10px;
    border-radius: 8px;
  }

  .scan-mode-tab {
    min-height: 42px;
    border-radius: 6px;
    font-size: 14px;
  }

  [data-scan-fields] {
    padding: 10px;
    border: 1px solid var(--ima-line);
    border-radius: 10px;
    background: #fff;
  }

  .scanner {
    min-height: min(58svh, 480px);
    border-radius: 10px;
  }

  .scanner-box {
    width: min(310px, 78vw);
    border-width: 4px;
  }

  .scanner[data-scan-mode="qr"] .scanner-box {
    width: min(230px, 68vw);
  }

  .scanner-text {
    bottom: 18px;
    font-size: 14px;
  }

  .scanner-hint {
    top: 12px;
    font-size: 13px;
  }

  .camera-tools {
    gap: 10px;
    margin-top: 10px;
  }

  .camera-select,
  .camera-zoom {
    border-radius: 8px;
    background: #f7fbfa;
  }

  .scanner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 10px;
  }

  .scanner-actions .btn {
    width: 100%;
    min-height: 46px;
    font-size: 14px;
  }

  .field {
    padding: 12px;
    border: 1px solid var(--ima-line);
    border-radius: 8px;
    background: #fff;
  }

  .sample-grid {
    gap: 12px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 50px;
    border-radius: 6px;
  }

  .field textarea {
    min-height: 96px;
  }

  .sample-entry-main .button-row:last-child {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: 1fr;
    margin: 0 -12px -28px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ima-line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .sample-entry-main .button-row:last-child .btn {
    width: 100%;
  }

  .success-hero {
    display: grid;
    gap: 12px;
  }

  .success-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 12px;
    font-size: 28px;
  }

  .success-main h1 {
    margin: 0 0 6px;
    font-size: 24px;
    line-height: 1.15;
  }

  .success-main p {
    margin: 0;
    font-size: 14px;
    color: var(--ima-muted);
  }

  .sample-detail-list {
    grid-template-columns: 1fr;
    gap: 3px;
    margin-top: 16px;
  }

  .sample-detail-list dt {
    margin-top: 10px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--ima-muted);
  }

  .sample-detail-list dd {
    color: var(--ima-ink);
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .app-header-inner {
    padding: 0 10px;
  }

  .brand img {
    width: 68px;
  }

  .brand-subtitle {
    font-size: 16px;
  }

  .btn-compact {
    max-width: 122px;
    padding: 0 8px;
    font-size: 12px;
  }

  .scanner {
    min-height: 52svh;
  }

  .scanner-actions {
    grid-template-columns: 1fr;
  }
}
