  <style>
  
  /* ===== LUNAWOLF design tokens (1.1) ===== */
:root {
  --lw-primary: #f59e0b;
  --lw-primary-dark: #d97706;
  --lw-primary-soft: #fef3c7;
  --lw-primary-border: rgba(251, 191, 36, 0.35);

  --lw-text: #111827;
  --lw-text-muted: #6b7280;
  --lw-text-soft: #9ca3af;

  --lw-surface: rgba(255, 255, 255, 0.55);
  --lw-surface-strong: rgba(255, 255, 255, 0.78);
  --lw-surface-inner: rgba(255, 255, 255, 0.4);
  --lw-border: rgba(251, 191, 36, 0.28);
  --lw-border-soft: rgba(17, 24, 39, 0.08);

  --lw-shadow: 0 8px 28px rgba(17, 24, 39, 0.08);
  --lw-shadow-lg: 0 16px 40px rgba(17, 24, 39, 0.12);

  --lw-radius-sm: 8px;
  --lw-radius-md: 12px;
  --lw-radius-lg: 18px;
  --lw-radius-xl: 22px;
  --lw-radius-pill: 9999px;

  --lw-blur: 14px;
  --lw-space-1: 4px;
  --lw-space-2: 8px;
  --lw-space-3: 12px;
  --lw-space-4: 16px;
  --lw-space-5: 20px;
  --lw-space-6: 24px;
  --lw-space-7: 32px;
  --lw-space-8: 40px;

  --lw-success: #10b981;
  --lw-warning: #f97316;
  --lw-danger: #ef4444;
  --lw-info: #3b82f6;
  --lw-premium: #f59e0b;
}

/* ===== Glass surfaces ===== */
.lw-glass {
  background: var(--lw-surface);
  backdrop-filter: blur(var(--lw-blur));
  -webkit-backdrop-filter: blur(var(--lw-blur));
  border: 1px solid var(--lw-border);
  border-radius: var(--lw-radius-lg);
  box-shadow: var(--lw-shadow);
}

.lw-glass-strong {
  background: var(--lw-surface-strong);
  backdrop-filter: blur(calc(var(--lw-blur) + 4px));
  -webkit-backdrop-filter: blur(calc(var(--lw-blur) + 4px));
  border: 1px solid var(--lw-primary-border);
  border-radius: var(--lw-radius-lg);
  box-shadow: var(--lw-shadow);
}

.lw-glass-inner {
  background: var(--lw-surface-inner);
  border: 1px solid var(--lw-border-soft);
  border-radius: var(--lw-radius-md);
}

/* Карточки журнала → единый glass (мягко, без ломки mobile) */
.j-card {
  background: var(--lw-surface-strong);
  backdrop-filter: blur(var(--lw-blur));
  -webkit-backdrop-filter: blur(var(--lw-blur));
  border: 1px solid var(--lw-border);
  border-radius: var(--lw-radius-lg);
  box-shadow: var(--lw-shadow);
  margin-bottom: var(--lw-space-4, 16px);
}

.j-card:last-child {
  margin-bottom: 0;
}

