/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #FAFAF8;
  --terra:     #FF3B30;
  --terra-d:   #CC2A20;
  --terra-l:   #FF6B64;
  --mint:      #5BAF9E;
  --mint-l:    #A8D8D0;
  --lavender:  #9B8EC4;
  --lav-l:     #C8C0E8;
  --sky:       #6AA8C8;
  --sky-l:     #B0D4E8;
  --text:      #1A1A1A;
  --text-2:    #6E6E73;
  --text-3:    #AEAEB2;
  --glass:     rgba(255,255,255,0.60);
  --glass-2:   rgba(255,255,255,0.88);
  --radius:    20px;
  --tab-h:     70px;
  --safe-top:  env(safe-area-inset-top, 0px);
  --safe-bot:  env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { border: none; background: none; cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ─── Ambient background blobs (всегда за контентом) ─── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: none;
}

/* ─── Screens ─── */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: transparent;
  z-index: 1;
}
.screen[hidden] { display: none !important; }

.top-safe   { height: var(--safe-top); min-height: 44px; flex-shrink: 0; }
.bottom-safe { height: calc(var(--tab-h) + var(--safe-bot) + 8px); flex-shrink: 0; }

/* ─── LOGIN ─── */
.login-bg {
  position: absolute; inset: 0;
  background:
    var(--bg);
}

.login-box {
  position: relative; z-index: 1;
  margin: auto;
  width: 100%; max-width: 340px;
  padding: 0 28px;
  display: flex; flex-direction: column; align-items: center;
}

.login-logo {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(24px);
  box-shadow: 0 4px 32px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.8) inset;
  margin-bottom: 22px;
}

.login-title {
  font-size: 34px; font-weight: 800;
  letter-spacing: -0.8px; color: var(--text);
  margin-bottom: 6px;
}

.login-sub {
  font-size: 15px; color: var(--text-2);
  margin-bottom: 38px;
}

.login-err {
  width: 100%; padding: 10px 14px;
  background: rgba(220,60,60,0.08);
  border-radius: 12px; font-size: 13px; color: #c0392b;
  margin-bottom: 12px;
}

#login-form {
  width: 100%; display: flex; flex-direction: column; gap: 10px;
}

#login-form input {
  width: 100%; padding: 14px 16px;
  background: var(--glass-2);
  border: 1.5px solid rgba(255,255,255,0.9);
  border-radius: 16px; font-size: 16px; color: var(--text); outline: none;
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
#login-form input:focus {
  border-color: rgba(26,26,26,0.3);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06), 0 2px 12px rgba(0,0,0,0.06);
}
#login-form input::placeholder { color: var(--text-3); }

/* ─── Buttons ─── */
.btn-primary {
  width: 100%; padding: 15px;
  background: #1A1A1A;
  color: #fff; border-radius: 16px;
  font-size: 16px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
  margin-top: 4px;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.985); box-shadow: 0 2px 10px rgba(0,0,0,0.15); }
.btn-primary:disabled { opacity: 0.5; }

.btn-secondary {
  padding: 12px 24px;
  background: rgba(0,0,0,0.05);
  color: var(--text); border-radius: 14px;
  font-size: 15px; font-weight: 500;
  border: 1px solid rgba(0,0,0,0.1);
  transition: background 0.15s;
}
.btn-secondary:active { background: rgba(0,0,0,0.08); }

.btn-outline {
  width: 100%; padding: 14px;
  background: transparent;
  border: 1.5px solid #E5E5E5;
  color: #1A1A1A; border-radius: 16px;
  font-size: 15px; font-weight: 500;
}
.btn-outline:active { opacity: 0.7; }

