:root {
  --bg: #05111a;
  --bg-deep: #091823;
  --panel: rgba(10, 25, 37, 0.9);
  --panel-strong: rgba(7, 20, 29, 0.96);
  --panel-soft: rgba(15, 35, 49, 0.84);
  --border: rgba(140, 193, 197, 0.18);
  --border-strong: rgba(130, 217, 201, 0.28);
  --text: #e8f4f7;
  --muted: #90a9b1;
  --muted-strong: #b6ccd1;
  --accent: #61e4c5;
  --accent-strong: #2ecfb5;
  --accent-dim: #193d43;
  --signal: #8be7ff;
  --warning: #ff9275;
  --danger-bg: rgba(255, 146, 117, 0.12);
  --neutral-bg: rgba(97, 228, 197, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(46, 207, 181, 0.12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(139, 231, 255, 0.12), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(44, 123, 145, 0.15), transparent 36%),
    linear-gradient(160deg, #06121b 0%, #081924 46%, #041018 100%);
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 18px 0 40px;
}

.main-grid > *,
.analysis-column,
.metric-grid > *,
.image-grid > *,
.details-grid > *,
.landing-grid > *,
.hero-panel > * {
  min-width: 0;
}

.page-stack {
  display: grid;
  gap: 24px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(14, 31, 43, 0.96) 0%, rgba(9, 22, 32, 0.94) 100%);
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(97, 228, 197, 0.45), rgba(139, 231, 255, 0.1), transparent);
}

.header {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 28px;
  margin-bottom: 28px;
  border: 1px solid rgba(130, 217, 201, 0.18);
  border-radius: 20px;
  background: #0a1d28;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.brand-lockup strong,
.hero-copy h2,
.section-heading h3,
.empty-panel h3,
.modal-header h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

.brand-link {
  text-decoration: none;
}

.brand-lockup {
  display: grid;
  gap: 5px;
}

.brand-lockup strong {
  font-size: 1.34rem;
  line-height: 1.02;
}

.eyebrow,
.card-kicker,
.hero-kicker,
.stat-label,
.metric-label,
thead th {
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow,
.card-kicker,
.hero-kicker {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.brand-copy,
.hero-copy p,
.footer p,
.modal-copy,
.status-panel p,
.empty-panel p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.brand-copy {
  max-width: 72ch;
  margin-top: 16px;
  font-size: 1.03rem;
}

.support-copy {
  max-width: 68ch;
  color: var(--muted);
}

.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.brand-chips span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(139, 231, 255, 0.18);
  background: rgba(6, 19, 28, 0.7);
  color: var(--muted-strong);
  font-size: 0.88rem;
}

.topbar-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.top-link {
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid rgba(139, 231, 255, 0.16);
  background: #0d2432;
  color: var(--muted-strong);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
}

.top-link-accent {
  color: #04211d;
  background: linear-gradient(135deg, #61e4c5 0%, #7dedff 100%);
  border-color: transparent;
}

.main-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.landing-view {
  display: grid;
  gap: 24px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.4fr 0.85fr;
  gap: 24px;
  padding: 32px;
}

.hero-copy {
  display: grid;
  gap: 18px;
}

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

.hero-copy h2 {
  max-width: 19ch;
  font-size: 1.34rem;
  line-height: 1.08;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.hero-stats > div,
.hero-sidecard {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(139, 231, 255, 0.12);
  background: rgba(5, 16, 24, 0.68);
}

.hero-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.35;
}

.stat-label {
  color: var(--muted);
  font-size: 0.68rem;
}

.hero-sidecard {
  display: grid;
  gap: 16px;
}

.hero-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted-strong);
  line-height: 1.7;
}

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

.landing-card {
  padding: 24px;
  display: grid;
  gap: 12px;
}

.landing-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.24rem;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.landing-card p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.72;
}

.control-rail {
  position: sticky;
  top: 118px;
  padding: 26px;
  display: grid;
  gap: 20px;
}