/* Семантические badges (заготовка под 1.4) */
.lw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--lw-radius-pill);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
  border: 1px solid transparent;
}
.lw-badge--premium {
  background: var(--lw-primary-soft);
  color: var(--lw-primary-dark);
  border-color: var(--lw-primary-border);
}
.lw-badge--success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}
.lw-badge--warning {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.25);
}
.lw-badge--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
}
.lw-badge--info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.25);
}
    @font-face {
      font-family: 'Maybug';
      src: url('/fonts/MAYBUG.woff2') format('woff2');
      font-display: swap;
    }
    @font-face {
      font-family: 'Cornerita';
      src: url('/fonts/Cornerita.woff2') format('woff2');
      font-display: swap;
    }
    * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
    .Maybug {
      font-family: 'Maybug', system-ui, sans-serif !important;
      text-rendering: geometricPrecision;
      -webkit-font-smoothing: antialiased;
    }
    body {
      font-family: 'Cornerita', system-ui, -apple-system, sans-serif;
      color: #1f2937;
      margin: 0;
      min-height: 100dvh;
      background-color: #fff7ed;
      background-image: url('/images/fon.webp');
      background-size: cover;
      background-position: center;
      background-attachment: fixed;
    }
    .wrap {
      max-width: 28rem;
      margin: 0 auto;
      padding: 1.15rem 1rem 5rem;
    }
    .j-card {
      background: rgba(255, 255, 255, 0.55);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid rgba(251, 191, 36, 0.28);
      border-radius: 1.35rem;
      box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.12);
      margin-bottom: 0.85rem;
      overflow: hidden;
    }
    .hero-photo {
      width: 100%;
      aspect-ratio: 1 / 1;
      object-fit: cover;
      display: block;
      background: rgba(255,255,255,0.6);
    }
    .hero-body { padding: 1.1rem 1.15rem 1.2rem; text-align: center; }
    .pet-name {
      font-family: 'Maybug', system-ui, sans-serif;
      font-size: clamp(1.5rem, 5vw, 1.85rem);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      color: #111;
      margin: 0 0 0.3rem;
      line-height: 1.15;
    }
    .meta { font-size: 0.95rem; color: #4b5563; line-height: 1.4; }
    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
      justify-content: center;
      margin-top: 0.75rem;
    }
    .chip {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      font-size: 0.75rem;
      background: rgba(255,255,255,0.7);
      border: 1px solid rgba(0,0,0,0.06);
      border-radius: 9999px;
      padding: 0.2rem 0.65rem;
      color: #4b5563;
    }
    .tag-on {
      background: rgba(16,185,129,0.14);
      color: #047857;
      border-color: rgba(16,185,129,0.28);
      font-weight: 600;
    }
    .tag-off {
      background: rgba(107,114,128,0.1);
      color: #6b7280;
      border-color: rgba(107,114,128,0.18);
    }
    .sec-title {
      font-family: 'Maybug', system-ui, sans-serif;
      font-size: 1.05rem;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      color: #111;
      margin: 0 0 0.75rem;
    }
    .sec-pad { padding: 1.1rem 1.15rem; }
    .info-row {
      display: flex;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.45rem 0;
      border-bottom: 1px solid rgba(251,191,36,0.15);
      font-size: 0.92rem;
    }
    .info-row:last-child { border-bottom: none; }
    .info-k { color: #9ca3af; flex-shrink: 0; }
    .info-v { color: #111; font-weight: 600; text-align: right; word-break: break-word; }

    /* Профиль — компактнее */
    #profile .j-fold-head {
      padding: 0.55rem 0.85rem 0.15rem;
    }
    #profile .j-fold-head .sec-title {
      margin: 0;
      font-size: 0.95rem;
    }
    #profile .sec-pad {
      padding: 0.05rem 0.85rem 0.55rem;
    }
    #profile .info-row {
      padding: 0.16rem 0;
      font-size: 0.84rem;
      line-height: 1.25;
      gap: 0.4rem;
    }
    #profile .info-k {
      font-size: 0.78rem;
      line-height: 1.25;
    }
    #profile .info-v {
      line-height: 1.25;
      font-size: 0.84rem;
    }

    /* Управление — компактнее */
    #manage .j-fold-head {
      padding: 0.55rem 0.85rem 0.1rem;
    }
    #manage .j-fold-head .sec-title {
      margin: 0;
      font-size: 0.95rem;
    }
    #manage .sec-pad {
      padding: 0.15rem 0.85rem 0.7rem; /* меньше отступ от заголовка */
    }
    #manage .public-details {
      margin: 0 0 0.55rem;
    }
    #manage .public-details > summary {
      padding: 0.55rem 0.75rem;
    }
    #manage .public-details .public-box,
    #manage .public-box {
      padding: 0.55rem 0.75rem 0.65rem;
      margin-bottom: 0.35rem;
    }
    #manage .actions {
      gap: 0.4rem;
      margin-top: 0.45rem;
    }
    #manage .j-btn {
      min-height: 40px;
      font-size: 13.5px;
      padding: 0 0.75rem;
      border-radius: 11px;
      width: auto;           /* чуть уже */
      min-width: 0;
      max-width: 100%;
    }
    #manage .j-btn-primary,
    #manage .j-btn-ghost,
    #manage .j-btn-danger {
      width: 100%;           /* в сетке 2 колонки остаются на всю ячейку */
    }
    #manage .actions-1 .j-btn {
      max-width: 16rem;      /* одиночные кнопки уже */
      margin-left: auto;
      margin-right: auto;
      display: flex;
    }
    #manage .j-btn-danger {
      min-height: 38px;
      font-size: 12.5px;
    }
    #manage .manage-help-row {
      margin-top: 0.75rem !important;
      padding-top: 0.65rem !important;
    }
    #manage .manage-help-row .j-btn {
      max-width: 16rem;
      margin: 0 auto;
      min-height: 38px;
      font-size: 13px;
    }
    .desc {
      font-size: 0.95rem;
      color: #374151;
      line-height: 1.5;
      white-space: pre-wrap;
      margin: 0;
    }
    .j-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.35rem;
      min-height: 46px;
      border-radius: 13px;
      font-size: 15px;
      font-weight: 600;
      font-family: inherit;
      border: none;
      cursor: pointer;
      text-decoration: none;
      padding: 0 1rem;
      transition: transform 0.15s ease;
      -webkit-appearance: none;
    }
    .j-btn:active { transform: scale(0.97); }
    .j-btn-primary {
      background: linear-gradient(135deg, #fbbf24, #f59e0b);
      color: #111;
      box-shadow: 0 8px 18px -6px rgba(245,158,11,0.4);
      width: 100%;
    }
    .j-btn-ghost {
      background: rgba(255,255,255,0.85);
      border: 1.5px solid rgba(0,0,0,0.08);
      color: #374151;
      width: 100%;
    }
    .j-btn-danger {
      background: rgba(254,226,226,0.95);
      color: #b91c1c;
      border: 1px solid rgba(252,165,165,0.5);
      font-size: 13px;
      min-height: 40px;
      width: 100%;
    }
    .actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      margin-top: 0.85rem;
    }
    .actions-1 { grid-template-columns: 1fr; }
    .entry {
      padding: 1rem 1.1rem;
      border-bottom: 1px solid rgba(251,191,36,0.18);
    }
    .entry:last-child { border-bottom: none; }
    .entry-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 0.5rem;
      margin-bottom: 0.35rem;
    }
    .entry-type {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: #b45309;
    }
    .entry-date {
      font-size: 0.75rem;
      color: #9ca3af;
      white-space: nowrap;
    }
    .entry-title {
      font-weight: 700;
      font-size: 1rem;
      color: #111;
      margin: 0 0 0.25rem;
    }
    .entry-body {
      font-size: 0.92rem;
      color: #374151;
      line-height: 1.45;
      white-space: pre-wrap;
      margin: 0;
    }
    .entry-photos {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.35rem;
      margin-top: 0.65rem;
    }
    .entry-photos img {
      width: 100%;
      aspect-ratio: 1;
      object-fit: cover;
      border-radius: 0.65rem;
      border: 1px solid rgba(251,191,36,0.25);
      background: #fff;
    }
    .label {
      display: block;
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #6b7280;
      margin-bottom: 0.3rem;
    }
    .tg-input {
      width: 100%;
      height: 48px;
      padding: 0 14px;
      border-radius: 12px;
      border: 1px solid rgba(251,191,36,0.35);
      background: rgba(255,255,255,0.85);
      font-size: 16px;
      color: #111827;
      outline: none;
      font-family: inherit;
      -webkit-appearance: none;
    }
    .tg-input:focus {
      border-color: #fbbf24;
      box-shadow: 0 0 0 3px rgba(245,158,11,0.2);
      background: #fff;
    }
    textarea.tg-input {
      height: auto;
      min-height: 96px;
      padding: 12px 14px;
      resize: vertical;
      line-height: 1.4;
    }
    .field { margin-bottom: 0.75rem; }
    .form-grid-2 { display: block; }
    .form-grid-2 .field { margin-bottom: 0.75rem; }
    .type-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
      margin-bottom: 0.75rem;
    }
    .type-chip {
      border-radius: 9999px;
      border: 1px solid rgba(0,0,0,0.08);
      background: rgba(255,255,255,0.85);
      font-size: 12px;
      font-weight: 600;
      font-family: inherit;
      padding: 0.35rem 0.65rem;
      cursor: pointer;
      color: #374151;
    }
    .type-chip.selected {
      background: #fef3c7;
      border-color: #f59e0b;
      color: #92400e;
    }
    .flash {
      border-radius: 1rem;
      padding: 0.85rem 1rem;
      margin-bottom: 0.85rem;
      font-size: 0.9rem;
    }
    .flash-success {
      background: rgba(209,250,229,0.9);
      border: 1px solid rgba(52,211,153,0.5);
      color: #065f46;
    }
    .flash-error {
      background: rgba(254,226,226,0.9);
      border: 1px solid rgba(252,165,165,0.55);
      color: #991b1b;
    }
    .empty-j {
      text-align: center;
      padding: 1.5rem 1rem;
      color: #6b7280;
      font-size: 0.95rem;
      line-height: 1.45;
    }
    .nav-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 0.85rem;
      gap: 0.5rem;
    }
    .back-link {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      font-size: 0.9rem;
      font-weight: 600;
      color: #92400e;
      text-decoration: none;
      background: rgba(255,255,255,0.7);
      border: 1px solid rgba(251,191,36,0.35);
      border-radius: 9999px;
      padding: 0.4rem 0.85rem;
    }
    .file-hint {
      font-size: 0.75rem;
      color: #9ca3af;
      margin-top: 0.3rem;
    }
    
