/* ─────────────────────────────────────────────────────────────
   Дневник — стили
   ───────────────────────────────────────────────────────────── */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --bg: #f8f7f4;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --text: #16150f;
  --muted: #7c7871;
  --faint: #a5a19a;
  --line: #e5e1d9;
  --line-soft: #eeebe4;
  --accent: #3a5a7d;
  --accent-text: #ffffff;
  --accent-soft: #e8eff5;
  --danger: #ad3d2c;
  --danger-soft: #fbeae7;

  /* шкала интенсивности: спокойное → жгучее */
  --calm: #5580ab;
  --hot: #c25c3c;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(22 21 15 / 0.05), 0 10px 30px -14px rgb(22 21 15 / 0.18);
  --shadow-lg: 0 16px 56px -14px rgb(22 21 15 / 0.32);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1c1c1a;
    --surface-2: #262523;
    --text: #f1eee8;
    --muted: #97928a;
    --faint: #706c66;
    --line: #302f2c;
    --line-soft: #262523;
    --accent: #9ab9db;
    --accent-text: #0f161d;
    --accent-soft: #1f2933;
    --danger: #e58370;
    --danger-soft: #2e1e1a;

    --calm: #7099c0;
    --hot: #d87d5c;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 10px 30px -14px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 16px 56px -14px rgb(0 0 0 / 0.8);
  }
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button { font: inherit; color: inherit; }
svg { width: 100%; height: 100%; display: block; }
::selection { background: var(--accent-soft); }

/* ─── Экраны ─────────────────────────────────────────────────── */

.app { height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

.app[data-mode="owner"] .share-only { display: none !important; }
.app[data-mode="share"] .owner-only { display: none !important; }

/* ─── Вход ───────────────────────────────────────────────────── */

.screen-login { align-items: center; justify-content: center; padding: 24px; }

.login-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-mark { width: 44px; height: 44px; color: var(--accent); margin: 0 auto; }

.login-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.form-error { margin: 0; font-size: 14px; color: var(--danger); text-align: center; }

/* ─── Поля ───────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 8px; }

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}

.field-hint { font-size: 13.5px; color: var(--muted); margin: -4px 0 2px; line-height: 1.4; }

input[type="password"],
input[type="text"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* меньше 16px — iOS зумит страницу при фокусе */
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

textarea { resize: none; overflow: hidden; min-height: 50px; }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder, textarea::placeholder { color: var(--faint); }

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.check input { width: 19px; height: 19px; accent-color: var(--accent); margin: 0; flex: none; }

/* ─── Кнопки ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.06s;
}

.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-block { width: 100%; }

.btn-primary { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger-soft); }

.btn-sm { min-height: 42px; padding: 0 14px; font-size: 14.5px; }
.btn svg { width: 18px; height: 18px; flex: none; }

.icon-btn {
  width: 40px; height: 40px;
  padding: 9px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 22px; height: 22px; }

.link-btn {
  background: none;
  border: none;
  padding: 6px 2px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { opacity: 0.3; pointer-events: none; }

/* ─── Верхняя панель ─────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: max(8px, env(safe-area-inset-top)) 16px 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
}

.brand { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -0.025em; }

.topbar-actions { display: flex; align-items: center; gap: 2px; }

#btn-view .i-grid { display: none; }
.app[data-view="grid"] #btn-view .i-list { display: none; }
.app[data-view="grid"] #btn-view .i-grid { display: block; }

.search { position: relative; margin: 6px 0 12px; }

.search input {
  padding-left: 42px;
  padding-right: 42px;
  background: var(--surface-2);
  border-color: transparent;
}

.search input:focus { background: var(--surface); }
.search input::-webkit-search-cancel-button { display: none; }

.search-icon {
  position: absolute;
  left: 13px; top: 50%;
  width: 19px; height: 19px;
  margin-top: -9.5px;
  color: var(--faint);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 7px; top: 50%;
  width: 32px; height: 32px;
  margin-top: -16px;
  padding: 7px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 16px 12px;
  margin: 0 -16px;
  scroll-padding: 16px;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:hover { border-color: var(--muted); color: var(--text); }

.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.chip-sep { flex: none; width: 1px; margin: 5px 4px; background: var(--line); }

.share-banner {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.share-banner::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--calm);
  flex: none;
}

.share-banner.is-soon::before { background: var(--hot); }

/* ─── Список записей ─────────────────────────────────────────── */

.list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(110px + env(safe-area-inset-bottom));
}

.list-inner { max-width: 700px; margin: 0 auto; }
.app[data-view="grid"] .list-inner { max-width: 1200px; }

.day { margin: 0 0 26px; }