/* ─── Page Header ─── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 16px; flex-shrink: 0;
}
.header-greet { font-size: 13px; color: var(--text-2); font-weight: 400; letter-spacing: 0.2px; }
.header-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }

.header-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.7));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.9) inset;
  transition: opacity 0.15s; overflow: hidden; position: relative;
}
.header-avatar:active { opacity: 0.7; }
.header-avatar img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; position: absolute; inset: 0;
}

/* ─── HOME ─── */
.home-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(var(--tab-h) + var(--safe-bot) + 24px);
}

/* Search bar */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.55) 100%);
  border-radius: var(--radius); margin-bottom: 16px;
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.8) inset;
  backdrop-filter: blur(24px);
  color: var(--text-3); cursor: pointer;
  transition: box-shadow 0.2s;
}
.search-bar:active { box-shadow: 0 1px 8px rgba(0,0,0,0.04); }
.search-placeholder { font-size: 15px; }

/* Stats — цветные пилюли */
.stats-row { display: flex; gap: 10px; margin-bottom: 20px; }

.stat-pill {
  flex: 1; border-radius: 16px; padding: 14px 10px; text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 14px rgba(0,0,0,0.07), 0 1px 0 rgba(255,255,255,0.7) inset;
}
.stat-pill:nth-child(1) {
  background: linear-gradient(135deg, rgba(230,230,230,0.4) 0%, rgba(255,255,255,0.3) 100%);
  border: 1.5px solid #EBEBEB;
}
.stat-pill:nth-child(2) {
  background: linear-gradient(135deg, rgba(91,175,158,0.18) 0%, rgba(168,216,208,0.10) 100%);
  border: 1.5px solid rgba(91,175,158,0.2);
}
.stat-pill:nth-child(3) {
  background: linear-gradient(135deg, rgba(155,142,196,0.18) 0%, rgba(200,192,232,0.10) 100%);
  border: 1.5px solid rgba(155,142,196,0.2);
}
.stat-pill:nth-child(1) .stat-n { color: #1A1A1A; }
.stat-pill:nth-child(2) .stat-n { color: var(--mint); }
.stat-pill:nth-child(3) .stat-n { color: var(--lavender); }

.stat-n { display: block; font-size: 24px; font-weight: 800; }
.stat-l { display: block; font-size: 11px; color: var(--text-2); margin-top: 3px; font-weight: 500; }

/* Section head */
.section-head { margin-bottom: 12px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--text); }

/* Note cards — цветные по типу */
.notes-list { display: flex; flex-direction: column; gap: 10px; }

.note-card {
  border-radius: var(--radius); padding: 15px 16px;
  cursor: pointer;
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 14px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.7) inset;
  transition: transform 0.12s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.note-card:active { transform: scale(0.983); box-shadow: 0 1px 6px rgba(0,0,0,0.04); }

/* голос — тёплый */
.note-card[data-type="audio"],
.note-card[data-type="voice"] {
  background: linear-gradient(135deg, rgba(240,240,240,0.55) 0%, rgba(255,255,255,0.55) 100%);
  border: 1.5px solid #EBEBEB;
}
/* текст — мятный */
.note-card[data-type="text"] {
  background: linear-gradient(135deg, rgba(91,175,158,0.18) 0%, rgba(255,255,255,0.55) 100%);
  border: 1.5px solid rgba(91,175,158,0.18);
}
/* фото — лавандовый */
.note-card[data-type="photo"] {
  background: linear-gradient(135deg, rgba(155,142,196,0.18) 0%, rgba(255,255,255,0.55) 100%);
  border: 1.5px solid rgba(155,142,196,0.18);
}
/* дефолт */
.note-card:not([data-type]) {
  background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.45) 100%);
  border: 1.5px solid rgba(255,255,255,0.85);
}

