:root {
  --bg:        #EDF2F7;
  --surface:   #FFFFFF;
  --surface-2: #F7FAFC;
  --primary:   #2B6CB0;
  --primary-d: #234E7D;
  --text:      #2D3748;
  --text-dim:  #718096;
  --border:    #E2E8F0;
  --start:     #38A169;
  --stop:      #E53E3E;
  --reset:     #4A5568;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  justify-content: center;
  padding: 28px 16px 40px;
}

.app {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Encabezado ---------- */
header { text-align: center; padding-top: 4px; }
header h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--primary-d);
}
header p { margin: 0; font-size: 13px; color: var(--text-dim); }

/* ---------- Tarjeta del cronómetro ---------- */
.timer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 56px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--primary-d);
}

.status {
  font-size: 13px;
  color: var(--text-dim);
  min-height: 18px;
  text-align: center;
}

/* ---------- Botón principal ---------- */
.primary-btn {
  width: 100%;
  padding: 20px;
  border-radius: 14px;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: background .15s ease, transform .05s ease;
}
.primary-btn:active { transform: scale(0.985); }
.primary-btn.start { background: var(--start); }
.primary-btn.start:hover { background: #2F8A5B; }
.primary-btn.stop  { background: var(--stop); }
.primary-btn.stop:hover  { background: #C53030; }
.primary-btn.reset { background: var(--reset); }
.primary-btn.reset:hover { background: #3A4452; }

/* ---------- Entrada de conteo ---------- */
.entry {
  display: none;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.entry.show { display: flex; }

.entry .elapsed {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin-top: -6px;
}

.entry label {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
}

.count-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.stepper {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--primary-d);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
}
.stepper:active { transform: scale(0.94); }

#countInput {
  width: 130px;
  text-align: center;
  font-size: 44px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--primary-d);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 0;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
#countInput::-webkit-outer-spin-button,
#countInput::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---------- Resultado ---------- */
.result {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  flex-direction: column;
  gap: 4px;
}
.result.show { display: flex; }

.result .value {
  font-size: 52px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  line-height: 1;
}
.result .unit {
  font-size: 15px;
  color: var(--text-dim);
  margin-top: 4px;
}
.result .detail {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---------- Pie ---------- */
footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding-top: 4px;
}

.titulo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.titulo .logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
``