.day-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 2px 10px;
  background: var(--bg);
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.day-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}

.day-items { display: flex; flex-direction: column; gap: 10px; }

.app[data-view="grid"] .day-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.entry {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.18s, transform 0.08s;
}

.entry:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
.entry:active { transform: scale(0.995); }

.entry-top { display: flex; align-items: baseline; gap: 9px; margin-bottom: 7px; }

.entry-time {
  flex: none;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.entry-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-thought {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-thought::before { content: "«"; color: var(--faint); }
.entry-thought::after { content: "»"; color: var(--faint); }

.entry-emos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.entry-more { font-size: 12.5px; color: var(--faint); font-weight: 500; }

/* ─── Эмоция-плашка ──────────────────────────────────────────── */

.emo {
  --v: 0;
  --c: var(--calm);
  --c: color-mix(in oklab, var(--calm), var(--hot) calc(var(--v) * 10%));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 11px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.45;
  position: relative;
  overflow: hidden;
}

.emo::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--c);
}

.emo-name { padding-left: 2px; }
.emo-score { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c); }

/* ─── Полоски достоверности / выгодности ─────────────────────── */

.meters {
  display: flex;
  gap: 16px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.meter { flex: 1; min-width: 0; }

.meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.meter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }

.meter-bar { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }

.meter-fill {
  --p: 0;
  height: 100%;
  width: calc(var(--p) * 1%);
  border-radius: 999px;
  background: var(--accent);
}

/* ─── Пустой экран ───────────────────────────────────────────── */

.empty { padding: 80px 24px; text-align: center; color: var(--faint); font-size: 15.5px; }

/* ─── FAB ────────────────────────────────────────────────────── */

.fab {
  position: fixed;
  right: max(16px, calc(50% - 350px));
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 30;
  width: 58px; height: 58px;
  padding: 15px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 19px;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}

.fab:hover { box-shadow: var(--shadow-lg); }
.fab:active { transform: scale(0.93); }

/* ─── Оверлеи ────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgb(18 17 14 / 0.45);
  animation: fade 0.18s ease;
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

.sheet {
  position: relative;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  animation: rise 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet-grip {
  width: 36px; height: 4px;
  margin: 9px auto 0;
  border-radius: 999px;
  background: var(--line);
  flex: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  flex: none;
}

.sheet-title { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(22px + env(safe-area-inset-bottom));
}

.sheet-foot {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.sheet-foot .btn { flex: 1; }
.sheet-foot .btn-danger { flex: none; width: 54px; padding: 0; }

@media (min-width: 640px) {
  .overlay { justify-content: center; align-items: center; padding: 24px; }
  .sheet { width: 100%; max-width: 580px; max-height: 86dvh; border-radius: 22px; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 18px; }
  .sheet-body { padding-bottom: 22px; }
  .sheet-foot { padding-bottom: 14px; }
}

/* ─── Просмотр записи ────────────────────────────────────────── */

.rec-meta { font-size: 14px; color: var(--muted); margin: 0 0 20px; }

.rec-section { margin-bottom: 22px; }

