/* TLAC Walkthrough — mobile-first. Big targets, one-hand operation. */

* { box-sizing: border-box; }

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e1e1de;
  --accent: #2a5d8a;
  --accent-ink: #ffffff;
  --yes: #2f8a4a;
  --yes-bg: #e6f4ea;
  --no: #b45309;
  --no-bg: #fdf2e1;
  --na: #6b6b6b;
  --na-bg: #ececea;
  --danger: #b91c1c;
  --warn-bg: #fef3c7;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

body { padding: 0 0 96px 0; }

header.app {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

header.app h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 600;
}

header.app a, header.app button.link {
  font-size: 15px;
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

h2 { font-size: 19px; margin: 8px 0 12px 0; }
h3 { font-size: 16px; margin: 0; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 14px; }

label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
  margin-bottom: 4px;
}

input, select, textarea, button {
  font: inherit;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
}

textarea { min-height: 84px; resize: vertical; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 14px 18px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
  min-height: 52px;
}

.btn.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.danger { background: var(--danger); }

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.btn-row .btn { margin-top: 0; }

.context-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.context-bar .who { font-weight: 600; font-size: 16px; }
.context-bar .meta { color: var(--muted); font-size: 14px; }

.category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.cat-header {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.cat-header .count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.cat-body {
  border-top: 1px solid var(--border);
  padding: 4px 0;
}

.cat-body.collapsed { display: none; }

.technique {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.technique:last-child { border-bottom: none; }

.technique .name {
  font-weight: 500;
  margin-bottom: 6px;
}

.status-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.status-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  width: 100%;
  color: var(--ink);
}
.status-btn[data-active="yes"][data-status="yes"] { background: var(--yes-bg); border-color: var(--yes); color: var(--yes); }
.status-btn[data-active="no"][data-status="no"] { background: var(--no-bg); border-color: var(--no); color: var(--no); }
.status-btn[data-active="na"][data-status="na"] { background: var(--na-bg); border-color: var(--na); color: var(--na); }

.technique textarea {
  margin-top: 6px;
  min-height: 44px;
  font-size: 14px;
}

.fab {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 688px;
  margin: 0 auto;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  cursor: pointer;
  min-height: 56px;
  z-index: 10;
}

.fab.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--ink);
  display: block;
}

.history-card .who { font-weight: 600; }
.history-card .when { color: var(--muted); font-size: 14px; }
.history-card .tally { font-size: 13px; color: var(--muted); margin-top: 6px; }
.history-card .pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
}
.pill.live { background: var(--warn-bg); color: #92400e; }
.pill.done { background: var(--yes-bg); color: var(--yes); }

.banner {
  background: var(--warn-bg);
  color: #7a4d00;
  border: 1px solid #e0b85a;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  display: none;
}
.banner.show { display: block; }
.banner button {
  margin-top: 8px;
  width: auto;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
}

/* Sprint 2: video record bar (live.html) */
.rec-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.rec-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 52px;
}
.rec-btn.recording {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.rec-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  flex-shrink: 0;
}
.rec-btn.recording .rec-dot {
  background: #fff;
  animation: rec-pulse 1.2s infinite;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.rec-status {
  margin-top: 8px;
  font-size: 13px;
}
#rec-preview {
  display: none;
  width: 100%;
  max-height: 220px;
  margin-top: 10px;
  background: #000;
  border-radius: 8px;
}
.rec-bar.recording #rec-preview { display: block; }

/* Sprint 2: video player in writeup.html */
.video-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}
.video-wrap video {
  width: 100%;
  max-height: 60vh;
  background: #000;
  border-radius: 8px;
  display: block;
}
.timeline {
  position: relative;
  height: 28px;
  margin-top: 10px;
  background: var(--bg);
  border-radius: 6px;
  cursor: crosshair;
  border: 1px solid var(--border);
}
.timeline-progress {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(42, 93, 138, 0.18);
  border-radius: 6px;
  pointer-events: none;
}
.timeline-marker {
  position: absolute;
  top: 2px; bottom: 2px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  cursor: pointer;
}
.timeline-marker:hover { background: var(--danger); }
.timeline-marker .marker-tip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
  z-index: 6;
}
.timeline-marker:hover .marker-tip { display: block; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 420px;
}
.modal h3 { margin: 0 0 12px 0; }
.modal .modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.modal .btn { margin-top: 0; }
.comment-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
}
.comment-list li {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  background: var(--surface);
}
.comment-list li:hover { background: var(--bg); }
.comment-list .tc {
  font-weight: 600;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  margin-right: 8px;
}

/* Print page */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
  main { max-width: none; }
}
