* { box-sizing: border-box; }
body {
  margin: 0;
  background: #060e21;
  color: #f8fafc;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}
.shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 18px;
}
.brand-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 2px 8px;
  min-height: 32px;
  color: #f8fafc;
}
.brand-header strong {
  color: #60a5fa;
  font-size: 22px;
  line-height: 1;
}
.brand-header span {
  color: #cbd5e1;
  font-size: 16px;
  font-weight: 700;
}
.pairing-status-bar {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
}
.pairing-status-bar div { display: grid; gap: 2px; min-width: 0; }
.pairing-status-bar strong { color: #f8fafc; font-size: 14px; }
.pairing-status-bar div span { overflow-wrap: anywhere; color: #cbd5e1; font-size: 12px; line-height: 1.35; }
.pairing-status-dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 3px rgba(100, 116, 139, .18); }
.pairing-status-bar[data-state="connected"] { border-color: #22c55e; background: #071b16; }
.pairing-status-bar[data-state="connected"] .pairing-status-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.pairing-status-bar[data-state="pairing"] .pairing-status-dot,
.pairing-status-bar[data-state="connecting"] .pairing-status-dot,
.pairing-status-bar[data-state="waiting"] .pairing-status-dot,
.pairing-status-bar[data-state="reconnecting"] .pairing-status-dot { background: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, .2); }
.pairing-status-bar[data-state="expired"],
.pairing-status-bar[data-state="full"] { border-color: #f59e0b; background: #2b1907; }
.pairing-status-bar[data-state="expired"] .pairing-status-dot,
.pairing-status-bar[data-state="full"] .pairing-status-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.pairing-reconnect-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #2b1907;
  color: #fef3c7;
}
.pairing-reconnect-banner[hidden] {
  display: none;
}
.pairing-reconnect-banner div {
  display: grid;
  gap: 2px;
}
.pairing-reconnect-banner span {
  color: #fde68a;
  font-size: 13px;
}
.pairing-reconnect-banner button {
  flex: 0 0 auto;
  border-color: #fbbf24;
  background: #b45309;
  color: #fff;
}
.pairing-reconnect-bottom {
  margin: 12px 0 0;
}
.pairing-scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 6, 23, .88);
}
.pairing-scanner-modal[hidden] {
  display: none;
}
.pairing-scanner-dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .5);
}
.pairing-scanner-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.pairing-scanner-dialog h2,
.pairing-scanner-dialog p {
  margin: 0;
}
.pairing-scanner-dialog header p {
  margin-top: 4px;
  color: #cbd5e1;
}
.pairing-scanner-stage {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #020617;
}
.pairing-scanner-stage video {
  display: block;
  width: 100%;
  min-height: 260px;
  max-height: 62vh;
  object-fit: cover;
}
.pairing-scanner-frame {
  position: absolute;
  inset: 16% 12%;
  border: 3px solid #60a5fa;
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(2, 6, 23, .25);
  pointer-events: none;
}
#pairingScannerStatus {
  min-height: 24px;
  margin: 10px 0;
}
.pairing-scanner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pairing-scanner-actions > * {
  flex: 1 1 140px;
  margin: 0;
  text-align: center;
}
.pairing-scanner-actions .file-button {
  display: grid;
  place-items: center;
}
.pairing-scanner-dialog > .helper-text {
  margin-top: 10px;
}
.mobile-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(17, 24, 39, .96);
  backdrop-filter: blur(10px);
}
.mobile-nav button {
  position: relative;
  min-height: 44px;
  padding: 9px 8px;
  background: transparent;
  border-color: transparent;
  color: #cbd5e1;
  opacity: .82;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}
