/* ── LongLive! — веб-версия. Тема повторяет приложение: аква-градиент, «стеклянные»
   карточки, оранжевый акцент (солнце). ─────────────────────────────────────────── */

:root {
  --grad-start: #87CEEB;
  --grad-mid:   #40E0D0;
  --grad-end:   #7FFFD4;
  --glass:        rgba(255,255,255,0.80);
  --glass-strong: rgba(255,255,255,0.92);
  --glass-done:   rgba(255,255,255,0.70);
  --orange: #F97316;
  --gold:   #F5DEB3;
  --text:      #2C3E50;
  --text-dim:  #7A7A7A;
  --paper:  #FFFDE7;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(44,62,80,0.12);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--grad-start) 0%, var(--grad-mid) 55%, var(--grad-end) 100%);
  background-attachment: fixed;
  min-height: 100%;
  overflow-x: hidden;
}

/* Мягкие плывущие блики на фоне (как пятна в приложении). Лёгкие, без нагрузки. */
.glow { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.35), rgba(255,255,255,0) 70%);
  filter: blur(4px); animation: drift 16s ease-in-out infinite alternate; }
.glow.g1 { width: 340px; height: 340px; left: 8%;  top: 10%; }
.glow.g2 { width: 420px; height: 420px; right: 4%; top: 22%; animation-duration: 19s; }
.glow.g3 { width: 300px; height: 300px; left: 30%; bottom: 8%; animation-duration: 22s; }
@keyframes drift { from { transform: translate(-20px,-14px);} to { transform: translate(22px,16px);} }
@media (prefers-reduced-motion: reduce) { .glow { animation: none; } }

/* ── Каркас приложения ── */
.app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto;
  min-height: 100dvh; display: flex; flex-direction: column; padding: 0 16px 92px; }

.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 28px 4px 14px; gap: 12px; }
.topbar h1 { color: #fff; font-size: 30px; font-weight: 700; margin: 0;
  text-shadow: 0 2px 8px rgba(44,62,80,0.18); }
.subtitle { color: rgba(255,255,255,0.92); margin: -6px 4px 16px; font-size: 15px; }

.account-chip { display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.30); color: #fff; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 12px; font-size: 13px; max-width: 60%; }
.account-chip:hover { background: rgba(255,255,255,0.42); }
.account-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #7CFFB2; flex: none; }
.account-chip.out .dot { background: #ffd27c; }
.account-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Карточки / общий вид ── */
.card { background: var(--glass); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.5); }

.views { flex: 1; }
.view { display: none; animation: fadeUp .45s var(--ease) both; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none;} }

/* ── Привычки ── */
.habit { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; margin-bottom: 12px; }
.habit-row { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.habit.done { background: var(--glass-done); }
.habit .name { font-size: 17px; transition: color .4s var(--ease); }
.habit.done .name { color: var(--text-dim); text-decoration: line-through; text-decoration-thickness: 2px; }

.check { width: 26px; height: 26px; border-radius: 9px; flex: none; cursor: pointer;
  border: 2px solid rgba(44,62,80,0.35); background: rgba(255,255,255,0.6);
  display: grid; place-items: center; transition: all .35s var(--ease); }
.check.on { background: var(--grad-mid); border-color: var(--grad-mid); }
.check svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 3; fill: none;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5);
  transition: all .3s var(--ease); }
.check.on svg { opacity: 1; transform: none; }

.sub-controls { display: flex; align-items: center; gap: 12px; padding-left: 40px; }
.round-btn { width: 36px; height: 36px; border-radius: 10px; border: none; cursor: pointer;
  background: rgba(255,255,255,0.65); color: var(--text); font-size: 20px; line-height: 1;
  display: grid; place-items: center; }
.round-btn:hover { background: rgba(255,255,255,0.85); }
.round-btn:active { transform: scale(0.94); }
.counter { min-width: 64px; text-align: center; font-size: 17px; }
.counter.full { color: var(--grad-mid); font-weight: 600; }
.timer-val { font-variant-numeric: tabular-nums; font-size: 17px; }

