:root {
  --green: #258a67;
  --deep: #235846;
  --mint: #e5f4ed;
  --yellow: #fff6d3;
  --ink: #26332f;
  --muted: #687570;
  --line: #dfe9e4;
  --paper: #f5faf7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fafcf9;
  color: var(--ink);
  font:
    15px/1.6 "Trebuchet MS",
    Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}
button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgb(35 88 70 / 16%);
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 235px;
  padding: 35px 25px;
  border-right: 1px solid var(--line);
  background: white;
  display: flex;
  flex-direction: column;
}
.logo {
  color: var(--deep);
  font-size: 29px;
  font-weight: bold;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.logo img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.slogan {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 38px;
}
nav {
  display: grid;
  gap: 9px;
}
nav a {
  padding: 13px 17px;
  border-radius: 16px;
  min-height: 48px;
  color: var(--muted);
}
nav a.active {
  background: var(--mint);
  color: var(--green);
  font-weight: bold;
}
.aside-note {
  margin-top: auto;
  background: #f3f7ea;
  border-radius: 24px;
  padding: 22px;
}
.aside-note p {
  font-size: 12px;
  color: var(--muted);
}
.workspace {
  margin-left: 235px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 26px 40px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: white;
}
main {
  max-width: 1300px;
  margin: auto;
  padding: 35px 40px;
  min-height: calc(100vh - 150px);
}
h1 {
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -1px;
  margin: 0 0 10px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
p {
  margin: 8px 0;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 27px;
}
.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 23px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
  background: var(--green);
  color: white;
}
.button.light {
  background: var(--mint);
  color: var(--green);
}
.full {
  width: 100%;
}
.hero {
  background: #e9f3e5;
  border-radius: 28px;
  padding: 30px 35px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  overflow: hidden;
}
.hero h2 {
  font-size: 28px;
  line-height: 1.4;
}
.hero p {
  max-width: 360px;
  color: #60765f;
  font-size: 13px;
  margin: 12px 0 20px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--green);
  font-weight: bold;
}
.hero-art {
  width: 180px;
  height: 150px;
  position: relative;
}
.circle {
  background: #d7e8cf;
  border-radius: 50%;
  width: 135px;
  height: 135px;
  position: absolute;
  right: 0;
  bottom: 0;
}
.pet-drawing {
  position: absolute;
  bottom: 5px;
  right: 15px;
  width: 95px;
  height: 105px;
  border-radius: 45% 45% 40% 40%;
  background: #f5e8c8;
  transform: rotate(-6deg);
}
.pet-drawing:before {
  content: "";
  position: absolute;
  top: -15px;
  left: 5px;
  width: 80px;
  height: 40px;
  background: #f5e8c8;
  clip-path: polygon(0 0, 35% 55%, 65% 55%, 100% 0, 94% 100%, 6% 100%);
}
.pet-drawing:after {
  content: "• ᴥ •";
  position: absolute;
  top: 28px;
  left: 16px;
  color: #665940;
  font-size: 25px;
}
.hero-heart {
  position: absolute;
  left: 0;
  top: 5px;
  font-size: 45px;
  color: #729d7e;
}
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 24px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 25px;
  padding: 24px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.link {
  background: none;
  border: 0;
  color: var(--green);
  font-size: 12px;
  min-height: 44px;
  padding: 10px;
}
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}
.day {
  border: 0;
  border-radius: 17px;
  background: #f5f8f3;
  min-height: 88px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.day b {
  font-size: 19px;
  color: var(--ink);
}
.day.active {
  background: var(--green);
  color: white;
}
.day.active b {
  color: white;
}
.day i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d9ba60;
}
.day i.hidden {
  visibility: hidden;
}
.day-label {
  margin-top: 22px;
  color: var(--muted);
  font-size: 11px;
}
.event {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid #eef3ed;
}
.event-body {
  flex: 1;
  min-width: 0;
}
.event strong {
  display: block;
  font-size: 13px;
}
.event small {
  color: var(--muted);
  font-size: 11px;
}
.symbol {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--mint);
  color: var(--green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.symbol.yellow {
  background: var(--yellow);
  color: #8c773a;
}
.event.done strong {
  text-decoration: line-through;
  color: var(--muted);
}
/* плавное исчезновение после отметки; длительность синхронна с FADE_OUT_MS в app.js */
.leaving {
  max-height: 0 !important;
  opacity: 0;
  overflow: hidden;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top-width: 0 !important;
  transition:
    opacity 250ms ease,
    max-height 400ms ease,
    padding 400ms ease,
    border-width 400ms ease;
}
.mini-pet {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 15px;
  background: var(--paper);
  border-radius: 19px;
  margin-bottom: 12px;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  background: #f0e6ce;
  color: #7a6a45;
  font-size: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
/* Фото питомца: в grid проценты считаются от ячейки, которая растёт под картинку,
   поэтому вписываем фото в рамку аватара абсолютным позиционированием. */
.avatar:has(img) {
  position: relative;
  overflow: hidden;
}
.avatar img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.avatar.small {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 0;
}
.pet-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}
.pet-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}
.pet-title h2 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.photo-preview {
  display: block;
  width: 96px;
  height: 96px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 10px;
}
.field .checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
  font-weight: normal;
}
.field .checkbox input {
  width: auto;
  min-height: 0;
}
.mini-pet p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.tip {
  background: var(--yellow);
  padding: 23px;
  border-radius: 22px;
  margin-top: 20px;
}
.tip p {
  font-size: 12px;
  color: #786c46;
}
.lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.metric {
  font-size: 36px;
  color: var(--green);
  font-weight: bold;
  margin-top: 15px;
}
.pet-grid,
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.pet-card .avatar {
  width: 75px;
  height: 75px;
  border-radius: 25px;
  font-size: 36px;
  margin-bottom: 20px;
}
.pet-card h2 {
  font-size: 25px;
}
.pet-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding: 15px 0;
  margin: 18px 0;
}
.pet-card dt {
  color: var(--muted);
}
.pet-card dd {
  margin: 0;
  text-align: right;
}
.notice {
  border-radius: 18px;
  background: var(--mint);
  padding: 17px 22px;
  font-size: 12px;
  margin-bottom: 24px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 12px;
}
.filter.active {
  background: var(--mint);
  color: var(--green);
}
.record {
  margin-bottom: 15px;
}
.record p {
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.badge {
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  padding: 6px 10px;
  font-size: 11px;
  display: inline-block;
}
.badge.warn {
  background: var(--yellow);
  color: #7c682e;
}
.empty {
  text-align: center;
  padding: 35px 15px;
  color: var(--muted);
  font-size: 13px;
}
/* заглушки пустых разделов одного размера на всех страницах */
.card.empty {
  min-height: 140px;
  display: grid;
  place-items: center;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.button-danger {
  color: #a33b35;
  border: 0;
  border-radius: 999px;
  padding: 12px 23px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
  background: white;
}
.card h2,
.mini-pet strong,
.event strong {
  overflow-wrap: anywhere;
}
footer {
  padding: 20px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  width: calc(100% - 32px);
  max-width: 470px;
  max-height: 90vh;
  overflow: auto;
  color: var(--ink);
}
dialog::backdrop {
  background: #1f3c3555;
  backdrop-filter: blur(3px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--paper);
  font-size: 24px;
  color: var(--muted);
}
dialog h2 {
  font-size: 25px;
  margin: 12px 0 22px;
}
.field {
  margin: 14px 0;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 6px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  min-height: 46px;
  padding: 11px 14px;
  background: var(--paper);
  color: var(--ink);
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.error {
  font-size: 12px;
  color: #a33b35;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--deep);
  color: white;
  padding: 12px 22px;
  border-radius: 15px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  max-width: 90%;
}
#toast.show {
  opacity: 1;
}
:focus-visible {
  outline: 3px solid #1d6f55;
  outline-offset: 3px;
}
@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  .right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .tip {
    margin: 0;
  }
  .hero-art {
    width: 130px;
  }
}
@media (max-width: 760px) {
  aside {
    position: static;
    width: 100%;
    padding: 18px 20px 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .slogan,
  .aside-note {
    display: none;
  }
  .logo {
    font-size: 23px;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 5px;
    margin-top: 14px;
  }
  nav a {
    font-size: 11px;
    white-space: nowrap;
    padding: 10px 12px;
    min-height: 44px;
  }
  .workspace {
    margin: 0;
  }
  header {
    padding: 15px 20px;
    font-size: 10px;
  }
  main {
    padding: 25px 18px;
  }
  h1 {
    font-size: 26px;
  }
  .heading {
    align-items: flex-start;
  }
  .heading .button {
    font-size: 11px;
    padding: 12px 16px;
  }
  .hero {
    padding: 24px;
  }
  .hero h2 {
    font-size: 23px;
  }
  .hero-art {
    display: none;
  }
  .hero p {
    font-size: 12px;
  }
  .right,
  .lower {
    grid-template-columns: 1fr;
  }
  .day {
    min-height: 80px;
  }
  .day b {
    font-size: 16px;
  }
  .card {
    padding: 19px;
  }
  .section-head {
    flex-wrap: wrap;
  }
  footer {
    padding: 20px;
    flex-wrap: wrap;
  }
  .pet-grid,
  .food-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
.event .check {
    grid-column: 4;
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    align-self: center;
}

.event .check {
  width: 38px;
  height: 38px;
}

@keyframes check-pop {
  50% {
    transform: scale(1.15);
  }
}

.check {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: transparent;
}
/* отключаем общий «прыжок» кнопок */
.check:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}
.check:disabled {
  cursor: progress;
}
.check::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 2px solid #b9cfc5;
  background: white;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}
.check::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: translate(-50%, -62%) rotate(45deg) scale(0);
  transition: transform 180ms ease;
}
@media (hover: hover) {
  .check:hover::before {
    border-color: var(--green);
    background: var(--mint);
  }
  .check:hover::after {
    border-color: var(--green);
    transform: translate(-50%, -62%) rotate(45deg) scale(0.8);
  }
}
.check:active::before {
  transform: scale(0.88);
}
/* отмечено */
.check[aria-pressed="true"]::before,
.event.done .check::before {
  background: var(--green);
  border-color: var(--green);
  animation: check-pop 450ms ease;
}
.check[aria-pressed="true"]::after,
.event.done .check::after {
  border-color: white;
  transform: translate(-50%, -62%) rotate(45deg) scale(1);
}
/* фокус с клавиатуры — мягкое кольцо вокруг кружка, а не квадрат */
.check:focus-visible {
  outline: none;
}
.check:focus-visible::before {
  box-shadow: 0 0 0 4px rgb(37 138 103 / 25%);
}
/* ---------- Вход и регистрация ---------- */

