:root {
  color-scheme: light;
  --ink: #24312f;
  --muted: #64716d;
  --paper: #fbfaf7;
  --line: #ddd8cf;
  --mint: #6fbf9f;
  --coral: #e98373;
  --gold: #d9a441;
  --blue: #5e8fc6;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(36, 49, 47, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(111, 191, 159, 0.11), transparent 36%),
    linear-gradient(270deg, rgba(233, 131, 115, 0.12), transparent 36%),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 18px;
  color: var(--white);
  background: var(--ink);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(36, 49, 47, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--white);
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 32px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
}

.auth-form,
.task-setup-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #b84538;
  font-weight: 700;
}

.demo-logins {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

code {
  padding: 4px 7px;
  border-radius: 6px;
  background: #f1eee7;
}

.dashboard-view {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 0 auto 18px;
  width: min(1180px, 100%);
}

.topbar h1 {
  margin-bottom: 0;
}

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

.ghost-button,
.edit-button,
.review-banner button {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.shared-meter {
  display: grid;
  gap: 8px;
  min-width: 190px;
  font-weight: 900;
  text-align: right;
}

.shared-meter small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.meter-track,
.person-meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e9e4dc;
}

.meter-fill,
.person-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--gold), var(--coral));
  transition: width 260ms ease;
}

.companion-strip {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.puppy-stage {
  height: 132px;
  position: relative;
}

.puppy {
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 118px;
  height: 118px;
  background-image: url("/elmo-sprite.png");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: 0% 100%;
  filter: drop-shadow(0 12px 16px rgba(36, 49, 47, 0.15));
  transform-origin: center bottom;
  transition: transform 260ms ease;
}

.puppy.waiting {
  background-position: 0% 100%;
}

.puppy.happy {
  background-position: 33.333% 0%;
  animation: bounce 1.3s ease-in-out infinite;
}

.puppy.party {
  background-position: 66.666% 33.333%;
  animation: bounce 620ms ease-in-out infinite;
}

.ear,
.face,
.body,
.tail {
  display: none;
  position: absolute;
  background: #b98658;
}

.ear {
  top: 4px;
  width: 25px;
  height: 36px;
  border-radius: 8px 8px 16px 16px;
}

.ear.left {
  left: 6px;
  transform: rotate(-18deg);
}

.ear.right {
  right: 6px;
  transform: rotate(18deg);
}

.face {
  top: 14px;
  left: 12px;
  width: 48px;
  height: 42px;
  border-radius: 45% 45% 50% 50%;
  z-index: 2;
}

.body {
  left: 18px;
  bottom: 0;
  width: 42px;
  height: 38px;
  border-radius: 18px 18px 12px 12px;
  background: #d19a68;
}

.tail {
  right: 1px;
  bottom: 20px;
  width: 28px;
  height: 10px;
  border-radius: 999px;
  transform: rotate(30deg);
  transform-origin: left center;
}

.party .tail {
  animation: wag 320ms ease-in-out infinite;
}

.eye {
  position: absolute;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2b2019;
}

.eye:first-child {
  left: 13px;
}

.eye:nth-child(2) {
  right: 13px;
}

.nose {
  position: absolute;
  left: 21px;
  top: 25px;
  width: 8px;
  height: 7px;
  border-radius: 50%;
  background: #2b2019;
}

.companion-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.companion-stats span {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f0e9;
}

.review-banner {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid #ead3a7;
  border-radius: 8px;
  background: #fff6df;
}

.split-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.person-column {
  min-height: 430px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(36, 49, 47, 0.08);
}

.person-column.current {
  border-color: rgba(111, 191, 159, 0.72);
}

.person-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.person-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.person-progress {
  font-size: 1.6rem;
  font-weight: 900;
}

.onboarding {
  margin-top: 22px;
  padding: 16px;
  border-radius: 8px;
  background: #f4f0e9;
}

.task-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 22px 0;
  list-style: none;
}

.task-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.task-item input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--mint);
}

.task-item.done {
  color: var(--muted);
  background: #f7f7f2;
}

.task-item.done span {
  text-decoration: line-through;
}

.person-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.activity-feed {
  width: min(1180px, 100%);
  margin: 18px auto 0;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.activity-feed h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.activity-feed ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.notification-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 18px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.notification-panel h2 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.notification-panel p {
  margin: 0;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 58px;
  height: 34px;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c8c2b8;
  transition: background 180ms ease;
}

.slider::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 4px 10px rgba(36, 49, 47, 0.18);
  transition: transform 180ms ease;
}

.switch input:checked + .slider {
  background: var(--mint);
}

.switch input:checked + .slider::before {
  transform: translateX(24px);
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0) scale(var(--puppy-scale, 1));
  }
  50% {
    transform: translateY(-7px) scale(var(--puppy-scale, 1));
  }
}

@keyframes wag {
  0%,
  100% {
    transform: rotate(18deg);
  }
  50% {
    transform: rotate(48deg);
  }
}

@media (max-width: 820px) {
  .dashboard-view {
    padding: 16px;
  }

  .topbar,
  .topbar-actions,
  .review-banner,
  .notification-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .shared-meter {
    min-width: 0;
    text-align: left;
  }

  .companion-strip,
  .split-board {
    grid-template-columns: 1fr;
  }

  .companion-strip {
    justify-items: start;
  }
}
