/* FITYFIT v2 — Brutalist Tech (lime/mono/sharp) + Bold display type */

:root {
  --bg: #0a0a0a;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --surface-3: #222;
  --border: #1f1f1f;
  --border-strong: #2a2a2a;
  --text: #fafafa;
  --text-mid: #aaa;
  --text-dim: #666;
  --accent: #d4ff3a;
  --accent-dim: #9bc02a;
  --danger: #ff4d4d;
  --warning: #ffb84d;
  --success: #4ade80;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter Tight', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  margin: 0; padding: 0;
}

.font-display {
  font-family: 'Archivo', 'Inter Tight', sans-serif;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-transform: uppercase;
}
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.font-mono-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
}
.card-pad { padding: 20px; }
.card-tight { padding: 14px 16px; }

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 800;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: transform .08s, filter .15s;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: border-color .12s;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
}
.btn-ghost:hover { border-color: var(--accent); }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(255,77,77,0.4);
  color: var(--danger);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
}
.btn-danger:hover { background: rgba(255,77,77,0.08); }

.btn-icon {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}
.btn-icon:hover { border-color: var(--accent); }

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color .15s;
  font-family: inherit;
  font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #4a4a4a; }
input[type=number] { font-family: 'JetBrains Mono', monospace; }

.mono-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.mono-label-accent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  cursor: pointer;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: color .15s;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tab-btn.active { color: var(--text); }
.tab-btn.active .tab-icon { color: var(--accent); }
.tab-icon { font-size: 18px; color: var(--text-dim); }

.auth-tab {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  padding: 10px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-tab.active {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

.bar-track {
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  height: 8px;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .5s cubic-bezier(.2,.7,.2,1);
}
.bar-fill-warn { background: var(--warning); }
.bar-fill-danger { background: var(--danger); }

.streak-strip {
  display: flex; gap: 4px;
  margin-top: 12px;
}
.streak-cell {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 2px;
  transition: background .3s;
}
.streak-cell.hit { background: var(--accent); }

.ring-fg {
  transition: stroke-dashoffset .9s cubic-bezier(.2,.7,.2,1);
  transform: rotate(-90deg);
  transform-origin: center;
}

.cal-day {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--text-dim);
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.cal-day.completed { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.cal-day.partial { background: rgba(212,255,58,0.12); border-color: var(--accent-dim); color: var(--text); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--text); }
.cal-day.future { opacity: 0.3; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.pill-cloud { background: rgba(74,222,128,0.1); color: var(--success); border: 1px solid rgba(74,222,128,0.25); }
.pill-local { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border-strong); }
.pill-accent { background: var(--accent); color: #0a0a0a; }
.pill-pr { background: rgba(212,255,58,0.12); color: var(--accent); border: 1px solid var(--accent-dim); }

.filter-btn {
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-mid);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.filter-btn.active {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ex-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, transform .08s;
}
.ex-row:hover { border-color: var(--border-strong); }
.ex-row:active { transform: scale(0.99); }

.ex-icon-sq {
  width: 44px; height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.set-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 80px auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.set-row.done {
  border-color: var(--accent-dim);
  background: rgba(212,255,58,0.04);
}
.set-row .set-num {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}
.set-row input {
  padding: 8px 10px;
  font-size: 14px;
  text-align: center;
}
.set-done-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.set-row.done .set-done-btn {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

.prev-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 6px;
  border-left: 2px solid var(--accent);
}

.toast {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 8px;
  animation: toastIn .25s cubic-bezier(.2,.7,.2,1);
}
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.view { display: none; animation: viewIn .2s ease; }
.view.active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: none;
  align-items: flex-end; justify-content: center;
}
.modal-bg.active { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px 16px 0 0;
  max-width: 600px; width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 20px;
}
@media (min-width: 600px) {
  .modal-bg { align-items: center; }
  .modal { border-radius: 16px; }
}

.chat-user {
  background: var(--accent);
  color: #0a0a0a;
  padding: 10px 14px;
  border-radius: 12px 12px 2px 12px;
  display: inline-block;
  max-width: 85%;
  font-weight: 500;
}
.chat-bot {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 12px 12px 12px 2px;
  display: inline-block;
  max-width: 85%;
  white-space: pre-wrap;
}

.pr-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.muted { color: var(--text-dim); }
.dim { color: var(--text-mid); }
.accent { color: var(--accent); }
.hidden { display: none !important; }

.text-tiny { font-size: 10px; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 28px; }
.text-3xl { font-size: 36px; }
.text-4xl { font-size: 48px; }
.text-5xl { font-size: 60px; }
.text-7xl { font-size: 80px; }

.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.15em; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.leading-tight { line-height: 1.05; }
.leading-none { line-height: 1; }

.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 96px;
  position: relative;
  z-index: 1;
}
