/* Circle-style system: light gray canvas, white rounded cards, blue accents, Inter. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #191b1f;
  --muted: #717680;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #2f6df6;
  --brand-deep: #1d4ed8;
  --brand-tint: #e8effd;
  --navy: #1e3a5f;
  --ok: #15803d;
  --ok-tint: #dcfce7;
  --warn: #a16207;
  --warn-tint: #fef3c7;
  --err: #b91c1c;
  --err-tint: #fee2e2;
  --radius: 12px;
  --radius-sm: 8px;
  --font:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.006em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: var(--brand);
}
a:hover {
  color: var(--brand-deep);
}

/* Top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand img {
  display: block;
}
.brand img.logo {
  height: 30px;
  width: auto;
}
.mainnav {
  display: flex;
  gap: 28px;
  justify-content: center;
}
.mainnav a {
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 20px 0;
  border-bottom: 2px solid transparent;
}
.mainnav a:hover {
  color: var(--ink);
}
.mainnav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--brand);
}
.topbar-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}
.foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Type: Circle's scale — 26/700 page titles, 18/600 card titles, 16 body, 14 meta, 13 pills */
h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 6px;
}
h2 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 16px 0 8px;
}
p {
  margin: 0 0 12px;
  max-width: 68ch;
}
.lede {
  font-size: 1rem;
  color: var(--muted);
  max-width: 60ch;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
  line-height: 1.45;
}
strong {
  font-weight: 600;
}
label,
.q {
  font-size: 0.9375rem;
  font-weight: 500;
}
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--brand-tint);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Flash */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
}
.flash.ok {
  background: var(--ok-tint);
  color: var(--ok);
  border-color: transparent;
}
.flash.err {
  background: var(--err-tint);
  color: var(--err);
  border-color: transparent;
}

/* Cards and grid */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 0 0 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.grid .card {
  margin: 0;
}

/* Forms */
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 12px;
}
.row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--muted);
}
.stack label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
input.code {
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-align: center;
  max-width: 240px;
}
textarea {
  font-family: var(--font);
  font-size: 0.95rem;
}
button,
.button-link {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 16px;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button-link:hover {
  background: #f9fafb;
  color: var(--ink);
}
button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  align-self: flex-start;
}
button.primary:hover {
  background: var(--brand-deep);
  color: #fff;
}
button.danger {
  color: var(--err);
}
button.danger:hover {
  border-color: var(--err);
}
button.linkish {
  border: 0;
  background: none;
  padding: 0;
  color: #4b5563;
  font-weight: 500;
}
button.linkish:hover {
  color: var(--ink);
  background: none;
}
form.inline {
  display: inline;
}

/* Tables */
table.list {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 12px 0 20px;
  font-size: 0.925rem;
}
table.list th,
table.list td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.list th {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8125rem;
  background: #fafafa;
}
td.actions {
  white-space: nowrap;
}
td.actions form {
  display: inline-block;
  margin-right: 6px;
}
td.actions button {
  padding: 5px 10px;
  font-size: 0.85rem;
}

/* Badges (Circle-style pills) */
.badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.ok {
  background: var(--ok-tint);
  color: var(--ok);
  border-color: transparent;
}
.badge.warn {
  background: var(--warn-tint);
  color: var(--warn);
  border-color: transparent;
}
.badge.err {
  background: var(--err-tint);
  color: var(--err);
  border-color: transparent;
}

@media (max-width: 720px) {
  .topbar-inner {
    grid-template-columns: auto 1fr auto;
    height: auto;
    padding: 10px 16px;
    row-gap: 4px;
  }
  .brand span {
    display: none;
  }
  .mainnav {
    gap: 16px;
    overflow-x: auto;
  }
  .mainnav a {
    padding: 12px 0;
    white-space: nowrap;
  }
  .wrap {
    padding: 20px 16px 48px;
  }
  table.list,
  table.list thead,
  table.list tbody,
  table.list tr,
  table.list td,
  table.list th {
    display: block;
  }
  table.list thead {
    display: none;
  }
  table.list tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  table.list td {
    border: 0;
    padding: 3px 14px;
  }
}

/* Audit grid */
.week {
  margin: 20px 0 8px;
}
.week h2 {
  margin-bottom: 8px;
}
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 0;
}
.day.today {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-tint);
}
.day.future {
  opacity: 0.55;
}
.day-name {
  font-weight: 600;
  font-size: 0.85rem;
}
.day-date {
  font-size: 0.78rem;
  color: var(--muted);
}
.day input {
  width: 100%;
  font-size: 1.05rem;
  padding: 6px 6px;
  text-align: center;
  margin-top: 4px;
}
.day input:disabled {
  background: var(--bg);
  color: var(--muted);
}
.day .entered {
  font-size: 0.72rem;
}
.week-total {
  margin: 8px 0 0;
}
.help {
  max-width: 70ch;
}
label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.95rem;
}
label.check input {
  margin-top: 4px;
}
.summary {
  border-color: var(--brand);
}
@media (max-width: 720px) {
  .days {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 420px) {
  .days {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Weekly check-ins */
ul.weeks {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.week-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.week-line.current {
  background: var(--brand-tint);
  margin: 0 -8px;
  padding: 8px;
  border-radius: var(--radius);
  border-bottom: 0;
}
.week-status {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
form.survey {
  max-width: 640px;
}
form.survey fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
form.survey .q {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
form.survey label,
form.survey .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
form.survey label.check {
  flex-direction: row;
}
form.survey .yesno {
  display: flex;
  gap: 18px;
}
form.survey .yesno label {
  flex-direction: row;
  gap: 6px;
  align-items: center;
  font-weight: 500;
}
form.survey .track {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
form.survey input.readonly {
  background: var(--bg);
  color: var(--muted);
  max-width: 160px;
}
form.survey input[type="number"] {
  max-width: 160px;
}
.field-error {
  color: var(--err);
  font-weight: 500;
  margin: 0;
}
/* The Weekly Big 3 only appears once "Yes" is chosen for the Weekly Preview. */
#big-three {
  display: none;
}
form.survey:has(input[name="preview"][value="yes"]:checked) #big-three {
  display: flex;
}

/* Staff: members and timeline */
table.members td {
  vertical-align: middle;
}
table.list.compact th,
table.list.compact td {
  padding: 5px 8px;
  font-size: 0.88rem;
}
table.list tr.inactive td {
  color: var(--muted);
}
.err-text {
  color: var(--err);
}
ul.facts {
  margin: 8px 0;
  padding-left: 18px;
}
ul.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.timeline li {
  display: grid;
  grid-template-columns: 190px 70px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
ul.timeline .when {
  color: var(--muted);
  white-space: nowrap;
}
ul.timeline .kind {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}
.filters a {
  margin-right: 12px;
}
.filters a.current {
  font-weight: 700;
  color: var(--ink);
}
@media (max-width: 640px) {
  ul.timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.day.counted {
  background: var(--brand-tint);
}
label.window {
  align-items: flex-start;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}
label.window input {
  margin-top: 5px;
}
