/* Достигатор — Apple-inspired dark UI */

:root {
  --bg: #0a0c12;
  --bg-elev: #12151f;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.94);
  --text-2: rgba(255, 255, 255, 0.56);
  --text-3: rgba(255, 255, 255, 0.34);
  --accent: #6e7ff3;
  --accent-soft: rgba(110, 127, 243, 0.16);
  --green: #34c77b;
  --red: #ff5f57;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html { scrollbar-gutter: stable; }
html, body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "SF Pro Text", Segoe UI, Roboto, sans-serif;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(110, 127, 243, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(52, 199, 123, 0.06), transparent 60%),
    var(--bg);
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea {
  font: inherit; color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
input:focus, textarea:focus { border-color: rgba(110, 127, 243, 0.55); background: rgba(255, 255, 255, 0.08); }
textarea { resize: none; }
#f-why { overflow-y: hidden; }
input[type="date"] { color-scheme: dark; }

.screen { max-width: 1040px; width: 100%; margin: 0 auto; padding: 20px 16px calc(96px + var(--safe-b)); }

/* ---------- board ---------- */
.board-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 12px 4px 20px;
}
.board-title {
  font-size: clamp(2.1rem, 3.4vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  background: linear-gradient(120deg, #fff 30%, #aab4ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.board-sub { color: var(--text-3); font-size: 0.85rem; margin-top: 4px; letter-spacing: 0.01em; }

.streak {
  display: flex; align-items: center; gap: 5px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: 999px; padding: 7px 14px 7px 10px;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.streak-flame { font-size: 1.05rem; }

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  justify-content: start;
  gap: 12px;
}

.goal-card {
  position: relative;
  width: 100%;
  max-width: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--glass-border);
  background: var(--bg-elev);
  text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  isolation: isolate;
  transition: transform 160ms var(--ease-out);
  opacity: 0; transform: translateY(10px) scale(0.98);
  animation: card-in 480ms var(--ease-out) forwards;
}
/* при возврате с деталей / смене фильтра карточки уже "на месте" — без повторного проигрывания входа */
.goal-card.no-anim { animation: none; opacity: 1; transform: none; }
.goal-card:active { transform: scale(0.97); }
@keyframes card-in { to { opacity: 1; transform: none; } }

.goal-card .cover {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-position: center;
}
.goal-card .cover-glass {
  position: absolute; inset: 0; z-index: -1;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  -webkit-mask-image: linear-gradient(to top, black 0%, black 38%, transparent 72%);
  mask-image: linear-gradient(to top, black 0%, black 38%, transparent 72%);
}
.goal-card .cover-shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(5, 6, 10, 0.92) 0%, rgba(5, 6, 10, 0.55) 40%, rgba(5, 6, 10, 0.1) 70%, rgba(5, 6, 10, 0) 100%);
}
.goal-card.done { filter: saturate(0.6); }
.goal-card.archived { filter: saturate(0.4) brightness(0.82); }
.goal-card.done::after {
  content: "✓ Готово"; position: absolute; top: 10px; right: 10px;
  font-size: 0.72rem; font-weight: 700; color: #0a0c12;
  background: var(--green); border-radius: 999px; padding: 3px 9px;
}

.goal-emoji { font-size: 1.5rem; margin-bottom: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.goal-name {
  font-weight: 700; font-size: 0.98rem; line-height: 1.25; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.goal-sub { color: var(--text-2); font-size: 0.75rem; margin-top: 3px; font-variant-numeric: tabular-nums; }

.goal-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); margin-top: 10px; overflow: hidden; }
.goal-bar i {
  display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #9aa7ff);
  transform-origin: left;
  transition: transform 700ms var(--ease-out);
}

/* stagger */
.goal-card:nth-child(1) { animation-delay: 0ms; }
.goal-card:nth-child(2) { animation-delay: 45ms; }
.goal-card:nth-child(3) { animation-delay: 90ms; }
.goal-card:nth-child(4) { animation-delay: 135ms; }
.goal-card:nth-child(5) { animation-delay: 180ms; }
.goal-card:nth-child(n+6) { animation-delay: 220ms; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 12vh 24px 0; }
.empty-star { font-size: 3.4rem; margin-bottom: 18px; animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.empty h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.empty p { color: var(--text-2); font-size: 0.95rem; margin-bottom: 24px; }

/* ---------- buttons ---------- */
.btn {
  border-radius: 999px; padding: 12px 22px; font-weight: 650;
  transition: transform 140ms var(--ease-out), opacity 140ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(110, 127, 243, 0.35); }
.btn-done { background: var(--green); color: #06281a; margin-top: 10px; padding: 10px 18px; font-size: 0.9rem; }
.btn-wide { width: 100%; margin-top: 6px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-size: 1.25rem; line-height: 1;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform 140ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.92); }

.chip-btn {
  display: inline-flex; align-items: center; cursor: pointer;
  border-radius: 999px; padding: 7px 14px; font-size: 0.82rem; font-weight: 600;
  background: var(--accent-soft); color: #aab4ff; border: 1px solid rgba(110, 127, 243, 0.3);
  transition: transform 140ms var(--ease-out);
}
.chip-btn:active { transform: scale(0.95); }

#btn-suggest { display: inline-flex; margin: 2px 0 20px; }
#btn-cover-reset { margin-top: -2px; }

.fab {
  position: fixed; right: 20px; bottom: calc(24px + var(--safe-b)); z-index: 30;
  width: 58px; height: 58px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 1.9rem; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(110, 127, 243, 0.45);
  transition: transform 160ms var(--ease-out);
}
.fab:active { transform: scale(0.92); }

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
}

/* ---------- detail ---------- */
.detail { padding: 0 0 calc(60px + var(--safe-b)); max-width: 680px; width: 100%; }
/* scale-up from the top settles into place без transientного скролбара:
   элемент всегда ≤ натуральной высоты, поэтому не появляется лишний слайдер */
#detail { animation: detail-in 380ms var(--ease-out); transform-origin: 50% 0; }
@keyframes detail-in { from { opacity: 0; transform: scale(0.985); } }

.detail-cover {
  position: relative; height: clamp(200px, 32vw, 320px);
  background: linear-gradient(150deg, #1a1f33, #0e1018);
  background-size: cover; background-position: center;
}
.detail-cover-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 2%, transparent 55%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0%, transparent 22%);
}