.note-card-type {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.7px;
  margin-bottom: 5px;
}
.note-card[data-type="audio"] .note-card-type,
.note-card[data-type="voice"] .note-card-type { color: #6E6E73; }
.note-card[data-type="text"] .note-card-type   { color: var(--mint); }
.note-card[data-type="photo"] .note-card-type  { color: var(--lavender); }
.note-card:not([data-type]) .note-card-type    { color: #6E6E73; }

.note-card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  line-height: 1.35; margin-bottom: 4px;
}
.note-card-preview {
  font-size: 13px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note-card-meta { font-size: 11px; color: var(--text-3); margin-top: 8px; }

.empty-hint {
  padding: 44px 20px; text-align: center; color: var(--text-2);
  font-size: 14px; line-height: 1.7;
}
.empty-icon { margin-bottom: 14px; }

/* ─── SEARCH / CHAT ─── */
.chat-area {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px 16px; display: flex; flex-direction: column;
}
.chat-hint {
  margin: auto; text-align: center; color: var(--text-3);
  font-size: 14px; line-height: 1.7; padding: 40px 20px;
}
.chat-msg {
  max-width: 86%; padding: 12px 16px;
  border-radius: 20px; font-size: 15px; line-height: 1.5;
  margin-bottom: 8px; animation: msgIn 0.2s ease;
}
@keyframes msgIn { from { opacity:0; transform:translateY(8px); } }

.chat-msg.user {
  align-self: flex-end;
  background: #1A1A1A;
  color: #fff; border-bottom-right-radius: 6px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.2);
}
.chat-msg.kora {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(255,255,255,0.65));
  backdrop-filter: blur(20px); color: var(--text);
  border: 1.5px solid rgba(255,255,255,0.9);
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.chat-msg.kora .chat-sources {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.07);
  font-size: 12px; color: var(--text-2);
}

.chat-input-row {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 16px calc(10px + var(--safe-bot));
  background: rgba(250,250,248,0.85);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.7); flex-shrink: 0;
}
.chat-input-row input {
  flex: 1; padding: 12px 16px;
  background: var(--glass-2);
  border: 1.5px solid rgba(255,255,255,0.9); border-radius: 24px;
  font-size: 15px; color: var(--text); outline: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-row input:focus {
  border-color: rgba(26,26,26,0.3);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}
.chat-input-row input::placeholder { color: var(--text-3); }

.chat-send-btn {
  width: 44px; height: 44px;
  background: #1A1A1A;
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 3px 14px rgba(0,0,0,0.2);
  transition: opacity 0.15s, transform 0.1s;
}
.chat-send-btn:active { opacity: 0.8; transform: scale(0.92); }

/* ─── ADD ─── */
.add-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(var(--tab-h) + var(--safe-bot) + 24px);
}

.tab-switcher {
  display: flex; gap: 6px;
  background: rgba(0,0,0,0.05); border-radius: 14px; padding: 4px;
  margin-bottom: 20px;
}
.ts-btn {
  flex: 1; padding: 9px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: all 0.2s;
}
.ts-btn.active {
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.add-pane { display: none; }
.add-pane.active { display: block; }

#add-textarea {
  width: 100%; min-height: 180px; padding: 16px;
  background: linear-gradient(135deg, rgba(91,175,158,0.08) 0%, rgba(255,255,255,0.65) 100%);
  border: 1.5px solid rgba(91,175,158,0.2); border-radius: var(--radius);
  font-size: 15px; color: var(--text); line-height: 1.6; resize: none; outline: none;
  backdrop-filter: blur(16px); margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#add-textarea:focus {
  border-color: rgba(91,175,158,0.45);
  box-shadow: 0 0 0 3px rgba(91,175,158,0.1);
}
#add-textarea::placeholder { color: var(--text-3); }

