/* hdontap.com palette: daisyUI "bumblebee" (light) / "halloween" (dark) with the
 brand orange #F47B20 as primary and #333 neutral; the grey comes from the
 HDOnTap logo. Brand orange is only 2.7:1 on white, so data marks use a deeper
 step (#D9650F, 3.6:1) in light mode. Visit states are solid colours (an
 outline doesn't read on a visit only a few px wide): orange = watchable,
 green + stripes = eagle there now (the stripes keep it distinct from the red
 "now" line for red-green colour-blind viewers), yellow = clip not cut yet,
 grey = no footage. */
:root {
--brand: #F47B20; --brand-hover: #d9650f; --brand-ink: #1a1a1a;
--header: #ffffff; --bg: #f2f2f2; --panel: #ffffff; --ink: #1f1f1f; --muted: #6b6b6b;
--line: #e5e6e6; --track: #f2f2f2; --visit: #D9650F; --visit-hover: #b85309;
--current: #16a34a; --pending: #E5A800;
--failed: #808285; --sel: #1f1f1f; --now: #dc2626; --tab-bar: rgba(0, 0, 0, .1);
--shadow: 0 1px 3px rgba(0, 0, 0, .12);
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root {
  --header: #212121; --bg: #1a1a1a; --panel: #212121; --ink: #ffffff; --muted: #a3a3a3;
  --line: #333333; --track: #2c2c2c; --visit: #F47B20; --visit-hover: #ff9446;
  --current: #22c55e; --pending: #FACC15;
  --sel: #ffffff; --now: #ef4444; --tab-bar: #3e3e3e; --shadow: 0 1px 3px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
}
* { box-sizing: border-box; }
/* `hidden` must win over the display rules below (.toast, .viewer, ...) */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 16px; }
header { position: sticky; top: 0; z-index: 5; background: var(--header); box-shadow: var(--shadow); }
header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 115px; height: 36px; display: block; }
h1 { font-size: 18px; margin: 0; font-weight: 700; padding-left: 10px; border-left: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav button, .nav input { font: inherit; color: inherit; background: var(--panel);
       border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.nav input { cursor: text; }
.nav button:hover { border-color: var(--muted); }
.nav button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink);
                      font-weight: 600; }
.nav button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.status { color: var(--muted); font-size: 12px; margin-left: auto; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.timeline { padding: 8px 16px 12px; }
.row { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 12px;
       padding: 6px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.cam { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam small { color: var(--muted); display: block; font-size: 11px; }
.track { position: relative; height: 26px; background: var(--track); border-radius: 5px; }
.axis .track { background: none; height: 18px; }
.tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.bar { position: absolute; top: 3px; bottom: 3px; min-width: 4px; border-radius: 3px;
       background: var(--visit); cursor: pointer; border: 0; padding: 0; }
.bar:hover { background: var(--visit-hover); }
.bar.open, .sw.open { background: repeating-linear-gradient(45deg, rgba(0,0,0,.35) 0 3px, transparent 3px 6px),
                                  var(--current); }
.bar.pending, .sw.pending { background: var(--pending); }
.bar.failed { background: var(--failed); }
.bar.sel { outline: 2px solid var(--sel); outline-offset: 1px; }
.now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--now); pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; color: var(--muted);
          font-size: 12px; border-top: 1px solid var(--line); }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 5px;
            vertical-align: -1px; }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }

.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; margin-top: 16px; }
.player { padding: 12px; }
video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; display: block; }
.noclip { aspect-ratio: 16 / 9; border-radius: 6px; background: var(--track); display: grid;
          place-items: center; color: var(--muted); text-align: center; padding: 16px; }
.meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-top: 10px; }
.meta h2 { font-size: 16px; margin: 0; }
.meta span { color: var(--muted); }
.meta .step { margin-left: auto; display: flex; gap: 6px; }
.meta .step button { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line);
                     border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.meta .step button:disabled { opacity: .4; cursor: default; }
.list { padding: 8px; max-height: 560px; overflow-y: auto; }
.list h3 { font-size: 13px; margin: 4px 6px 8px; color: var(--muted); font-weight: 600; }
.item { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; width: 100%;
        padding: 6px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit;
        text-align: left; cursor: pointer; }
.item:hover { background: var(--track); }
.item.sel { background: var(--track); box-shadow: inset 3px 0 0 var(--sel); }
.item img, .item .ph { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px;
                       background: var(--track); display: block; }
.item small { color: var(--muted); display: block; }

@media (max-width: 900px) {
  .viewer { grid-template-columns: minmax(0, 1fr); }
  .list { max-height: none; }
}
@media (max-width: 640px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .axis .cam { display: none; }
  .status { margin-left: 0; width: 100%; }
}
.camlink { color: inherit; text-decoration: none; }
.camlink:hover { color: var(--visit); text-decoration: underline; }

