/* Videoloft light skin. */
@font-face { font-family: "GT Walsheim"; src: url("/fonts/GT-Walsheim-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "GT Walsheim"; src: url("/fonts/GT-Walsheim-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --card: #18202e;
  --inset: #222b3b;
  --line: rgba(255, 255, 255, 0.1);
  --control-line: rgba(255, 255, 255, 0.2);
  --text: #fff;
  --text2: rgba(255, 255, 255, 0.86);
  --text3: rgba(255, 255, 255, 0.66);
  --accent: #34cac6;
  --accent-hover: #5ad8d4;
  --on-accent: #181828;
  --red: #ff4767;
  --font: "GT Walsheim", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: #3f3f4d; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -12%, rgba(52, 202, 198, 0.22), transparent 36%),
    linear-gradient(180deg, #004c5b 0%, #3f3f4d 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, p, ul { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { max-width: 880px; margin: 0 auto; padding: 20px 16px 0; }
.brand { display: inline-flex; padding: 4px 0; }
.brand img { display: block; width: 140px; height: auto; }

.page { max-width: 880px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 20px; }

.title { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.card-head { padding: 18px 24px 0; }
.card-title { position: relative; display: inline-block; font-size: 16px; font-weight: 700; line-height: 20px; }
.card-title::after { content: ""; position: absolute; left: 0; bottom: -7px; width: 24px; height: 2px; border-radius: 2px; background: var(--accent); }
.card-body { padding: 22px 24px 24px; }

.label { display: block; margin: 0 0 6px; padding: 0; font-size: 13px; color: var(--text2); }
.hint { margin-top: 6px; font-size: 13px; color: var(--text3); }

/* Camera rows */
.rows { display: flex; flex-direction: column; container-type: inline-size; }
.cam-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cam-row:first-child { padding-top: 0; }
.cam-row:last-child { padding-bottom: 0; border-bottom: 0; }
.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.remove { position: absolute; top: 14px; right: 0; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text3); cursor: pointer; }
.cam-row:first-child .remove { top: -4px; }
.remove:hover { background: rgba(255, 255, 255, 0.06); color: var(--red); }

@container (min-width: 700px) {
  .cam-row { grid-template-columns: 136px minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; padding: 0 0 14px; border-bottom: 0; }
  .cam-row:has(.remove) { grid-template-columns: 136px minmax(0, 1.2fr) minmax(0, 1fr) 32px; }
  .remove, .cam-row:first-child .remove { position: static; margin-bottom: 2px; }
  .cam-row:not(:first-child) .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Stepper */
.stepper { display: flex; width: 136px; height: 40px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--inset); overflow: hidden; }
.stepper button { width: 40px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--text2); }
.stepper button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.stepper input { width: 0; flex: 1; border: 0; background: transparent; text-align: center; font-size: 16px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus-visible { outline: none; background: rgba(52, 202, 198, 0.12); }

/* Segmented control, built on native radios */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.seg-option { position: relative; flex: 1 1 0; min-width: 0; }
.seg-option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-option span { display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 8px; border-radius: 6px; font-size: 14px; color: var(--text2); text-align: center; line-height: 1.15; white-space: nowrap; }
.seg-option small { margin-left: 5px; font-size: inherit; opacity: 0.8; }
.seg-option input:hover + span { color: var(--text); }
.seg-option input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.seg-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-secondary { margin-top: 16px; height: 36px; padding: 0 14px; border: 1px solid var(--control-line); border-radius: 8px; background: rgba(255, 255, 255, 0.06); font-size: 14px; cursor: pointer; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; height: 42px; padding: 0 18px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 700; text-decoration: none; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary:hover { border-color: rgba(255, 255, 255, 0.32); }

.settings { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
#motion { margin-top: 18px; }
#codec .seg, #motion .seg { max-width: 520px; }

/* Result */
.result { border-color: rgba(52, 202, 198, 0.35); overflow: hidden; }
.result-grid { display: grid; gap: 28px; padding: 28px 24px; }
.result-label { font-size: 14px; color: var(--text2); }
.figure { margin-top: 8px; color: var(--accent); font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.unit { font-size: 22px; font-weight: 400; letter-spacing: 0; color: var(--text2); }
.sentence { margin-top: 14px; font-size: 16px; color: var(--text2); }
.result-side { padding-top: 24px; border-top: 1px solid var(--line); }
.stat-value { margin-top: 8px; font-size: 32px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.result-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 18px 24px; border-top: 1px solid var(--line); background: var(--inset); color: var(--text2); }
.result-foot .btn-primary { margin-top: 0; }
@media (min-width: 640px) {
  .result-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .result-side { padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--line); }
}

.footer { padding: 0 4px; font-size: 13px; color: var(--text3); }

@media (max-width: 480px) {
  .title { font-size: 26px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 20px 16px 20px; }
  .figure { font-size: 48px; }
  .result-grid { padding: 24px 16px; gap: 22px; }
  .result-foot { padding: 18px 16px; }
  .result-foot .btn-primary { width: 100%; justify-content: center; }
  .seg-option span { font-size: 13px; padding: 4px; min-height: 38px; }
  #motion .seg-option span { flex-direction: column; }
  #motion .seg-option small { margin-left: 0; font-size: 12px; }
}
