:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  color: #132936;
  background: #f3f6f7;
  --muted: #4d6572;
  --navy: #102633;
  --line: #dce6e9;
  --teal: #08776b;
  --teal-dark: #005d53;
  --mist: #edf6f4;
  --orange: #a6491e;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
button { font: inherit; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #d97839; outline-offset: 4px; }
.container { max-width: 1224px; width: calc(100% - 80px); margin-inline: auto; }
.masthead { background: var(--navy); color: white; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand, .privacy, .button, .sample-row, .sample-buttons { display: inline-flex; align-items: center; }
.brand { gap: .7rem; font-weight: 700; letter-spacing: .025em; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 35px; height: 35px; border-radius: 9px; background: #23534e; color: #86ead2; }
.brand-mark i, .state-icon i { width: 3px; height: 9px; border-radius: 5px; background: currentColor; }
.brand-mark i:nth-child(2) { height: 20px; }
.brand-mark i:nth-child(3) { height: 13px; }
.brand-mark i:nth-child(4) { height: 6px; }
.privacy { gap: .5rem; color: #dcf2ed; font-size: .875rem; font-weight: 600; }
.privacy-dot { height: 7px; width: 7px; background: #6ae2c1; border-radius: 50%; }
.intro { padding: 49px 0 32px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.3rem, 4.8vw, 3.8rem); line-height: 1.16; letter-spacing: -.052em; }
.intro p { margin-top: 12px; color: var(--muted); font-size: 1.12rem; line-height: 1.55; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; }
.card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 4px 16px #183c4808; padding: 23px; }
.video-card, .result-card { display: flex; flex-direction: column; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 { font-size: 1.24rem; line-height: 1.4; letter-spacing: -.015em; }
h3 { font-size: .93rem; line-height: 1.4; }
.source-heading > div { min-width: 0; }
.source-name { margin-top: 3px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.button { justify-content: center; gap: .55rem; flex-shrink: 0; min-height: 42px; padding: .55rem .88rem; border-radius: 9px; font-size: .9rem; font-weight: 650; line-height: 1.2; cursor: pointer; }
.button:disabled, .sample:disabled { opacity: .55; cursor: default; }
.secondary { background: #fff; color: var(--navy); border: 1px solid #cbdade; }
.secondary:hover:not(:disabled) { background: #f1f7f7; }
.primary { color: white; background: var(--teal); border: 1px solid var(--teal); }
.primary:hover:not(:disabled) { background: var(--teal-dark); }
.plus { font-size: 1.22rem; line-height: 0; color: var(--teal); }
.play { width: 0; height: 0; border-block: 5px solid transparent; border-left: 8px solid currentColor; }
.screen { position: relative; margin-top: 17px; border-radius: 13px; overflow: hidden; background: #0a1822; }
.screen video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.drop-overlay { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; color: #fff; background: #005c54e6; border: 2px dashed #a9efdf; border-radius: inherit; font-weight: 700; }
.screen.is-dragging .drop-overlay { display: flex; }
.sample-row { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 15px; color: var(--muted); font-size: .875rem; }
.sample-buttons { flex-wrap: wrap; gap: 6px; }
.sample { border: 1px solid #dce6e9; border-radius: 8px; background: #fff; color: #334d5b; padding: .42rem .7rem; cursor: pointer; font-weight: 600; }
.sample:hover:not(:disabled) { border-color: #77b8ae; }
.sample[aria-pressed="true"] { color: #005b50; background: var(--mist); border-color: #a6d6cb; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
#file-help { flex: 1 1 13rem; font-size: .875rem; color: var(--muted); }
.error { margin-top: 12px; padding: .65rem .75rem; border-radius: 8px; background: #fff1eb; color: #8c3819; font-size: .9rem; line-height: 1.5; }
.result-heading { min-height: 42px; }
.state { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; min-height: 256px; margin-top: 16px; padding: 22px; text-align: center; border-radius: 13px; border: 1px dashed #c8dadd; background: #f6f9f9; }
.state-icon { display: flex; align-items: center; justify-content: center; gap: 3px; width: 47px; height: 47px; margin-bottom: 14px; border-radius: 12px; background: #e5f2ef; color: var(--teal); }
.state-icon i:nth-child(2) { height: 15px; }
.state-icon i:nth-child(3) { height: 24px; }
.state-icon i:nth-child(4) { height: 17px; }
#state-title { font-weight: 700; }
#state-detail { color: var(--muted); font-size: .9rem; line-height: 1.55; max-width: 28ch; margin-top: 5px; }
progress { width: min(100%, 250px); height: 8px; margin-top: 16px; accent-color: var(--teal); }
.model-note { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; padding: .85rem 1rem; border-radius: 10px; background: #eef4f6; font-size: .875rem; color: var(--muted); }
.model-label { color: #2c4c5a; font-weight: 700; }
.verdict { display: flex; align-items: center; gap: .6rem; margin-top: 14px; padding: 11px 12px; border-radius: 9px; color: #005a50; background: var(--mist); font-weight: 700; }
.verdict::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.verdict[data-decision="fall"] { color: #87370f; background: #fff1e8; }
.metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-block: 12px 18px; }
.metrics div { border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; }
.metrics dt { font-size: .875rem; color: var(--muted); }
.metrics dd { margin: 4px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.timeline-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.timeline-heading span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .875rem; }
.timeline-heading i { width: 15px; border-top: 2px dashed var(--orange); }
#timeline { display: block; width: 100%; height: 152px; margin-top: 5px; }
.alert-area { margin-top: 6px; }
.alert-area ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 7px 0 0; padding: 0; }
.alert-link { border: 1px solid #eccbb7; border-radius: 7px; background: #fff7f2; color: #793210; padding: .42rem .55rem; cursor: pointer; font-size: .875rem; font-variant-numeric: tabular-nums; }
.alert-link:hover { background: #ffecdf; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: var(--muted); padding-block: 21px 27px; font-size: .875rem; line-height: 1.65; }
footer a { color: var(--teal-dark); text-underline-offset: 3px; }

@media (max-width: 900px) {
  .container { width: calc(100% - 44px); }
  .workspace { grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 14px; }
  .card { padding: 17px; }
}

@media (max-width: 690px) {
  .container { width: calc(100% - 32px); max-width: 540px; }
  .topbar { min-height: 60px; }
  .intro { padding-block: 32px 24px; }
  .intro p { font-size: 1rem; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .state { min-height: 190px; }
  footer { padding-block: 15px 22px; }
}

@media (max-width: 360px) {
  .container { width: calc(100% - 24px); }
  .card { padding: 13px; }
  .button { padding-inline: .64rem; }
}