.mobile-nav button.active,
.mobile-nav button[aria-selected="true"],
.mobile-nav button[aria-current="page"] {
  background: #2563eb;
  border-color: #60a5fa;
  color: #fff;
  opacity: 1;
  box-shadow: inset 0 -4px 0 #ef3340, 0 0 0 1px rgba(96, 165, 250, .35);
}
.mobile-nav button:focus-visible {
  outline: 3px solid rgba(96, 165, 250, .75);
  outline-offset: 2px;
}
.nav-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .48);
  font-size: 12px;
}
.nav-count[hidden] {
  display: none;
}
.capture-intro h1,
[data-view-panel] > .panel > h1 {
  margin: 0 0 8px;
  font-size: 26px;
}
.context-summary {
  margin: 0 0 10px;
  color: #bfdbfe;
  font-weight: 800;
}
.brand-footer {
  display: flex;
  justify-content: center;
  margin: 22px 0 4px;
  opacity: .72;
}
.brand-footer span {
  color: #93c5fd;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}
.brand-footer img {
  display: block;
  width: min(210px, 54vw);
  height: auto;
  border-radius: 3px;
}
.eyebrow {
  margin: 0;
  color: #93c5fd;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(38px, 9vw, 56px);
  line-height: 1;
}
h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.panel {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}
label {
  display: block;
  color: #cbd5e1;
  font-weight: 700;
  margin-bottom: 12px;
}
input, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #020617;
  color: #f8fafc;
  font: inherit;
}
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #020617;
  color: #f8fafc;
  font: inherit;
}
select:disabled,
input:disabled {
  border-color: #334155;
  background: #172033;
  color: #bfdbfe;
  opacity: .82;
  cursor: not-allowed;
}
.destination-lock-notice {
  margin: -4px 0 14px;
  padding: 9px 10px;
  border-left: 3px solid #60a5fa;
  background: rgba(37, 99, 235, .12);
  color: #bfdbfe;
  font-size: 13px;
  line-height: 1.4;
}
.manual-field {
  display: none;
}
.manual-field.visible {
  display: block;
}
.optional-field {
  display: none;
}
.optional-field.visible {
  display: block;
}
.capture-role-field {
  min-width: 0;
  margin: 2px 0 14px;
  padding: 0;
  border: 0;
}
.capture-role-field[hidden] {
  display: none;
}
.capture-role-field legend {
  margin-bottom: 7px;
  color: #cbd5e1;
  font-weight: 800;
}
.role-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #020617;
}
.role-segment button {
  min-height: 46px;
  border-color: transparent;
  background: transparent;
  color: #cbd5e1;
}
.role-segment button[aria-checked="true"] {
  border-color: #60a5fa;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, .3);
}
.role-segment button:focus-visible {
  outline: 3px solid rgba(96, 165, 250, .75);
  outline-offset: 2px;
}
.timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.timer span {
  display: block;
  color: #cbd5e1;
  font-weight: 700;
}
.timer strong {
  font-size: 30px;
}
.timer small {
  display: block;
  margin-top: 4px;
  color: #93c5fd;
}
.timer-actions {
  display: grid;
  gap: 8px;
  min-width: 150px;
}
.clock-edit {
  display: none;
  margin-top: 8px;
}
.clock-edit.visible {
  display: block;
}
.clock-edit input {
  min-width: 220px;
}
.time-entries {
  flex-basis: 100%;
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.time-entries li {
  padding: 8px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #020617;
  color: #cbd5e1;
}
.time-entries label {
  margin: 8px 0 0;
}
.time-entries input {
  padding: 10px;
}
.manual-time {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.legacy-manual-time {
  display: none;
}
.platform-panel {
  display: none;
}
.platform-panel.visible {
  display: block;
}
.helper-text {
  margin: 0 0 10px;
  color: #cbd5e1;
  line-height: 1.45;
}
.helper-text.small {
  font-size: 14px;
  margin-bottom: 0;
}
.metrics-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: #f8fafc;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.metric-chip {
  padding: 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #020617;
}
.metric-chip span {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}
.metric-chip strong {
  display: block;
  margin-top: 2px;
  color: #f8fafc;
  font-size: 16px;
}
.actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.backup-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: -4px 0 14px;
}
button, .file-button {
  border: 1px solid #475569;
  border-radius: 8px;
  background: #1e293b;
  color: #f8fafc;
  font: inherit;
  font-weight: 800;
  padding: 14px;
  text-align: center;
}
.big {
  min-height: 84px;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.primary {
  background: #2563eb;
  border-color: #2563eb;
}
.primary.recording {
  background: #dc2626;
  border-color: #f87171;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .2);
}
.recording-monitor {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  background: #1f1015;
}
.recording-monitor[hidden] {
  display: none;
}
.recording-monitor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #fecaca;
}
.recording-monitor-header #recordingElapsed {
  margin-left: auto;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}