.analysis-column {
  display: grid;
  gap: 22px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.section-heading-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading-actions > div:first-child {
  display: grid;
  gap: 8px;
}

.section-heading h3 {
  font-size: 1.55rem;
  line-height: 1.04;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.sample-links {
  display: grid;
  gap: 10px;
}

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

.sample-link {
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(139, 231, 255, 0.12);
  background: rgba(7, 19, 28, 0.62);
  color: var(--muted-strong);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.sample-link:hover {
  border-color: rgba(97, 228, 197, 0.28);
  color: var(--text);
}

.input-field {
  display: grid;
  gap: 9px;
}

.input-field span {
  color: var(--muted-strong);
  font-weight: 700;
  font-size: 0.94rem;
}

.input-field input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(139, 231, 255, 0.16);
  background: rgba(4, 14, 20, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-field input:focus {
  border-color: rgba(97, 228, 197, 0.55);
  box-shadow: 0 0 0 4px rgba(97, 228, 197, 0.08);
}

.input-select {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(139, 231, 255, 0.16);
  background: rgba(4, 14, 20, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-select:focus {
  border-color: rgba(97, 228, 197, 0.55);
  box-shadow: 0 0 0 4px rgba(97, 228, 197, 0.08);
}

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

.field-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.button-grid,
.rail-actions {
  display: grid;
  gap: 14px;
}

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

#captureBtn {
  grid-column: 1 / -1;
}

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

.camera-actions {
  display: none;
  gap: 14px;
}

.btn,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 20px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

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

.btn:not(:disabled):hover,
.icon-button:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #04211d;
  background: linear-gradient(135deg, #61e4c5 0%, #7dedff 100%);
  box-shadow: 0 18px 35px rgba(97, 228, 197, 0.16);
}

.btn-secondary {
  color: var(--text);
  background: linear-gradient(135deg, rgba(12, 34, 48, 0.96) 0%, rgba(18, 51, 67, 0.92) 100%);
  border: 1px solid rgba(139, 231, 255, 0.14);
}

.btn-ghost {
  color: var(--muted-strong);
  background: rgba(7, 19, 28, 0.7);
  border: 1px solid rgba(139, 231, 255, 0.12);
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(139, 231, 255, 0.16);
  background: rgba(8, 24, 34, 0.84);
  color: var(--muted-strong);
  font-weight: 700;
  white-space: nowrap;
}

.copy-button:hover {
  color: var(--text);
  border-color: rgba(97, 228, 197, 0.34);
}

.status-panel {
  padding: 18px 18px;
  border-radius: 18px;
  border: 1px solid rgba(139, 231, 255, 0.12);
  background: var(--neutral-bg);
}

.status-panel[data-tone="danger"] {
  border-color: rgba(255, 146, 117, 0.32);
  background: var(--danger-bg);
}

.status-panel[data-tone="success"] {
  border-color: rgba(97, 228, 197, 0.22);
  background: rgba(97, 228, 197, 0.1);
}

.status-title {
  margin-bottom: 4px;
  font-weight: 800;
}

.camera-shell {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  border-radius: 20px;
  border: 1px solid rgba(139, 231, 255, 0.12);
  background: #000;
}

.camera-shell video {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
  display: block;
}

.mobile-camera-mode .camera-actions {
  display: grid;
}

.primary-metrics,
.image-panel,
.warning-panel,
.detail-panel,
.wide-panel,
.empty-panel,
.footer {
  padding: 26px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.metric-card {
  padding: 14px 14px 12px;
  border-radius: 20px;
  border: 1px solid rgba(139, 231, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(10, 28, 39, 0.98) 0%, rgba(6, 16, 24, 0.96) 100%);
  display: grid;
  grid-template-rows: auto minmax(52px, 1fr) auto;
  gap: 6px;
  min-height: 132px;
  justify-items: center;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3em;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 800;
  width: 100%;
  line-height: 1.15;
  letter-spacing: 0.14em;
  text-transform: none;
}

.metric-card-shelf {
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.metric-card-control {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 0;
  width: min(100%, 136px);
  justify-items: center;
  text-align: center;
}

.metric-card-control span {
  color: var(--muted-strong);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.metric-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 2vw, 2.5rem);
  line-height: 1;
  align-self: center;
  justify-self: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  width: 100%;
}

.metric-card strong.metric-text-value {
  font-size: 1.55rem;
  line-height: 1.08;
  max-width: 9ch;
  margin-inline: auto;
  text-wrap: balance;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.45;
  min-height: 2.2em;
  width: 100%;
  font-size: 0.86rem;
}

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

.warning-item {
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 146, 117, 0.24);
  background: rgba(255, 146, 117, 0.1);
  color: #ffd9cf;
  line-height: 1.6;
}

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

.image-card {
  display: grid;
  gap: 12px;
}

.image-title {
  color: var(--muted-strong);
  font-weight: 700;
}

.image-frame {
  position: relative;
  min-height: 190px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(139, 231, 255, 0.12);
  background: rgba(4, 12, 18, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-frame img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: none;
}

.image-frame.has-image img {
  display: block;
}

.image-placeholder {
  color: var(--muted);
  text-align: center;
}

.image-frame.has-image .image-placeholder {
  display: none;
}

.empty-panel {
  display: grid;
  gap: 12px;
  min-height: 182px;
  place-content: center;
}

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

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

.detail-row {
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(139, 231, 255, 0.1);
  background: rgba(5, 15, 22, 0.78);
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 16px;
}

.detail-row span:first-child {
  color: var(--muted);
}

.detail-row span:last-child {
  color: var(--text);
  font-weight: 700;
  text-align: right;
  line-height: 1.5;
}

.wide-panel {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  border: 1px solid rgba(139, 231, 255, 0.1);
  background: rgba(5, 15, 22, 0.72);
}

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

thead th {
  padding: 15px 13px;
  background: rgba(7, 19, 28, 0.98);
  color: var(--muted-strong);
  font-size: 0.68rem;
  text-align: left;
}

tbody td {
  padding: 15px 13px;
  border-top: 1px solid rgba(139, 231, 255, 0.08);
  color: var(--muted-strong);
  vertical-align: top;
  line-height: 1.55;
}

tbody tr:nth-child(odd) {
  background: rgba(5, 15, 22, 0.72);
}

.footer {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.footer-block {
  display: grid;
  gap: 10px;
}

.footer a {
  color: var(--muted-strong);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.footer a:hover {
  color: var(--text);
}

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

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 8, 12, 0.82);
  backdrop-filter: blur(8px);
}

.modal-scrollable {
  align-items: start;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-scrollable .modal-card {
  margin: auto;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.modal-scrollable .modal-body {
  min-height: 0;
  overflow-y: auto;
}

.modal-card {
  width: min(980px, 100%);
  border-radius: 28px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(10, 25, 37, 0.98) 0%, rgba(6, 15, 22, 0.97) 100%);
  box-shadow: var(--shadow);
}

.modal-card-compact {
  width: min(620px, 100%);
}

.modal-header,
.modal-body {
  padding: 24px 26px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid rgba(139, 231, 255, 0.1);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(7, 19, 28, 0.78);
  color: var(--text);
  border: 1px solid rgba(139, 231, 255, 0.12);
}

.modal-body {
  display: grid;
  gap: 20px;
}

.crop-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: min(480px, calc(100vh - 360px));
  border-radius: 22px;
  border: 1px dashed rgba(139, 231, 255, 0.24);
  background: rgba(4, 12, 18, 0.92);
  overflow: hidden;
}

#cropCanvas {
  max-width: 100%;
  max-height: min(68vh, 620px);
  display: block;
}

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

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

@media (max-width: 1220px) {
  .hero-panel,
  .main-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .control-rail {
    position: static;
  }

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

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

  .footer-block:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .app-shell {
    width: calc(100vw - 20px);
    padding-top: 10px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .header,
  .hero-panel,
  .control-rail,
  .primary-metrics,
  .image-panel,
  .warning-panel,
  .detail-panel,
  .wide-panel,
  .empty-panel,
  .footer {
    padding: 20px;
  }

  .metric-grid,
  .image-grid,
  .hero-stats,
  .landing-grid,
  .sample-grid,
  .modal-actions,
  .footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-block:last-child {
    grid-column: auto;
  }

  .footer-block:first-child {
    grid-column: 1 / -1;
  }

  .mobile-camera-mode .camera-actions {
    grid-template-columns: 1fr;
  }

  .modal-scrollable {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .modal-scrollable .modal-card {
    max-height: calc(100dvh - 24px);
  }

  .crop-stage {
    min-height: 260px;
  }

  .mobile-camera-mode .camera-shell {
    order: 1;
  }

  .mobile-camera-mode .camera-actions {
    order: 2;
  }

  .mobile-camera-mode .rail-actions {
    order: 3;
  }
}

@media (max-width: 640px) {
  :root {
    --radius: 18px;
  }

  .app-shell {
    width: calc(100vw - 12px);
    padding-top: 6px;
  }

  .header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 16px;
  }

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

  .top-link {
    min-width: 0;
    padding: 11px 10px;
    text-align: center;
    font-size: 0.88rem;
  }

  .page-stack,
  .landing-view,
  .analysis-column,
  .details-grid {
    gap: 14px;
  }

  .header,
  .hero-panel,
  .control-rail,
  .primary-metrics,
  .image-panel,
  .warning-panel,
  .detail-panel,
  .wide-panel,
  .empty-panel,
  .footer {
    padding: 16px;
  }

  .hero-copy h2 {
    max-width: none;
    font-size: clamp(1.3rem, 6vw, 1.65rem);
  }

  .section-heading h3 {
    font-size: clamp(1.2rem, 5vw, 1.45rem);
  }

  .hero-stats,
  .landing-grid,
  .sample-grid,
  .image-grid,
  .button-grid,
  .condition-grid,
  .rail-actions,
  .modal-actions,
  .footer {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 10px;
  }

  .footer-block:first-child {
    grid-column: auto;
  }

  .metric-card {
    min-height: 124px;
    padding: 13px 10px 11px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
  }

  .detail-row span:last-child {
    text-align: left;
  }

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

  .copy-button {
    justify-content: center;
    width: 100%;
  }

  .crop-stage {
    min-height: min(52dvh, 360px);
  }

  .modal {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .modal-scrollable .modal-card {
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .modal-header,
  .modal-body {
    padding: 16px;
  }

  .modal-header h3 {
    font-size: 1.15rem;
  }

  .image-frame {
    min-height: 170px;
  }

  .image-frame img {
    width: 100%;
    height: auto;
    max-height: 52dvh;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 380px) {
  .metric-grid,
  .topbar-links {
    grid-template-columns: 1fr;
  }

  .btn {
    padding-inline: 12px;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .header {
    position: static;
  }

  .modal-scrollable .modal-card {
    margin-block: 0;
  }

  .crop-stage {
    min-height: 220px;
  }

  #cropCanvas {
    max-height: 52dvh;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn,
  .top-link,
  .copy-button,
  .icon-button,
  input,
  select {
    min-height: 48px;
  }

  .btn:not(:disabled):hover,
  .icon-button:hover {
    transform: none;
  }
}