/* Voice pane */
.voice-center {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 0 16px; gap: 16px;
}
.voice-wave {
  display: flex; gap: 4px; align-items: center; height: 30px;
  opacity: 0; transition: opacity 0.3s;
}
.voice-wave.active { opacity: 1; }
.wave-bar {
  width: 3.5px; border-radius: 3px;
  background: linear-gradient(180deg, #555, #1A1A1A);
  animation: wave 0.8s ease-in-out infinite alternate;
}
.wave-bar:nth-child(1) { height: 8px;  animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 18px; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 26px; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 14px; animation-delay: 0.15s; }
.wave-bar:nth-child(5) { height: 8px;  animation-delay: 0.05s; }
@keyframes wave { from { transform:scaleY(1); } to { transform:scaleY(0.25); } }

.voice-status-text { font-size: 15px; color: var(--text-2); }
.voice-orb {
  width: 84px; height: 84px;
  background: #1A1A1A;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 6px 28px rgba(0,0,0,0.25), 0 2px 0 rgba(255,255,255,0.2) inset;
  transition: transform 0.15s, box-shadow 0.15s;
}
.voice-orb.recording {
  background: linear-gradient(135deg, #ff7070, #d94040);
  box-shadow: 0 6px 32px rgba(217,64,64,0.5);
  animation: pulse-orb 1.4s ease-in-out infinite;
}
@keyframes pulse-orb { 0%,100% { transform:scale(1); } 50% { transform:scale(1.07); } }
.voice-timer {
  font-size: 22px; font-weight: 300; color: var(--text);
  letter-spacing: 2px; font-variant-numeric: tabular-nums;
}

.voice-upload-row {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px;
}
.voice-divider { font-size: 13px; color: var(--text-3); }

/* Photo pane */
.photo-zone {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(155,142,196,0.12) 0%, rgba(255,255,255,0.55) 100%);
  border-radius: var(--radius);
  border: 1.5px dashed rgba(155,142,196,0.3);
  backdrop-filter: blur(16px);
  text-align: center; color: var(--text-2); font-size: 14px; line-height: 1.6;
}

/* ─── PROFILE ─── */
.profile-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(var(--tab-h) + var(--safe-bot) + 24px);
}
.profile-avatar-wrap {
  display: flex; flex-direction: column; align-items: center; padding: 20px 0 28px;
}
.profile-avatar {
  width: 76px; height: 76px;
  background: linear-gradient(135deg, rgba(232,168,124,0.25) 0%, rgba(255,255,255,0.7) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
  margin-bottom: 12px;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.8) inset;
  position: relative; overflow: visible;
  border: 2px solid #EBEBEB;
  transition: opacity 0.15s;
}
.profile-avatar:active { opacity: 0.8; }
.profile-avatar img {
  width: 76px; height: 76px; border-radius: 50%;
  object-fit: cover; position: absolute; inset: -2px;
  width: calc(100% + 4px); height: calc(100% + 4px);
}
.avatar-edit-badge {
  position: absolute; bottom: 0; right: -2px;
  width: 24px; height: 24px;
  background: #1A1A1A;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; border: 2.5px solid var(--bg); z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.profile-name { font-size: 18px; font-weight: 700; color: var(--text); }

.profile-section {
  background: linear-gradient(135deg, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0.5) 100%);
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255,255,255,0.9); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.profile-row {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px;
}
.profile-row + .profile-row { border-top: 1px solid rgba(0,0,0,0.05); }
.profile-row-icon { color: #1A1A1A; }
.profile-row-label { font-size: 13px; color: var(--text-2); }
.profile-row-val { font-size: 15px; font-weight: 600; color: var(--text); }

/* ─── NOTE DETAIL ─── */
.overlay {
  position: fixed; inset: 0;
  background: var(--bg); z-index: 100;
  display: flex; flex-direction: column; overflow: hidden;
}
.overlay[hidden] { display: none !important; }

.overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 52px) 16px 14px;
  background: linear-gradient(180deg, rgba(244,239,236,0.95) 0%, rgba(244,239,236,0.8) 100%);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.6); flex-shrink: 0;
}
.overlay-back, .overlay-del {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: #1A1A1A; border-radius: 50%;
  transition: opacity 0.15s;
}
.overlay-back:active, .overlay-del:active { opacity: 0.6; }
.overlay-del { color: #c0392b; }

.overlay-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px 20px 40px;
}

