/* ══════════════════════════════════════════════════════════════════════
   MAK FIT — coach dashboard + client portal
   Same brand as the public site, denser: this is a tool people open every
   day, so contrast and hit targets win over spectacle.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --bg:      #07080a;
  --bg-2:    #0b0d11;
  --panel:   #101319;
  --panel-2: #151922;
  --panel-3: #1b202a;
  --line:    rgba(255, 255, 255, .085);
  --line-2:  rgba(255, 255, 255, .16);

  --ink:   #f2f5f8;
  --ink-2: rgba(242, 245, 248, .64);
  --ink-3: rgba(242, 245, 248, .40);

  --acc:    #c8f031;
  --acc-dk: #9ec41a;
  --acc-2:  #ff5a1f;
  --good:   #34c76a;
  --warn:   #ffc44d;
  --bad:    #ff5b5b;

  --r:    13px;
  --r-lg: 18px;

  --rail: 240px;
  --top:  62px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 24px 60px -22px rgba(0, 0, 0, .92);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--acc); text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--acc); color: #141c04; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #242932; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #333a45; }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 5px; }

.brand-txt { font-family: Anton, Impact, sans-serif; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; }
.brand-txt em { font-style: normal; color: var(--acc); }
.brand-mark { color: var(--acc); display: grid; place-items: center; }

/* ═══════════════════════════════════════════════════════════════ login */

.is-login { display: grid; place-items: center; min-height: 100svh; padding: 24px; position: relative; overflow: hidden; }

.login-art { position: absolute; inset: 0; pointer-events: none; }
.la-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(90% 70% at 50% 30%, #000, transparent 74%);
  -webkit-mask-image: radial-gradient(90% 70% at 50% 30%, #000, transparent 74%);
}
.la-glow {
  position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 640px; height: 520px; border-radius: 50%; filter: blur(96px);
  background: radial-gradient(circle, rgba(200, 240, 49, .22), transparent 66%);
}

.login-box {
  position: relative; width: min(100%, 420px);
  padding: clamp(28px, 5vw, 40px);
  border: 1px solid var(--line); border-radius: 22px;
  background: rgba(16, 19, 25, .86);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; color: var(--ink); }
.login-box h1 { margin: 0 0 6px; font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.login-sub { margin: 0 0 26px; color: var(--ink-2); font-size: 14.5px; }
.login-box form { display: grid; gap: 16px; }
.login-foot { margin: 22px 0 0; text-align: center; font-size: 13.5px; color: var(--ink-3); }

.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 8px;
}
.pw-eye:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.pw-eye.on { color: var(--acc); }

/* ═══════════════════════════════════════════════════════════ buttons */

.btn {
  --btn-bg: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--btn-bg);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .16s var(--ease), opacity .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

.btn-solid { --btn-bg: var(--acc); color: #141c04; }
.btn-solid:hover:not(:disabled) { --btn-bg: #d9f95e; }

.btn-line { border-color: var(--line-2); color: var(--ink); }
.btn-line:hover:not(:disabled) { border-color: var(--acc); color: var(--acc); }

.btn-soft { --btn-bg: var(--panel-3); color: var(--ink); }
.btn-soft:hover:not(:disabled) { --btn-bg: #232935; }

.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: rgba(255, 255, 255, .06); }

.btn-danger { color: var(--bad); border-color: rgba(255, 91, 91, .35); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 91, 91, .12); }

.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 9px; background: none;
  color: var(--ink-3); cursor: pointer; transition: all .2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: rgba(255, 255, 255, .05); }
.icon-btn.danger:hover { color: var(--bad); border-color: rgba(255, 91, 91, .4); background: rgba(255, 91, 91, .1); }
.icon-btn svg { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════ fields */

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field > span i, .req { color: var(--acc); font-style: normal; }
.field .hint { font-size: 11.5px; color: var(--ink-3); }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg-2); color: var(--ink);
  font: inherit; font-size: 14.5px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { resize: vertical; min-height: 82px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: rgba(242, 245, 248, .26); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--acc); background: #0e1116;
  box-shadow: 0 0 0 3px rgba(200, 240, 49, .12);
}
input.bad, select.bad, textarea.bad { border-color: var(--bad); }
input[type=date] { color-scheme: dark; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a0ac' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
  padding-right: 36px; cursor: pointer;
}
select option { background: #0e1116; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.check input { width: 17px; height: 17px; accent-color: var(--acc); cursor: pointer; }

.form-msg { margin: 0; font-size: 13.5px; font-weight: 600; min-height: 1px; text-align: center; }
.form-msg.err  { color: var(--bad); }
.form-msg.good { color: var(--good); }

.f-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.f-row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ═══════════════════════════════════════════════════════════ layout */

.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100svh; }

