:root {
  color-scheme: dark;
  --bg: #07100e;
  --panel: #10201c;
  --panel-2: #152b25;
  --line: #2e4b43;
  --text: #f5fff9;
  --muted: #b5c9c1;
  --accent: #6df0bc;
  --accent-2: #f7c76b;
  --danger: #ff856d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(109, 240, 188, 0.15), transparent 28rem),
    radial-gradient(circle at 90% 15%, rgba(247, 199, 107, 0.12), transparent 24rem),
    var(--bg);
  color: var(--text);
}

button,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.topbar,
.hero-panel,
.capture-panel,
.fit-panel,
.assistant-panel {
  border: 1px solid var(--line);
  background: rgba(16, 32, 28, 0.92);
  box-shadow: var(--shadow);
  border-radius: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

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

.topbar h1,
.hero-panel h2,
.capture-header h2,
.section-title h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(2rem, 8vw, 4rem);
}

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

.status-pill,
.count-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #071915;
  color: var(--accent);
  border-radius: 999px;
  padding: 10px 13px;
  font-weight: 800;
  min-width: 72px;
  text-align: center;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 22px;
}

.hero-panel h2 {
  max-width: 720px;
  font-size: clamp(1.8rem, 7vw, 4.6rem);
}

.hero-panel p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
  min-height: 54px;
  padding: 0 18px;
  color: #04100d;
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.secondary-action {
  background: var(--accent-2);
}

.ghost-action {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  text-decoration: none;
}

.nav-action {
  min-height: 46px;
  white-space: nowrap;
}

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

.wide {
  width: 100%;
}

.capture-panel,
.fit-panel,
.assistant-panel {
  padding: 18px;
}

.capture-header,
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #020706;
  aspect-ratio: 9 / 14;
  max-height: 72vh;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #020706;
}

.framing-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid rgba(109, 240, 188, 0.38);
  opacity: 0.9;
}

.guide-line {
  position: absolute;
  background: rgba(109, 240, 188, 0.34);
}

.guide-line--top,
.guide-line--middle,
.guide-line--bottom {
  left: 0;
  right: 0;
  height: 1px;
}

.guide-line--top {
  top: 24%;
}

.guide-line--middle {
  top: 50%;
}

.guide-line--bottom {
  top: 76%;
}

.guide-line--left,
.guide-line--right {
  top: 0;
  bottom: 0;
  width: 1px;
}

.guide-line--left {
  left: 33.333%;
}

.guide-line--right {
  right: 33.333%;
}

.camera-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(109, 240, 188, 0.08), transparent),
    #020706;
}

.camera-empty strong {
  color: var(--text);
  font-size: 1.35rem;
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.shot {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #071915;
  position: relative;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  right: 6px;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(2, 7, 6, 0.78);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 900;
}

.field-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  color: var(--text);
  background: #071915;
}

.result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #071915;
  color: var(--muted);
  line-height: 1.55;
}

.ai-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #071915;
}

.ai-card div {
  display: grid;
  gap: 3px;
}

.ai-card strong {
  color: var(--text);
}

.ai-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.compact {
  min-height: 42px;
  padding: 0 12px;
}

.result strong {
  color: var(--text);
}

.result pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  font: inherit;
}

.result ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.dashboard-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 18px;
  display: grid;
  gap: 16px;
}

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

.session-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #071915;
  color: var(--muted);
}

.session-card__header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.session-card h3,
.session-card h4 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.session-card h3 {
  font-size: 1.2rem;
}

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

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(16, 32, 28, 0.75);
}

.metric-grid dt {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-grid dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.session-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.session-section ul {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.5;
}

.warning {
  border-color: rgba(255, 133, 109, 0.75);
}

@media (min-width: 760px) {
  .app-shell {
    padding: 28px;
    grid-template-columns: 1fr 0.86fr;
    align-items: start;
  }

  .topbar,
  .hero-panel {
    grid-column: 1 / -1;
  }

  .hero-panel {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .capture-panel {
    grid-row: span 2;
  }

  .camera-frame {
    aspect-ratio: 3 / 4;
  }

  .controls {
    grid-template-columns: 1fr 1fr auto;
  }

  .dashboard-shell {
    padding: 28px;
  }

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

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