.rec-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.rec-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rec-quote {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rec-list { margin: 0; padding: 0; list-style: none; }

.rec-list li {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.rec-list li:last-child { border-bottom: none; }

.rec-list .num {
  flex: none;
  width: 18px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  padding-top: 1px;
}

.rec-emos { display: flex; flex-direction: column; gap: 11px; }

.rec-emo {
  --v: 0;
  --c: var(--calm);
  --c: color-mix(in oklab, var(--calm), var(--hot) calc(var(--v) * 10%));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  align-items: baseline;
}

.rec-emo-name { font-size: 16px; overflow-wrap: anywhere; }

.rec-emo-score {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c);
}

.rec-emo-bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.rec-emo-bar i {
  display: block;
  height: 100%;
  width: calc(var(--v) * 10%);
  border-radius: 999px;
  background: var(--c);
}

/* ─── Мастер создания ────────────────────────────────────────── */

.wizard {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: fade 0.16s ease;
}

.wiz-head {
  flex: none;
  padding: max(8px, env(safe-area-inset-top)) 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.wiz-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 50px;
}

.wiz-step-of {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.wiz-progress { display: flex; gap: 4px; padding: 0 2px 12px; }

.wiz-progress button {
  flex: 1;
  min-width: 0;
  padding: 7px 0;
  border: none;
  background: none;
  cursor: pointer;
}

.wiz-progress button::after {
  content: "";
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.2s;
}

.wiz-progress button[data-filled="1"]::after { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.wiz-progress button[aria-current="step"]::after { background: var(--accent); height: 4px; margin-top: -0.5px; }

.wiz-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 26px 16px 28px;
}

.wiz-inner { max-width: 580px; margin: 0 auto; }

.wiz-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.wiz-sub { margin: 0 0 26px; font-size: 15px; color: var(--muted); line-height: 1.45; }
.wiz-sub:empty { margin-bottom: 26px; }

.wiz-fields { display: flex; flex-direction: column; gap: 22px; }

.wiz-foot {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.wiz-foot .btn-ghost { flex: none; padding: 0 22px; }
.wiz-foot .btn-primary { flex: 1; }

/* ─── Шкала 0–10 ─────────────────────────────────────────────── */

.scale {
  --v: 0;
  --c: var(--calm);
  --c: color-mix(in oklab, var(--calm), var(--hot) calc(var(--v) * 10%));
  display: flex;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  overflow: hidden;
}

.scale button {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: none;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.scale button:last-child { border-right: none; }
.scale button.on { background: var(--c); color: #fff; border-right-color: color-mix(in srgb, #000 8%, transparent); }
.scale button.sel { font-weight: 800; font-size: 15px; }
.scale button.sel:not(.on) { color: var(--text); background: var(--surface-2); }

/* ─── Ползунок процентов ─────────────────────────────────────── */

.pct-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

.pct-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  height: 34px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  margin-top: -11.5px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow);
}

input[type="range"]::-moz-range-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow);
}

/* ─── Повторяющиеся пункты ───────────────────────────────────── */

.items { display: flex; flex-direction: column; gap: 14px; }

.item {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.item-top { display: flex; align-items: center; gap: 9px; }

.item-top .num {
  flex: none;
  width: 20px; height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.item-top input {
  border: none;
  background: transparent;
  padding: 5px 0;
  font-size: 16px;
  font-weight: 500;
}

.item-top input:focus { box-shadow: none; }

.item-del {
  flex: none;
  width: 32px; height: 32px;
  padding: 8px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.item-del:hover { background: var(--danger-soft); color: var(--danger); }

.item-plain {
  flex-direction: row;
  align-items: flex-start;
  gap: 9px;
  padding: 0;
  border: none;
  background: none;
}

.item-plain .num {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 15px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.item-plain .item-del { margin-top: 9px; }

.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 48px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.add-btn:disabled { opacity: 0.35; pointer-events: none; }
.add-btn svg { width: 17px; height: 17px; }

/* ─── Ссылки для психолога ───────────────────────────────────── */

.share-block {
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--accent-soft);
  margin-bottom: 16px;
}

.share-url {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.share-btns { display: flex; gap: 8px; }
.share-btns .btn { flex: 1; }

.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.share-row:last-child { border-bottom: none; }
.share-info { min-width: 0; }
.share-left { font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.share-meta {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-actions { display: flex; gap: 2px; flex: none; }

.sect-title {
  margin: 24px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.menu-list { display: flex; flex-direction: column; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 2px;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.15s;
}

.menu-item:last-child { border-bottom: none; }
.menu-item:hover { color: var(--accent); }
.menu-item svg { width: 21px; height: 21px; flex: none; color: var(--muted); }
.menu-item.is-danger { color: var(--danger); }
.menu-item.is-danger svg { color: var(--danger); }

/* ─── Развёрнутый просмотр (для психолога) ───────────────────── */

.app[data-expanded="1"] .entry-brief { display: none; }
.entry-full { display: none; }
.app[data-expanded="1"] .entry-full { display: block; }
.app[data-expanded="1"] .entry { cursor: default; padding: 20px; }
.app[data-expanded="1"] .entry:hover { border-color: var(--line); box-shadow: none; }
.app[data-expanded="1"] .entry:active { transform: none; }
.app[data-expanded="1"] .day-items { display: flex; flex-direction: column; gap: 12px; }

.entry-full > .entry-top { margin-bottom: 18px; }
.entry-full .rec-section:last-child { margin-bottom: 0; }

/* ─── Тост ───────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom));
  z-index: 100;
  transform: translateX(-50%);
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: rise 0.2s ease;
}

/* ─── Печать ─────────────────────────────────────────────────── */

@media print {
  .topbar, .fab, .sheet-foot, .toast { display: none !important; }

  body, .app, .list { height: auto; overflow: visible; display: block; }
  .list { padding: 0; }
  .list-inner { max-width: none; }

  .entry-brief { display: none !important; }
  .entry-full { display: block !important; }

  .entry {
    border: none;
    border-top: 1px solid #ccc;
    border-radius: 0;
    padding: 12pt 0;
    break-inside: avoid;
  }

  .day-head { position: static; break-after: avoid; }
  .rec-quote { background: none; border-left: 2px solid #999; }
  .day-items { display: block !important; }
}
