/*
 * theme.css — WRITTEN BY THE PLATFORM. Do not edit.
 *
 * Palette: Your colours (custom)
 * Source colours: #0e161a #e8f0ec #0a0c0f #4d4d56 #629ab7 #a9c0ec #ffffff
 *
 * Every value below is either one of those five or derived from them, and each
 * one is contrast-corrected against this palette's own background. Consume
 * them with var(--token); never write a colour value in app code.
 */

:root {
  --canvas: #0a0c0f;
  --surface: #4d4d56;
  --surface-2: #16181b;
  --border: #2c2e31;
  --border-strong: #545557;
  --ink: #e8f0ec;
  --muted: #bbbfbf;
  --accent: #629ab7;
  --accent-hover: #7aa9c2;
  --accent-ink: #0a0c0f;
  --accent-text: #a9c0ec;
  --accent-strong: #629ab7;
  --accent-soft: #1d2b34;
  --accent-border: #324c5b;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #0c2619;
  --success-strong: #499c68;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #2f1c0e;
  --warning-strong: #c57a40;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #311012;
  --danger-strong: #d16969;}

/* The same palette on a dark page — written here, never by the app. It
   applies while <html> carries data-theme="dark", which the platform's own
   toggle sets and remembers; an app that never renders that toggle is exactly
   as it was. Do not repoint any of these from app code: a token that
   references another token here is a cycle, and CSS makes every property in
   a cycle invalid. */
html[data-theme="dark"] {
  --canvas: #0a0c0f;
  --surface: #4d4d56;
  --surface-2: #16181b;
  --border: #2c2e31;
  --border-strong: #545557;
  --ink: #e8f0ec;
  --muted: #bbbfbf;
  --accent: #629ab7;
  --accent-hover: #7aa9c2;
  --accent-ink: #0a0c0f;
  --accent-text: #a9c0ec;
  --accent-strong: #629ab7;
  --accent-soft: #1d2b34;
  --accent-border: #324c5b;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #0c2619;
  --success-strong: #499c68;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #2f1c0e;
  --warning-strong: #c57a40;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #311012;
  --danger-strong: #d16969;
}

/* ====================================================================
 * app.css — THIS APP'S OWN CSS. Yours to write. Ships empty.
 *
 * design.css is a FLOOR, not a ceiling.
 *
 * For a long time it was both, and the cost was measurable: an app could
 * not write a single CSS rule, so every app built here had the same 10px
 * radius, the same Public Sans at the same 15px, the same 1px borders and
 * the same soft shadow. Only fourteen COLOUR tokens ever differed. Three
 * apps in a row came out looking like the same product in three coats of
 * paint, which is what this file exists to end.
 *
 * It loads AFTER design.css and theme.css, so anything here wins.
 *
 * ---- THE FIRST LEVER: RETUNE THE SYSTEM ---------------------------
 *
 * A :root block here re-tunes every component at once — nothing is
 * restyled one class at a time. These are the tokens that decide an app's
 * CHARACTER, and they are the fastest way to make two apps look nothing
 * alike:
 *
 *   --radius-sm --radius --radius-lg   0 is brutal, 4 is crisp, 18 is soft
 *   --font-sans --font-mono            a display face changes more than colour
 *   --t-xs … --t-5xl                   the type scale, and how far it ramps
 *   --lh --lh-tight --track-tight      density and tone
 *   --s-1 … --s-12                     the spacing scale: tight or generous
 *   --shadow --shadow-raised           flat, or lifted
 *   --border --border-strong widths    hairline, or heavy and drawn
 *   --dur-1 --dur-2 --ease             brisk, or languid
 *   --content-max --measure            a wide dashboard or a narrow reading page
 *
 * COLOUR IS THE ONE EXCEPTION, and it is not a technicality: the owner
 * picked the palette on the approval card before you built anything, and
 * it is the only part of the look they chose themselves. theme.css holds
 * it. Write var(--accent), var(--ink), var(--canvas) — never a hex, an
 * rgb() or an hsl(), here or anywhere. The validator refuses those.
 *
 * ---- THE SECOND LEVER: WRITE WHAT IS NOT THERE ---------------------
 *
 * design.css covers the ordinary furniture. It does NOT cover the one
 * screen that makes this app itself — a timer's dial, a board's columns,
 * a chart, a seating plan, a game grid. Write those here, in full, and
 * name them for what they are (.dial, .board-col), never .card-2.
 *
 * Compose the primitives where they fit and write your own where they do
 * not. An app that used only the frozen classes and added nothing shipped
 * 160 component classes and zero rules of its own — and read as generated,
 * because the system's ceiling had become the app's ceiling.
 *
 * Keep using the tokens in what you write. A rule built on var(--s-4) and
 * var(--radius) stays consistent with everything around it and follows the
 * app when its character changes; one built on 16px and 10px does not.
 * ==================================================================== */

/* FitTrack — retunes the system toward a premium dark fitness command
   centre, then adds the handful of components the system does not have. */

:root {
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 22px;
  --track-tight: -0.03em;
  --dur-2: 160ms;
}

body {
  letter-spacing: 0.01em;
}

.page-title {
  letter-spacing: var(--track-tight);
}

/* ---------------------------------------------------------------------
   Landing / auth
--------------------------------------------------------------------- */

.hero-band {
  background: linear-gradient(160deg, var(--surface-2), var(--canvas) 70%);
  border-bottom: 1px solid var(--border);
  padding: var(--s-11) var(--s-5);
}
.hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.hero-title {
  font-size: var(--t-4xl);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  max-width: 20ch;
  line-height: var(--lh-tight);
}
.hero-sub {
  font-size: var(--t-lg);
  color: var(--muted);
  max-width: 56ch;
}
.feature-emoji {
  font-size: 28px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.auth-wrap {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: var(--s-6);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--s-8);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: var(--t-lg);
  color: var(--accent-text);
}

/* ---------------------------------------------------------------------
   Sidebar footer / user chip
--------------------------------------------------------------------- */

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
}
.user-chip-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.user-chip-name {
  font-size: var(--t-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip-email {
  font-size: var(--t-xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------------
   Bottom tab bar (mobile)
--------------------------------------------------------------------- */

.bottomnav {
  display: none;
}
@media (max-width: 900px) {
  .shell-sidebar .sidebar {
    display: none;
  }
  .shell-sidebar .navbtn {
    display: none;
  }
  .bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    background: color-mix(in srgb, var(--surface) 92%, var(--canvas));
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: var(--s-2) var(--s-1) calc(var(--s-2) + env(safe-area-inset-bottom));
    z-index: 40;
  }
  .bottomnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--t-xs);
    color: var(--muted);
    padding: var(--s-1) var(--s-2);
    border-radius: var(--radius-sm);
    text-decoration: none;
  }
  .bottomnav-item span {
    margin-top: 2px;
  }
  .bottomnav-item .icon {
    width: 20px;
    height: 20px;
  }
  .bottomnav-item.is-active {
    color: var(--accent-text);
  }
  .content {
    padding-bottom: 84px;
  }
}

/* ---------------------------------------------------------------------
   Notifications bell
--------------------------------------------------------------------- */

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--surface);
}
.menu-notifs {
  width: 300px;
  max-height: 360px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  font-size: var(--t-sm);
  border-radius: var(--radius-sm);
}
.notif-item + .notif-item {
  margin-top: 2px;
}
.notif-emoji {
  flex: 0 0 auto;
}
.notif-success {
  background: var(--success-soft);
  color: var(--success-strong);
}
.notif-warning {
  background: var(--warning-soft);
  color: var(--warning-strong);
}
.notif-danger {
  background: var(--danger-soft);
  color: var(--danger-strong);
}