/* Обложка цели — фото пользователя произвольной яркости, поэтому кнопки поверх
   неё держатся на собственном тёмном фоне, а не на светлом --glass — иначе на
   светлой/белой картинке они становятся невидимы. */
.icon-btn-on-photo {
  background: rgba(10, 12, 18, 0.42);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.back-btn { position: absolute; top: 16px; left: 16px; font-size: 1.6rem; padding-bottom: 3px; }
.edit-btn { position: absolute; top: 16px; right: 16px; font-size: 1rem; }

.detail-body { padding: 0 18px; margin-top: -34px; position: relative; }
.detail-headline { display: flex; align-items: center; gap: 10px; }
.detail-emoji { font-size: 1.9rem; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.detail-headline h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.detail-meta { color: var(--text-2); font-size: 0.85rem; margin: 6px 2px 0; }

.why {
  margin: 16px 0 0; padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 12px;
}
.why-label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #aab4ff; margin-bottom: 4px; }
.why p { font-size: 0.95rem; line-height: 1.45; }

.progress-block {
  display: flex; align-items: center; gap: 6px;
  margin-top: 16px; padding: 16px; position: relative;
}
.ring { transform: rotate(-90deg); flex: none; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 9; }
.ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 900ms var(--ease-out), stroke 300ms ease;
}
.ring-center {
  position: absolute; width: 108px; height: 108px; left: 16px; top: 50%;
  transform: translateY(-50%); display: grid; place-items: center; pointer-events: none;
}
.ring-pct { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.progress-side { min-width: 0; }
.progress-line { font-weight: 650; font-size: 0.95rem; }
.progress-hint { color: var(--text-2); font-size: 0.8rem; margin-top: 3px; }

/* ---------- sections ---------- */
.section { margin-top: 26px; }
.section h3 { font-size: 1.05rem; letter-spacing: -0.015em; margin-bottom: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h3 { margin: 0; }

.milestones { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.milestone {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--glass-border);
  transition: opacity 240ms ease, transform 160ms var(--ease-out);
}
.milestone:active { transform: scale(0.985); }
.milestone .box {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.28);
  display: grid; place-items: center; font-size: 0.85rem; color: #06281a;
  transition: background 200ms var(--ease-out), border-color 200ms ease, transform 200ms var(--ease-out);
}
.milestone.done .box { background: var(--green); border-color: var(--green); transform: scale(1.05); }
.milestone.done .ms-title { color: var(--text-3); text-decoration: line-through; }
.ms-title { flex: 1; font-size: 0.94rem; line-height: 1.35; }
.ms-edit-input {
  flex: 1; font-size: 0.94rem; line-height: 1.35; background: transparent;
  border: none; border-bottom: 1px solid var(--accent); color: inherit; padding: 0 0 2px;
}
.ms-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.ms-move, .ms-edit, .ms-del { color: var(--text-3); font-size: 1rem; padding: 4px 6px; opacity: 0.7; }
.ms-move { font-size: 0.85rem; }

.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-btn { background: var(--accent-soft); border-color: rgba(110, 127, 243, 0.3); color: #aab4ff; font-weight: 700; }

/* ---------- checkin ---------- */
.checkin { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.moods { display: flex; gap: 8px; }
.mood {
  width: 44px; height: 44px; border-radius: 14px; font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border);
  display: grid; place-items: center;
  transition: transform 140ms var(--ease-out), background 160ms ease, border-color 160ms ease;
}
.mood:active { transform: scale(0.9); }
.mood.on { background: var(--accent-soft); border-color: rgba(110, 127, 243, 0.6); transform: scale(1.06); }
.checkin-row { display: flex; gap: 8px; align-items: center; }
.checkin-row input { max-width: 130px; }
.checkin-row .btn { margin-left: auto; }

/* ---------- journal ---------- */
.journal { display: flex; flex-direction: column; gap: 2px; }
.j-item { display: flex; gap: 12px; padding: 9px 4px; }
.j-rail { display: flex; flex-direction: column; align-items: center; flex: none; width: 20px; }
.j-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); margin-top: 6px; flex: none; }
.j-line { width: 2px; flex: 1; background: rgba(255, 255, 255, 0.08); margin-top: 4px; }
.j-item:last-child .j-line { display: none; }
.j-date { color: var(--text-3); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.j-note { font-size: 0.92rem; line-height: 1.4; margin-top: 1px; }
.j-delta { color: var(--green); font-weight: 650; font-size: 0.85rem; }

/* ---------- coach ---------- */
.coach { padding: 14px; }
.coach-log { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; margin-bottom: 10px; }
.coach-log:empty { display: none; }
.bubble {
  max-width: 86%; padding: 10px 13px; border-radius: 16px;
  font-size: 0.92rem; line-height: 1.42; white-space: pre-wrap; overflow-wrap: break-word;
  animation: bubble-in 320ms var(--ease-out);
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble.ai { align-self: flex-start; background: rgba(255, 255, 255, 0.08); border-bottom-left-radius: 5px; }
.bubble.typing { color: var(--text-2); }
.bubble.typing::after { content: "…"; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "…"; } }

.danger-zone { display: flex; gap: 20px; justify-content: center; margin: 34px 0 10px; }
.link-danger { color: var(--text-3); font-size: 0.85rem; transition: color 160ms ease; }
.link-danger:active { color: var(--red); }

/* ---------- sheet ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  opacity: 1; transition: opacity 280ms ease;
}
.scrim.hide { opacity: 0; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: 560px; margin: 0 auto;
  max-height: 92dvh; overflow-y: auto;
  background: rgba(20, 23, 34, 0.92);
  backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--glass-border); border-bottom: 0;
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(24px + var(--safe-b));
  transform: translateY(0);
  transition: transform 420ms var(--ease-sheet);
}
.sheet.hide { transform: translateY(105%); }
.sheet-grab { width: 40px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); margin: 4px auto 14px; }
.sheet h2 { font-size: 1.3rem; letter-spacing: -0.02em; margin-bottom: 16px; }

/* На широких экранах форма — центрированное окно, а не растянутая по всей ширине
   шторка снизу: то же самое действие, но без ощущения "телефонного экрана на весь монитор". */
@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: 92vw; max-width: 480px;
    border-radius: 24px; border-bottom: 1px solid var(--glass-border);
    transform: translate(-50%, -50%) scale(1);
    transition: transform 320ms var(--ease-out), opacity 320ms ease;
  }
  .sheet.hide { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
  .sheet-grab { display: none; }
}

/* ---------- emoji picker ---------- */
.emoji-trigger {
  width: 100%; padding: 10px 12px; font-size: 1.4rem; text-align: center;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border);
  border-radius: 12px; line-height: 1.3;
  transition: transform 140ms var(--ease-out), border-color 160ms ease;
}
.emoji-trigger:active { transform: scale(0.94); }