.pet-nav-btn {
  min-width: 0;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
  font-size: 0.82rem;
}
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.entry-edit-form {
  display: none;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(251,191,36,0.2);
}
.entry-edit-form.open {
  display: block;
}
.j-btn-sm {
  width: auto;
  min-height: 34px;
  padding: 0 0.75rem;
  font-size: 12px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 2px solid rgba(251,191,36,0.25);
  background: #fff;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item.is-cover {
  border-color: #f59e0b;
  border-width: 3px;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4), 0 6px 16px -6px rgba(180, 83, 9, 0.35);
}
.gallery-actions {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 0.2rem;
  padding: 0.25rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
}
.gallery-actions button,
.gallery-actions .btn-cover-label {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  padding: 0.25rem 0.2rem;
  cursor: pointer;
  font-family: inherit;
}
.gallery-actions .btn-cover {
  background: rgba(255, 255, 255, 0.92);
  color: #78716c;
  border: 1px solid rgba(251, 191, 36, 0.45);
}
.gallery-actions .btn-cover:hover {
  background: #fef3c7;
  color: #92400e;
}
.gallery-actions .btn-del { background: rgba(254,226,226,0.95); color: #b91c1c; }
.gallery-actions .btn-cover-label {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  text-align: center;
  cursor: default;
  box-shadow: 0 1px 4px rgba(180, 83, 9, 0.35);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
.gallery-item.is-cover .gallery-actions .btn-cover-label {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
}

/* Lightbox галереи */
.j-lb {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, background 0.28s ease, visibility 0.28s;
}
.j-lb.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.88);
}
.j-lb__inner {
  position: relative;
  max-width: min(92vw, 920px);
  max-height: 88vh;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.j-lb.is-open .j-lb__inner {
  transform: scale(1);
  opacity: 1;
}
.j-lb__img {
  display: block;
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  background: #0f172a;
}
.j-lb__close {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 9999px;
  background: rgba(255,255,255,0.95);
  color: #111;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.j-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 9999px;
  background: rgba(255,255,255,0.92);
  color: #111;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.j-lb__nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.j-lb__prev { left: 0.5rem; }
.j-lb__next { right: 0.5rem; }
.j-lb__counter {
  position: absolute;
  left: 50%;
  bottom: -1.75rem;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.gallery-item .j-lb-open {
  display: block;
  cursor: zoom-in;
  border: none;
  padding: 0;
  background: none;
  width: 100%;
  height: 100%;
}
.gallery-item .j-lb-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
@media (max-width: 640px) {
  .j-lb__nav { width: 2.15rem; height: 2.15rem; font-size: 1.15rem; }
  .j-lb__prev { left: 0.25rem; }
  .j-lb__next { right: 0.25rem; }
}

.entry-photo-wrap { position: relative; }
.entry-photo-del {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 9999px;
  background: rgba(185,28,28,0.9);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.public-details {
  margin: 0 0 0.85rem;
  border-radius: 1rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(255, 251, 235, 0.45);
  overflow: hidden;
}
.public-details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  font-family: Maybug, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92400e;
  user-select: none;
}
.public-details > summary::-webkit-details-marker {
  display: none;
}
.public-details > summary::after {
  content: '▾';
  font-size: 0.85rem;
  transition: transform 0.2s ease;
  color: #b45309;
}
.public-details[open] > summary::after {
  transform: rotate(180deg);
}
.public-details .public-box {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  border-top: 1px solid rgba(251, 191, 36, 0.25);
  padding: 0.75rem 0.9rem 0.9rem;
}
.public-box {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 1rem;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.5rem;
}
.public-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.public-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #111;
  margin: 0;
}
.public-hint {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 0.25rem 0 0;
  line-height: 1.35;
}
.public-link-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.65rem;
  align-items: stretch;
}
.public-link-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 11px;
  border: 1px solid rgba(251,191,36,0.35);
  background: rgba(255,255,255,0.9);
  font-size: 12px;
  color: #374151;
  font-family: inherit;
}
.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 9999px;
  cursor: pointer;
  transition: 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.tpl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 0.85rem;
}
.tpl-chip {
  border-radius: 9999px;
  border: 1px solid rgba(251,191,36,0.4);
  background: rgba(255,251,235,0.85);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: #92400e;
}
.load-more-wrap {
  padding: 0.85rem 1.1rem 1.1rem;
  text-align: center;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.65rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 9999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.85);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  padding: 0.3rem 0.6rem;
  color: #4b5563;
}
.filter-chip.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.pp-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 1rem;
}
.pp-overlay[hidden] { display: none !important; }
.pp-sheet {
  width: 100%; max-width: 28rem;
  background: rgba(255,255,255,0.97);
  border-radius: 1.35rem 1.35rem 1rem 1rem;
  border: 1px solid rgba(251,191,36,0.35);
  padding: 1.1rem 1.15rem 1.25rem;
  max-height: 85dvh; overflow-y: auto;
}
.pp-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.35rem;
}
.pp-close {
  border: none; background: transparent; font-size: 1.5rem;
  line-height: 1; cursor: pointer; color: #6b7280; padding: 0 0.25rem;
}
.pp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem;
}
.pp-tile {
  font-family: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 0.75rem 0.5rem; border-radius: 0.85rem;
  border: 1px solid rgba(251,191,36,0.3);
  background: rgba(255,251,235,0.95); color: #111;
  cursor: pointer; text-align: center;
}
.pp-tile.pp-locked {
  background: rgba(243,244,246,0.95); color: #6b7280;
  border-color: rgba(0,0,0,0.08);
}
.pp-body {
  margin-top: 0.85rem; padding: 0.85rem;
  border-radius: 0.85rem;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(251,191,36,0.22);
  font-size: 0.9rem; color: #374151; line-height: 1.45;
}
.pp-body[hidden] { display: none !important; }



