:root {
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e2e8f0;
  background-color: #020617;
  --primary: #f59e0b;
  --primary-dark: #b45309;
  --accent: #0f766e;
  --card: rgba(15, 23, 42, 0.85);
  --border: rgba(148, 163, 184, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #0f172a, #020617 70%);
  color: inherit;
}

.language-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.title-row {
  text-align: center;
  margin-top: 1rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.tagline {
  margin-top: 0.25rem;
  color: #94a3b8;
}

.language-switcher {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  justify-content: center;
}

header {
  padding: 2rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.language-switcher button {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #e2e8f0;
  padding: 0.35rem 0.65rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.language-switcher button.active {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
}

main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem clamp(1rem, 5vw, 4rem) 3rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.timer-card,
.session-log {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.6);
}

.timer-card {
  position: relative;
}

.timer-output {
  font-size: clamp(2.5rem, 8vw, 4rem);
  text-align: center;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.day-summary {
  margin: -0.5rem 0 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  color: #94a3b8;
}

.timer-version {
  position: absolute;
  right: 1.25rem;
  bottom: 1rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 1.15rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #0f172a;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
}

@keyframes timerSweep {
  0% {
    background-position: 200% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

button.primary.is-running {
  background: linear-gradient(120deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 100%;
  animation: timerSweep 1.5s linear infinite;
}

button.secondary {
  margin-top: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  color: inherit;
}

.session-sync {
  margin: 0 0 1rem;
}

.status {
  margin-top: 1rem;
  text-align: center;
  color: #cbd5f5;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.badge {
  font-size: 0.9rem;
  color: #cbd5f5;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 60vh;
  overflow-y: auto;
}

.week-block {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
}

.week-block h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #94a3b8;
}

.session-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.session-table th,
.session-table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.session-table th {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.session-table td.status {
  text-transform: capitalize;
  color: #e2e8f0;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 1rem;
}

.status-icon--uploaded {
  background: #dcfce7;
  color: #15803d;
}

.status-icon--pending-upload {
  background: #fee2e2;
  color: #b91c1c;
}

.status-icon--running {
  background: #e0f2fe;
  color: #0ea5e9;
}

.session-table td:last-child {
  text-align: right;
}

.session-table tbody tr:last-child td {
  border-bottom: none;
}

.week-total {
  margin-top: 0.75rem;
  text-align: right;
  font-size: 0.9rem;
  color: #cbd5f5;
}

.warning {
  padding: 1rem;
  text-align: center;
}

.warning--inline {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  background: rgba(250, 204, 21, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 0.35rem;
}

.endpoint-name {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.1rem;
  color: #f8fafc;
  font-weight: 500;
}

.error-screen {
  display: flex;
  justify-content: center;
  padding: 1rem;
  margin: 0.5rem auto 2rem;
  max-width: 640px;
  width: 100%;
}

@media (min-width: 768px) {
  .error-screen {
    min-height: 60vh;
    align-items: center;
  }
}

.error-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1.5rem;
  padding: 2rem;
  text-align: center;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.6);
}

.error-card h1 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}

.error-card p {
  margin: 0.65rem 0;
  color: #94a3b8;
}

@media (max-width: 600px) {
  main {
    padding-bottom: 4rem;
  }
}

@media (max-width: 520px) {
  main {
    padding: 0.75rem 1rem 2.5rem;
  }

  .timer-card,
  .session-log {
    padding: 1.25rem;
  }

  .week-block {
    padding: 1rem;
  }

  .session-table th,
  .session-table td {
    padding: 0.35rem 0.25rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-sync {
    width: 100%;
  }
}