.emoji-picker {
  position: fixed; left: 50%; top: 50%; z-index: 60;
  transform: translate(-50%, -50%) scale(1);
  width: 92vw; max-width: 360px; max-height: 80dvh; overflow-y: auto;
  background: rgba(20, 23, 34, 0.94);
  backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--glass-border); border-radius: 24px;
  padding: 10px 20px 20px;
  transition: transform 260ms var(--ease-out), opacity 260ms ease;
}
.emoji-picker.hide { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
.emoji-picker h2 { font-size: 1.1rem; letter-spacing: -0.02em; margin-bottom: 14px; }

.emoji-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px;
}
.emoji-opt {
  aspect-ratio: 1; border-radius: 12px; font-size: 1.35rem;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid transparent;
  transition: transform 120ms var(--ease-out), background 140ms ease, border-color 140ms ease;
}
.emoji-opt:active { transform: scale(0.88); }
.emoji-opt.on { background: var(--accent-soft); border-color: rgba(110, 127, 243, 0.5); }

.emoji-custom-input { text-align: center; }

@media (hover: hover) and (pointer: fine) {
  .emoji-opt:hover { background: rgba(255, 255, 255, 0.1); }
}

.field { display: block; margin-bottom: 14px; }
.field > span, .field-label { display: block; font-size: 0.8rem; font-weight: 650; color: var(--text-2); margin-bottom: 6px; }
.field > span em, .field-label em { color: var(--accent); font-style: normal; font-weight: 500; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.field-s { flex: 0 0 88px !important; }
.hint { color: var(--text-3); font-size: 0.76rem; margin-top: 6px; }

.seg { display: flex; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border); border-radius: 12px; padding: 3px; gap: 3px; }
.seg-item {
  flex: 1; padding: 8px 4px; border-radius: 9px; font-size: 0.84rem; font-weight: 600; color: var(--text-2);
  transition: background 200ms var(--ease-out), color 200ms ease;
}
.seg-item.on { background: var(--accent); color: #fff; }

/* ---------- chips (categories) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 13px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border); color: var(--text-2);
  transition: transform 140ms var(--ease-out), background 160ms ease, color 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.cat-filter {
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px;
  scrollbar-width: none;
}
.cat-filter::-webkit-scrollbar { display: none; }
.cat-filter .chip { flex: none; background: var(--glass); backdrop-filter: blur(16px); }

.chip-add {
  background: transparent; border-style: dashed; color: var(--text-2);
}

.chip[data-v^="custom:"] {
  position: relative; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
.chip[data-v^="custom:"]::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255, 95, 87, 0.4);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 150ms ease-out;
  pointer-events: none;
  border-radius: inherit;
}
.chip[data-v^="custom:"].holding::after {
  transition: clip-path 350ms linear;
  clip-path: inset(0 0 0 0);
}

.status-filter { margin-bottom: 12px; max-width: 360px; }
.sort-filter { margin-bottom: 12px; max-width: 420px; }

.tab-empty { color: var(--text-3); font-size: 0.9rem; padding: 24px 4px; text-align: center; }

.new-cat-row { display: flex; gap: 8px; margin-top: 10px; }
.new-cat-row .emoji-trigger { width: 44px; flex: none; padding: 10px; }
.new-cat-row input { flex: 1; }
.new-cat-row .chip-btn { flex: none; background: var(--accent); color: #fff; border-color: var(--accent); }

.cat-badge {
  align-self: flex-start; z-index: 1; margin-bottom: 10px;
  font-size: 0.66rem; font-weight: 700; color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  border-radius: 999px; padding: 3px 9px;
  white-space: nowrap;
}

.cover-pick { display: flex; gap: 12px; align-items: stretch; }
.cover-preview {
  width: 84px; height: 84px; flex: none; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border);
  display: grid; place-items: center; font-size: 1.6rem;
  background-size: cover; background-position: center; overflow: hidden;
  cursor: pointer;
}
.cover-actions { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.cover-actions .chip-btn { align-self: flex-start; }

/* ---------- locked (нет доступа) ---------- */
#locked {
  position: fixed; inset: 0; z-index: 95;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 32px; text-align: center;
  background: var(--bg, #0a0c12);
}
#locked .locked-icon { font-size: 3rem; margin-bottom: 6px; }
#locked h2 { font-size: 1.3rem; letter-spacing: -0.02em; }
#locked p { color: var(--text-2); font-size: 0.95rem; max-width: 340px; line-height: 1.45; }

/* ---------- toast & celebrate ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 90;
  transform: translateX(-50%);
  background: rgba(30, 34, 48, 0.92); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 999px; padding: 10px 18px; font-size: 0.9rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 1; transition: opacity 240ms ease, transform 240ms var(--ease-out);
}
.toast.hide { opacity: 0; transform: translateX(-50%) translateY(8px); }

.celebrate { position: fixed; inset: 0; z-index: 80; pointer-events: none; overflow: hidden; }
.confetti {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0.6; }
}

/* ---------- splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(900px 560px at 82% -10%, rgba(110, 127, 243, 0.30), transparent 60%),
    radial-gradient(760px 520px at -8% 106%, rgba(52, 199, 123, 0.18), transparent 60%),
    var(--bg);
  transition: opacity 520ms var(--ease-out), filter 520ms var(--ease-out);
}
#splash.splash-exit {
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
}

.splash-card {
  position: absolute; width: 46vw; max-width: 210px; aspect-ratio: 4/5;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.splash-card--tl { left: -12vw; top: -8vh; transform: rotate(-10deg); }
.splash-card--tr { right: -14vw; top: -10vh; transform: rotate(9deg); }
.splash-card--bl { left: -14vw; bottom: -10vh; transform: rotate(8deg); }
.splash-card--br { right: -12vw; bottom: -8vh; transform: rotate(-9deg); }

.splash-dot { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }

.splash-pill {
  position: absolute; top: max(26px, env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; color: rgba(255, 255, 255, 0.7);
}
.splash-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: splash-pulse 1.6s ease-in-out infinite;
}
@keyframes splash-pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

.splash-scene { display: flex; flex-direction: column; align-items: center; }

.splash-ring-wrap { position: relative; width: 132px; height: 132px; margin-bottom: 22px; }
.splash-ring { transform: rotate(-90deg); }
.splash-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.10); stroke-width: 7; }
.splash-ring-fill {
  fill: none; stroke: url(#splashGrad); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 345; stroke-dashoffset: 345;
  animation: splash-ring 1.1s var(--ease-out) 150ms forwards;
}
@keyframes splash-ring { to { stroke-dashoffset: 92; } }

.splash-star {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 56px; filter: drop-shadow(0 6px 18px rgba(110, 127, 243, 0.55));
  opacity: 0; transform: scale(0.92);
  animation: splash-star-in 480ms var(--ease-out) 80ms forwards;
}
@keyframes splash-star-in { to { opacity: 1; transform: scale(1); } }

.splash-title {
  font-size: 42px; font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  background: linear-gradient(120deg, #ffffff 25%, #aab4ff 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(6px);
  animation: splash-text-in 420ms var(--ease-out) 260ms forwards;
}
.splash-tagline {
  margin-top: 8px; font-size: 15px; font-weight: 500; letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.56);
  opacity: 0; transform: translateY(6px);
  animation: splash-text-in 420ms var(--ease-out) 340ms forwards;
}
@keyframes splash-text-in { to { opacity: 1; transform: none; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .goal-card { opacity: 1; transform: none; }
  #splash, #splash.splash-exit { transition-duration: 180ms !important; filter: none !important; }
  .splash-star, .splash-title, .splash-tagline { opacity: 1 !important; transform: none !important; }
}

/* фон чуть шире раскрывается на больших экранах, чтобы не смотреться пустым */
@media (min-width: 900px) {
  body {
    background:
      radial-gradient(1700px 650px at 78% -12%, rgba(110, 127, 243, 0.13), transparent 60%),
      radial-gradient(1300px 650px at -8% 38%, rgba(52, 199, 123, 0.055), transparent 60%),
      var(--bg);
  }
}

/* ===== header actions: avatar + report CTA ===== */
.head-right { display: flex; align-items: center; gap: 10px; }
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--glass) center/cover no-repeat;
  border: 1px solid var(--glass-border);
  display: grid; place-items: center; font-size: 1.1rem; color: var(--text-2);
  transition: transform 160ms var(--ease-out);
}
.avatar-btn:active { transform: scale(0.92); }