.note-type-pill {
  display: inline-block; padding: 5px 12px;
  background: rgba(0,0,0,0.04);
  color: #1A1A1A; border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.4px;
  border: 1px solid #EBEBEB;
  margin-bottom: 14px;
}
.note-detail-title {
  font-size: 22px; font-weight: 800; line-height: 1.3; color: var(--text); margin-bottom: 8px;
}
.note-detail-meta { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }
.note-detail-summary {
  font-size: 15px; color: var(--text-2); line-height: 1.65; margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.03);
  border-radius: 14px; border-left: 3px solid #1A1A1A;
}
.note-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tag-chip {
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(91,175,158,0.15), rgba(168,216,208,0.08));
  color: var(--mint); border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1px solid rgba(91,175,158,0.2);
}
.nd-section {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-3); margin-bottom: 10px;
}
.note-detail-text {
  font-size: 15px; color: var(--text); line-height: 1.75; white-space: pre-wrap;
}

/* ─── RECORD OVERLAY ─── */
.overlay-record { background: transparent; backdrop-filter: none; border: none; }
.record-backdrop {
  position: absolute; inset: 0;
  background: rgba(45,36,32,0.35); backdrop-filter: blur(4px);
}
.record-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(248,244,241,0.95) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  border-radius: 30px 30px 0 0;
  padding: 14px 24px calc(var(--safe-bot) + 32px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 -4px 40px rgba(45,36,32,0.12);
}
.record-grip {
  width: 36px; height: 4px; background: rgba(0,0,0,0.1); border-radius: 2px; margin-bottom: 4px;
}
.record-title { font-size: 17px; font-weight: 700; color: var(--text); }
.record-orb-wrap { position: relative; width: 100px; height: 100px; margin: 8px 0; }
.rring {
  position: absolute; border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  opacity: 0; transition: opacity 0.3s;
}
.r1 { width: 100px; height: 100px; border: 2px solid rgba(26,26,26,0.15); }
.r2 { width: 130px; height: 130px; border: 1.5px solid rgba(26,26,26,0.10); }
.r3 { width: 164px; height: 164px; border: 1px solid rgba(26,26,26,0.06); }
.record-rings.active .rring { opacity: 1; animation: ring-pulse 1.8s ease-in-out infinite; }
.r2 { animation-delay: 0.3s !important; }
.r3 { animation-delay: 0.6s !important; }
@keyframes ring-pulse {
  0%,100% { opacity:0.6; transform:translate(-50%,-50%) scale(1); }
  50%      { opacity:0.15; transform:translate(-50%,-50%) scale(1.06); }
}
.record-orb {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 76px; height: 76px;
  background: #1A1A1A;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25), 0 2px 0 rgba(255,255,255,0.2) inset;
  transition: background 0.2s, box-shadow 0.2s; z-index: 1;
}
.record-orb.recording {
  background: linear-gradient(135deg, #ff7070, #d94040);
  box-shadow: 0 6px 28px rgba(217,64,64,0.5);
  animation: pulse-orb 1.4s ease-in-out infinite;
}
.record-timer {
  font-size: 30px; font-weight: 200; color: var(--text);
  letter-spacing: 3px; font-variant-numeric: tabular-nums;
}
.record-hint { font-size: 13px; color: var(--text-2); }
.record-cancel {
  font-size: 15px; color: var(--text-3); padding: 8px 24px; transition: opacity 0.15s;
}
.record-cancel:active { opacity: 0.5; }

/* ─── TAB BAR ─── */
.tab-bar {
  position: fixed;
  left: 14px; right: 14px;
  bottom: calc(var(--safe-bot) + 10px);
  height: 58px;
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-radius: 28px;
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow:
    0 4px 32px rgba(45,36,32,0.12),
    0 1px 0 rgba(255,255,255,0.9) inset;
  z-index: 50;
}
.tab-bar[hidden] { display: none !important; }

.tab-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-3); border-radius: 28px;
  transition: color 0.2s;
}
.tab-btn.active { color: #1A1A1A; font-weight: 600; }
.tab-btn:active { opacity: 0.6; }

/* Central voice — выпирает вверх */
.tab-voice {
  width: 54px; height: 54px;
  background: #1A1A1A;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow:
    0 0 0 4px rgba(250,250,248,0.9),
    0 6px 24px rgba(0,0,0,0.25);
  margin-top: -20px; flex-shrink: 0; position: relative; z-index: 1;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tab-voice:active {
  transform: scale(0.92);
  box-shadow: 0 0 0 4px rgba(250,250,248,0.9), 0 3px 12px rgba(0,0,0,0.2);
}
.tab-voice.recording {
  background: linear-gradient(135deg, #ff7070, #d94040);
  animation: pulse-orb 1.4s ease-in-out infinite;
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: calc(58px + var(--safe-bot) + 22px);
  left: 50%; transform: translateX(-50%);
  background: rgba(45,36,32,0.9);
  backdrop-filter: blur(20px);
  color: #fff; padding: 11px 20px; border-radius: 24px;
  font-size: 14px; white-space: nowrap; z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastIn 0.25s ease;
}
.toast[hidden] { display: none !important; }
@keyframes toastIn {
  from { opacity:0; transform:translateX(-50%) translateY(10px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 0; }

/* ══════════════════════════════════════════
   МАСКОТ
══════════════════════════════════════════ */
.mascot {
  position: relative;
  width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
}
.mascot.mascot-sm  { width: 56px; height: 56px; }
.mascot.mascot-xs  { width: 44px; height: 44px; }
.mascot.mascot-empty { width: 64px; height: 64px; opacity: 0.7; }

.m-ring {
  position: absolute; border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation: mascot-pulse 3s ease-in-out infinite;
}
.m-r1 {
  width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(26,26,26,0.10) 0%, rgba(26,26,26,0.02) 70%, transparent 100%);
  animation-delay: 0s;
}
.m-r2 {
  width: 72%; height: 72%;
  background: radial-gradient(circle, rgba(26,26,26,0.14) 0%, rgba(26,26,26,0.04) 70%, transparent 100%);
  animation-delay: 0.4s;
}
.m-r3 {
  width: 45%; height: 45%;
  background: radial-gradient(circle, rgba(26,26,26,0.10) 0%, transparent 70%);
  animation-delay: 0.8s;
}
@keyframes mascot-pulse {
  0%, 100% { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
  50%       { transform: translate(-50%,-50%) scale(1.08); opacity: 0.8; }
}

.m-core {
  position: relative; z-index: 2;
  width: 48%; height: 48%;
  background: linear-gradient(135deg, #444, #1A1A1A);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 1px 0 rgba(255,255,255,0.3) inset;
}
.mascot.mascot-sm .m-core { width: 50%; height: 50%; }
.mascot.mascot-xs .m-core { width: 55%; height: 55%; }

/* Варианты по цвету */
.mascot-voice .m-ring  { animation-name: mascot-pulse-voice; }
.mascot-voice .m-r1 { background: radial-gradient(circle, rgba(91,175,158,0.2) 0%, transparent 70%); }
.mascot-voice .m-r2 { background: radial-gradient(circle, rgba(91,175,158,0.28) 0%, transparent 70%); }
.mascot-voice .m-r3 { background: radial-gradient(circle, rgba(91,175,158,0.18) 0%, transparent 70%); }
.mascot-voice .m-core { background: linear-gradient(135deg, #7DCFC4, var(--mint), #3D8C7F); box-shadow: 0 4px 20px rgba(91,175,158,0.45); }
@keyframes mascot-pulse-voice {
  0%, 100% { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
  50%       { transform: translate(-50%,-50%) scale(1.1); opacity: 0.75; }
}

.mascot-search .m-r1 { background: radial-gradient(circle, rgba(155,142,196,0.2) 0%, transparent 70%); }
.mascot-search .m-r2 { background: radial-gradient(circle, rgba(155,142,196,0.28) 0%, transparent 70%); }
.mascot-search .m-r3 { background: radial-gradient(circle, rgba(155,142,196,0.18) 0%, transparent 70%); }
.mascot-search .m-core { background: linear-gradient(135deg, var(--lav-l), var(--lavender), #6A5FA0); box-shadow: 0 4px 20px rgba(155,142,196,0.45); }

/* ══════════════════════════════════════════
   ОНБОРДИНГ
══════════════════════════════════════════ */
.ob-screen {
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0;
  overflow: hidden;
}

.ob-slides {
  display: flex;
  width: 100%;
  flex: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ob-slide {
  min-width: 100%;
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 0 36px;
  text-align: center; gap: 0;
}

.ob-mascot {
  margin-bottom: 36px;
}

.ob-title {
  font-size: 26px; font-weight: 800;
  color: var(--text); letter-spacing: -0.5px;
  margin-bottom: 14px;
  line-height: 1.2;
}

.ob-text {
  font-size: 16px; color: var(--text-2);
  line-height: 1.65; max-width: 300px;
}

.ob-dots {
  display: flex; gap: 8px; padding: 24px 0 0;
}
.ob-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #EBEBEB;
  transition: all 0.3s;
}
.ob-dot.active {
  width: 22px; border-radius: 4px;
  background: #1A1A1A;
}

.ob-actions {
  padding: 20px 24px calc(var(--safe-bot) + 32px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: 100%;
}
.ob-next {
  width: 100%; max-width: 320px;
  padding: 15px;
  background: #1A1A1A;
  color: #fff; border-radius: 16px;
  font-size: 16px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: opacity 0.15s, transform 0.1s;
}
.ob-next:active { opacity: 0.85; transform: scale(0.985); }
.ob-skip {
  font-size: 14px; color: var(--text-3); padding: 6px 16px;
  transition: opacity 0.15s;
}
.ob-skip:active { opacity: 0.5; }

/* ══════════════════════════════════════════
   AUTH
══════════════════════════════════════════ */
.auth-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow-y: auto;
}
.auth-bg {
  position: absolute; inset: 0;
  background:
    var(--bg);
}
.auth-box {
  position: relative; z-index: 1;
  width: 100%; max-width: 360px;
  padding: calc(var(--safe-top) + 20px) 24px calc(var(--safe-bot) + 24px);
  display: flex; flex-direction: column; align-items: center;
}
.auth-logo { margin-bottom: 18px; }
.auth-title {
  font-size: 32px; font-weight: 800; letter-spacing: -0.8px;
  color: var(--text); margin-bottom: 5px;
}
.auth-sub { font-size: 15px; color: var(--text-2); margin-bottom: 28px; }

.auth-tabs {
  display: flex; width: 100%; gap: 0;
  background: rgba(0,0,0,0.05); border-radius: 12px; padding: 3px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 9px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--glass-2); color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-err {
  width: 100%; padding: 10px 14px;
  background: rgba(220,60,60,0.08); border-radius: 12px;
  font-size: 13px; color: #c0392b; margin-bottom: 12px;
  border: 1px solid rgba(220,60,60,0.12);
}

.auth-form {
  width: 100%; display: flex; flex-direction: column; gap: 10px; 
}
.auth-form[hidden] { display: none !important; }
.auth-form input {
  width: 100%; padding: 14px 16px;
  background: var(--glass-2);
  border: 1.5px solid rgba(255,255,255,0.9); border-radius: 16px;
  font-size: 16px; color: var(--text); outline: none;
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form input:focus {
  border-color: rgba(26,26,26,0.3);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}
.auth-form input::placeholder { color: var(--text-3); }

/* profile email */
.profile-email {
  font-size: 13px; color: var(--text-2); margin-top: 4px;
}

/* ══════════════════════════════════════════
   HOME HEADS UP БЛОК
══════════════════════════════════════════ */
.home-heads-up {
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: #F7F7F5;
  border: 1px solid #EBEBEB;
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.home-hu-header {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 15px 8px;
  font-size: 11px; font-weight: 700;
  color: #1A1A1A; letter-spacing: 0.5px;
  text-transform: uppercase;
}

.home-hu-list {
  display: flex; flex-direction: column;
}

.home-hu-card {
  padding: 10px 15px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-top: 1px solid #EBEBEB;
}
.home-hu-card:first-child { border-top: none; }
.home-hu-card:active { background: rgba(0,0,0,0.04); }

.home-hu-card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 3px;
}
.home-hu-card-text {
  font-size: 12px; color: var(--text-2); line-height: 1.45;
}
.home-hu-card-ref {
  margin-top: 5px;
  font-size: 11px; color: #1A1A1A;
  font-weight: 500;
}

/* ══════════════════════════════════════════
   SECTION HEAD + ORGANIZE BUTTON
══════════════════════════════════════════ */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.organize-btn {
  font-size: 12px; color: var(--text-3);
  background: rgba(0,0,0,0.05); border-radius: 10px;
  padding: 5px 11px; font-weight: 500;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}
.organize-btn:active { opacity: 0.6; }
.organize-btn:disabled { opacity: 0.4; }

/* ══════════════════════════════════════════
   COLLECTIONS BAR
══════════════════════════════════════════ */
.collections-bar {
  display: flex; gap: 8px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 12px;
  scrollbar-width: none;
}
.collections-bar::-webkit-scrollbar { display: none; }
.col-pill {
  flex-shrink: 0;
  padding: 7px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500; color: var(--text);
  background: rgba(0,0,0,0.05);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.col-pill.active {
  border-color: #1A1A1A;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.col-pill:active { opacity: 0.7; }

/* ══════════════════════════════════════════
   HEADS UP (связанные заметки)
══════════════════════════════════════════ */
.heads-up {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.07);
}
.heads-up-title {
  font-size: 11px; font-weight: 600;
  color: var(--text-3); letter-spacing: 0.6px;
  text-transform: uppercase; margin-bottom: 10px;
}
.heads-up-list {
  display: flex; flex-direction: column; gap: 8px;
}
.heads-up-card {
  padding: 11px 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.65), rgba(255,255,255,0.45));
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.heads-up-card:active { opacity: 0.7; transform: scale(0.98); }
.heads-up-card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 3px;
}
.heads-up-card-preview {
  font-size: 12px; color: var(--text-2); line-height: 1.4;
}

/* ══════════════════════════════════════════
   MASCOT ANIMATION
══════════════════════════════════════════ */
@keyframes mascot-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
.mascot-animated {
  animation: mascot-float 4s ease-in-out infinite;
  filter: drop-shadow(0 16px 32px rgba(0,0,0,0.12));
}
.mascot-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: relative;
}
.mascot-shadow {
  width: 80px;
  height: 16px;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  animation: shadow-pulse 3.5s ease-in-out infinite;
}
@keyframes shadow-pulse {
  0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 0.5; }
  50% { transform: translateX(-50%) scaleX(0.7); opacity: 0.2; }
}

.mascot-video {
  mix-blend-mode: multiply;
  display: block;
}

/* ─── Consent checkbox (registration) ─── */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #6E6E73;
  line-height: 1.4;
  cursor: pointer;
  margin-bottom: 8px;
}
.consent-label input[type=checkbox] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: #FF3B30;
  margin-top: 1px;
}
.consent-label a {
  color: #FF3B30;
  text-decoration: underline;
}