/* ── Записки ── */
.note-editor { padding: 16px; background: var(--paper); min-height: 320px; display: flex; flex-direction: column; }
.note-created { align-self: flex-end; color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.note-editor textarea { flex: 1; min-height: 260px; resize: none; border: none; outline: none;
  background: transparent; font-size: 16px; line-height: 1.6; color: var(--text);
  font-family: inherit; }
.note-counter { text-align: right; color: var(--text-dim); font-size: 12px; margin-top: 8px; }

.note-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px; }
.note-item .mark { width: 12px; height: 12px; border-radius: 50%; flex: none; cursor: pointer;
  border: 1.5px solid rgba(44,62,80,0.25); }
.note-item .note-text { flex: 1; overflow: hidden; }
.note-item .note-text .preview { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item.struck .preview { text-decoration: line-through; color: var(--text-dim); }
.note-item .when { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-dim); padding: 6px; border-radius: 8px; font-size: 16px; }
.icon-btn:hover { background: rgba(0,0,0,0.06); color: var(--text); }

/* ── Кнопки / формы ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; border-radius: 12px; padding: 13px 18px; font-size: 15px;
  font-weight: 600; transition: transform .15s, filter .15s; width: 100%; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: rgba(255,255,255,0.7); color: var(--text); }
.btn-danger { background: #e2574c; color: #fff; }
.btn-google { background: #fff; color: #3c4043; box-shadow: var(--shadow); }
.btn-row { display: flex; gap: 10px; }

.section-title { color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; margin: 22px 6px 10px; opacity: .92; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; }
.row + .row { border-top: 1px solid rgba(44,62,80,0.08); }
.row .label { font-size: 15px; }
.row .value { color: var(--text-dim); font-size: 15px; }
.seg { display: inline-flex; background: rgba(255,255,255,0.5); border-radius: 10px; padding: 3px; }
.seg button { border: none; background: none; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-dim); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
select, input[type="time"] { font-family: inherit; font-size: 15px; border: 1px solid rgba(44,62,80,0.2);
  border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--text); }

/* ── Об авторе ── */
.about-logo { width: 96px; height: 96px; margin: 8px auto 4px; display: block;
  background: #fff; border-radius: 24px; padding: 14px; box-shadow: var(--shadow); }
.about-card { padding: 20px; text-align: center; }
.about-card h2 { margin: 6px 0; }
.about-card p { color: var(--text); line-height: 1.6; }
.about-links { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.about-links a { text-decoration: none; }
.support-title { margin: 22px 0 4px; font-weight: 700; color: var(--text); }

/* ── Нижняя навигация ── */
.nav { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: 14px;
  width: min(540px, calc(100% - 24px)); display: flex; justify-content: space-around;
  background: var(--glass-strong); border-radius: 18px; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.6); padding: 8px 6px; }
.nav button { flex: 1; border: none; background: none; cursor: pointer; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; padding: 4px; border-radius: 12px; }
.nav button .ico { font-size: 20px; line-height: 1; }
.nav button.on { color: var(--orange); }
.nav button.on .ico { transform: translateY(-1px); }

/* ── Модальные окна / тосты ── */
.modal-back { position: fixed; inset: 0; background: rgba(44,62,80,0.4); z-index: 20;
  display: grid; place-items: center; padding: 20px; animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0;} to { opacity: 1;} }
.modal { background: #fff; border-radius: var(--radius); padding: 22px; max-width: 380px; width: 100%; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 10px; }
.modal p { color: var(--text-dim); line-height: 1.5; }
.modal .btn-row { margin-top: 18px; }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  z-index: 30; box-shadow: var(--shadow); opacity: 0; transition: opacity .25s, transform .25s;
  max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.empty { text-align: center; color: rgba(255,255,255,0.9); padding: 40px 0; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,0.5); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg);} }

/* ── Статья политики конфиденциальности ── */
.article { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.article .card { padding: 28px; }
.article h1 { color: #fff; text-shadow: 0 2px 8px rgba(44,62,80,0.18); }
.article h2 { color: var(--text); margin-top: 26px; }
.article p, .article li { color: var(--text); line-height: 1.7; }
.article a { color: var(--orange); }
.back-link { display: inline-block; color: #fff; text-decoration: none; margin-bottom: 14px; font-weight: 600; }
