:root {
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --teal-soft: #d7efe8;
  --ink: #14241f;
  --muted: #4b6059;
  --paper: #f4f7f5;
  --card: #ffffff;
  --warn: #9a4d00;
  --err: #9f1239;
  --ok: #0f766e;
  --line: #d5e4de;
  --shadow: 0 10px 30px rgba(15, 118, 110, 0.08);
  --r: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, #c8efe4 0%, transparent 50%),
    var(--paper);
  min-height: 100vh;
  font-size: 17px;
  line-height: 1.45;
}
header, main, footer { width: min(720px, 100%); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: 8px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(160deg, #14b8a6, var(--teal-dark));
  box-shadow: 0 6px 0 #0b4f4a;
  position: relative;
}
.logo:after {
  content: "";
  position: absolute; inset: 14px 10px 14px 10px;
  background: linear-gradient(#fff, #fff) 0 50%/100% 3px no-repeat,
              radial-gradient(circle at 20% 50%, #fff 2px, transparent 3px),
              radial-gradient(circle at 80% 50%, #fff 2px, transparent 3px);
  opacity: .9;
}
h1 { font-size: 1.35rem; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; margin: 0 0 8px; }
header p, .fine, footer p { color: var(--muted); margin: 2px 0 0; }
.badge {
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px;
  background: #e8f4f0; color: var(--teal-dark); white-space: nowrap;
}
.badge[data-kind="ok"] { background: var(--teal-soft); }
.badge[data-kind="warn"] { background: #ffe8c8; color: var(--warn); }
.privacy, .panel, .settings {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  margin: 12px 0;
}
.privacy { background: #edfaf6; }
.privacy p, .panel p { margin: 6px 0 0; }
.status {
  min-height: 1.4em;
  margin: 8px 0;
  font-weight: 650;
}
.status[data-kind="ok"] { color: var(--ok); }
.status[data-kind="warn"] { color: var(--warn); }
.status[data-kind="err"] { color: var(--err); }
.meter-wrap { margin: 8px 0 4px; }
#meter { width: 100%; height: 64px; border-radius: 12px; display: block; background: #d7efe8; }
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 14px 0 0;
}
.tab, .btn {
  font: inherit;
  font-weight: 800;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  background: #e6f3ee;
  color: var(--ink);
  min-height: 48px;
}
.tab.on { background: var(--teal); color: #fff; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 4px 0 var(--teal-dark); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--teal-dark); }
.btn-danger { background: #ffe4ea; color: var(--err); }
.btn-sm { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.btn.wide, input[type="text"] { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.btn.on { background: #9a4d00; color: #fff; }
label { display: block; font-weight: 800; margin: 12px 0 6px; }
input[type="text"] {
  font: inherit;
  font-size: 18px;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #fff;
}
input[type="text"]:focus { outline: none; border-color: var(--teal); }
input[type="range"] { width: 100%; }
.progress {
  position: relative;
  height: 28px;
  background: #e6f3ee;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, #14b8a6, var(--teal)); }
.progress .time { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.clip-list { padding-left: 18px; margin: 10px 0 0; }
.person {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.person p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.person-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.empty { color: var(--muted); font-style: italic; }
.file-lab { display: inline-block; margin: 8px 0 0; font-weight: 700; color: var(--teal-dark); cursor: pointer; }
.file-lab input { display: block; margin-top: 6px; }
.verdict { text-align: center; padding: 10px 8px 16px; }
.verdict h3 { font-size: 2rem; margin: 0; }
.verdict-kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 800; color: var(--muted); margin: 0; }
.verdict-score { margin: 4px 0 0; color: var(--muted); }
.verdict-match h3 { color: var(--teal-dark); }
.verdict-below-threshold h3, .verdict-no-profiles h3 { color: var(--muted); }
.verdict-too-close h3 { color: var(--warn); }
.rank { list-style: none; padding: 0; margin: 8px 0 0; }
.rank li { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; padding: 6px 0; }
.score-bar { height: 10px; background: #e6f3ee; border-radius: 99px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--teal); }
.rank em { font-style: normal; font-weight: 800; font-size: 13px; }
footer { padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); font-size: 14px; }
@media (max-width: 520px) {
  .person { flex-direction: column; }
  header { flex-direction: column; }
}
