/* rs1-rec — light, mobile-friendly encrypted recording browser */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #ffffff;
  color: #1a1a1e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

#app { min-height: 100%; }

/* ---------- PIN ---------- */
.pin-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  user-select: none;
  -webkit-user-select: none;
}
.pin-title { font-size: 20px; letter-spacing: 2px; color: #8a8a93; text-transform: uppercase; }
.pin-dots { display: flex; gap: 18px; }
.pin-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #b9b9c2;
  transition: background .12s, border-color .12s;
}
.pin-dot.filled { background: #1a1a1e; border-color: #1a1a1e; }
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 84px);
  gap: 14px;
  touch-action: manipulation;
}
.pin-insecure {
  grid-column: 1 / -1;
  max-width: 260px;
  color: #b3261e;
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
  padding: 20px 4px;
}
.pin-loading {
  font-size: 15px;
  color: #8a8a93;
  letter-spacing: 1px;
  min-height: 22px;
}
.pin-key {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 1px solid #e0e0e6;
  background: #f1f1f4;
  color: #1a1a1e;
  font-size: 30px;
  cursor: pointer;
  touch-action: manipulation;
}
.pin-key:active { background: #e2e2e8; }
.pin-key.fn { font-size: 18px; color: #8a8a93; }
.pin-screen.shake .pin-dots { animation: shake .35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-12px); }
  75% { transform: translateX(12px); }
}

/* ---------- LIBRARY / BROWSER ---------- */
.library { padding: 20px 16px 48px; max-width: 700px; margin: 0 auto; }
.library h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.library .sub { color: #8a8a93; font-size: 13px; margin-bottom: 16px; }
.back-btn {
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #e0e0e6;
  background: #f4f4f6;
  color: #1a1a1e;
  cursor: pointer;
}
.back-btn:active { background: #e2e2e8; }
.search {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #e0e0e6;
  background: #f4f4f6;
  color: #1a1a1e;
  outline: none;
}
.search:focus { border-color: #b9b9c2; }
.grid {
  display: flex;
  flex-direction: column;
}
.card {
  background: #ffffff;
  border: none;
  border-bottom: 1px solid #ececf0;
  border-radius: 0;
  padding: 14px 4px;
  cursor: pointer;
}
.card:active { background: #f4f4f6; }
.card-body { padding: 0; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.3; margin-bottom: 3px; }
.card-meta { font-size: 13px; color: #8a8a93; }
.empty { color: #8a8a93; text-align: center; margin-top: 60px; }

/* ---------- TRACK LIST ---------- */
.track-list {
  display: flex;
  flex-direction: column;
}
.track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #ececf0;
  cursor: pointer;
}
.track-row:active { background: #f4f4f6; }
.track-row.playing .track-label { font-weight: 700; }
.play-btn {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #1a1a1e;
  background: #1a1a1e;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
}
.track-row.playing .play-btn { background: #1a1a1e; }
.track-label {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-btn {
  flex: none;
  padding: 6px 12px;
  font-size: 15px;
  border-radius: 20px;
  border: 1px solid #e0e0e6;
  background: #f4f4f6;
  color: #1a1a1e;
  cursor: pointer;
}
.dl-btn.small { padding: 6px 14px; }
.dl-btn:active { background: #e2e2e8; }
.dl-btn:disabled { opacity: .5; }

/* ---------- AUDIO PLAYER ---------- */
.player-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #e0e0e6;
  padding: 8px 12px 10px;
}
.player-bar[hidden] { display: none; }
.player-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.player-row { display: flex; align-items: center; gap: 10px; }
.player-btn {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid #1a1a1e;
  background: #1a1a1e;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
}
.player-btn.ghost { background: #f4f4f6; border-color: #e0e0e6; color: #1a1a1e; }
.player-seek {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #e0e0e6;
  outline: none;
  cursor: pointer;
}
.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #1a1a1e;
  cursor: pointer;
}
.player-seek::-moz-range-thumb {
  width: 16px; height: 16px;
  border: none;
  border-radius: 50%;
  background: #1a1a1e;
  cursor: pointer;
}
.player-time {
  font-size: 12px;
  color: #8a8a93;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
body.has-player .library { padding-top: 92px; }