/* ===== Activity feed ===== */
.act-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 0.2rem 0.25rem 0.55rem;
  margin: 0 -0.35rem 0.25rem;
  scrollbar-width: thin;
  touch-action: pan-x;
}
.act-scroll::-webkit-scrollbar {
  height: 4px;
}
.act-scroll::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.45);
  border-radius: 9999px;
}
.act-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  text-decoration: none;
  border-radius: 1rem;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.85);
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  color: #4b5563;
  text-align: center;
  min-width: 4.8rem;
  max-width: 6.5rem;
  line-height: 1.25;
  white-space: nowrap;
}
.act-chip.active {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #92400e;
  box-shadow: 0 4px 12px -4px rgba(245,158,11,0.35);
  transform: scale(1.04);
}
.act-chip .act-emoji { display: block; font-size: 1.15rem; margin-bottom: 0.15rem; }
.act-item {
  margin: 0.45rem 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 1.1rem;
  border: 2px solid rgba(251, 191, 36, 0.35);
  background: linear-gradient(135deg, rgba(255,251,235,0.55) 0%, rgba(255,255,255,0.9) 100%);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.act-item:last-child { margin-bottom: 0.65rem; }
.act-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.act-type {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
}
.act-date {
  font-size: 0.72rem;
  color: #9ca3af;
  white-space: nowrap;
}
.act-meta-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  max-width: 55%;
}
.act-src {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 9999px;
  padding: 0.12rem 0.4rem 0.12rem 0.3rem;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  color: #92400e;
  text-decoration: none;
  flex-shrink: 0;
}
.act-src--static {
  cursor: default;
  border-color: rgba(209, 213, 219, 0.9);
  color: #6b7280;
}
.act-src__ico {
  font-size: 0.8rem;
  line-height: 1;
}
.act-src__lbl {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.act-src:not(.act-src--static):hover {
  background: #fef3c7;
  border-color: rgba(245, 158, 11, 0.55);
}
.act-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: #111;
  margin: 0 0 0.2rem;
}
.act-body {
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.4;
  margin: 0;
  white-space: pre-wrap;
}

