* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  margin: 0;
  background: #f6f7f9;
  color: #1a1f2c;
  font-size: 14px;
}
header {
  background: #1e293b;
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
nav a {
  color: #cbd5e1;
  text-decoration: none;
  margin-right: 18px;
  font-weight: 500;
}
nav a:hover { color: white; }
button, .btn {
  background: #475569;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
}
button.primary, .btn.primary {
  background: #2563eb;
}
button.primary:hover, .btn.primary:hover { background: #1d4ed8; }
button.danger { background: #dc2626; }
main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.count { color: #64748b; font-weight: 400; font-size: 0.8em; }
h1 { font-size: 20px; margin: 0; }
.empty { color: #64748b; padding: 32px; text-align: center; background: white; border-radius: 6px; }

table {
  width: 100%;
  background: white;
  border-collapse: collapse;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f1f5f9; }
th { background: #f8fafc; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover { background: #f8fafc; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.negative { color: #dc2626; font-weight: 600; }
.codecs { font-family: monospace; font-size: 12px; color: #475569; }
.ok { color: #16a34a; font-weight: 600; }

.form {
  max-width: 600px;
  background: white;
  padding: 24px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.form label {
  display: block;
  margin-bottom: 14px;
}
.form label > span:first-child {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}
.form input[type=text],
.form input[type=number],
.form select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
}
.form input:focus, .form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form small {
  display: block;
  color: #64748b;
  margin-top: 4px;
  font-size: 12px;
}
fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
legend {
  font-weight: 600;
  padding: 0 8px;
  color: #475569;
}
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.actions { display: flex; gap: 8px; margin-top: 20px; }

details summary { cursor: pointer; padding: 8px 0; color: #475569; }
table.raw th { font-weight: 600; vertical-align: top; width: 200px; }
table.raw th small { display: block; color: #94a3b8; font-weight: 400; }
table.raw input { width: 100%; }
.hint { color: #64748b; font-size: 12px; max-width: 400px; }

#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 14px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 400px;
  display: none;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 12px;
}
#toast.success { background: #16a34a; }
#toast.error { background: #dc2626; }

table.status { width: 400px; }
table.status td { font-variant-numeric: tabular-nums; text-align: right; }