/* ---- rail (desktop sidebar) */

.rail {
  position: sticky; top: 0; height: 100svh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
}

.rail-brand { display: flex; align-items: center; gap: 9px; padding: 6px 10px 20px; color: var(--ink); }
.rail-brand .brand-txt { font-size: 21px; }

.rail-nav { display: flex; flex-direction: column; gap: 3px; }
.rail-nav button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-align: left;
  cursor: pointer; transition: background .18s, color .18s;
}
.rail-nav button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.rail-nav button:hover { background: rgba(255, 255, 255, .05); color: var(--ink); }
.rail-nav button.on { background: rgba(200, 240, 49, .12); color: var(--acc); font-weight: 600; }

.nav-pill {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--acc-2); color: #fff; font-size: 11px; font-weight: 800;
}

.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.rail-user {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 11px; background: none;
  cursor: pointer; text-align: left; color: inherit; transition: background .18s;
}
.rail-user:hover { background: rgba(255, 255, 255, .05); }
.avatar {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(140deg, var(--acc-dk), #7fa815);
  color: #141c04; font-size: 13px; font-weight: 800; letter-spacing: .02em;
}
.avatar.lg { width: 54px; height: 54px; font-size: 19px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.ru-txt { min-width: 0; display: flex; flex-direction: column; }
.ru-txt b { font-size: 13.6px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ru-txt span { font-size: 11.5px; color: var(--ink-3); }

/* ---- main */

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: var(--top); padding: 0 clamp(16px, 3vw, 30px);
  background: rgba(7, 8, 10, .84);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.topbar .sub { font-size: 12.5px; color: var(--ink-3); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.page { padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 30px) 90px; flex: 1; }
.page > * + * { margin-top: 18px; }

.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink-3); font-size: 13.5px; font-weight: 600; background: none; border: 0;
  cursor: pointer; padding: 4px 0;
}
.back-link:hover { color: var(--acc); }

/* ---- mobile tab bar */

.tabbar { display: none; }

/* ═══════════════════════════════════════════════════════════ panels */

.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.panel-head .ph-sub { font-size: 12.5px; color: var(--ink-3); }
.panel-head .ph-act { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ═══════════════════════════════════════════════════════ stat tiles */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.stat {
  position: relative; overflow: hidden;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
}
.stat .s-label { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.stat .s-value { display: block; margin-top: 6px; font-family: Anton, Impact, sans-serif; font-size: 31px; line-height: 1.05; letter-spacing: .02em; }
.stat .s-foot { margin-top: 4px; font-size: 12.2px; color: var(--ink-3); }
.stat.accent .s-value { color: var(--acc); }
.stat.warn   .s-value { color: var(--warn); }
.stat.good   .s-value { color: var(--good); }
.stat.clickable { cursor: pointer; transition: border-color .2s, background .2s; }
.stat.clickable:hover { border-color: var(--line-2); background: var(--panel-2); }

/* ═══════════════════════════════════════════════════════════ badges */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.active   { background: rgba(52, 199, 106, .13); color: var(--good);  border-color: rgba(52, 199, 106, .3); }
.badge.paused   { background: rgba(255, 196, 77, .13); color: var(--warn);  border-color: rgba(255, 196, 77, .3); }
.badge.expired  { background: rgba(255, 91, 91, .13);  color: var(--bad);   border-color: rgba(255, 91, 91, .3); }
.badge.new      { background: rgba(200, 240, 49, .13); color: var(--acc);   border-color: rgba(200, 240, 49, .32); }
.badge.contacted{ background: rgba(255, 196, 77, .13); color: var(--warn);  border-color: rgba(255, 196, 77, .3); }
.badge.accepted { background: rgba(52, 199, 106, .13); color: var(--good);  border-color: rgba(52, 199, 106, .3); }
.badge.rejected { background: rgba(255, 255, 255, .06); color: var(--ink-3); border-color: var(--line); }
.badge.muted    { background: rgba(255, 255, 255, .06); color: var(--ink-3); border-color: var(--line); }

/* ═══════════════════════════════════════════════════════════ tables */

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.tbl th {
  padding: 11px 16px; text-align: left; font-size: 11.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background .16s; }
table.tbl tbody tr.row-click { cursor: pointer; }
table.tbl tbody tr.row-click:hover { background: rgba(255, 255, 255, .035); }
.td-name { display: flex; align-items: center; gap: 11px; }
.td-name b { font-weight: 600; }
.td-sub { font-size: 12.2px; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* ═══════════════════════════════════════════════════════════ lists */

.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row-main b { font-weight: 600; font-size: 14.5px; }
.row-main span { font-size: 12.5px; color: var(--ink-3); }
.row-act { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.row.clickable { cursor: pointer; transition: background .16s; }
.row.clickable:hover { background: rgba(255, 255, 255, .035); }

/* ═══════════════════════════════════════════════════════════ empty */

.empty { padding: 46px 26px; text-align: center; color: var(--ink-3); }
.empty svg { width: 38px; height: 38px; margin: 0 auto 14px; color: var(--line-2); }
.empty b { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 15px; }
.empty p { margin: 0 auto; max-width: 42ch; font-size: 13.8px; }
.empty .btn { margin-top: 18px; }

/* ═══════════════════════════════════════════════════════════ tabs */

.tabs {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px;
  border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; padding: 11px 15px; border: 0; background: none;
  color: var(--ink-3); font-size: 14px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: color .18s;
}
.tabs button::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--acc); border-radius: 2px; transform: scaleX(0); transition: transform .25s var(--ease);
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { color: var(--acc); }
.tabs button.on::after { transform: scaleX(1); }

/* ═══════════════════════════════════════════════════════════ modal */

.modal-back {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 5, 7, .74); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }

.modal {
  width: min(100%, 620px); max-height: calc(100svh - 40px);
  display: flex; flex-direction: column;
  border: 1px solid var(--line-2); border-radius: 20px;
  background: var(--panel); box-shadow: var(--shadow);
  animation: rise .3s var(--ease);
}
.modal.wide { width: min(100%, 880px); }
.modal.slim { width: min(100%, 440px); }
@keyframes rise { from { transform: translateY(18px) scale(.98); opacity: 0; } }

.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.modal-head .mh-sub { font-size: 12.5px; color: var(--ink-3); }
.modal-x { margin-left: auto; }
.modal-body { padding: 20px; overflow-y: auto; display: grid; gap: 15px; }
.modal-foot {
  display: flex; gap: 9px; justify-content: flex-end;
  padding: 15px 20px; border-top: 1px solid var(--line); flex: 0 0 auto;
}
.modal-foot .spread { margin-right: auto; }

/* ═══════════════════════════════════════════════════════════ toast */

.toast-wrap {
  position: fixed; left: 50%; bottom: 24px; z-index: 400;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(100% - 32px, 460px);
}
.toast {
  padding: 12px 20px; border-radius: 999px;
  background: var(--acc); color: #141c04; font-size: 14px; font-weight: 700;
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .9);
  animation: toastIn .3s var(--ease);
  max-width: 100%; text-align: center;
}
.toast.bad  { background: var(--bad);  color: #fff; }
.toast.info { background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-2); }
.toast.out  { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn  { from { transform: translateY(16px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

/* ═══════════════════════════════════════════════════════ progress ui */

.bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--acc); transition: width .6s var(--ease); }
.bar.good i { background: var(--good); }
.bar.warn i { background: var(--warn); }

.ring { display: grid; place-items: center; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: rgba(255, 255, 255, .08); }
.ring .val { stroke: var(--acc); transition: stroke-dashoffset .8s var(--ease); }
/* Keep the caption inside the ring - it is centred over the stroke, so a long
   word would otherwise sit across it. */
.ring-txt { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: 1.1; max-width: 82%; text-align: center; }
.ring-txt b { font-family: Anton, Impact, sans-serif; font-size: 22px; letter-spacing: .02em; }
.ring-txt span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* macro bars */
.macros { display: grid; gap: 12px; }
.macro { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.macro .m-name { color: var(--ink-2); font-weight: 600; }
.macro .m-num { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12.5px; }
.macro.p .bar i { background: var(--acc); }
.macro.c .bar i { background: var(--warn); }
.macro.f .bar i { background: var(--acc-2); }

/* activity strip */
.strip { display: flex; gap: 3px; flex-wrap: wrap; }
.strip i {
  width: 13px; height: 13px; border-radius: 3px; background: rgba(255, 255, 255, .06);
  transition: background .2s;
}
.strip i.on   { background: rgba(200, 240, 49, .45); }
.strip i.on2  { background: var(--acc); }
.strip i.today { box-shadow: 0 0 0 1.5px var(--acc-2); }

/* line chart */
.chart { width: 100%; height: 210px; display: block; overflow: visible; }
.chart .grid-l { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--acc); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: url(#cGrad); }
.chart .pt { fill: var(--bg); stroke: var(--acc); stroke-width: 2; }
.chart .lbl { fill: rgba(242, 245, 248, .42); font-size: 10.5px; font-family: Inter, sans-serif; }
.chart .goal { stroke: var(--acc-2); stroke-width: 1.4; stroke-dasharray: 5 5; }

/* ═══════════════════════════════════════════════════════ workout ui */

.day-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); overflow: hidden; }
.day-card + .day-card { margin-top: 10px; }
.day-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .015);
}
.day-head .dh-day { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.day-head b { font-size: 15px; font-weight: 700; }
.day-head .dh-act { margin-left: auto; display: flex; gap: 6px; }
.day-card.rest { opacity: .62; }
.day-card.today { border-color: rgba(200, 240, 49, .4); box-shadow: 0 0 0 1px rgba(200, 240, 49, .12) inset; }

.ex {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.ex:last-child { border-bottom: 0; }
.ex-num {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; margin-top: 1px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); color: var(--ink-3);
  font-size: 11.5px; font-weight: 700;
}
.ex-main { flex: 1; min-width: 0; }
.ex-main b { display: block; font-size: 14.6px; font-weight: 600; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.ex-meta span {
  padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .055);
  font-size: 11.8px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.ex-meta span.hi { background: rgba(200, 240, 49, .12); color: var(--acc); }
.ex-note { margin: 6px 0 0; font-size: 12.8px; color: var(--ink-3); }
.ex-act { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }

/* the round tick used for exercises, sessions and meals */
.tick {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--line-2); background: none; cursor: pointer;
  display: grid; place-items: center; color: transparent;
  transition: all .22s var(--ease);
}
.tick svg { width: 15px; height: 15px; }
.tick:hover { border-color: var(--acc); }
.tick.on { background: var(--acc); border-color: var(--acc); color: #141c04; }
.tick.on:hover { background: #d9f95e; }
.done .ex-main b { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }

.vid-link { color: var(--ink-3); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; }
.vid-link:hover { color: var(--acc); background: rgba(200, 240, 49, .1); }

/* ═══════════════════════════════════════════════════════ meals ui */

.meal { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); overflow: hidden; }
.meal + .meal { margin-top: 10px; }
.meal-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.meal-head b { font-size: 15px; font-weight: 700; }
.meal-head .mh-time { font-size: 12px; color: var(--ink-3); }
.meal-head .mh-kcal { margin-left: auto; font-size: 12.5px; color: var(--acc); font-weight: 700; font-variant-numeric: tabular-nums; }

/* The macro figures must never be clipped, so the row is allowed to wrap and
   drop them onto their own line once the name has taken the space it needs. */
.mi { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.mi:last-child { border-bottom: 0; }
.mi.alt { padding-left: 40px; background: rgba(255, 255, 255, .012); }
.mi.alt::before { content: "or"; position: absolute; margin-left: -26px; font-size: 11.5px; color: var(--ink-3); font-style: italic; }
.mi-main { flex: 1 1 150px; min-width: 0; }
.mi-main b { font-size: 14.2px; font-weight: 500; }
.mi-qty { font-size: 12.5px; color: var(--ink-3); }
.mi-macros { display: flex; gap: 9px; font-size: 11.8px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; margin-left: auto; }
.mi-macros b { color: var(--ink-2); font-weight: 600; }

/* ═══════════════════════════════════════════════════════ check-ins */

.ci { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); padding: 16px; }
.ci + .ci { margin-top: 12px; }
.ci-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ci-head b { font-size: 14.5px; }
.ci-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ci-m { padding: 9px 11px; border-radius: 9px; background: rgba(255, 255, 255, .035); }
.ci-m span { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ci-m b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ci-note { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.ci-photos { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ci-photos a { width: 84px; height: 112px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.ci-photos img { width: 100%; height: 100%; object-fit: cover; }
.ci-reply {
  padding: 12px 14px; border-radius: 10px;
  background: rgba(200, 240, 49, .07); border: 1px solid rgba(200, 240, 49, .22);
  font-size: 13.8px; color: var(--ink); white-space: pre-wrap;
}
.ci-reply b { display: block; margin-bottom: 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }

/* ═══════════════════════════════════════════════════════ messages */

.chat { display: flex; flex-direction: column; height: min(64svh, 560px); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 15px; font-size: 14.3px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg.them { align-self: flex-start; background: var(--panel-3); border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: var(--acc); color: #141c04; border-bottom-right-radius: 5px; font-weight: 500; }
.msg-time { display: block; margin-top: 4px; font-size: 10.5px; opacity: .6; }
.chat-day { align-self: center; padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .05); font-size: 11.5px; color: var(--ink-3); }
.chat-foot { display: flex; gap: 9px; align-items: flex-end; padding: 13px 16px; border-top: 1px solid var(--line); }
.chat-foot textarea { min-height: 42px; max-height: 130px; border-radius: 12px; }

/* ═══════════════════════════════════════════════════════ builder ui */

.builder-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel-2); margin-bottom: 14px;
}
.builder-bar .bb-title { font-weight: 700; font-size: 15px; }
.builder-bar .bb-meta { font-size: 12.5px; color: var(--ink-3); }
.builder-bar .bb-act { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }

.drag-handle { cursor: grab; color: var(--ink-3); display: grid; place-items: center; width: 22px; }
.drag-handle:active { cursor: grabbing; }
.ex.dragging { opacity: .4; }
.ex.drop-target { box-shadow: inset 0 2px 0 var(--acc); }

.picker-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.picker-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 13px;
  border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer;
  text-align: left; transition: background .16s;
}
.picker-list button:last-child { border-bottom: 0; }
.picker-list button:hover { background: rgba(255, 255, 255, .05); }
.picker-list b { font-size: 14px; font-weight: 500; }
.picker-list span { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* password reveal box */
.pw-box {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  background: rgba(200, 240, 49, .08); border: 1px solid rgba(200, 240, 49, .3);
}
.pw-box code {
  flex: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 19px;
  font-weight: 700; letter-spacing: .06em; color: var(--acc); user-select: all;
}

/* ═══════════════════════════════════════════════════════ responsive */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .split { grid-template-columns: 1fr; }
  .page { padding-bottom: 96px; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(9, 11, 14, .93);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--line);
  }
  .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 2px; border: 0; background: none; border-radius: 10px;
    color: var(--ink-3); font-size: 10.5px; font-weight: 600; cursor: pointer;
    position: relative; transition: color .18s;
  }
  .tabbar button svg { width: 21px; height: 21px; }
  .tabbar button.on { color: var(--acc); }
  .tabbar .nav-pill {
    position: absolute; top: 3px; right: 50%; margin-right: -20px;
    min-width: 16px; height: 16px; font-size: 10px;
  }

  .topbar h1 { font-size: 17px; }
  .f-row4 { grid-template-columns: repeat(2, 1fr); }
  .f-row3 { grid-template-columns: 1fr 1fr; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal, .modal.wide, .modal.slim {
    width: 100%; max-height: 92svh; border-radius: 22px 22px 0 0; border-bottom: 0;
    animation: sheet .32s var(--ease);
  }
  @keyframes sheet { from { transform: translateY(100%); } }
  .msg { max-width: 88%; }
}

@media (max-width: 560px) {
  .f-row, .f-row3, .f-row4 { grid-template-columns: 1fr 1fr; }
  .stat .s-value { font-size: 26px; }
  .ci-photos a { width: 72px; height: 96px; }

  /* 168px tiles miss two-up by a few pixels on a 375px phone, which pushes
     today's actual session a full screen down. Shrink them so they pair. */
  .stats { grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
