:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1a2230;
  --muted: #6b7686;
  --accent: #1e6fd9;
  --accent-ink: #ffffff;
  --ok: #157347;
  --warn: #b5470b;
  --danger: #c02626;
  --border: #dbe1e8;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --card: #1b2230; --ink: #e7ecf3; --muted: #9aa6b6;
    --accent: #4a90e2; --border: #2b3444;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
.app { max-width: 640px; margin: 0 auto; padding: 0 16px 96px; }
header.top {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; border-bottom: 1px solid var(--border);
}
header.top h1 { font-size: 17px; margin: 0; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin: 16px 0;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input, select, button {
  font-size: 16px; font-family: inherit;
}
input, select {
  width: 100%; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card); color: var(--ink);
}
button {
  cursor: pointer; border: none; border-radius: 10px; padding: 13px 16px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  width: 100%; margin-top: 12px;
}
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.danger { background: var(--danger); }
button.small { width: auto; padding: 8px 12px; font-size: 14px; margin: 0; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
video, .preview { width: 100%; border-radius: var(--radius); background: #000; display: block; }
.badge { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.ok { background: rgba(21,115,71,.14); color: var(--ok); }
.badge.warn { background: rgba(181,71,11,.14); color: var(--warn); }
.hint { font-size: 13px; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; }
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--card);
  border-top: 1px solid var(--border); display: flex; justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
nav.tabs button {
  background: none; color: var(--muted); width: auto; margin: 0; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 16px;
}
nav.tabs button.active { color: var(--accent); }
nav.tabs .ic { font-size: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.entry-actions { display: flex; gap: 6px; }
.hidden { display: none !important; }
.spinner { text-align: center; padding: 20px; color: var(--muted); }
.langswitch { display: flex; gap: 6px; align-items: center; }
.langswitch button { width: auto; margin: 0; padding: 6px 10px; font-size: 13px; background: transparent; color: var(--muted); border: 1px solid var(--border); }
.langswitch button.active { color: var(--accent); border-color: var(--accent); }