/* --- типы --- */
.act-item--care {
  background: linear-gradient(135deg, rgba(255,251,235,0.85) 0%, rgba(254,243,199,0.75) 45%, rgba(255,237,213,0.7) 100%);
  border-color: rgba(251, 191, 36, 0.65);
}
.act-item--care .act-type { color: #b45309; }

.act-item--health {
  background: linear-gradient(135deg, rgba(240,253,250,0.9) 0%, rgba(204,251,241,0.75) 50%, rgba(167,243,208,0.55) 100%);
  border-color: rgba(45, 212, 191, 0.55);
}
.act-item--health .act-type { color: #0f766e; }

.act-item--photo {
  background: linear-gradient(135deg, rgba(239,246,255,0.9) 0%, rgba(219,234,254,0.75) 50%, rgba(191,219,254,0.55) 100%);
  border-color: rgba(96, 165, 250, 0.55);
}
.act-item--photo .act-type { color: #1d4ed8; }

.act-item--event {
  background: linear-gradient(135deg, rgba(250,245,255,0.9) 0%, rgba(243,232,255,0.75) 50%, rgba(233,213,255,0.55) 100%);
  border-color: rgba(192, 132, 252, 0.55);
}
.act-item--event .act-type { color: #7e22ce; }

.act-item--note {
  background: linear-gradient(135deg, rgba(249,250,251,0.95) 0%, rgba(243,244,246,0.85) 100%);
  border-color: rgba(209, 213, 219, 0.8);
}
.act-item--note .act-type { color: #4b5563; }

.act-item--done {
  background: linear-gradient(135deg, rgba(240,253,244,0.9) 0%, rgba(220,252,231,0.8) 45%, rgba(187,247,208,0.65) 100%);
  border-color: rgba(134, 239, 172, 0.75);
  opacity: 0.95;
}
.act-item--done .act-title {
  text-decoration: line-through;
  color: #4b5563;
  font-weight: 600;
}
.act-item--done .act-type { color: #047857; }

.act-item--overdue {
  background: linear-gradient(135deg, rgba(254,242,242,0.95) 0%, rgba(254,226,226,0.85) 100%);
  border-color: rgba(252, 165, 165, 0.85);
}
.act-item--overdue .act-type { color: #b91c1c; }
.act-item--overdue .act-title { color: #7f1d1d; }
.act-overdue {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #b91c1c;
  background: rgba(239,68,68,0.12);
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
}
.act-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  margin-top: 0.5rem;
}
.act-photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.6rem;
  border: 1px solid rgba(251,191,36,0.25);
  background: #fff;
}
.act-done {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #047857;
  background: rgba(16,185,129,0.12);
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
}

/* ДР badge у фото */
.bday-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #9a3412;
  background: linear-gradient(135deg, rgba(255,251,235,0.95) 0%, rgba(254,243,199,0.9) 50%, rgba(253,186,116,0.75) 100%);
  border: 1.5px solid rgba(251, 146, 60, 0.55);
  box-shadow: 0 4px 14px -4px rgba(234, 88, 12, 0.25);
  line-height: 1.25;
}
.bday-badge .bday-cake { font-size: 1.1rem; line-height: 1; }
.bday-badge.bday-today {
  color: #9f1239;
  background: linear-gradient(135deg, #fff1f2 0%, #fecdd3 50%, #fda4af 100%);
  border-color: rgba(244, 63, 94, 0.55);
}

/* ===== Сворачиваемые секции ===== */
.j-fold-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.95rem 1.1rem 0.5rem;
  font-family: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.j-fold-head:active {
  background: rgba(251, 191, 36, 0.08);
}
.j-fold-head .sec-title {
  margin: 0;
  flex: 1;
}
.j-fold-arrow {
  flex-shrink: 0;
  font-size: 1.15rem;
  color: #b45309;
  line-height: 1;
  transition: transform 0.22s ease;
}
.j-fold.is-collapsed .j-fold-arrow {
  transform: rotate(-90deg);
}
.j-fold-body {
  overflow: hidden;
  max-height: 8000px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.22s ease;
}
.j-fold.is-collapsed .j-fold-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ===== FAB + меню ===== */
.j-fab-wrap {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.15rem, env(safe-area-inset-bottom));
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}
.j-fab-menu {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  margin-bottom: 0.1rem;
  z-index: 50; /* меню поверх кнопки ? */
}
.j-fab-wrap.open .j-fab-menu {
  display: flex;
}
.j-fab-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2937;
  background: rgba(255,255,255,0.96);
  border-radius: 9999px;
  padding: 0.55rem 0.9rem;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.22);
  text-decoration: none;
  white-space: nowrap;
}
.j-fab-item:active {
  transform: scale(0.97);
}
.j-fab-item .j-fab-ico {
  font-size: 1.05rem;
  line-height: 1;
}
.j-fab {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 28px -6px rgba(217, 119, 6, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  z-index: 30;
  flex-shrink: 0;
}
.j-fab-wrap.open .j-fab {
  transform: rotate(45deg);
  box-shadow: 0 8px 20px -6px rgba(0,0,0,0.35);
}
.j-fab-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8999;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
}
.j-fab-wrap.open + .j-fab-backdrop,
.j-fab-backdrop.show {
  display: block;
}

/* Мини-кнопка панели — как низ меню «Мои профили» */
.pet-panel-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  color: #111;
  background: linear-gradient(90deg, #f59e0b 0%, #eab308 45%, #f59e0b 100%);
  background-size: 160% 100%;
  background-position: 0% 50%;
  box-shadow:
    0 4px 14px rgba(245, 158, 11, 0.35),
    0 0 0 1px rgba(251, 191, 36, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-position 0.35s ease;
}
.pet-panel-btn:hover {
  background-position: 100% 50%;
  box-shadow:
    0 8px 22px rgba(245, 158, 11, 0.42),
    0 0 0 1px rgba(217, 119, 6, 0.5);
  transform: translateY(-1px);
}
.pet-panel-btn:active {
  transform: scale(0.98);
}
.pet-panel-btn__icon {
  font-size: 1.55rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.pet-panel-btn:hover .pet-panel-btn__icon {
  transform: scale(1.08);
}
.pet-panel-btn__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.pet-panel-btn__title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}
.pet-panel-btn__sub {
  font-size: 0.72rem;
  opacity: 0.72;
  line-height: 1.2;
}
.pet-panel-btn__arrow {
  font-size: 1.15rem;
  opacity: 0.75;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.pet-panel-btn:hover .pet-panel-btn__arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* ===== 1.2 Desktop layout + 1.3 hero ===== */
main.wrap {
  width: 100%;
  max-width: 42rem; /* mobile / tablet — как узкая колонка */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

.j-card {
  margin-bottom: var(--lw-space-4, 16px);
}
/* last-child убирал отступ у последней карточки main-col → стык с profile */
.j-main-col > .j-card,
.j-side-col > .j-card {
  margin-bottom: var(--lw-space-4, 16px);
}
.j-side-col > .j-card:last-child {
  margin-bottom: 0;
}

/* Ближайшие события — карусель, фиксированная высота */
/* Ближайшие события — карусель по 2, стрелки снаружи */
.j-up-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.j-up-row {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.j-up-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.j-up-track {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}
.j-up__slide {
  flex: 0 0 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.1rem 0.15rem;
}
.j-up__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.4rem;
}
.j-up__ico {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: rgba(255, 251, 235, 0.9);
}
.j-up__item--birthday .j-up__ico { background: #fce7f3; }
.j-up__item--health .j-up__ico { background: #e0f2fe; }
.j-up__item--care .j-up__ico { background: #ecfdf5; }
.j-up__body {
  min-width: 0;
  flex: 1;
}
.j-up__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #111;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.j-up__sub {
  font-size: 0.72rem;
  color: #9ca3af;
  margin: 0.05rem 0 0;
  line-height: 1.2;
}
.j-up__btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}
.j-up__btn:hover {
  background: #fef3c7;
}
.j-up-nav {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  color: #92400e;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.j-up-nav[hidden] {
  visibility: hidden;
  pointer-events: none;
}
.j-up-dots {
  display: flex;
  justify-content: center;
  gap: 0.28rem;
  min-height: 0.45rem;
}
.j-up-dots span {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 9999px;
  background: rgba(251, 191, 36, 0.35);
  transition: background 0.2s, transform 0.2s;
}
.j-up-dots span.is-on {
  background: #f59e0b;
  transform: scale(1.15);
}
.j-up__empty {
  font-size: 0.84rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.4;
}
#upcoming .j-fold-head {
  padding: 0.55rem 0.85rem 0.15rem;
}
#upcoming .j-fold-head .sec-title {
  margin: 0;
  font-size: 0.9rem;
}
#upcoming .sec-pad {
  padding: 0.1rem 0.55rem 0.5rem;
}
#upcoming.j-card {
  overflow: hidden;
}

@media (min-width: 1200px) {
  main.wrap {
    max-width: 1280px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 3rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    column-gap: 1.75rem;
    row-gap: 1.25rem;
    align-items: start;
  }

  /* шапка на всю ширину; герой — только main-колонка */
  main.wrap > .nav-top,
  main.wrap > .pet-nav,
  main.wrap > .j-stats,
  main.wrap > .j-sec-nav,
  main.wrap > .flash {
    grid-column: 1 / -1;
  }

  main.wrap > .pet-hero,
  main.wrap > article.pet-hero {
    grid-column: 1;
    grid-row: auto;
  }

  /* Ближайшие — справа от hero (пустая колонка) */
  main.wrap > #upcoming {
    grid-column: 2;
    align-self: start;
    margin-bottom: 0;
  }

  main.wrap > .j-main-col {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
  }

    main.wrap > .j-side-col {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    position: sticky;
    top: 5.5rem;
    /* без max-height/overflow — карточки не обрезаются снизу */
    align-self: start;
  }

  main.wrap > .j-main-col > .j-card,
  main.wrap > .j-side-col > .j-card {
    margin-bottom: 0;
  }

   /* 1.3 Hero — квадрат слева, инфо справа */
    article.pet-hero {
    border-radius: var(--lw-radius-xl, 22px);
    box-shadow: var(--lw-shadow-lg, 0 16px 40px rgba(17, 24, 39, 0.12));
    overflow: hidden;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: stretch;
    min-height: 260px;
  }

  article.pet-hero .hero-photo {
    width: 260px;
    height: 100%;
    min-height: 260px;
    max-width: 260px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
  }

  article.pet-hero .hero-body {
    padding: 1.1rem 1.25rem 1.2rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }

  article.pet-hero .pet-name {
    font-family: Maybug, system-ui, sans-serif;
    font-size: clamp(1.35rem, 1.6vw, 1.75rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  article.pet-hero .chips {
    justify-content: flex-start;
  }

  article.pet-hero .meta {
    text-align: left;
  }

    /* ===== 1.5 Gallery ===== */
  #photos .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.55rem;
    max-width: none; /* на всю main-колонку */
  }

  #photos .gallery-item {
    aspect-ratio: 1 / 1;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }

  #photos .gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -8px rgba(17, 24, 39, 0.2);
    border-color: rgba(245, 158, 11, 0.55);
    z-index: 1;
  }

  #photos .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* ===== 1.5 Forms (Новая заметка + edit) ===== */
  #add-entry .form-grid-2,
  .entry-edit-form .form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
  }

  #add-entry .form-grid-2 .field-span-2,
  .entry-edit-form .form-grid-2 .field-span-2 {
    grid-column: 1 / -1;
  }

  #add-entry .tg-input,
  .entry-edit-form .tg-input {
    height: 44px;
  }

  #add-entry textarea.tg-input,
  .entry-edit-form textarea.tg-input {
    height: auto;
    min-height: 110px;
  }

  /* ===== 1.5 Bottom-sheet → centered modal (desktop) ===== */
  .pp-overlay {
    align-items: center;
    padding: 1.5rem;
  }

  .pp-sheet {
    max-width: 32rem;
    border-radius: 1.35rem;
    max-height: min(85vh, 720px);
    box-shadow: 0 24px 48px -12px rgba(17, 24, 39, 0.25);
  }

  .j-fab-wrap {
    right: 1.75rem;
    bottom: 1.75rem;
  }

  /* ===== 1.4 Navigation / buttons / badges (desktop) ===== */

  /* Activity chips — крупнее, hover, active */
  .act-scroll {
    gap: 0.55rem;
    padding-bottom: 0.65rem;
    margin-bottom: 0.35rem;
  }
  .act-chip {
    min-width: 5.4rem;
    max-width: none;
    padding: 0.7rem 1.05rem;
    font-size: 0.84rem;
    border-radius: 1.1rem;
    transition: background 0.18s ease, border-color 0.18s ease,
                box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
  }
  .act-chip:hover {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(255, 251, 235, 0.95);
    color: #92400e;
    box-shadow: 0 6px 16px -6px rgba(245, 158, 11, 0.28);
    transform: translateY(-1px);
  }
  .act-chip:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
  }
  .act-chip.active {
    transform: translateY(-1px) scale(1.03);
  }
  .act-chip .act-emoji {
    font-size: 1.25rem;
  }

  /* Journal filter chips */
  .filter-row {
    gap: 0.4rem;
  }
  .filter-chip {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    min-height: 36px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  }
  .filter-chip:hover {
    border-color: rgba(245, 158, 11, 0.5);
    background: #fffbeb;
    color: #92400e;
  }
  .filter-chip:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
  }
  .filter-chip.active {
    box-shadow: 0 2px 8px -2px rgba(245, 158, 11, 0.35);
  }

  /* Type chips (новая заметка) */
  .type-chip {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    min-height: 36px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
  .type-chip:hover {
    border-color: rgba(245, 158, 11, 0.45);
    background: #fffbeb;
  }
  .type-chip:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
  }

  /* Buttons hierarchy + hover */
  .j-btn {
    transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  }
  .j-btn:hover {
    transform: translateY(-1px);
  }
  .j-btn:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
  }
  .j-btn-primary:hover {
    box-shadow: 0 10px 22px -6px rgba(245, 158, 11, 0.5);
  }
  .j-btn-ghost:hover {
    background: #fff;
    border-color: rgba(245, 158, 11, 0.4);
    color: #111;
  }
  .j-btn-danger:hover {
    background: #fecaca;
    border-color: rgba(239, 68, 68, 0.45);
  }
  .j-btn-sm {
    min-height: 38px;
    font-size: 13px;
  }

  /* Cards hover (лёгкий lift) */
  .j-card {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }
  .j-card:hover {
    box-shadow: var(--lw-shadow-lg, 0 16px 40px rgba(17, 24, 39, 0.12));
    border-color: rgba(251, 191, 36, 0.4);
  }

  /* Activity items hover */
  .act-item:hover {
    box-shadow: 0 8px 20px -8px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
  }

  /* Pet nav prev/next */
  .pet-nav-btn {
    min-height: 40px;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
    font-size: 0.88rem;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .pet-nav-btn:hover {
    background: rgba(255, 251, 235, 0.95);
  }
  .pet-nav-btn:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
  }
}

