:root {
  --bg: #FAFAF8;
  --ink: #17201B;
  --muted: #79827D;
  --line: #E4E6E1;
  --accent: #1E5B3C;
  --card-a: #F2F3EF;
  --card-b: #ECEEE8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.muted {
  color: var(--muted);
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Buttons and fields */

.btn {
  height: 44px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn.primary {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.btn.quiet {
  color: var(--muted);
  border-color: transparent;
}


.field {
  height: 44px;
  padding: 0 14px;
  font-size: 16px; /* below 16px iOS Safari auto-zooms the page on focus */
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
}

.field-wrap {
  position: relative;
  display: flex;
}

.field-wrap .field {
  flex-grow: 1;
  padding-right: 46px;
}

.eye-btn {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
}

.eye-btn:hover {
  color: var(--ink);
}

.field-label {
  font-size: 11px;
  color: var(--muted);
}

.form-error {
  font-size: 11px;
  color: var(--muted);
}

/* Login and enroll views */

.login,
.enroll {
  min-height: calc(100dvh - 60px);
  display: flex;
  align-items: center;
}

.login-inner {
  width: 100%;
  max-width: 326px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.login-brand {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form .btn {
  margin-top: 4px;
}

.face-first {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.enroll-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.enroll-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.enroll-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.enroll-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Top row */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stats {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  white-space: nowrap;
}

.lock-btn {
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lock-btn:hover {
  color: var(--accent);
}

/* Messages */

.message {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* Day tabs */

.tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.tab.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* Day view — cards */

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 12px;
  font-size: 11px;
}

.day-total {
  font-size: 12px;
  font-weight: 500;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 6px;
}

.card:nth-child(odd) {
  background: var(--card-a);
}

.card:nth-child(even) {
  background: var(--card-b);
}

.card.skipped {
  opacity: 0.55;
}

.card.pending {
  background: var(--bg);
  border: 1px dashed var(--line);
  padding: 11px 13px;
  opacity: 0.6;
}

.card .time {
  font-size: 11px;
  color: var(--muted);
  width: 40px;
  flex-shrink: 0;
}

.card .body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.card .desc {
  font-size: 14px;
}

.card .note {
  font-size: 11px;
  color: var(--muted);
}

.card .tag {
  font-size: 10px;
  color: var(--muted);
}

.card .kcal {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.empty {
  padding: 14px 0;
  font-size: 12px;
  color: var(--muted);
}

/* Weight chart */

.chart-block {
  margin-top: 26px;
}

.chart-title {
  font-size: 11px;
  margin-bottom: 8px;
}

#chart svg {
  display: block;
  width: 100%;
  height: auto;
}

#chart .axis {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  fill: var(--muted);
}

#chart .series {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
}

#chart .frame {
  stroke: var(--line);
  stroke-width: 1;
}

@media (max-width: 420px) {
  .stats {
    gap: 8px;
  }
}
