:root {
  --bg: #16181B;
  --panel: #22252A;
  --key: #30343A;
  --text: #F4F1EA;
  --muted: #A8A398;
  --green: #17784B;
  --amber: #E9B23E;
  --blue: #2F63D6;
  --red: #C2362F;
  --signal: #E4572E;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}
button:focus-visible, input:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 12px;
}
#company { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; flex: 1; }
.clock { text-align: center; flex: 1; }
#time { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
#date { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.langs { flex: 1; display: flex; justify-content: flex-end; gap: 6px; }
.langs button { background: transparent; border: 2px solid var(--key); border-radius: 8px; padding: 6px 10px; color: var(--muted); font-weight: 600; }
.langs button.active { border-color: var(--signal); color: var(--text); }

main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 16px; }
section { width: 100%; max-width: 560px; text-align: center; }
h1 { font-family: var(--font-display); font-size: 1.9rem; margin: 0 0 16px; }

.dots { display: flex; justify-content: center; gap: 16px; margin: 8px 0; min-height: 28px; }
.dots span { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--muted); }
.dots span.filled { background: var(--signal); border-color: var(--signal); }
.message { min-height: 1.6em; font-size: 1.15rem; color: var(--amber); margin: 8px 0 12px; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 420px; margin: 0 auto; }
.keypad button { font-family: var(--font-display); background: var(--key); border-radius: 16px; font-size: 2.2rem; font-weight: 600; padding: 18px 0; min-height: 76px; }
.keypad button:active { background: var(--panel); transform: scale(.97); }
.keypad button.muted { color: var(--muted); }
.keypad button:disabled { opacity: .4; }

.state { font-size: 1.25rem; color: var(--muted); margin: 0 0 20px; }
.actions { display: grid; gap: 14px; }
.actions button {
  font-family: var(--font-display);
  border-radius: 18px;
  padding: 26px 16px;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
}
.actions button:active { transform: scale(.98); filter: brightness(.9); }
.actions .ClockIn { background: var(--green); }
.actions .BreakStart { background: var(--amber); color: var(--bg); }
.actions .BreakEnd { background: var(--blue); }
.actions .ClockOut { background: var(--red); }
.totals { color: var(--muted); font-size: 1.1rem; margin-top: 18px; }
.link { background: transparent; color: var(--muted); text-decoration: underline; padding: 12px; font-size: 1.1rem; }
.primary { background: var(--green); border-radius: 12px; padding: 14px 28px; font-size: 1.2rem; font-weight: 600; color: var(--text); }

.check { font-size: 5rem; color: var(--green); line-height: 1; margin-bottom: 8px; }
#done h1 { font-size: 2.2rem; }

#setup input { width: 100%; font-size: 1.1rem; padding: 12px; border-radius: 10px; border: 2px solid var(--key); background: var(--panel); color: var(--text); margin: 8px 0 16px; user-select: text; -webkit-user-select: text; }
.error { color: var(--red); min-height: 1.4em; }

footer { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; color: var(--muted); font-size: .85rem; }
footer .brand { height: 18px; display: block; }
footer .link { font-size: .85rem; padding: 4px; }
#online.offline { color: var(--red); font-weight: 600; }

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay[hidden], section[hidden] { display: none; }
.panel { background: var(--panel); border-radius: 16px; padding: 24px; max-width: 560px; text-align: left; line-height: 1.5; }
.panel h2 { margin-top: 0; }

/* Phone in portrait, or a small tablet */
@media (max-width: 600px) {
  header { flex-wrap: wrap; padding: 10px 12px; }
  #company { order: 1; flex-basis: 50%; }
  .langs { order: 2; }
  .clock { order: 3; flex-basis: 100%; margin-top: 6px; }
  #time { font-family: var(--font-display); font-size: 2rem; }
  h1 { font-size: 1.5rem; }
  .keypad button { min-height: 64px; font-size: 1.9rem; padding: 12px 0; }
  .actions button { padding: 20px 12px; font-size: 1.4rem; }
}
/* Landscape tablet with little height */
@media (max-height: 640px) and (min-width: 700px) {
  .keypad button { min-height: 58px; padding: 8px 0; font-size: 1.8rem; }
  h1 { margin-bottom: 8px; }
}
