/* Audio Lab — в духе Диктофона iOS: системный шрифт, крупный заголовок, список, красная кнопка записи */
:root {
  --bg: #ffffff; --bg2: #f2f2f7; --card: #ffffff; --text: #000000; --muted: #8a8a8e; --line: #c6c6c8;
  --red: #ff3b30; --blue: #007aff; --green: #34c759; --orange: #ff9500; --fill: #7676801f; --sheet: #f2f2f7;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --bg2: #1c1c1e; --card: #1c1c1e; --text: #ffffff; --muted: #8d8d93; --line: #38383a;
    --red: #ff453a; --blue: #0a84ff; --green: #30d158; --orange: #ff9f0a; --fill: #7676803d; --sheet: #1c1c1e; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding: calc(var(--safe-t) + 8px) 16px calc(var(--safe-b) + 140px); max-width: 720px; margin: 0 auto;
  -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* навигация */
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.nav a, .nav button { background: none; border: 0; color: var(--blue); padding: 8px 0; font-size: 17px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; font-size: 22px; }
h1.large { font-size: 34px; font-weight: 700; letter-spacing: .3px; margin: 2px 0 10px; }
.search { width: 100%; border: 0; border-radius: 10px; background: var(--fill); padding: 8px 12px 8px 34px;
  margin-bottom: 8px; font-size: 17px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238a8a8e'%3E%3Ccircle cx='6.5' cy='6.5' r='5.2' stroke='%238a8a8e' stroke-width='1.6' fill='none'/%3E%3Cpath d='M10.4 10.4l4 4' stroke='%238a8a8e' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center; }

/* список записей */
.list { margin: 0; padding: 0; list-style: none; }
.list li { border-bottom: .5px solid var(--line); }
.list a { display: block; padding: 11px 0; color: var(--text); }
.list .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .m { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; margin-top: 2px; }
.badge { font-size: 12px; padding: 1px 7px; border-radius: 9px; background: var(--fill); color: var(--muted); margin-left: 6px; }
.badge.warn { background: #ff950026; color: var(--orange); }
.badge.err { background: #ff3b3026; color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }

/* нижняя панель с кнопкой записи */
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(var(--safe-b) + 14px);
  background: color-mix(in srgb, var(--bg2) 88%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: .5px solid var(--line); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; z-index: 5; }
.dock .side { font-size: 13px; color: var(--muted); }
.dock .side.r { text-align: right; }
.rec-btn { width: 74px; height: 74px; border-radius: 50%; border: 4px solid var(--text); background: transparent;
  display: grid; place-items: center; padding: 0; opacity: .95; }
.rec-btn::after { content: ""; width: 60px; height: 60px; border-radius: 50%; background: var(--red); transition: all .25s; }
.rec-btn.on::after { width: 30px; height: 30px; border-radius: 7px; }
.chip { display: inline-block; border: 0; background: var(--fill); border-radius: 14px; padding: 4px 10px; font-size: 13px; color: var(--text); }

/* шторка записи */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--sheet); border-radius: 14px 14px 0 0;
  padding: 10px 20px calc(var(--safe-b) + 18px); transform: translateY(105%); transition: transform .3s ease; z-index: 10;
  box-shadow: 0 -8px 30px #0003; max-width: 720px; margin: 0 auto; }
.sheet.open { transform: none; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { text-align: center; font-size: 20px; margin: 4px 0 0; }
.sheet .sub { text-align: center; color: var(--muted); font-size: 14px; min-height: 19px; }
.timer { text-align: center; font: 300 48px/1.1 -apple-system, "SF Pro Display", sans-serif; font-variant-numeric: tabular-nums; margin: 14px 0 6px; }
canvas.wave { width: 100%; height: 96px; display: block; }
.sheet .info { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 14px; min-height: 36px; }
.sheet .stop { display: grid; place-items: center; }
.backdrop { position: fixed; inset: 0; background: #0006; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 9; }
.backdrop.open { opacity: 1; pointer-events: auto; }
.blackout { position: fixed; inset: 0; background: #000; z-index: 20; color: #555; display: grid; place-items: center;
  text-align: center; font-size: 15px; }

/* выбор качества */
.picker { margin: 0; padding: 0; list-style: none; background: var(--card); border-radius: 12px; overflow: hidden; }
.picker label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: .5px solid var(--line); }
.picker li:last-child label { border-bottom: 0; }
.picker input { accent-color: var(--blue); width: 20px; height: 20px; }
.picker .q { flex: 1; }
.picker .q small { display: block; color: var(--muted); font-size: 13px; }

/* карточка записи */
.rtitle { font-size: 26px; font-weight: 700; margin: 4px 0 2px; word-break: break-word; }
.rmeta { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.player { background: var(--card); border-radius: 14px; padding: 14px 16px 10px; margin-bottom: 14px; }
@media (prefers-color-scheme: light) { .player { background: var(--bg2); } }
.player input[type=range] { width: 100%; accent-color: var(--muted); margin: 0; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.controls { display: flex; justify-content: center; align-items: center; gap: 34px; margin-top: 6px; }
.controls button { background: none; border: 0; font-size: 26px; color: var(--text); padding: 6px; }
.controls .play { font-size: 40px; width: 56px; }
.controls .speed { font-size: 14px; font-weight: 600; color: var(--blue); width: 44px; }
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 6px 0 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 6px; border-radius: 7px; font-size: 14px; font-weight: 500; }
.seg button.on { background: var(--card); box-shadow: 0 1px 4px #0002; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
.transcript p { margin: 0 0 10px; cursor: pointer; border-radius: 6px; padding: 2px 4px; }
.transcript p .ts { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-right: 6px; }
.transcript p.now { background: #ffcc0040; }
.group { background: var(--card); border-radius: 12px; margin: 0 0 18px; overflow: hidden; }
@media (prefers-color-scheme: light) { .group { background: var(--bg2); } }
.group .row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: .5px solid var(--line); }
.group .row:last-child { border-bottom: 0; }
.group .row > span:last-child { color: var(--muted); text-align: right; word-break: break-all; }
.group-title { color: var(--muted); font-size: 13px; text-transform: uppercase; margin: 0 0 6px 14px; letter-spacing: .3px; }
.group input[type=text], .group input[type=password], .group input[type=datetime-local], .group input[type=email] {
  border: 0; background: transparent; outline: none; width: 100%; padding: 11px 14px; font-size: 17px; }
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 13px; font-size: 17px; font-weight: 600;
  background: var(--blue); color: #fff; text-align: center; margin: 8px 0; }
.btn.plain { background: var(--card); color: var(--blue); font-weight: 400; }
@media (prefers-color-scheme: light) { .btn.plain { background: var(--bg2); } }
.btn.danger { background: var(--card); color: var(--red); font-weight: 400; }
@media (prefers-color-scheme: light) { .btn.danger { background: var(--bg2); } }
.note { font-size: 13px; color: var(--muted); margin: -10px 14px 18px; }
.warn { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; background: #ff950022; border: 1px solid #ff950055; font-size: 15px; }
.warn.err { background: #ff3b3018; border-color: #ff3b3055; }
.toast { position: fixed; left: 16px; right: 16px; top: calc(var(--safe-t) + 8px); z-index: 30; padding: 12px 14px;
  border-radius: 12px; background: var(--card); box-shadow: 0 6px 24px #0004; font-size: 15px; animation: toast 6s forwards; }
.toast.error { border-left: 4px solid var(--red); }
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--fill); border-radius: 12px; padding: 2px 10px; font-size: 14px; }
.menu { list-style: none; margin: 0; padding: 0; }
.menu a, .menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--blue);
  padding: 13px 14px; border-bottom: .5px solid var(--line); font-size: 17px; }
.menu li:last-child a, .menu li:last-child button { border-bottom: 0; }
.login { max-width: 380px; margin: 12vh auto 0; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 19px; }
