:root {
  color-scheme: dark;
  --bg: #101713;
  --panel: #19241e;
  --line: #33443a;
  --text: #edf3eb;
  --muted: #a9baad;
  --accent: #b9dda5;
  --radius: 18px;
  font-family: system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px max(5vw, calc((100vw - 1060px) / 2));
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 32px;
  letter-spacing: -3px;
  font-weight: 850;
  color: var(--text);
  text-decoration: none;
}
.brand span {
  color: var(--accent);
}
.header-right,
.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-right {
  font-size: 12px;
  color: var(--muted);
}
.settings-link {
  color: var(--accent);
  text-underline-offset: 3px;
}
.plan-settings {
  max-width: 760px;
}
.plan-settings h3 {
  margin: 0;
}
.plan-settings fieldset {
  min-width: 0;
  margin: 18px 0 0;
  padding: 8px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.plan-settings legend {
  padding: 0 4px;
  font-size: 14px;
  font-weight: 700;
}
.plan-settings input:not([type='checkbox']) {
  min-width: 0;
  width: 100%;
  min-height: 44px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 0 12px;
}
.settings-date-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-bottom: 18px;
}
.settings-date-filter label {
  margin-top: 0;
}
.settings-feedback {
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--text);
}
.settings-hint {
  margin: 6px 0 0;
  font-size: 14px;
}
.settings-actions {
  margin-top: 16px;
}
.settings-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.settings-day {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.settings-day input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.settings-day span {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding-inline: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.settings-day input:checked + span {
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
}
.settings-day input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (forced-colors: active) {
  .settings-day input:checked + span {
    border-color: Highlight;
  }
}
.drive-settings {
  max-width: 760px;
}
.drive-settings input[type='text'] {
  width: 100%;
}
#drive-saved-file {
  overflow-wrap: anywhere;
}
.drive-settings fieldset {
  min-width: 0;
  margin: 20px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px
}
.drive-settings legend {
  padding: 0 4px;
  font-weight: 700;
}
.drive-settings .tick input {
  flex: none;
}
.drive-settings fieldset p {
  margin: 12px 0 0;
}
.drive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
main {
  max-width: 1060px;
  margin: auto;
  padding: 30px 20px 60px;
}
.intro {
  padding: 24px 0 30px;
  overflow-wrap: anywhere;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 750;
  color: var(--accent);
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(32px, 6vw, 57px);
  line-height: 1.1;
  letter-spacing: -2px;
  margin: 0 0 14px;
}
h2 {
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 12px;
}
p {
  color: var(--muted);
  margin: 0 0 16px;
}
.progress {
  height: 6px;
  border-radius: 8px;
  background: var(--line);
  overflow: hidden;
  margin: 24px 0 8px;
}
.progress div {
  height: 100%;
  background: var(--accent);
  width: 0;
}
.intro .spread {
  font-size: 12px;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.section-nav {
  flex-wrap: wrap;
}
.section-nav .tab {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 8px clamp(6px, 2vw, 16px);
  background: none;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}
.section-nav .tab.active {
  color: var(--accent);
  border-color: var(--accent);
}
button,
.button {
  border: 0;
  background: var(--accent);
  color: #152019;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.quiet,
.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.layout > div {
  min-width: 0;
}
.section-head {
  margin-bottom: 16px;
}
.entry-heading {
  flex-wrap: wrap;
}
.entry-heading h2 {
  margin: 0;
}
.date-controls {
  display: grid;
  grid-template-columns: 46px minmax(0, 155px) 46px auto;
  align-items: stretch;
  gap: 6px;
  max-width: 100%;
  margin-inline-start: auto;
}
.date-controls > * {
  min-height: 46px;
}
.date-controls input {
  min-width: 0;
  width: 100%;
  padding-inline: 8px;
  font-size: 14px;
}
.date-controls #entry-today {
  padding-inline: 9px;
}
.nav-btn {
  display: grid;
  place-items: center;
  padding: 0;
}
.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}
.gym-extra {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
#gym-extra-status {
  order: -1;
  margin: 0;
}
article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
label {
  display: block;
  font-size: 14px;
  margin: 16px 0 6px;
  font-weight: 600;
}
input,
textarea,
select {
  font: inherit;
  background: #101713;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  max-width: 100%;
}
textarea,
select,
input[type='password'] {
  width: 100%;
  display: block;
}
textarea {
  resize: vertical;
}
form > button {
  margin-top: 14px;
}
input[type='checkbox'] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
.tick {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.scale button {
  min-height: 44px;
  padding: 0;
  background: #25372d;
  color: var(--text);
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 21px;
  line-height: 1;
}
@media (min-width: 1024px) {
  .scale {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
  }
}
.scale button.selected {
  background: var(--accent);
  color: var(--bg);
}
output {
  color: var(--accent);
  float: right;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stats article {
  padding: 15px;
}
.stat {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}
.weight-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weight-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.weight-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.weight-label {
  color: var(--muted);
}
.weight-value {
  font-weight: 700;
  color: var(--accent);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: var(--bg);
}
.chart-row {
  display: grid;
  grid-template-columns: 90px 1fr 30px;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  font-size: 12px;
}
.bar {
  height: 10px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden
}
.bar div {
  background: var(--accent);
  height: 100%;
}
.login {
  max-width: 420px;
  margin: 9vh auto;
}
.login h1 {
  font-size: 42px;
}
.save-feedback {
  position: sticky;
  bottom: 8px;
  z-index: 1;
  background: var(--panel);
  padding: 10px;
  border-radius: 8px;
}
#status {
  margin: 0;
}
#retry-save:not([hidden]) {
  margin-top: 6px;
}
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.history-item p {
  margin: 0;
}
.objectives-panel {
  margin-top: 24px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.objectives-heading {
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.objectives-heading h3 {
  margin: 0;
}
#reflection-state,
#reflection-feedback,
#reflection-editor-feedback {
  margin: 8px 0;
}
#reflection-state:empty,
#reflection-feedback:empty,
#reflection-editor-feedback:empty {
  display: none;
}
#reflection-items {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
#reflection-items:empty {
  display: none;
}
.reflection-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.reflection-checkbox-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
}
.reflection-text {
  padding: 12px 4px 12px 0;
  font-size: 14px;
  line-height: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.reflection-generated {
  font-style: italic;
}
.reflection-user-edited {
  font-weight: 500;
  text-decoration: underline dashed var(--accent);
  text-underline-offset: 3px;
}
.reflection-complete {
  position: absolute;
  opacity: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.reflection-checkmark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid var(--muted);
  border-radius: 4px;
}
.reflection-checkbox-wrap:hover .reflection-checkmark {
  border-color: var(--accent);
}
.reflection-complete:checked + .reflection-checkmark {
  background: var(--accent);
  border-color: var(--accent);
}
.reflection-complete:checked + .reflection-checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.reflection-complete:focus-visible + .reflection-checkmark {
  outline: 2px solid var(--accent);
  outline-offset: 2px
}
.reflection-done .reflection-text {
  color: var(--muted);
  text-decoration: line-through
}
.reflection-edit,
.reflection-del {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0;
  border-color: transparent;
  font-size: 19px;
  line-height: 1
}
#reflection-editor {
  width: min(440px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  z-index: 2
}
#reflection-editor::backdrop {
  background: rgb(0 0 0 / 65%);
}
.reflection-editor-actions {
  display: flex;
  flex-wrap: wrap
  justify-content: end
  gap: 8px
  margin-top: 16px
}
@media (forced-colors: active) {
  .reflection-complete:checked + .reflection-checkmark {
    border-color: Highlight
  }
  .reflection-complete:checked + .reflection-checkmark::after {
    border-color: Highlight
  }
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px
}
button:disabled {
  opacity: 0.5
  cursor: wait
}
[hidden] {
  display: none !important
}
@media (max-width: 700px) {
  .layout {
    grid-template-columns: 1fr
    gap: 0
  }
  main {
    padding: 18px 14px 36px
  }
  article {
    padding: 16px
  }
  .stats {
    grid-template-columns: 1fr 1fr
  }
  .section-head h2 {
    font-size: 18px
  }
  .intro {
    padding-top: 12px
  }
}
@media (max-width: 440px) {
  .date-controls {
    grid-template-columns: 44px minmax(0, 1fr) 44px auto
    width: 100%
  }
}