/* Deliberately plain CSS with no build step: this is a personal Mini App, and a
   bundler would add tooling to maintain for no gain (docs/SERVICES.md §3).
   Colours follow the Telegram theme so the app does not fight the client. */

:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --fg: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #7a7a7a);
  --accent: var(--tg-theme-button-color, #2f81f7);
  --accent-fg: var(--tg-theme-button-text-color, #ffffff);
}

* {
  box-sizing: border-box;
}

/* A class rule like `.entry { display: flex }` outranks the user-agent
   `[hidden] { display: none }`, so without this the hidden attribute silently
   does nothing and the entry form shows before the first set is finished. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  max-width: 32rem;
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field span {
  color: var(--hint);
  font-size: 0.85rem;
}

select,
input {
  padding: 0.7rem;
  font-size: 1rem;
  border: 1px solid var(--hint);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--fg);
}

.status {
  text-align: center;
  color: var(--hint);
  min-height: 1.2rem;
  margin: 0;
}

/* Thumb-sized, because it is pressed with one hand while holding a bar. */
.primary {
  padding: 1.1rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: 0;
  border-radius: 0.75rem;
  background: var(--accent);
  color: var(--accent-fg);
}

.primary:active {
  opacity: 0.85;
}

/* Pressed once per set, one-handed, mid-workout — so it is the largest thing
   on the screen and needs no aim. */
.big {
  padding: 2rem 1rem;
  font-size: 1.35rem;
}

.row {
  display: flex;
  gap: 0.75rem;
}

.row .field {
  flex: 1;
}

.since {
  text-align: center;
  color: var(--hint);
  min-height: 1.2rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.link {
  padding: 0.5rem;
  border: 0;
  background: none;
  color: var(--hint);
  font-size: 0.9rem;
  text-decoration: underline;
}

.entry {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Probe-mode export control. Deliberately quieter than the primary action —
   it is used once per session, not once per set. */
.secondary {
  padding: 0.8rem;
  font-size: 0.95rem;
  border: 1px solid var(--hint);
  border-radius: 0.75rem;
  background: transparent;
  color: var(--fg);
}

#export-dump {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}