.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .18);
  animation: recording-pulse 1.15s ease-in-out infinite;
}
@keyframes recording-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 4px rgba(239, 68, 68, .18); }
  50% { opacity: .62; transform: scale(.82); box-shadow: 0 0 0 8px rgba(239, 68, 68, .08); }
}
.recording-level {
  height: 12px;
  overflow: hidden;
  border: 1px solid #475569;
  border-radius: 999px;
  background: #020617;
}
.recording-level > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e 0 68%, #fbbf24 68% 86%, #ef4444 86%);
  transition: width 80ms linear;
}
.send-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
}
.export {
  width: 100%;
  background: #16a34a;
  border-color: #16a34a;
  font-size: 20px;
}
.export:disabled {
  cursor: wait;
  opacity: 1;
}
.export[data-send-phase="preparing"],
.export[data-send-phase="sending"] {
  background: #1d4ed8;
  border-color: #60a5fa;
  color: #eff6ff;
}
.export[data-send-phase="delivered"] {
  background: #15803d;
  border-color: #86efac;
  color: #f0fdf4;
  cursor: default;
}
.export[data-send-phase="failed"] {
  background: #b45309;
  border-color: #fbbf24;
  color: #fffbeb;
}
.file-button input {
  display: none;
}
.hidden-file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: 0;
  bottom: 0;
}
.status {
  color: #cbd5e1;
}
.inline-status {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
}
.backup-actions.needs-attention .file-button {
  border-color: #fbbf24;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, .18);
}
.backup-actions.needs-attention #attachSavedRecordingButton {
  border-color: #fbbf24;
  color: #fef3c7;
}
.status.connected {
  color: #86efac;
}
.status.disconnected {
  color: #fca5a5;
}
.device-protection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.device-protection-actions button {
  min-height: 40px;
  padding: 8px 12px;
}
.install-guidance {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #334155;
}
.install-guidance summary {
  cursor: pointer;
  color: #bfdbfe;
  font-weight: 800;
}
.install-guidance p:last-child {
  margin-bottom: 0;
}
.storage-warning {
  color: #fbbf24;
  font-weight: 800;
}
ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}
li {
  margin: 6px 0;
}
.capture-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #020617;
}
.capture-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: #1e293b;
}
.capture-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: #1e293b;
  color: #93c5fd;
  font-weight: 900;
}
.capture-name {
  font-weight: 800;
}
.capture-meta {
  color: #cbd5e1;
  font-size: 14px;
}
.remove-capture {
  padding: 9px 10px;
  min-height: 38px;
  border-color: #7f1d1d;
  color: #fecaca;
}
.remove-capture:hover {
  background: #7f1d1d;
}
.queue-list {
  display: grid;
  gap: 10px;
}
.queue-item {
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #020617;
}
.queue-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.queue-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: #dbeafe;
  background: #1e3a8a;
  font-size: 12px;
  font-weight: 800;
}
.queue-status.delivered { color: #dcfce7; background: #166534; }
.queue-status.needs-attention { color: #fef3c7; background: #92400e; }
.queue-status.sending { color: #dbeafe; background: #1d4ed8; }
.queue-error { margin-top: 8px; color: #fecaca; font-size: 14px; }
.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.queue-actions button { min-height: 38px; padding: 8px 10px; }
.danger { border-color: #7f1d1d; color: #fecaca; }
.receipt-action { border-color: #475569; color: #dbeafe; }
.empty-state { padding: 22px 12px; color: #94a3b8; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .recording-dot { animation: none; }
}
@media (max-width: 480px) {
  .brand-header {
    min-height: 28px;
    margin-bottom: 6px;
  }
  .brand-header strong {
    font-size: 20px;
  }
  .brand-header span {
    font-size: 15px;
  }
  .brand-footer img {
    width: min(180px, 52vw);
  }
  .pairing-reconnect-banner {
    align-items: stretch;
    flex-direction: column;
  }
  .pairing-reconnect-banner button {
    width: 100%;
  }
  .actions {
    grid-template-columns: 1fr;
  }
  .manual-time {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .capture-item {
    grid-template-columns: 48px 1fr;
  }
  .remove-capture {
    grid-column: 1 / -1;
  }
  .send-row {
    grid-template-columns: 1fr;
  }
  .queue-item-header {
    display: grid;
  }
}
