/* "Review my data" (rackoon.fit/review/). Colors come from ../styles.css's tokens. */

/* Elements with display set below still hide with the hidden attribute. */
[hidden] {
  display: none !important;
}

:root {
  --series: #9c6400;
  --series-2: #5c636d;
  --grid: #e6e8ec;
  --pr: #9c6400;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --series: #f2b33d;
    --series-2: #a6a6a6;
    --grid: #333333;
    --pr: #f2b33d;
  }
}
:root[data-theme='dark'] {
  --series: #f2b33d;
  --series-2: #a6a6a6;
  --grid: #333333;
  --pr: #f2b33d;
}

button {
  font: inherit;
  color: inherit;
}
.btn-primary,
.btn-ghost,
.chip {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}
.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-text);
  padding: 10px 22px;
}
.btn-ghost {
  background: none;
  border: 1.5px solid var(--border);
  padding: 7px 16px;
}
.btn-ghost:hover,
.chip:hover {
  border-color: var(--text);
}
/* Round 120: "← Back to Nov 2" in amber, like the site's arrow links. */
.btn-ghost.go {
  color: var(--accent);
}
.btn-ghost.go:hover {
  border-color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--eyeshine);
  outline-offset: 2px;
}

.review {
  padding-block: 28px 56px;
}

/* Opening a file */
.start {
  max-width: 720px;
}
.start h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.drop {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  text-align: center;
}
.drop.over {
  border-color: var(--eyeshine);
  background: var(--accent-soft);
}
.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.drop-title {
  font-size: 1.2rem;
  font-weight: 800;
}
.drop-or {
  color: var(--muted);
}
.private {
  color: var(--muted);
  margin-top: 14px;
}
.error {
  color: #b3261e;
  font-weight: 700;
}
/* Round 140: made-up data to look around with. */
.example {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.example p {
  margin: 0;
  flex: 1 1 18rem;
}
/* Round 141: alone on its row (it wrapped), the button is centered; next to the text it sits at the end. */
.example .btn-ghost {
  margin-inline: auto;
}
/* Round 141: "Open your own backup" in amber, like the site's other links that do something. */
button.link.go {
  color: var(--accent);
}
.example-note {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}

/* After */
.file-line {
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  scrollbar-width: none;
}
.tabs button {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tabs button[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--eyeshine);
}

h2.h {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 4px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.9rem;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cols {
  display: grid;
  gap: 16px;
}
@media (min-width: 900px) {
  .cols {
    grid-template-columns: 1fr 1fr;
  }
  .cols.side {
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
  }
}
.card {
  min-width: 0;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.tile .label {
  color: var(--muted);
  font-size: 0.9rem;
}
.tile .value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}
.tile .sub {
  color: var(--muted);
  font-size: 0.85rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  background: none;
  border: 1.5px solid var(--border);
  padding: 5px 13px;
  font-size: 0.9rem;
}
.chip[aria-pressed='true'] {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
/* Round 141: a chart's title on its own line, its range pills always on the line under it. */
.row.heading-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stepper button {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.1rem;
}
.stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}
.stepper .title {
  font-weight: 800;
  font-size: 1.1rem;
  min-width: 150px;
  text-align: center;
}

/* Charts */
.chart {
  width: 100%;
  overflow: visible;
}
.chart text {
  fill: var(--muted);
  font-size: 11px;
}
.chart .grid {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart .bar {
  fill: var(--series);
}
.chart .hit {
  fill: transparent;
  cursor: crosshair;
}
/* Round 141: where the pointer is along the chart. */
.chart .guide {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}
.chart .mark {
  fill: var(--series);
  stroke: var(--card);
  stroke-width: 2;
  pointer-events: none;
}
.chart .line {
  fill: none;
  stroke-width: 2;
}
.chart .s1 {
  stroke: var(--series);
  fill: var(--series);
}
.chart .s2 {
  stroke: var(--series-2);
  fill: var(--series-2);
}
.chart .line.s1,
.chart .line.s2 {
  fill: none;
}
.chart .line.s2 {
  stroke-dasharray: 5 4;
}
.chart .dot {
  stroke: var(--card);
  stroke-width: 2;
}
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}
.legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  vertical-align: middle;
  margin-right: 6px;
  background: var(--series);
}
.legend i.s2 {
  background: repeating-linear-gradient(90deg, var(--series-2) 0 5px, transparent 5px 9px);
}
details.table summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}
.scroll-x {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
th,
td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 700;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.barrow {
  display: grid;
  gap: 3px;
}
.barrow .head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
}
.barrow .track {
  height: 8px;
  border-radius: 4px;
  background: var(--grid);
  overflow: hidden;
}
.barrow .fill {
  height: 8px;
  border-radius: 4px;
  background: var(--series);
}
.tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--primary);
  color: var(--primary-text);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  max-width: 260px;
}