/* ---------------------------------------------------------------------
   Progress rings & mini bars
--------------------------------------------------------------------- */

.ring-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.ring-svg {
  display: block;
}
.ring-fill {
  transition: stroke-dashoffset 600ms var(--ease-out);
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ring-big {
  font-size: var(--t-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--track-tight);
}
.ring-small {
  margin-top: 2px;
  font-size: var(--t-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}

.mini-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  overflow: hidden;
  margin-top: 6px;
}
.mini-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 500ms var(--ease-out);
}

/* ---------------------------------------------------------------------
   Weekly bar charts
--------------------------------------------------------------------- */

.week-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-2);
  height: 140px;
}
.week-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  height: 100%;
  justify-content: flex-end;
}
.week-bar-track {
  width: 100%;
  max-width: 28px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  overflow: hidden;
}
.week-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 500ms var(--ease-out);
}
.week-bar-fill.is-demo {
  background: color-mix(in srgb, var(--muted) 40%, transparent);
}

/* ---------------------------------------------------------------------
   Stat / dashboard cards
--------------------------------------------------------------------- */

.stat-card {
  position: relative;
  overflow: hidden;
}
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-link:hover {
  border-color: var(--accent-border);
}

/* ---------------------------------------------------------------------
   Meals
--------------------------------------------------------------------- */

.meal-row {
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.meal-row + .meal-row {
  margin-top: var(--s-2);
}
.edit-form .field-row {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.edit-form .input {
  flex: 1 1 120px;
}

/* ---------------------------------------------------------------------
   Weekly diet plan / workout plan grid
--------------------------------------------------------------------- */

.diet-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--s-3);
}
@media (max-width: 980px) {
  .diet-week-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
.diet-day-card {
  min-width: 0;
}
.diet-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.diet-check {
  flex: 0 0 auto;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--success-strong);
  display: flex;
}
.diet-check-empty {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: inline-block;
}
.diet-emoji {
  flex: 0 0 auto;
}
.diet-text,
.diet-text-static {
  border: none;
  background: none;
  font-size: var(--t-sm);
  color: var(--ink);
  min-width: 0;
  flex: 1 1 auto;
  padding: 2px 0;
}
.diet-text:focus {
  outline: none;
  border-bottom: 1px solid var(--accent);
}
.diet-text-static {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diet-item.is-done .diet-text {
  color: var(--muted);
  text-decoration: line-through;
}

/* ---------------------------------------------------------------------
   Exercises & achievements
--------------------------------------------------------------------- */

.exercise-card {
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.exercise-card.is-done {
  border-color: var(--success-strong);
  box-shadow: 0 0 0 1px var(--success-strong) inset;
}
.exercise-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.badge-card {
  text-align: center;
  transition: transform var(--dur-2) var(--ease);
}
.badge-card.is-unlocked {
  border-color: var(--accent-border);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent);
}
.badge-card.is-locked {
  opacity: 0.55;
}
.badge-card:hover {
  transform: translateY(-2px);
}
.badge-emoji {
  font-size: 34px;
  line-height: 1;
}

/* ---------------------------------------------------------------------
   Misc
--------------------------------------------------------------------- */

.sparkline {
  display: block;
}
.empty-emoji {
  font-size: 34px;
  line-height: 1;
}
.steps-input {
  max-width: 160px;
  text-align: center;
  font-size: var(--t-xl);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .ring-fill,
  .mini-bar-fill,
  .week-bar-fill,
  .exercise-card,
  .badge-card {
    transition: none;
  }
}