/* ===== 2.1 UX: stats + sticky section nav + empty ===== */
.j-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}
.j-stat {
  text-align: center;
  padding: 0.65rem 0.4rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.j-stat__n {
  font-family: Maybug, system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111;
  line-height: 1.1;
}
.j-stat__l {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  margin-top: 0.15rem;
}

/* sticky section nav — только desktop */
.j-sec-nav {
  display: none;
}
.j-sec-nav a {
  text-decoration: none;
  color: #4b5563;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.j-sec-nav a:hover {
  background: rgba(255, 251, 235, 0.95);
  border-color: rgba(245, 158, 11, 0.4);
  color: #92400e;
}
.j-sec-nav a:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}
.j-sec-nav a.is-active {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #92400e;
  box-shadow: 0 2px 8px -2px rgba(245, 158, 11, 0.35);
}

/* якоря не прячутся под sticky-nav / header */
#photos,
#activity,
#add-entry,
#journal,
#profile,
#manage {
  scroll-margin-top: 5.5rem;
}
@media (min-width: 1200px) {
  #photos,
  #activity,
  #add-entry,
  #journal,
  #profile,
  #manage {
    scroll-margin-top: 4.25rem;
  }
}

.empty-j {
  padding: 1.75rem 1.1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(251, 191, 36, 0.4);
}
.empty-j__ico {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
  display: block;
}
.empty-j a {
  color: #92400e;
  font-weight: 600;
}

