@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg: #f6f4ef;
  --ink: #172321;
  --accent: #0f9d8a;
  --accent-strong: #007c69;
  --live: #1965d6;
  --live-strong: #0a4bab;
  --card: #fffdf9;
  --line: #d7d2c8;
  --warn: #bf4e30;
  --muted: #5f6f69;
  --shadow: 0 14px 45px rgba(23, 35, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(15, 157, 138, 0.2), transparent 40%),
    radial-gradient(circle at 92% 88%, rgba(255, 137, 91, 0.18), transparent 45%),
    var(--bg);
}

.page {
  width: min(980px, 92vw);
  margin: 28px auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.panel,
.result {
  background: color-mix(in oklab, var(--card) 92%, white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

h1,
h2,
h3 {
  font-family: "Syne", sans-serif;
  margin: 10px 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.75rem, 3.7vw, 2.6rem);
}

h2 {
  font-size: 1.4rem;
}

h3 {
  margin-top: 18px;
  font-size: 1.05rem;
}

.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
}

.provider-block {
  margin: 0 0 14px;
}

.provider-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.provider-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.provider-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease;
}

.provider-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(23, 35, 33, 0.12);
}

.provider-btn.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(130deg, var(--accent-strong), var(--accent));
}

.provider-hint {
  margin: 8px 2px 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.dropzone {
  width: 100%;
  border: 2px dashed var(--accent);
  border-radius: 18px;
  background: linear-gradient(
    160deg,
    rgba(15, 157, 138, 0.14),
    rgba(15, 157, 138, 0.03)
  );
  padding: 26px;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.dropzone:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 124, 105, 0.14);
}

.dropzone.is-dragover {
  border-color: var(--accent-strong);
  background: linear-gradient(
    160deg,
    rgba(0, 124, 105, 0.2),
    rgba(15, 157, 138, 0.06)
  );
}

.dropzone-title {
  display: block;
  font-weight: 700;
  font-size: 1.03rem;
  margin-bottom: 4px;
}

.dropzone-hint {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}

.preview-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.preview-wrap img {
  display: block;
  width: 100%;
  height: min(42vh, 260px);
  object-fit: cover;
}

.preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.predict-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(130deg, var(--accent-strong), var(--accent));
  cursor: pointer;
  transition: transform 150ms ease;
}

.predict-btn:hover:enabled {
  transform: translateY(-1px);
}

.predict-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-text {
  min-height: 1.2rem;
  margin: 10px 2px 0;
  font-size: 0.92rem;
}

.status-text.error {
  color: var(--warn);
}

.thumbnail-title {
  margin: 0;
  font-size: 1.1rem;
}

.thumbnail-subtitle {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.input-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.input-textarea,
.input-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.input-textarea {
  resize: vertical;
  min-height: 82px;
}

.thumbnail-btn {
  margin-top: 12px;
}

.thumbnail-result {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.thumbnail-result img {
  display: block;
  width: 100%;
  height: min(42vh, 280px);
  object-fit: cover;
}

.thumbnail-link {
  display: inline-block;
  margin: 10px 12px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-strong);
  text-decoration: none;
}

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

.section-divider {
  margin: 20px 0 16px;
  border-top: 1px dashed color-mix(in oklab, var(--line) 82%, white);
}

.camera-title {
  margin: 0;
  font-size: 1.1rem;
}

.camera-subtitle {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.camera-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.camera-btn:hover:enabled {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(23, 35, 33, 0.12);
}

.camera-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.camera-btn-live {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(130deg, var(--live-strong), var(--live));
}

.camera-btn-live.is-live {
  background: linear-gradient(130deg, #b1422f, var(--warn));
}

.camera-btn-stop {
  border-color: color-mix(in oklab, var(--warn) 45%, var(--line));
}

.camera-preview-wrap {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 18% 14%, #2d3735, #101513 70%);
}

.camera-preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fffeff;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px dashed color-mix(in oklab, var(--line) 88%, white);
}

.result-row:last-child {
  border-bottom: none;
}

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

.value {
  text-align: right;
  font-weight: 700;
}

.candidate-list {
  margin: 8px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.candidate-list li {
  line-height: 1.25;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    width: min(740px, 92vw);
  }

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