* { box-sizing: border-box; }
html { font-size: 16px; }
body { font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 24px; background: #ffffff; color: #0b1220; overflow-x: hidden; line-height: 1.65; letter-spacing: 0.1px; }
.container { max-width: 1200px; margin: 0 auto; }
p { margin: 0 0 0.85em; }
/* Shared header */
.site-head { background: #ffffff; border-bottom: 1px solid #e2e8f0; margin-bottom: 36px; }
.head-wrap { max-width: 1200px; margin: 0 auto; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; }
.head-brand { color: #0b1220; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; margin-left: 0; }
.head-logo { height: 55px; width: auto; display: block; }
.head-links { display: inline-flex; gap: 20px; }
.head-links a { color: #0b1220; text-decoration: none; font-size: 15px; padding: 6px 0; opacity: 0.9; }
.head-links a:hover { text-decoration: underline; opacity: 1; }
h1 { margin: 0 0 8px; letter-spacing: 0.2px; color: #0b1220; font-size: 28px; line-height: 1.25; }
h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.35; }
h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.4; }
.controls { display: flex; gap: 10px; align-items: center; }
header.header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; }
header.header p { margin: 0; color: #475569; }
header .controls input[type="file"] { background: #f1f5f9; padding: 8px; border-radius: 6px; border: 1px solid #cbd5e1; }
button { background: #2563eb; color: white; border: none; padding: 12px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: background .15s ease, transform .06s ease; }
button:hover { background: #1f4fd6; }
button:active { transform: translateY(1px); }
button:disabled { background: #3b3b3b; cursor: not-allowed; }
a.hidden { display: none; }
.grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,0.8fr); gap: 22px; align-items: start; }
.player { position: relative; background: #0f172a0f; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; }
video { width: 100%; height: auto; display: block; background: #0f172a08; }
canvas#overlay { position: absolute; left: 0; top: 0; pointer-events: none; }
.player-drop { display: grid; place-items: center; min-height: 320px; }
.player .dropzone { width: min(420px, 90%); height: 160px; }
.card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(2,6,23,0.04), 0 10px 28px -18px rgba(2,6,23,0.25); }
.hint { margin: 4px 0 12px; color: #475569; }
#rectList { list-style: none; padding: 0; margin: 0; }
#rectList li { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
#rectList .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#rectList .coords { color: #0f172a; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
#rectList .coords .pill { background:#eef2ff; color:#1e40af; border:1px solid #c7d2fe; padding:3px 8px; border-radius:999px; font-size:12px; }
#rectList .time { color: #1d4ed8; margin-left:auto; }
#rectList .time-vert { display:flex; flex-direction:column; gap:4px; }
#rectList .time-label { display:inline-block; min-width:46px; background:#eff6ff; color:#1d4ed8; border-radius:6px; padding:2px 6px; margin-right:6px; font-size:12px; }
#rectList .time-val { font-variant-numeric: tabular-nums; color:#0f172a; }
#rectList .actions { display: flex; gap: 8px; }
#rectList button { background: #ef4444; color: #fff; }
#rectList .set { background: #10b981; color: #fff; }
#timeline { display: flex; align-items: center; gap: 14px; margin: 8px 0 2px; }
#timeline input[type="range"] { flex: 1; accent-color: #2563eb; }
#timeline .time-readout { width: 160px; text-align: right; color: #0f172a; font-variant-numeric: tabular-nums; }

.actions { display: flex; gap: 12px; margin-top: 14px; }
.btn-green { background: #10b981; color: #fff; padding: 12px 16px; border-radius: 8px; text-decoration: none; display: inline-block; font-weight: 600; }
.btn-green:hover { background: #0ea371; }
.btn-outline { background: transparent; border: 1px solid #cbd5e1; color: #0f172a; border-radius: 8px; padding: 12px 16px; font-weight: 600; }
.btn-lg { font-size: 16px; padding: 12px 18px; }
.actions-card { margin-top: 12px; }
.actions-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.primary-actions { display: flex; align-items: center; gap: 12px; }
.secondary-actions { display: flex; align-items: center; gap: 12px; }
.spinner { width: 18px; height: 18px; border: 3px solid #e2e8f0; border-top-color: #2563eb; border-radius: 50%; animation: spin 0.8s linear infinite; }
.spinner.hidden { display: none; }
.queue-status { font-size: 13px; color: #334155; }
.queue-status.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.dropzone { display: grid; place-items: center; width: 220px; height: 60px; border: 2px dashed #94a3b8; border-radius: 10px; background: #f8fafc; color: #334155; cursor: pointer; transition: all .2s ease; }
.dropzone:hover { background: #f1f5f9; }
.dropzone.drag { background: #e0f2fe; border-color: #0284c7; color: #075985; }
.dz-title { font-weight: 600; }
.dz-sub { font-size: 12px; opacity: .8; }

section.info { margin-top: 22px; }
section.info h2 { margin: 6px 0 10px; }
section.info ol { padding-left: 18px; margin: 0; color: #0f172a; }
section.info details { margin: 8px 0; }
section.info summary { cursor: pointer; font-weight: 600; }

button { background: #2563eb; color: white; border: none; padding: 10px 14px; border-radius: 6px; cursor: pointer; }
button:disabled { background: #cbd5e1; cursor: not-allowed; }
a.hidden { display: none; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .head-wrap { padding: 10px 0; }
}

.site-footer { margin-top: 48px; background: #0b1220; color: #e2e8f0; width: 100vw; padding: 0; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); overflow: hidden; position: relative; }
.site-footer:before { content: ""; position: absolute; inset: -10% -10% 0 -10%; pointer-events: none; background: radial-gradient(800px 200px at 10% 0, rgba(99,102,241,0.18), rgba(11,18,32,0)), radial-gradient(800px 200px at 90% 0, rgba(20,184,166,0.18), rgba(11,18,32,0)); filter: blur(12px); }
.footer-wrap { max-width: 1100px; margin: 0 auto; min-height: 250px; padding: 0 24px 0 24px; display: flex; flex-direction: column; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 18px 24px; margin-top: 24px; position: relative; }
.footer-brand { font-weight: 600; color: #fff; letter-spacing: 0.2px; display: inline-flex; gap: 10px; align-items: center; }
.footer-brand img { height: 36px; width: auto; display: block; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: #e2e8f0; text-decoration: none; opacity: 0.9; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.footer-desc { margin: 28px auto 0 auto; font-size: 15px; color: #cbd5e1; line-height: 1.8; text-align: center; max-width: 820px; padding: 0 24px; }
.footer-meta { margin-top: auto; font-size: 12px; color: #cbd5e1; text-align: center; opacity: 0.85; padding: 16px 0 20px 0; border-top: 1px dashed rgba(255,255,255,0.15); }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

