:root {
  color-scheme: light;
  --nav: #111d32;
  --bg: #f4f6fa;
  --paper: #fff;
  --ink: #19253a;
  --muted: #5c6980;
  --line: #dce2ec;
  --blue: #315adb;
  --pale: #eef2ff;
  --gold: #f1b75b;
  --green: #167353;
  --red: #aa3040;
  --input: #fff;
  --soft-badge: #edf0f6;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --nav: #090f1d;
  --bg: #0d1422;
  --paper: #151f30;
  --ink: #edf2fb;
  --muted: #a8b5c9;
  --line: #2c3a50;
  --blue: #86a3ff;
  --pale: #1b2a49;
  --gold: #f1b75b;
  --green: #69c99f;
  --red: #ff8997;
  --input: #101929;
  --soft-badge: #26344a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.55 system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2.15rem;
  letter-spacing: -0.06rem;
  line-height: 1.2;
  margin-bottom: 0;
}
h2 {
  font-size: 1.2rem;
  margin-bottom: 14px;
}
h3 {
  font-size: 1rem;
  margin-bottom: 5px;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 750;
  color: var(--muted);
  margin-bottom: 8px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  min-height: 42px;
}
button:hover {
  border-color: var(--blue);
  background: var(--pale);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
button.primary:hover {
  background: #2449bd;
}
button.danger {
  color: var(--red);
}
input,
textarea,
select {
  width: 100%;
  min-width: 0;
  background: var(--input);
  color: var(--ink);
  padding: 10px 11px;
  border: 1px solid #c9d2e2;
  border-radius: 7px;
  min-height: 43px;
}
textarea {
  resize: vertical;
}
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}
label input,
label textarea,
label select {
  display: block;
  margin-top: 6px;
  font-weight: 400;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #83a0ff;
  outline-offset: 3px;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 0.8125rem;
}
a {
  color: var(--blue);
}
[hidden] {
  display: none !important;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--nav);
  padding: 24px;
}
.loginbox {
  max-width: 460px;
  width: 100%;
  background: var(--paper);
  padding: 40px;
  border-radius: 18px;
}
.loginbox h1 {
  font-size: 2.5rem;
  margin-bottom: 18px;
}
.loginbox button {
  width: 100%;
  margin: 20px 0 12px;
}
.loginbox small {
  display: block;
}
.loginbox .eyebrow {
  margin-top: 28px;
}
.brandmark {
  background: var(--gold);
  color: var(--nav);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 850;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  letter-spacing: -4px;
  padding-right: 4px;
}
.brandmark span {
  position: relative;
  top: 3px;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 218px;
  background: var(--nav);
  color: #dde5f6;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: white;
  text-decoration: none;
  line-height: 1.2;
  font-size: 18px;
  margin-bottom: 40px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
nav button {
  background: none;
  border: 0;
  color: #c8d1e2;
  text-align: left;
}
nav button.active {
  background: #293c60;
  color: white;
}
nav button:hover {
  background: #20314d;
}
.asidebottom {
  margin-top: auto;
  font-size: 14px;
}
.asidebottom small {
  display: block;
  color: #a6b5ce;
  margin: 5px 0 16px;
}
.asidebottom button {
  border-color: #42516b;
  background: transparent;
  color: #dbe4f5;
  width: 100%;
}
.asidebottom button + button {
  margin-top: 7px;
}
main {
  margin-left: 218px;
  padding: 34px 36px;
  max-width: 1600px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.weekcontrols {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.weekcontrols input {
  width: 153px;
}
footer {
  margin-top: 32px;
  font-size: 13px;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.stat strong {
  display: block;
  font-size: 2rem;
  line-height: 1.25;
  margin: 6px 0;
}
.stat span {
  font-size: 14px;
  color: var(--muted);
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr);
  gap: 22px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
  min-width: 0;
}
.panelhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.panelhead h2 {
  margin: 0;
}
.session {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 15px;
}
.session:first-of-type {
  border-top: 0;
}
.sessiontime {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.sessiontime small {
  display: block;
  font-weight: 400;
}
.session p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}
.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.actions button {
  font-size: 14px;
  padding: 6px 10px;
  min-height: 36px;
}
.badge {
  font-size: 12px;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--soft-badge);
  color: #506078;
  white-space: nowrap;
}
.badge.done {
  background: #e4f4eb;
  color: #126143;
}
.badge.partial,
.badge.rescheduled {
  background: #fff2d9;
  color: #7a5012;
}
.badge.missed {
  background: #fce9eb;
  color: var(--red);
}
.badge.in_progress {
  background: #e8edff;
  color: var(--blue);
}
.plannote {
  color: var(--ink) !important;
  background: var(--pale);
  border-left: 3px solid var(--blue);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
}
.datestrip {
  display: grid;
  grid-template-columns: repeat(7, minmax(75px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.datestrip button {
  padding: 9px 8px;
  min-width: 75px;
}
.datestrip button small,
.datestrip button b {
  display: block;
}
.datestrip button.active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}
.datestrip button.active small {
  color: white;
}
.tagline {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 4px 0 10px;
  flex-wrap: wrap;
}
.anchorrow {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.anchorrow b {
  display: block;
}
.empty {
  padding: 20px 0;
  color: var(--muted);
  font-size: 14px;
}
.callout {
  padding: 14px 17px;
  background: var(--pale);
  border-left: 3px solid var(--blue);
  font-size: 14px;
  margin-bottom: 20px;
}
.weekdays {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.daycard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.daycard .session {
  grid-template-columns: 85px minmax(0, 1fr);
}
.daycard:last-child {
  grid-column: 1/-1;
}
.trend {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 155px;
  margin-top: 18px;
}
.trendcol {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.bararea {
  height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.bar {
  background: var(--blue);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  width: 65%;
  margin: 4px auto 0;
}
.trendcol b {
  color: var(--ink);
  font-weight: 600;
}
.trendcol small {
  font-size: 11px;
}
.trendlabel {
  margin-top: 5px;
}
.tablewrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
td small {
  display: block;
}
td button {
  font-size: 13px;
  padding: 5px 9px;
  min-height: 32px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.recordcard {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.recordcard p {
  font-size: 14px;
  margin: 7px 0;
}
.recordcard a {
  margin-right: 10px;
  font-size: 14px;
}
.recordcard .top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.recordcard .top button {
  padding: 4px 10px;
  min-height: 32px;
  font-size: 13px;
}
.milestones {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  font-size: 14px;
}
.milestones li {
  padding: 4px 0;
}
.milestones li.complete {
  color: var(--green);
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--blue);
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.formgrid .wide {
  grid-column: 1/-1;
}
.reviewform label {
  margin-bottom: 16px;
}
.reviewform textarea {
  min-height: 100px;
}
.reviewform button {
  margin-top: 8px;
}
.settingslist .template {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.template small {
  display: block;
}
.template button {
  align-self: center;
}
.summaryline {
  font-size: 14px;
  margin: 8px 0;
}
.categoryrow {
  display: grid;
  grid-template-columns: 100px 1fr 45px;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  margin: 13px 0;
}
.categoryrow progress {
  margin: 0;
}
.timer {
  color: var(--blue);
  font-size: 13px;
}
.error,
#loginError,
#editorError {
  color: var(--red);
  font-size: 14px;
}
#toast {
  background: #e4f4eb;
  color: #125438;
  padding: 13px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
}
#toast.error {
  background: #fce9eb;
  color: var(--red);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 620px;
  max-width: calc(100% - 24px);
  max-height: 90vh;
  padding: 24px;
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop {
  background: #101a32a8;
}
.modalhead,
.modalfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.modalhead h2 {
  margin: 0;
}
.modalhead button {
  font-size: 22px;
  line-height: 1;
}
.modalfoot {
  margin: 20px 0 0;
  justify-content: flex-end;
}
.modalfoot .danger {
  margin-right: auto;
}
#editorFields > label {
  margin-bottom: 15px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.focusnote {
  font-size: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.focusnote b {
  display: block;
}
.checklist {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 15px;
}
.checklist legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.checklist input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--blue);
}
.workoutlist > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.workoutlist b {
  white-space: nowrap;
  color: var(--blue);
}
.callout.compact {
  margin: 16px 0 0;
}
.mealgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.mealgrid article {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px;
}
.mealgrid article small,
.mealgrid article b,
.mealgrid article span {
  display: block;
}
.mealgrid article b {
  margin: 5px 0;
  font-size: 14px;
}
.mealgrid article span {
  color: var(--muted);
  font-size: 12px;
}
.healthnote {
  margin: 16px 0 0;
}
.priorities {
  padding-left: 22px;
}
.priorities li {
  padding: 9px 0 12px 6px;
  border-bottom: 1px solid var(--line);
}
.priorities li b,
.priorities li span,
.priorities li small {
  display: block;
}
.priorities li span {
  margin: 4px 0;
  color: var(--muted);
}
.priority-high {
  color: var(--red);
}
.priority-medium {
  color: #a36b18;
}
.profilecard {
  border-top: 4px solid var(--blue);
}
@media (max-width: 1100px) {
  main {
    padding: 26px 22px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  header {
    align-items: flex-start;
    flex-direction: column;
  }
  .weekdays {
    grid-template-columns: 1fr;
  }
  .daycard:last-child {
    grid-column: auto;
  }
}
@media (max-width: 750px) {
  aside {
    position: static;
    width: 100%;
    padding: 14px 16px;
    display: block;
  }
  .brand {
    margin: 0 0 13px;
    font-size: 16px;
  }
  .brandmark {
    width: 36px;
    height: 36px;
  }
  nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px;
  }
  nav button {
    font-size: 14px;
    padding: 8px 10px;
    min-height: 38px;
  }
  .asidebottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
  }
  .asidebottom button + button {
    margin: 0 0 0 6px;
  }
  .asidebottom small {
    display: none;
  }
  .asidebottom button {
    width: auto;
    font-size: 13px;
    min-height: 32px;
  }
  main {
    margin: 0;
    padding: 23px 14px;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    padding: 13px;
  }
  .stat strong {
    font-size: 1.6rem;
  }
  .grid2,
  .formgrid {
    grid-template-columns: 1fr;
  }
  .formgrid .wide {
    grid-column: auto;
  }
  .checklist {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 17px;
  }
  .session {
    grid-template-columns: 85px minmax(0, 1fr);
    gap: 8px;
  }
  .loginbox {
    padding: 28px;
  }
  .loginbox h1 {
    font-size: 2.1rem;
  }
  .weekcontrols input {
    width: 145px;
  }
  .sessiontime {
    font-size: 13px;
  }
  h1 {
    font-size: 1.8rem;
  }
  dialog {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.12s,
      border-color 0.12s;
  }
}
