/* Markora — plain, big, high-contrast styling. Original design. */

:root {
  --ink: #1a1a1a;
  --muted: #555;
  --paper: #ffffff;
  --wash: #f4f6f8;
  --brand: #0b5fff;
  --brand-dark: #0849c4;
  --ok: #0a7d2c;
  --danger: #b00020;
  --line: #d9dee3;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--wash);
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.wordmark {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.current-biz {
  font-weight: 700;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}
.biz-switch select {
  min-height: 48px;
  font-size: 18px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  padding: 0 12px;
  background: var(--paper);
}
.mainnav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
.mainnav a, .logout {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: var(--radius);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}
.mainnav a:hover, .logout:hover {
  background: var(--wash);
  text-decoration: underline;
}

/* ---------- page ---------- */
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
h1 { font-size: 34px; margin: 0 0 16px; line-height: 1.25; }
h2 { font-size: 26px; margin: 28px 0 12px; }
.lede { color: var(--muted); font-size: 19px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 0 0 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card.narrow { max-width: 560px; }

/* ---------- stats + actions (dashboard) ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.stat { text-align: center; margin: 0; }
.stat-number { font-size: 44px; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 18px; margin-top: 4px; }
.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--wash); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-big { width: 100%; font-size: 21px; padding: 16px 24px; }

/* ---------- forms ---------- */
label {
  display: block;
  font-weight: 700;
  margin: 18px 0 6px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="url"], input[type="date"], input[type="time"],
input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: 48px;
  font-size: 18px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus, a:focus {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- alerts ---------- */
.alert {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 19px;
}
.alert-error { background: #fdecea; border: 2px solid var(--danger); color: var(--danger); }
.alert-ok { background: #e6f4ea; border: 2px solid var(--ok); color: var(--ok); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 18px; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 800; }

.footer {
  text-align: center;
  color: var(--muted);
  padding: 24px 20px 40px;
  font-size: 16px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- settings sections (shared by worker partials) ---------- */
.settings-section { margin: 0 0 20px; }
.settings-section h2 { margin-top: 0; }
.field { display: block; margin: 18px 0 6px; }
.field > span:first-child { display: block; font-weight: 700; margin-bottom: 6px; }
p.field > span:first-child { font-weight: 400; }
.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 18px 0 6px;
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 28px;
  height: 28px;
  min-height: 28px;
  flex: none;
  margin-top: 2px;
  accent-color: var(--brand);
}
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 700; }
.warn { color: #8a5a00; font-weight: 700; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  h1 { font-size: 28px; }
  .topbar-inner { gap: 10px; }
  .mainnav { margin-left: 0; width: 100%; }
  .mainnav a, .logout { padding: 10px 8px; }
  .page { padding: 20px 14px 48px; }
}
