:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  margin-bottom: 20px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

h1 {
  margin: 0;
  font-size: 1.4rem;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.hidden {
  display: none !important;
}

.profile-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

#profileInfo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-picture {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
}

.profile-hint {
  font-size: 0.85rem;
  color: #6b7280;
  max-width: 260px;
}

.signout-button {
  padding: 8px 12px;
  font-size: 0.85rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.auth-message {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
  background: #fef3c7;
}

.auth-message p {
  margin: 0;
  color: #92400e;
  font-size: 0.9rem;
}

/* ---- Navigation tabs ---- */

.view-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.nav-button {
  flex: 1;
  background: #e5e7eb;
  color: #111827;
  font-weight: 600;
}

.nav-button.active {
  background: #2563eb;
  color: #ffffff;
}

/* ---- Cards & inputs ---- */

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: #374151;
}

input[type='text'],
input[type='datetime-local'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 1rem;
  margin-top: 6px;
  font-family: inherit;
  background: #ffffff;
  color: #1f2937;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ---- Buttons ---- */

button {
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  cursor: pointer;
}

button.primary {
  background: #2563eb;
  color: #ffffff;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

button.danger {
  background: #dc2626;
  color: #ffffff;
}

button:hover {
  opacity: 0.95;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.big-button {
  width: 100%;
  padding: 16px;
  font-size: 1.15rem;
  font-weight: 600;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.link-button {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.9rem;
  padding: 0;
  text-decoration: underline;
}

/* ---- Timer screen ---- */

.timer-card {
  text-align: center;
}

.timer-card label {
  text-align: left;
}

.timer-display {
  font-size: 3.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: #111827;
  margin: 8px 0 4px;
}

.status-text {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.desc-panel {
  margin-top: 16px;
  text-align: left;
}

.desc-panel button {
  width: 100%;
  margin-top: 10px;
}

.manual-stop {
  margin-top: 20px;
}

.manual-stop-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

/* ---- History ---- */

.history-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.history-controls label {
  margin-bottom: 0;
}

#exportButton {
  grid-column: 1 / -1;
}

.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: #374151;
}

.session-list {
  display: grid;
  gap: 12px;
}

.session-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.entry-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.entry-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
}

.entry-type.work {
  background: #dbeafe;
  color: #1d4ed8;
}

.entry-type.drive {
  background: #dcfce7;
  color: #15803d;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #4b5563;
  font-size: 0.9rem;
}

.entry-description {
  flex-basis: 100%;
}

@media (max-width: 480px) {
  .history-controls {
    grid-template-columns: 1fr;
  }
}