/* Timelapse / Real time switch in the players */
.modes { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.modes button { font: inherit; font-size: 13px; color: inherit; background: var(--panel); border: 0;
                padding: 3px 10px; cursor: pointer; }
.modes button + button { border-left: 1px solid var(--line); }
.modes button.on { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.soon { color: var(--muted); font-size: 13px; }

/* "Not an eagle" button, undo toast, accuracy card */
/* specific enough to beat the main page's `.meta .step button` styling */
.meta .step button.danger, .caption button.danger {
  font: inherit; color: var(--now); background: var(--panel); cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--now) 45%, var(--line)); border-radius: 6px; padding: 3px 10px; }
.meta .step button.danger:hover, .caption button.danger:hover {
  background: color-mix(in srgb, var(--now) 12%, var(--panel)); }
.caption button.danger { margin-left: auto; }
.toast { position: fixed; left: 50%; transform: translateX(-50%);
         bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 30;
         display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--panel);
         padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast button { font: inherit; font-weight: 600; color: var(--brand); background: none; border: 0; cursor: pointer; }
.accuracy { padding: 14px 16px; margin-top: 16px; }
.accuracy h3 { font-size: 14px; margin: 0; }
.accuracy h4 { font-size: 13px; margin: 16px 0 6px; color: var(--muted); font-weight: 600; }
.accuracy .sub { color: var(--muted); font-size: 12px; margin: 2px 0 10px; }
.table-wrap { overflow-x: auto; }
.accuracy table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.accuracy th, .accuracy td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.accuracy th:first-child, .accuracy td:first-child { text-align: left; white-space: normal; }
.accuracy th { color: var(--muted); font-weight: 600; font-size: 12px; }
.accuracy tr.total td { font-weight: 600; border-bottom: 0; }
.marks { list-style: none; padding: 0; margin: 0; }
.marks li { display: flex; justify-content: space-between; align-items: center; gap: 10px;
            padding: 5px 0; border-bottom: 1px solid var(--line); }
.marks button { font: inherit; font-size: 13px; color: inherit; background: var(--panel);
                border: 1px solid var(--line); border-radius: 6px; padding: 2px 10px; cursor: pointer; }

/* "Not an eagle" confirmation */
.confirm { border: 1px solid var(--line); border-radius: 10px; padding: 20px; max-width: min(420px, calc(100% - 32px));
           background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.confirm::backdrop { background: rgba(0, 0, 0, .45); }
.confirm h3 { margin: 0 0 8px; font-size: 16px; }
.confirm p { margin: 0 0 6px; color: var(--muted); }
.confirm .what { color: var(--ink); font-weight: 600; }
.confirm .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.confirm button { font: inherit; padding: 6px 14px; border-radius: 6px; cursor: pointer;
                  border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.confirm button.remove { background: var(--now); border-color: var(--now); color: #fff; font-weight: 600; }

/* sign-in and account pages */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-wrap { display: grid; gap: 16px; max-width: 900px; }
.auth-card { padding: 20px; display: grid; gap: 12px; width: min(380px, 100%); }
.auth-wrap .auth-card { width: auto; }
.auth-card h2, .users-card h2 { margin: 0; font-size: 16px; }
.auth-card form, #pw-form { display: grid; gap: 12px; }
.auth-card label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.auth-card input, .users-card input, .users-card select { font: inherit; color: var(--ink); background: var(--panel);
       border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; }
.auth-card button.primary, .users-card button.primary { font: inherit; font-weight: 600; background: var(--brand);
       color: var(--brand-ink); border: 0; border-radius: 6px; padding: 8px 12px; cursor: pointer; }
.auth-error { margin: 0; color: var(--now); }
.auth-note { margin: 0; color: var(--muted); font-size: 12px; }
.users-card { padding: 20px; display: grid; gap: 12px; overflow-x: auto; }
.users-card h3 { margin: 8px 0 0; font-size: 14px; }
.users-card table { border-collapse: collapse; width: 100%; }
.users-card th, .users-card td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.users-card tr.disabled td { color: var(--muted); text-decoration: line-through; }
.users-card tr.quiet td { color: var(--muted); }
.users-card tr.error td { color: var(--now); }
.users-card td button { font: inherit; font-size: 12px; color: inherit; background: var(--panel);
       border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.add-form { display: flex; flex-wrap: wrap; gap: 8px; }
.status a { color: inherit; }
form.signout { display: inline; }
form.signout button { font: inherit; color: inherit; background: none; border: 0; padding: 0;
       text-decoration: underline; cursor: pointer; }

.trim { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.trim button { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line);
       border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.trim button:hover { border-color: var(--muted); }
#t-label { color: var(--muted); font-variant-numeric: tabular-nums; }
