/* GainzTracker app styles. Colours come from each user's settings (see inc/layout.php). */
:root {
  --bg: #05070B; --accent: #1E6BFF; --text: #F2F4F7; --muted: #9AA3B2; --on-accent: #FFFFFF;
  --surface: color-mix(in srgb, var(--bg) 92%, var(--text));
  --line: color-mix(in srgb, var(--bg) 82%, var(--text));
  --accent-text: color-mix(in srgb, var(--accent) 60%, var(--text));
  --bad: #FF6B6B;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 Arial, Helvetica, sans-serif; }
body.area-app { padding-bottom: 90px; }
a { color: var(--accent-text); }
h1 { font-size: 26px; line-height: 1.15; margin: 0 0 4px; }
h2 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.wrap { max-width: 920px; margin: 0 auto; padding: 20px; }
.area-auth .wrap { max-width: 480px; }

.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; min-height: 44px; padding: 0 8px; cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.notice { background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; }
.error { background: var(--surface); border: 1px solid var(--bad); border-radius: 12px; padding: 12px 14px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; margin-bottom: 14px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 14px; color: var(--text); font-size: 15px; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; }

.btn { display: block; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: inherit; font-size: 18px; font-weight: 700; text-align: center; text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); font-size: 15px; min-height: 48px; }
.btn.danger { background: var(--surface); color: var(--bad); border: 1px solid var(--bad); font-size: 15px; min-height: 48px; }

