:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: #f7f8fa;
  color: #172033;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #f7f8fa; }
main { max-width: 1240px; margin: auto; padding: 32px 24px 56px; }
a { color: #1769e0; text-decoration: none; }
a:hover { text-decoration: underline; }
header, .panel-title, .toolbar, .account-summary, .controls, .tabs, .metrics,
.site-nav, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
header, .panel-title { justify-content: space-between; }
header { margin-bottom: 24px; }
.site-nav { margin-left: auto; }
.site-nav a { padding: 8px 10px; color: #475569; font-weight: 650; }
h1 { margin: 4px 0; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.035em; }
h2, h3 { margin: 0 0 8px; }
p { color: #64748b; line-height: 1.6; }
.eyebrow { margin: 0; color: #1769e0; font-size: .78rem; font-weight: 800; letter-spacing: .18em; }
.subtitle, .panel-title p { margin: 0; }
.card {
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}
.stack { display: grid; gap: 16px; }
.page-narrow { max-width: 760px; margin: 36px auto; }
.auth-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; align-items: center; }
#authStatus { grid-column: 1 / -1; margin: 0; }
.toolbar { justify-content: space-between; margin-bottom: 14px; }
.controls { align-items: end; }
label { display: grid; gap: 6px; color: #334155; font-size: .9rem; font-weight: 600; }
input, textarea, select, button, .button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #172033;
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input[type="file"] { max-width: 260px; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #1769e0;
  background: #1769e0;
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}
button:hover, .button:hover { filter: brightness(.94); text-decoration: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
button.secondary, .button.secondary { border-color: #cbd5e1; background: #fff; color: #334155; }
button.danger, .button.danger { border-color: #dc2626; background: #fff; color: #dc2626; }
.tabs { justify-content: center; }
.tab { border-color: transparent; background: transparent; color: #64748b; }
.tab.active { border-color: #bfdbfe; background: #eff6ff; color: #1769e0; }
.mode-panel { margin-top: 14px; }
.panel-title { margin-bottom: 18px; }
.status { min-height: 24px; margin: 12px 4px; color: #1769e0; }
.status.error { color: #dc2626; }
.notice { padding: 12px 14px; border: 1px solid #fde68a; border-radius: 10px; background: #fffbeb; color: #92400e; }
.success { padding: 12px 14px; border: 1px solid #bbf7d0; border-radius: 10px; background: #f0fdf4; color: #166534; }
.grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 18px; }
.list { display: grid; gap: 12px; }
.list-item { padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.list-item p { margin: 6px 0; }
.meta { color: #64748b; font-size: .88rem; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: .78rem; font-weight: 750; }
.badge.approved { background: #dcfce7; color: #166534; }
.badge.rejected { background: #fee2e2; color: #991b1b; }
.secret { display: block; padding: 14px; border: 1px dashed #93c5fd; border-radius: 10px; background: #eff6ff; word-break: break-all; font-family: ui-monospace, monospace; }
.media-box, video, pre {
  width: 100%;
  min-height: 380px;
  border-radius: 12px;
  background: #f1f5f9;
}
.media-box { display: grid; place-items: center; overflow: hidden; }
img, video { max-width: 100%; object-fit: contain; }
#imagePreview { max-height: 560px; }
pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}
.metrics { margin-bottom: 12px; }
.metrics span { padding: 8px 12px; border-radius: 999px; background: #f1f5f9; }
.progress { height: 12px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.progress div { width: 0; height: 100%; background: #1769e0; transition: width .25s; }
details { margin-top: 18px; }
summary { cursor: pointer; color: #1769e0; }
#videoResults { min-height: 180px; margin-top: 10px; }

@media (max-width: 820px) {
  main { padding: 20px 14px 40px; }
  header { align-items: flex-start; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
  .auth-card, .grid { grid-template-columns: 1fr; }
  .media-box, video, pre { min-height: 280px; }
  .toolbar { align-items: stretch; }
}
