:root {
  --bg: #ffffff;
  --bg-wash: #f5f8fc;
  --ink: #1a1a1a;
  --ink-muted: #555555;
  --title: #5579a3;
  --pink: #ff6ac4;
  --pink-soft: #fc8bc9;
  --pink-wash: #ffbfe2;
  --lime: #d2ed68;
  --lime-soft: #e3fe7b;
  --peach: #ffa96b;
  --blue: #acceff;
  --blue-wash: #d6e3f6;
  --line: #e1eaf5;
  --danger: #dc2626;
  --ok: #2f7d4a;
  --shadow: 0 4px 20px rgba(151, 188, 241, 0.18);
  --shadow-hover: 0 8px 28px rgba(151, 188, 241, 0.28);
  --radius: 1rem;
  --font: "Inter", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: calc(5.25rem + var(--safe-b));
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(255, 191, 226, 0.45), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 8%, rgba(172, 206, 255, 0.4), transparent 50%),
    radial-gradient(ellipse 50% 35% at 80% 100%, rgba(227, 254, 123, 0.28), transparent 50%),
    var(--bg);
}

.hidden { display: none !important; }
.view { min-height: 100dvh; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background: #ffffff;
}
.boot-stage {
  position: relative;
  width: 7.25rem;
  height: 7.25rem;
}
.boot-icon {
  position: absolute;
  inset: 0.9rem;
  width: calc(100% - 1.8rem);
  height: calc(100% - 1.8rem);
  object-fit: contain;
  animation: boot-pulse 1.15s ease-in-out infinite;
}
.boot-ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--pink-wash);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: boot-spin 0.75s linear infinite;
}
.boot-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
@keyframes boot-spin {
  to { transform: rotate(360deg); }
}
@keyframes boot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.96); opacity: 0.82; }
}

.view-login {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: calc(24px + var(--safe-t)) 24px calc(32px + var(--safe-b));
  overflow: hidden;
}

.login-blobs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.85;
}
.blob-pink { width: 16rem; height: 16rem; background: var(--pink-wash); top: -3rem; right: -4rem; }
.blob-lime { width: 11rem; height: 11rem; background: var(--lime-soft); top: 28%; left: -4rem; }
.blob-blue { width: 13rem; height: 13rem; background: var(--blue); bottom: 18%; right: -5rem; opacity: 0.45; }
.blob-peach { width: 8rem; height: 8rem; background: var(--peach); bottom: 8%; left: 12%; opacity: 0.55; }

.login-inner {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  font-size: clamp(2.6rem, 10vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
  line-height: 1;
  color: var(--ink);
}

.login-headline {
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 0.75rem;
  max-width: 16ch;
}

.login-sub { margin: 0 0 1.75rem; color: var(--ink-muted); font-weight: 500; }
.login-hint { margin: 1.25rem 0 0; font-size: 0.85rem; color: var(--ink-muted); }
.login-error { margin: 1rem 0 0; color: var(--danger); font-weight: 600; }

.view-app { padding-bottom: var(--tabbar-h); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-t)) 18px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.topbar-brand { display: flex; align-items: baseline; gap: 0.4rem; }
.brand-mark {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}
.brand-name {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--title);
}
.topbar-user { display: flex; align-items: center; gap: 0.65rem; }
.avatar {
  border-radius: 50%;
  border: 2px solid var(--pink-soft);
  object-fit: cover;
  background: var(--blue-wash);
}

.main { max-width: 440px; margin: 0 auto; padding: 20px 18px 12px; }
.panel { animation: fadeInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--title);
  font-weight: 700;
}

.hero-status h2 {
  font-size: 1.75rem;
  margin: 0.35rem 0 0.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lede { margin: 0; color: var(--ink-muted); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.card-ring {
  margin: 1.5rem 0 1.25rem;
  padding: 1.25rem 1rem 1rem;
  text-align: center;
}

.card-form { padding: 1.1rem; }

.progress-ring-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto;
}

.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.ring-fg {
  fill: none;
  stroke: var(--pink);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ring-label strong { font-size: 2rem; line-height: 1; font-weight: 800; color: var(--title); }
.ring-label span { color: var(--ink-muted); font-size: 0.9rem; font-weight: 600; }
.ring-caption {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--title);
}

.ask-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.4rem;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.985); }

