body {
  font-family: system-ui, sans-serif;
  margin: 0;
  color: #1d2733;
  background:
    linear-gradient(rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.58)),
    url('/images/cat-bop-bg.svg') center center / cover fixed no-repeat,
    #0f172a;
}
header { background: rgba(15, 23, 42, 0.88); color: white; backdrop-filter: blur(6px); }
header a { color: white; text-decoration: none; }
.shell { max-width: 1000px; margin: 0 auto; padding: 1rem 1.25rem; }
nav { display: flex; gap: 1rem; margin-top: .5rem; align-items: center; flex-wrap: wrap; }
.card { background: rgba(255, 255, 255, 0.94); border-radius: 10px; padding: 1rem 1.25rem; box-shadow: 0 8px 30px rgba(0,0,0,.18); margin-bottom: 1rem; backdrop-filter: blur(3px); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input, textarea, button { width: 100%; box-sizing: border-box; padding: .65rem; margin-bottom: .9rem; }
textarea { min-height: 100px; }
button, .button, .button-link { background: #2563eb; color: white; border: 0; border-radius: 6px; text-decoration: none; display: inline-block; width: auto; padding: .7rem 1rem; transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease; }
button:hover, .button:hover, .button-link:hover,
button:focus-visible, .button:focus-visible, .button-link:focus-visible { background: #7c3aed; box-shadow: 0 6px 18px rgba(124, 58, 237, .28); transform: translateY(-1px); }
button:disabled, .button:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.inline-form { display: inline; }
.inline-form button { margin-bottom: 0; }
.inline-checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.inline-checkbox input { width: auto; margin: 0; }
.stack > * + * { margin-top: .25rem; }
.two-column-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.button-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.collapsible-section { margin-bottom: 1rem; border: 1px solid rgba(148, 163, 184, 0.35); border-radius: 10px; background: rgba(255, 255, 255, 0.45); }
.collapsible-section summary { cursor: pointer; font-weight: 700; padding: .9rem 1rem; list-style: none; }
.collapsible-section summary::-webkit-details-marker { display: none; }
.collapsible-section summary::before { content: '▸'; display: inline-block; margin-right: .55rem; transition: transform .15s ease; }
.collapsible-section[open] summary::before { transform: rotate(90deg); }
.collapsible-section > :not(summary) { padding: 0 1rem 1rem; }
.collapsible-grid { margin-top: .25rem; }
.button.secondary { background: #475569; }
.button.danger, button.danger { background: #b91c1c; }
.status-message { border-left: 4px solid #2563eb; }
.danger-zone { border-left: 4px solid #b91c1c; }
.inline-actions { display: flex; flex-direction: column; gap: .35rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem; border-bottom: 1px solid #dbe2ea; vertical-align: top; }
.status { display: inline-block; padding: .2rem .55rem; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: .85rem; }
.validation-summary-errors, .field-validation-error { color: #b91c1c; }
small, .muted { color: #64748b; }
.inline-helper-link { display: inline-block; margin-top: .4rem; font-size: .92rem; }
.status-banner { padding: .75rem 1rem; border-radius: 8px; }
.success-banner { background: #dcfce7; color: #166534; }
.error-banner { background: #fee2e2; color: #991b1b; }
dt { font-weight: 600; margin-top: .5rem; }
dd { margin-left: 0; margin-bottom: .5rem; }
.actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.log-view { white-space: pre-wrap; overflow-x: auto; background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 8px; font-size: .9rem; }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.frame-card { margin: 0; }
.frame-card img { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid #dbe2ea; background: #e2e8f0; }
.frame-card figcaption { margin-top: .5rem; }
.clip-selector { padding: 1.25rem; }
.clip-video-shell { background: #0f172a; border-radius: 10px; padding: 0.75rem; overflow: hidden; }
.clip-video { width: 100%; min-height: 30rem; max-height: 78vh; display: block; background: #000; border-radius: 8px; object-fit: contain; }
.clip-range-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.clip-time-picker { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.clip-time-picker input { width: 7rem; margin-bottom: 0; }
.plate-override-grid { align-items: start; }
.plate-override-hints { display: flex; flex-direction: column; gap: .5rem; }
.plate-chip-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.button.plate-chip, .plate-chip { margin-bottom: 0; padding: .45rem .75rem; font-size: .95rem; }
.template-card { border: 1px solid rgba(148, 163, 184, 0.35); border-radius: 8px; padding: .9rem 1rem; background: rgba(255, 255, 255, 0.6); margin-bottom: .75rem; }
.template-preview { white-space: pre-wrap; }

@media (max-width: 700px) {
  .clip-video { min-height: 18rem; }
}