.report-cta {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 4px 0 16px; padding: 13px 16px; text-align: left;
  background: var(--accent-soft); border: 1px solid rgba(110, 127, 243, 0.28);
  border-radius: 16px; color: #c2caff; font-size: 0.9rem; line-height: 1.25;
  transition: transform 160ms var(--ease-out), background 160ms ease;
}
.report-cta:active { transform: scale(0.985); background: rgba(110, 127, 243, 0.22); }
.report-cta-emoji { font-size: 1.35rem; flex: none; }

/* ===== profile sheet ===== */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.profile-avatar {
  width: 60px; height: 60px; border-radius: 50%; flex: none;
  background: var(--glass) center/cover no-repeat;
  border: 1px solid var(--glass-border);
  display: grid; place-items: center; font-size: 1.7rem; color: var(--text-3);
}
.profile-head h2 { margin: 0; }

/* ===== toggle switch ===== */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 14px; font-size: 0.92rem; color: var(--text);
}
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 46px; height: 28px; border-radius: 99px; background: rgba(255,255,255,0.14);
  position: relative; cursor: pointer; transition: background 200ms var(--ease-out);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform 220ms var(--ease-out);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

.reminder-time-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.reminder-time-row input[type=time] {
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text);
  border-radius: 12px; padding: 9px 12px; font: inherit; font-variant-numeric: tabular-nums;
}
.reminder-time-row .hint { margin: 0; }

/* ===== report result ===== */
.report-reply {
  font-size: 0.98rem; line-height: 1.4; color: var(--text);
  padding: 14px 16px; background: var(--accent-soft);
  border: 1px solid rgba(110,127,243,0.24); border-radius: 14px; margin-bottom: 12px;
}
.report-summary { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.report-summary li {
  font-size: 0.9rem; color: var(--text); padding: 10px 13px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px;
}
.report-actions { display: flex; gap: 10px; }
.report-actions .btn { flex: 1; }
.btn-ghost { background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-2); }
.btn-ghost:active { background: rgba(255,255,255,0.09); }
#report-text {
  width: 100%; background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text); border-radius: 14px; padding: 13px 14px; font: inherit;
  line-height: 1.4; resize: none; margin-bottom: 14px;
}

/* ===== avatar fallback: colored initial or compass, not a flat grey silhouette ===== */
.avatar-btn span, .profile-avatar span {
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