@media (min-width: 1200px) {
  .j-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
  }
  .j-stat {
    padding: 0.85rem 0.5rem;
  }
  .j-stat__n {
    font-size: 1.35rem;
  }

  .j-sec-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0.75rem;
    z-index: 40;
    margin: 0 0 1rem;
    padding: 0.45rem 0.55rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 8px 24px -10px rgba(17, 24, 39, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* sticky внутри main-col: full width of main column */
  main.wrap > .j-sec-nav {
    grid-column: 1;
  }
}

/* ===== 3.3 Report modal ===== */
.j-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.j-report-overlay.is-open {
  display: flex;
}
.j-report-sheet {
  width: 100%;
  max-width: 26rem;
  max-height: min(88vh, 640px);
  overflow-y: auto;
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 24px 48px -12px rgba(17, 24, 39, 0.28);
  padding: 1.15rem 1.2rem 1.35rem;
}
.j-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.j-report-head h3 {
  margin: 0;
  font-family: Maybug, system-ui, sans-serif;
  font-size: 1.15rem;
  text-transform: uppercase;
  color: #111;
}
.j-report-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 0.25rem;
}
.j-report-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.j-report-period {
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  color: #4b5563;
}
.j-report-period.is-on {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #92400e;
}
.j-report-total {
  text-align: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 1rem;
  background: rgba(255, 251, 235, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.j-report-total strong {
  font-family: Maybug, system-ui, sans-serif;
  font-size: 1.6rem;
  display: block;
  color: #111;
}
.j-report-total span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
}
.j-report-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 2.2rem;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}
.j-report-bar {
  height: 10px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.j-report-bar > i {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  width: 0%;
  transition: width 0.35s ease;
}
.j-report-empty {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  padding: 1rem 0;
}
.j-report-err {
  color: #b91c1c;
  font-size: 0.85rem;
  text-align: center;
}

/* Premium need modal (journal) */
.j-prem-need {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.j-prem-need[hidden] { display: none !important; }
.j-prem-need__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.j-prem-need__card {
  position: relative;
  width: 100%;
  max-width: 22rem;
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.35rem 1.25rem 1.15rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  text-align: center;
}
.j-prem-need__x {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
}
.j-prem-need__ico { font-size: 2rem; margin-bottom: 0.35rem; }
.j-prem-need__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #111;
}
.j-prem-need__text {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #4b5563;
  text-align: left;
}
.j-prem-need__hint {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #9ca3af;
  text-align: left;
}
.j-prem-need__actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.j-prem-need__actions .j-btn { width: 100%; justify-content: center; }

/* ===== Confirm modal ===== */
.j-confirm {
  position: fixed;
  inset: 0;
  z-index: 100060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, background 0.22s ease, visibility 0.22s;
}
.j-confirm.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.j-confirm__card {
  width: 100%;
  max-width: 20.5rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  padding: 1.25rem 1.15rem 1.1rem;
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  text-align: center;
}
.j-confirm.is-open .j-confirm__card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.j-confirm__ico {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.55rem;
}
.j-confirm__title {
  font-family: Maybug, system-ui, sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #111;
  margin: 0 0 0.4rem;
}
.j-confirm__text {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.45;
  margin: 0 0 1rem;
  white-space: pre-line;
}
.j-confirm__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.j-confirm__actions .j-btn {
  min-height: 42px;
  font-size: 14px;
  width: 100%;
}
.j-confirm--danger .j-confirm__card {
  border-color: rgba(252, 165, 165, 0.65);
}

.j-fab-help {
  /* убрали absolute — теперь в общем flex-столбце, ровно над ＋ */
  position: relative;
  right: auto;
  bottom: auto;
  width: 3.25rem;          /* тот же диаметр, что у .j-fab */
  height: 3.25rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  background: rgba(255, 255, 255, 0.92);
  color: #92400e;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;             /* ниже меню */
  font-family: inherit;
  flex-shrink: 0;
}
.j-fab-help:active { transform: scale(0.96); }
</style>