:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #687088;
  --line: #dbe1ef;
  --primary: #166534;
  --primary-hover: #14532d;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef3ff 0%, var(--bg) 35%, #f8fafc 100%);
}

.container {
  max-width: 920px;
  margin: 2rem auto;
  padding: 0 1rem 2rem;
}

h1,
h2 {
  margin: 0 0 1rem;
}

header h1 {
  margin: 0;
}

header {
  margin-bottom: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.timer-display {
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0 0 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}

.wrap {
  flex-wrap: wrap;
}

.spread {
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

input,
select,
button,
textarea {
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
}

input,
select {
  min-width: 110px;
  background: #fff;
}

textarea {
  width: 100%;
  min-height: 9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: #fff;
}

button {
  cursor: pointer;
  background: #fff;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button.small {
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

button.primary:hover {
  background: var(--primary-hover);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

button.danger:hover {
  background: var(--danger-hover);
}

.table-wrap {
  overflow-x: auto;
}

.actions {
  display: flex;
  gap: 0.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.9rem;
  color: var(--muted);
}

.total {
  margin: 0.6rem 0 0.35rem;
  font-weight: 600;
}

.note,
.lede {
  color: var(--muted);
  margin-top: 0;
}

.note {
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.login-card {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.account {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--muted);
}

.account span {
  overflow-wrap: anywhere;
}

.banner {
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin: 0 0 1rem;
  white-space: pre-wrap;
}

.banner.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.banner.ok {
  background: #f0fdf4;
  color: var(--primary);
  border: 1px solid #bbf7d0;
}

.banner.info {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

[hidden] {
  display: none !important;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

h3 {
  margin: 1rem 0 0.4rem;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .row {
    align-items: stretch;
  }

  .row > * {
    flex: 1 1 auto;
  }
}
