/* Client area (app.html). Purple and white, phone first. */
:root {
  --p1: #7c3aed;
  --p2: #a855f7;
  --p-dark: #2e1065;
  --p-soft: #f3e8ff;
  --ink: #1f1433;
  --muted: #6b5b84;
  --line: #e4dcf2;
  --bg: #faf7ff;
  --error: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.hidden { display: none !important; }

.a-top {
  background: var(--p-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.a-logo { color: #fff; font-weight: 800; font-size: 19px; text-decoration: none; }
.a-logo span { color: #d8b4fe; margin-left: 4px; }

.a-main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }
h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 16px; color: var(--p-dark); }

.a-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.a-narrow { max-width: 420px; margin: 24px auto; }
.a-muted { color: var(--muted); }
.a-small { font-size: 14px; margin-bottom: 0; }
.a-error { color: var(--error); min-height: 1.5em; margin: 10px 0 0; }
a { color: var(--p1); }

label { display: block; font-size: 14px; font-weight: 600; margin-top: 14px; }
input, select {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1px solid #c9bde0;
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--p2);
  outline-offset: 2px;
}

.a-btn {
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
}
.a-btn-solid { background: var(--p1); color: #fff; }
.a-btn-solid:hover { background: #6d28d9; }
.a-btn-ghost { background: #fff; color: var(--p-dark); border-color: var(--line); }
.a-top .a-btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); padding: 8px 14px; }
.a-full { width: 100%; margin-top: 20px; padding: 14px; }
.a-link { background: none; border: 0; padding: 6px 0; font: inherit; color: var(--p1); font-weight: 600; cursor: pointer; }

/* My programmes */
.a-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.a-prog {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--p1);
  border-radius: 16px;
  padding: 18px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
}
.a-prog:hover { border-color: var(--p1); }
.a-prog strong { display: block; font-size: 19px; color: var(--p-dark); }
.a-prog span { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.a-prog em { display: inline-block; margin-top: 12px; font-style: normal; font-weight: 700; color: var(--p1); }

/* Day picker */
.a-daybar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.a-daybar select { margin: 0; flex: 1; font-weight: 600; }
.a-daybar .a-btn { padding: 9px 16px; font-size: 20px; line-height: 1; }
.a-daybar .a-btn:disabled { opacity: .4; cursor: default; }

/* Video and exercise list */
.a-split { display: grid; gap: 16px; }
.a-player { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
/* The exercise videos are upright (YouTube Shorts), so the player is upright too.
   It is as wide as the space allows, but never taller than about 70% of the screen. */
.a-player iframe {
  display: block; border: 0; border-radius: 10px; background: #000;
  aspect-ratio: 9 / 16;
  width: min(100%, calc(70vh * 9 / 16));
  margin: 0 auto;
}
.a-player h2 { font-size: 18px; margin: 12px 4px 2px; color: var(--p-dark); }
.a-player p { margin: 0 4px 4px; color: var(--muted); }

.a-exercises { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.a-ex {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.a-ex:hover { border-color: var(--p1); }
.a-ex[aria-current="true"] { border-color: var(--p1); background: var(--p-soft); }
.a-ex:disabled { opacity: .55; cursor: default; }
.a-plain { cursor: default; border-style: dashed; background: transparent; }
.a-plain:hover { border-color: var(--line); }
.a-num {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--p-soft);
  color: var(--p-dark);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
}
.a-ex[aria-current="true"] .a-num { background: var(--p1); color: #fff; }
.a-ex b { display: block; font-weight: 600; }
.a-ex small { display: block; color: var(--muted); font-size: 14px; }
.a-rest { background: var(--p-soft); border-radius: 12px; padding: 18px; color: var(--p-dark); font-weight: 600; }

.a-foot { text-align: center; padding: 18px 16px; font-size: 14px; color: var(--muted); }

@media (min-width: 860px) {
  .a-split { grid-template-columns: minmax(300px, 400px) 1fr; align-items: start; }
  .a-player { position: sticky; top: 76px; }
  h1 { font-size: 30px; }
}

/* Logo on the login card */
.a-loginlogo { display: block; width: 190px; max-width: 70%; height: auto; margin: 4px auto 18px; }

/* Install note for iPhone and iPad */
.a-hint {
  background: var(--p-soft);
  border: 1px solid #d8b4fe;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--p-dark);
}
.a-hint p { margin: 0; flex: 1 1 240px; }
.a-hint .a-btn { padding: 8px 16px; }

/* Header links */
.a-nav { display: flex; gap: 14px; align-items: center; }
.a-toplink { color: #e9d5ff; font-weight: 600; font-size: 15px; text-decoration: none; }
.a-toplink:hover { color: #fff; text-decoration: underline; }

/* Progress and "done" */
.a-progress { margin: -8px 0 14px; font-size: 15px; }
.a-done { display: block; width: 100%; max-width: 420px; margin: 22px auto 0; padding: 15px; font-size: 17px; }
.a-btn-done { background: #ecfdf3; color: #166534; border-color: #86efac; }
.a-ok { color: #166534; margin: 6px 0 0; }
.a-topbtn { background: none; border: 0; cursor: pointer; font-family: inherit; padding: 6px 0; }
.a-homelinks { margin: 26px 0 0; }
.a-toplink, .a-top .a-btn-ghost { white-space: nowrap; }

/* Show/hide button inside password boxes */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-eye {
  position: absolute; right: 4px; top: 6px; bottom: 0; width: 44px;
  display: grid; place-items: center; padding: 0;
  background: none; border: 0; border-radius: 8px; cursor: pointer; color: var(--muted);
}
.pw-eye:hover { color: var(--p1); }

/* Tip of the day: one line, opens to show the detail */
.a-tip { background: var(--p-soft); border: 1px solid var(--line); border-radius: 14px; margin: 0 0 14px; }
.a-tip summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  list-style: none; cursor: pointer; padding: 12px 14px; line-height: 1.4;
}
.a-tip summary::-webkit-details-marker { display: none; }
.a-tip summary::after { content: '+'; flex: none; font-size: 24px; line-height: 1; color: var(--p-dark); }
.a-tip[open] summary::after { content: '\2212'; }
.a-tip summary b { display: block; font-weight: 600; }
.a-tiplabel { display: block; font-size: 13px; color: var(--p-dark); font-weight: 600; }
.a-tip p { margin: 0; padding: 0 14px 14px; white-space: pre-line; }
.a-tip-flat summary { cursor: default; }
.a-tip-flat summary::after { content: none; }

/* Recipes */
.a-recipesbtn { margin: 0 0 14px; }
.a-recipes { display: grid; gap: 8px; margin-top: 14px; }
.a-recipe { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.a-recipe summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  list-style: none; cursor: pointer; padding: 14px;
}
.a-recipe summary::-webkit-details-marker { display: none; }
.a-recipe summary::after { content: '+'; flex: none; font-size: 24px; line-height: 1; color: var(--p-dark); }
.a-recipe[open] summary::after { content: '\2212'; }
.a-recipe[open] { border-color: var(--p1); }
.a-recipe summary b { font-weight: 600; }
.a-recipe h3 { margin: 4px 14px 6px; font-size: 14px; color: var(--p-dark); }
.a-recipe ul, .a-recipe ol { margin: 0 14px 14px; padding-left: 20px; }
.a-recipe li { margin: 4px 0; }

/* Veg and non-veg labels, filter buttons, and the day's meal ideas */
.a-recipe summary small, .a-meal small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.a-recipe summary b { display: block; }
.a-kind-veg { color: #15803d !important; }
.a-kind-nonveg { color: #b45309 !important; }
.a-kinds { display: flex; gap: 8px; margin-top: 12px; }
.a-kinds button {
  font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--p-dark); border: 1px solid var(--line);
}
.a-kinds button[aria-pressed="true"] { background: var(--p-dark); color: #fff; border-color: var(--p-dark); }
.a-meals { margin-top: 22px; }
.a-meals h2 { font-size: 18px; margin: 0 0 10px; }
.a-meals #mealsList { display: grid; gap: 8px; }
.a-meal {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font: inherit; color: inherit; cursor: pointer;
}
.a-meal:hover { border-color: var(--p1); }
.a-meal b { display: block; font-weight: 600; }
.a-meal em { flex: none; font-style: normal; font-weight: 600; color: var(--p1); font-size: 14px; }
@media (min-width: 860px) { .a-meals #mealsList { grid-template-columns: 1fr 1fr; } }
.a-recipe { scroll-margin-top: 84px; }
