* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-text); font-size: 15px; line-height: 1.45; }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
b, strong { color: var(--head); }
[hidden] { display: none !important; }

/* полоса под статус-баром iPhone в цвете обложки (экраны без большой шапки) */
body::before {
  content: ''; position: fixed; inset: 0 0 auto 0; height: var(--safe-top); background: var(--cover); z-index: 30;
}

#view { min-height: 100dvh; padding-bottom: calc(var(--tabs-h) + var(--safe-bottom) + 24px); }
body.bare #view { padding-bottom: 0; }

/* ---------- общие элементы ---------- */
.kicker { font-family: var(--f-head); font-weight: 800; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--cor); }
.page { padding: calc(var(--safe-top) + 22px) 18px 0; }
.page-title { font-family: var(--f-head); font-weight: 800; font-size: 30px; letter-spacing: -.02em; color: var(--head); margin: 4px 0 14px; }
.muted { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 48px; padding: 0 20px; border-radius: 15px;
  font-family: var(--f-head); font-weight: 800; font-size: 15px; background: var(--card); border: 1px solid var(--line); color: var(--head);
  white-space: nowrap; flex: none; transition: transform .12s ease, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--grad-ind); color: #fff; border: 0; }
.btn.cor { background: var(--grad-cor); color: #fff; border: 0; box-shadow: 0 10px 22px -10px rgba(225, 29, 72, .7); }
.btn.done { background: var(--green-bg); color: var(--green); border-color: #CFF3E2; }
.btn.ghost { color: #B3B0D4; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.field {
  width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 0 14px; font-size: 16px; outline: none;
}
.field:focus { border-color: var(--ind); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.chip { display: inline-block; font-size: 12px; padding: 4px 10px; border-radius: 12px; background: var(--lil); color: #4338CA; margin: 0 5px 6px 0; white-space: nowrap; }
.chip.amb { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: #FFE4EA; color: var(--cor); }
.chip.mono { font-family: var(--f-mono); font-size: 11px; }

/* ---------- вкладки и кнопка «+» ---------- */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  height: calc(var(--tabs-h) + var(--safe-bottom)); padding: 7px 6px var(--safe-bottom);
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line2);
}
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: #A9A6C8;
  font-family: var(--f-head); font-weight: 700; font-size: 10.5px; position: relative; }
#tabs a svg { width: 24px; height: 24px; }
#tabs a.on { color: var(--ind); }
#tabs .badge { position: absolute; top: -3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--cor2); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; }
#fab {
  position: fixed; right: 18px; bottom: calc(var(--tabs-h) + var(--safe-bottom) + 16px); z-index: 21; width: 58px; height: 58px; border-radius: 19px;
  background: var(--grad-cor); color: #fff; font-size: 32px; font-weight: 300; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 26px -10px rgba(225, 29, 72, .75); transition: transform .15s ease;
}
#fab:active { transform: scale(.92); }
body.bare #tabs, body.bare #fab { display: none; }

/* ---------- нижний лист ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(23, 21, 58, .38); opacity: 0; transition: opacity .2s; }
.scrim.in { opacity: 1; }
.sheet {
  position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 41; max-height: 86dvh; overflow: auto; background: #fff; border-radius: 28px;
  padding: 18px 18px calc(16px + var(--safe-bottom)); transform: translateY(110%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -10px 40px -20px rgba(30, 27, 75, .5);
}
.sheet.in { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: #E2E0F2; margin: -6px auto 12px; }
.sheet-title { font-family: var(--f-head); font-weight: 800; font-size: 13px; color: var(--muted); }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-bottom) + 86px); z-index: 60; transform: translate(-50%, 20px); opacity: 0;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 16px;
  background: #1E1B4B; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 16px 30px -12px rgba(30, 27, 75, .6);
  transition: transform .22s ease, opacity .22s ease; white-space: nowrap;
}
body.bare .toast { bottom: calc(var(--safe-bottom) + 28px); }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast button { font-family: var(--f-head); font-weight: 800; color: var(--cor-soft); }

/* ---------- вход ---------- */
.login { min-height: 100dvh; background: var(--cover); color: #fff; padding: calc(var(--safe-top) + 72px) 26px 40px; position: relative; overflow: hidden; }
.login .ghost { position: absolute; right: -30px; top: 90px; font-family: var(--f-head); font-weight: 800; font-size: 220px; line-height: 1;
  color: rgba(255, 255, 255, .06); letter-spacing: -.05em; pointer-events: none; }
.login .kicker { color: var(--cor-soft); letter-spacing: .22em; }
.login h1 { font-family: var(--f-head); font-weight: 800; font-size: 46px; line-height: 1.02; letter-spacing: -.03em; margin: 14px 0 12px; }
.login p { color: #DAD7FF; font-size: 15px; margin: 0 0 34px; max-width: 300px; }
.login .field { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; }
.login .field::placeholder { color: rgba(255, 255, 255, .55); }
.login .field:focus { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .14); }
.login .btn { width: 100%; margin-top: 12px; }
.login .err { color: #FDA4AF; font-size: 14px; min-height: 20px; margin-top: 10px; }

/* ---------- запись ---------- */
.capture textarea {
  width: 100%; border: 0; outline: none; resize: none; min-height: 84px; margin: 8px 0 12px; padding: 0;
  font-family: var(--f-head); font-weight: 700; font-size: 20px; line-height: 1.3; color: var(--head); background: transparent;
}
.capture textarea::placeholder { color: #C9C6E4; }
.capture .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.capture .hint { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.capture .mic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--lil); display: flex; align-items: center; justify-content: center; }

/* ---------- пусто ---------- */
.empty { text-align: center; color: var(--muted); padding: 48px 24px; font-size: 14px; }
.empty b { display: block; font-family: var(--f-head); font-weight: 800; font-size: 19px; margin-bottom: 6px; }
.pending-note { margin: 12px 16px 0; padding: 9px 12px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-size: 13px; }