/* гостю страница открыта; вход и регистрация — окно поверх неё */
body.logged-out .account,
body:not(.logged-out) .guest-login {
  display: none;
}
.auth {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background: #1f3c3555;
  backdrop-filter: blur(3px);
}
.auth[hidden],
.auth-form[hidden] {
  display: none;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px 28px;
}
.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
}
.auth-card .slogan {
  margin-bottom: 26px;
}
.auth-tabs {
  margin-bottom: 8px;
}
.auth-tabs .filter {
  flex: 1;
}
.auth-form h2 {
  margin: 18px 0 4px;
}
.auth-form .button {
  margin-top: 6px;
}
.auth-judge {
  margin-top: 14px;
}
.auth-judge[hidden],
#admin-link[hidden] {
  display: none;
}
.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* блок пользователя в правом углу шапки */
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 320px;
}
.account .avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  font-size: 17px;
}
.account-body {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.account-body strong,
.account-body small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-body strong {
  font-size: 13px;
  color: var(--ink);
}
a.account-body {
  color: inherit;
  text-decoration: none;
}
.account .link {
  padding: 10px 4px;
}
@media (max-width: 760px) {
  .account-body small {
    display: none;
  }
  .auth-card {
    padding: 26px 20px;
  }
}

/* страница профиля */
.profile {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: 24px;
  align-items: start;
}
.profile-side {
  display: grid;
  gap: 24px;
}
.profile-card .avatar {
  width: 75px;
  height: 75px;
  border-radius: 25px;
  font-size: 36px;
  margin-bottom: 20px;
}
.profile-card h2 {
  font-size: 25px;
  overflow-wrap: anywhere;
}
.profile-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin: 18px 0 0;
}
.profile-card dt {
  color: var(--muted);
}
.profile-card dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.profile-stats .metric {
  margin-top: 0;
}
@media (max-width: 1100px) {
  .profile {
    grid-template-columns: 1fr;
  }
}