/* PRs */
.pr {
  color: var(--pr);
  font-weight: 800;
  white-space: nowrap;
}
button.link,
.prline {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prline {
  color: var(--muted);
  display: block;
  padding: 2px 0;
}
.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sheet {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sheet h3 {
  margin: 0;
}

/* Exercises */
.search {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.list {
  display: flex;
  flex-direction: column;
  max-height: 560px;
  overflow-y: auto;
  margin-top: 8px;
}
.list button {
  background: none;
  border: 0;
  border-radius: 8px;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.list button[aria-current='true'] {
  background: var(--accent-soft);
  font-weight: 700;
}
.list button:hover {
  background: var(--grid);
}

/* Journal. Round 141: a page of the app's journal (components/journal/parts.tsx): its paper and ink,
   headings in the same drafting hand (Architects Daughter, from the app), a page-sized sheet. */
@font-face {
  font-family: 'Architects Daughter';
  src: url('../assets/fonts/ArchitectsDaughter-Regular.ttf') format('truetype');
  font-display: swap;
}
.page {
  --paper: #fbf6e9;
  --ink: #1f1b16;
  --faint: #7e7362;
  --rule: #e2d7bf;
  --hand: 'Architects Daughter', 'Segoe Print', 'Bradley Hand', cursive;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(60, 40, 10, 0.12);
  padding: 22px 24px 26px;
  min-width: 0;
  width: 100%;
  max-width: 560px;
  justify-self: center;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .page {
    --paper: #26231e;
    --ink: #ece6d8;
    --faint: #9a9080;
    --rule: #3d372e;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme='dark'] .page {
  --paper: #26231e;
  --ink: #ece6d8;
  --faint: #9a9080;
  --rule: #3d372e;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.page .muted,
.page .ex .line,
.page .sets .faint,
.page .note {
  color: var(--faint);
}
.page h3 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 1.7rem;
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* The day's labels (Sleep, Supplements, meals), in the hand like the app's SLEEP: and MEALS:. */
.page .stack b {
  font-family: var(--hand);
  font-size: 1.12em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.page .stack > div {
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--rule);
}
.workout {
  border-top: 1.5px solid var(--ink);
  margin-top: 14px;
  padding-top: 12px;
}
.workout h4 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 1.25rem;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.group {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 12px 0 4px;
}
.ex {
  padding: 6px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
.ex.flash {
  animation: flash 2.2s ease-out;
}
@keyframes flash {
  0%,
  80% {
    box-shadow: 0 0 0 2px var(--accent);
  }
  100% {
    box-shadow: 0 0 0 2px transparent;
  }
}
.ex .name {
  font-weight: 600;
}
.ex .line {
  color: var(--muted);
  font-size: 0.92rem;
}
.sets {
  display: grid;
  grid-template-columns: auto auto auto auto;
  justify-content: start;
  column-gap: 14px;
  margin: 4px 0 0 14px;
  font-size: 0.95rem;
}
.sets .faint {
  color: var(--muted);
}
/* Round 141: each part of a set line stays on one line ("6 @ 11.5 kg c/u"), pills their own size. */
.sets > * {
  white-space: nowrap;
  align-self: center;
}
@media (max-width: 480px) {
  .page {
    padding: 18px 14px 22px;
  }
  .sets {
    column-gap: 8px;
    margin-left: 4px;
  }
  .ex {
    margin-left: 0;
    padding: 6px 4px;
  }
}
.rpe {
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}
.note {
  font-style: italic;
  color: var(--muted);
  margin: 4px 0 0 14px;
}
.days {
  max-height: 640px;
  overflow-y: auto;
}
.days h5 {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Round 142: on phones "Open another file" leaves the top bar (it wrapped into a tall bubble) for the
   line under it: the example's "Open your own backup", or the file line's own link. */
.narrow-only {
  display: none;
}
@media (max-width: 700px) {
  #open-another {
    display: none;
  }
  .narrow-only {
    display: inline;
  }
}
