:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #232730;
  --line: #2e333d;
  --text: #f4f6fa;
  --muted: #9aa3b2;
  --accent: #f97316;     /* safety orange */
  --accent-press: #c2570d;
  --go: #16a34a;
  --go-press: #128239;
  --danger: #ef4444;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.4;
}

body {
  /* leave room for the sticky submit bar */
  padding-bottom: calc(150px + var(--safe-b));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.25rem; margin: 0; letter-spacing: .2px; }

.net-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--go);
  box-shadow: 0 0 0 3px rgba(22,163,74,.18);
}
.net-dot.off { background: var(--muted); box-shadow: 0 0 0 3px rgba(154,163,178,.18); }

main { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* Shot list */
.shotlist {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.shotlist h2 { margin: 0 0 8px; font-size: 1rem; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.shotlist ol { margin: 0; padding-left: 22px; }
.shotlist li { margin: 4px 0; }
.tips { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }

/* Pickers */
.pickers { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }
.field > span { font-size: .85rem; color: var(--muted); padding-left: 4px; }

select, input[type="text"] {
  appearance: none;
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  font-size: 1.1rem;
  min-height: 60px;
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%239aa3b2'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  padding: 20px;
  width: 100%;
  min-height: 68px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; }

.btn-add { background: var(--accent); }
.btn-add:active:not(:disabled) { background: var(--accent-press); }
.btn-add .cam { font-size: 1.5rem; }

.btn-submit { background: var(--go); }
.btn-submit:active:not(:disabled) { background: var(--go-press); }

/* Tray */
.tray-head { display: flex; align-items: center; justify-content: space-between; }
.tray h2 { font-size: 1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.badge {
  background: var(--accent); color: #fff; font-size: .8rem;
  min-width: 26px; height: 26px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 8px;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .del {
  position: absolute; top: 6px; right: 6px;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.62); color: #fff;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.thumb .del:active { background: var(--danger); }
.empty-hint { color: var(--muted); text-align: center; padding: 18px 0; }
.empty-hint[hidden] { display: none; }

/* Submit bar */
.submitbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  background: linear-gradient(180deg, rgba(15,17,21,0) 0%, var(--bg) 24%);
  padding: 18px 16px calc(18px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.status { margin: 8px 2px 0; font-size: .9rem; color: var(--muted); text-align: center; min-height: 1.2em; }
.status.err { color: var(--danger); }
.status.ok { color: var(--go); }

.progress {
  height: 10px; border-radius: 6px; background: var(--panel-2);
  overflow: hidden; margin-top: 12px;
}
.progress[hidden] { display: none; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width .25s ease; }

/* Success overlay */
.done {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(8,9,12,.86);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.done[hidden] { display: none; }
.done-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 32px 24px; text-align: center;
  max-width: 360px; width: 100%;
}
.done-check {
  width: 84px; height: 84px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--go); color: #fff;
  font-size: 3rem; display: flex; align-items: center; justify-content: center;
}
.done-card h2 { margin: 0 0 8px; }
.done-card p { color: var(--muted); margin: 0 0 22px; }
