:root {
  --blue: #0f5c6e;
  --blue-dark: #0a4552;
  --bg: #f4f4f1;
  --card: #ffffff;
  --text: #1f2422;
  --muted: #6b716e;
  --border: #dddad2;
  --red: #b3261e;
  --amber: #9a6200;
  --green: #1a6b3c;
}

* { box-sizing: border-box; }

html { font-size: 17px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--blue);
  color: #fff;
}
.topbar a.brand { color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; }
.topnav a { color: #d9eef2; font-weight: 600; text-decoration: none; }
.whoami { font-size: 0.85rem; opacity: 0.9; }

@media (max-width: 480px) {
  .topnav { gap: 0.5rem; }
}

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

.footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 0.2rem 1rem 1.4rem;
  text-align: center;
}

h1 { font-size: 1.4rem; margin: 0.6rem 0; }
h2 { font-size: 1.15rem; margin: 1rem 0 0.4rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.6rem; }

.stack { display: flex; flex-direction: column; gap: 0.6rem; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
}
.card-pending { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.card-ok { border-color: var(--green); }
.narrow { max-width: 420px; margin: 1rem auto; }
.center { text-align: center; }

/* Buttons: big tap targets */
.btn, button.btn {
  display: inline-block;
  min-height: 48px;
  padding: 0.55rem 1.1rem;
  font-size: 1.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  background: #e9e7e0;
  border-color: #d6d3c9;
  color: inherit;
  font-weight: 600;
  transition: background 0.1s ease, transform 0.05s ease;
}
.btn:hover { background: #dfdcd3; }
.btn:active { background: #d6d3c9; transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.btn.btn-primary, button.btn-primary { background: var(--blue); color: #fff !important; }
.btn.btn-primary:hover, button.btn-primary:hover { background: #126e83; }
.btn.btn-secondary, button.btn-secondary { background: #fff; border-color: #a9a496; }
.btn.btn-secondary:hover, button.btn-secondary:hover { background: #f3f2ee; }
.btn.btn-danger, button.btn-danger {
  background: #fff; border-color: var(--red); color: var(--red) !important;
}
.btn.btn-danger:hover, button.btn-danger:hover { background: #fdf1f0; }
.btn.btn-small, button.btn-small { min-height: 38px; padding: 0.25rem 0.7rem; font-size: 0.9rem; }
.btn-link {
  background: none; border: none; color: #d9eef2; font-weight: 600;
  text-decoration: underline; cursor: pointer; min-height: 0; padding: 0.2rem 0.3rem; font-size: 0.95rem;
}

label { font-weight: 600; }
input, select {
  font: inherit;
  min-height: 48px;
  padding: 0.45rem 0.7rem;
  border: 1px solid #b9b4a6;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  width: 100%;
}
input:focus, select:focus { outline: 3px solid var(--blue); outline-offset: 1px; }

.error { color: var(--red); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.inline-form { display: inline-block; margin: 0; }

/* The mic row: the two biggest buttons on the worker's page */
.mic-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 0.8rem 0 0.4rem; }
.mic-row .btn { flex: 1 1 240px; min-height: 64px; font-size: 1.15rem; }
.mic-state {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  background: #eaf4f6; border: 1px solid var(--blue); border-radius: 10px;
  padding: 0.6rem 0.8rem; margin-top: 0.6rem;
}

.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: #fbfaf8;
}
.item-main { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.item-text { font-weight: 600; flex: 1 1 auto; text-decoration: none; color: inherit; }
.item-sub { margin-top: 0.35rem; font-size: 0.95rem; color: #33413c; }
.item-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.item-done .item-text { text-decoration: line-through; color: var(--muted); }
.item-notdone .item-text { color: var(--muted); }
.item-num { font-weight: 700; color: var(--blue); }

.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #e9e7e0;
  color: #4c514e;
  white-space: nowrap;
}
.chip-done { background: #e0f0e6; color: var(--green); }
.chip-notdone { background: #f7e5e3; color: var(--red); }
.chip-open { background: #e8f2f5; color: var(--blue); }
.chip-plan { background: #e8f2f5; color: var(--blue); }
.chip-extra { background: #f3ecdd; color: var(--amber); }

.add-form { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.add-form input { flex: 1 1 auto; }
.date-form { max-width: 300px; }

/* Voice confirm page */
blockquote.transcript {
  margin: 0.4rem 0;
  padding: 0.6rem 0.8rem;
  border-left: 4px solid var(--blue);
  background: #eaf4f6;
  border-radius: 0 8px 8px 0;
  white-space: pre-wrap;
}
.review .item-main { align-items: center; }
.review-text { flex: 1 1 auto; }
.review-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }
.review-select { width: auto; min-height: 44px; flex: 1 1 200px; }
.check-label { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }
.check-label input { width: auto; min-height: 0; }
.confirm-row { display: flex; justify-content: center; margin: 0.8rem 0; }

/* Admin table */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td {
  text-align: left; padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table td a { font-weight: 700; color: inherit; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.timeline li { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.tl-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }

.password {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #eaf4f6;
  border: 2px dashed var(--blue);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  text-align: center;
  user-select: all;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%) translateY(20px);
  background: #26302d;
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(92vw, 480px);
  text-align: center;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner {
  width: 46px; height: 46px;
  margin: 1.2rem auto;
  border: 5px solid #cfe3e8;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.rename-form { display: inline; }