/* drop-down panels */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
summary { min-height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  font-weight: 700; font-size: 15px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
details[open] > summary::after { transform: rotate(-135deg); }
.panel { padding: 4px 16px 16px; }
.count { color: var(--muted); font-weight: 400; margin-left: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; color: var(--text); text-decoration: none; font-weight: 700; }
.list a span { color: var(--muted); font-weight: 400; font-size: 14px; }

.stats { display: flex; gap: 12px; }
.stats div { flex: 1; }
.stats b { display: block; font-size: 20px; }
.stats span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* exercise page */
.pills { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; }
.pills a { flex: 1; min-width: 52px; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; padding: 0 8px; }
.pills a.done { background: var(--surface); }
.pills a.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.suggest { font-size: 28px; font-weight: 700; color: var(--accent-text); margin: 0; }
.rule { height: 1px; background: var(--line); margin: 12px 0; }
.steppers { display: flex; gap: 12px; margin-bottom: 16px; }
.stepper { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; }
.stepper label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.stepper input[type=text] { border: 0; background: transparent; font-size: 40px; font-weight: 700; text-align: center; padding: 0; margin: 0 0 8px; min-height: 52px; }
.stepper .pm { display: flex; gap: 8px; }
.stepper .pm button { flex: 1; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 24px; font-weight: 700; cursor: pointer; }
table.hist { width: 100%; border-collapse: collapse; font-size: 14px; }
table.hist td { padding: 10px 0; border-top: 1px solid var(--line); }
table.hist td:last-child { text-align: right; width: 44px; }
table.hist .muted { font-size: 14px; }
.x-btn { width: 44px; height: 44px; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.row2 { display: flex; gap: 12px; }
.row2 > div { flex: 1; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: 72px; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px 10px; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; }
.tabs a.on { color: var(--accent-text); }



/* home page */
.home { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; padding: 16px 0 8px; }
.home h1 { font-size: 34px; margin-bottom: 12px; }
.home .lead { font-size: 18px; color: var(--muted); margin-bottom: 20px; }
.home .cta { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.home .small { font-size: 14px; color: var(--muted); margin-top: 12px; }
.phones { display: flex; gap: 20px; justify-content: center; }
.steps { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 32px; }
.steps .card { margin: 0; }
.steps b { display: block; margin-bottom: 4px; font-size: 17px; }
.steps span { color: var(--muted); font-size: 15px; }
.foot { text-align: center; color: var(--muted); font-size: 14px; margin-top: 32px; }
@media (min-width: 820px) {
  .home { grid-template-columns: 1fr auto; padding-top: 40px; }
  .home h1 { font-size: 44px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* phone pictures drawn in CSS, so they always match the real app */
.phone { width: 236px; flex: none; border: 9px solid #20252F; border-radius: 34px; background: var(--bg); overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); font-size: 11px; line-height: 1.35; position: relative; }
.phone::before { content: ""; position: absolute; top: 0; left: 50%; width: 84px; height: 14px; margin-left: -42px; background: #20252F; border-radius: 0 0 10px 10px; }
.phone .p-top { height: 40px; padding-top: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.phone .p-body { padding: 12px 12px 16px; min-height: 380px; }
.phone .p-h { font-size: 17px; font-weight: 700; }
.phone .p-m { color: var(--muted); margin-bottom: 10px; }
.phone .p-pills { display: flex; gap: 5px; margin-bottom: 10px; }
.phone .p-pills span { flex: 1; height: 26px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; }
.phone .p-pills .on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.phone .p-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.phone .p-card .m { color: var(--muted); }
.phone .p-card .line { height: 1px; background: var(--line); margin: 8px 0; }
.phone .p-big { font-size: 18px; font-weight: 700; color: var(--accent-text); }
.phone .p-steps { display: flex; gap: 8px; margin-bottom: 10px; }
.phone .p-steps > div { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; }
.phone .p-steps small { display: block; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.phone .p-steps strong { display: block; font-size: 24px; margin: 2px 0 6px; }
.phone .p-steps i { display: flex; gap: 5px; font-style: normal; }
.phone .p-steps i span { flex: 1; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.phone .p-btn { height: 36px; border-radius: 11px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.phone .p-row { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 5px; padding: 0 10px; }
.phone .p-row > div { min-height: 30px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.phone .p-row > div + div { border-top: 1px solid var(--line); }
.phone .p-row span { color: var(--muted); font-weight: 400; font-size: 10px; }
.phone.two { display: none; }
@media (min-width: 560px) { .phone.two { display: block; margin-top: 36px; } }

/* header bar */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.head-in { max-width: 920px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.site-head > .head-in { min-height: 60px; }
.brand { color: var(--text); font-size: 24px; font-weight: 700; text-decoration: none; letter-spacing: .01em; }
.head-btn { min-height: 40px; padding: 0 16px; display: flex; align-items: center; border-radius: 10px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; }
.mainnav { background: var(--accent); }
.mainnav .head-in { justify-content: flex-start; gap: 4px; overflow-x: auto; }
.mainnav a { color: var(--on-accent); text-decoration: none; font-weight: 700; font-size: 15px; padding: 0 14px; min-height: 46px; display: flex; align-items: center; white-space: nowrap; opacity: .85; border-bottom: 3px solid transparent; }
.mainnav a:hover, .mainnav a.on { opacity: 1; border-bottom-color: var(--on-accent); }
.area-app .mainnav { display: none; }
.site-foot { max-width: 920px; margin: 32px auto 0; padding: 20px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14px; }

/* two columns on a computer */
.cols { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.acard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; }
.acard img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--line); }
.acard span { padding: 12px; }
.acard small { display: block; padding: 0 12px 12px; color: var(--muted); font-weight: 400; font-size: 13px; margin-top: -6px; }
.sec { margin-top: 36px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sec-h b { font-size: 22px; }
.join-strip { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.join-strip b { display: block; font-size: 18px; }
.join-strip span { color: var(--muted); font-size: 15px; }
.prose { max-width: 720px; }
.prose h1 { font-size: 30px; margin-bottom: 12px; }
.prose h2 { font-size: 20px; letter-spacing: 0; text-transform: none; color: var(--text); margin: 24px 0 8px; }
.prose h3 { font-size: 17px; margin: 20px 0 6px; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; }
.prose p, .prose li { font-size: 17px; line-height: 1.6; }
.tags a { display: inline-block; padding: 8px 14px; margin: 0 6px 6px 0; border: 1px solid var(--line); border-radius: 20px; text-decoration: none; font-size: 14px; }
.funny { text-align: center; }
.funny img { max-width: 100%; max-height: 320px; border-radius: 12px; }

/* diet */
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; }
.macros b { display: block; font-size: 20px; }
.macros span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.food { display: flex; gap: 12px; align-items: center; padding: 12px 0; }
.food img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--line); }
.food .f-name { font-weight: 700; }
.food .f-mac { color: var(--muted); font-size: 13px; }
.food-row { border-top: 1px solid var(--line); }
.food-row:first-child { border-top: 0; }
.food-row details { background: none; border: 0; margin: 0 0 8px; }
.food-row summary { min-height: 36px; padding: 0; font-weight: 400; font-size: 14px; color: var(--accent-text); justify-content: flex-start; gap: 10px; }
.food-row .panel { padding: 4px 0 8px; }
.mini { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.mini input[type=text] { width: 110px; margin: 0; }
.mini .btn { width: auto; min-height: 48px; font-size: 15px; padding: 0 16px; }
.divider { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 10px 0 0; }
table.sheet { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sheet th, table.sheet td { border: 1px solid var(--line); padding: 8px; text-align: left; }

/* settings */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.swatches button { width: 44px; height: 44px; border-radius: 22px; border: 3px solid var(--line); padding: 0; cursor: pointer; }
.swatches input[type=color] { width: 64px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }

@media (min-width: 820px) {
  .area-app .mainnav { display: block; }
  .area-app .tabs { display: none; }
  body.area-app { padding-bottom: 0; }
  .site-head > .head-in { min-height: 72px; }
  .brand { font-size: 28px; }
  .cols { grid-template-columns: 1fr 1fr; }
  .cols > .full { grid-column: 1 / -1; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .join-strip { flex-direction: row; align-items: center; justify-content: space-between; }
  .join-strip .btn { width: auto; padding: 0 28px; }
  .narrow { max-width: 560px; }
}

@media print {
  .site-head, .tabs, .site-foot, .btn, form, .no-print { display: none !important; }
  body, .card { background: #fff !important; color: #000 !important; border-color: #999 !important; }
  table.sheet th, table.sheet td { border-color: #999; }
}