.btn-block { width: 100%; }
.btn-primary { background: var(--pink); color: var(--ink); }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-discord-icon {
  width: 1.15rem;
  height: 1.15rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.317 4.37a19.8 19.8 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.08.08 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.373-.292a.074.074 0 0 1 .078-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .079.01c.12.098.247.198.373.292a.077.077 0 0 1-.006.127 12.3 12.3 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.btn-text {
  background: none;
  border: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.back {
  background: none;
  border: none;
  color: var(--title);
  font: inherit;
  font-weight: 700;
  padding: 0;
  margin: 0 0 0.75rem;
  cursor: pointer;
}
.panel h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  font-weight: 800;
  color: var(--title);
}

.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; color: var(--ink-muted); font-weight: 600; }
.field legend { padding: 0 0.25rem; font-weight: 600; }
fieldset.field {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  margin: 0;
  padding: 0.65rem 0.75rem 0.8rem;
}
.field select,
.field input[type="text"],
.field input[type="number"] {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-wash);
  color: var(--ink);
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
  font: inherit;
  font-weight: 500;
}

.mood-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.mood-grid label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.65rem 0.7rem;
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  font-weight: 500;
}
.mood-grid label:has(input:checked) {
  border-color: var(--pink);
  background: var(--pink-wash);
}
.vis-field .radio { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem; color: var(--ink); font-weight: 500; }
.feedback { min-height: 1.25rem; margin: 0; font-size: 0.95rem; color: var(--title); font-weight: 600; }
.feedback.error { color: var(--danger); }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.month-nav h2 { margin: 0; text-align: center; flex: 1; font-size: 1.15rem; }
.icon-btn {
  width: 2.4rem; height: 2.4rem; border-radius: 0.85rem;
  border: 1px solid var(--line); background: #fff;
  color: var(--title); font-size: 1.4rem; cursor: pointer;
  box-shadow: var(--shadow);
}

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; padding: 0.9rem; }
.cal-dow { text-align: center; font-size: 0.68rem; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 0.65rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-muted);
}
.cal-day.empty { visibility: hidden; }
.cal-day.done { background: var(--lime); color: var(--ink); font-weight: 800; }
.cal-day.today:not(.done) { box-shadow: inset 0 0 0 2px var(--pink); color: var(--ink); }

.workout-list { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.workout-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  background: #fff;
  box-shadow: var(--shadow);
}
.workout-item header { display: flex; justify-content: space-between; gap: 0.5rem; }
.workout-item .type { font-weight: 800; color: var(--title); }
.workout-item .date { font-size: 0.82rem; color: var(--ink-muted); font-weight: 600; }
.workout-item .meta { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--ink-muted); }
.workout-item .actions { display: flex; gap: 0.55rem; margin-top: 0.7rem; }
.workout-item .actions button {
  border: 1px solid var(--line);
  background: var(--bg-wash);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.workout-item .actions .danger { color: var(--danger); background: #fff; }

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  padding: 0.55rem 0.5rem calc(0.45rem + var(--safe-b));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(151, 188, 241, 0.16);
  z-index: 30;
  backdrop-filter: blur(12px);
}
.tabbar > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.18rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.15rem;
  border-radius: 0.75rem;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  line-height: 1.1;
}
.tabbar > button.on {
  color: var(--ink);
  background: var(--pink-wash);
}
.tabbar .ico {
  width: 1.4rem;
  height: 1.4rem;
}
.tabbar .ico svg { display: block; width: 100%; height: 100%; }
.tabbar .tab-lbl { display: block; width: 100%; }

@media (min-width: 720px) {
  .view-login { align-items: center; padding-left: 8vw; }
  .main { max-width: 480px; padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .login-inner { animation: none; }
}
