:root {
  --green: #1f9d55;
  --green-dark: #1f7a46;
  --ink: #16301f;
  --muted: #5f7a68;
  --line: #e3eee7;
  --line-strong: #d6e5db;
  --bg: #f6faf7;
  --soft: #e7f5ec;
  --card: #fff;
  --danger: #e2683c;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; }

body {
  margin: 0;
  font: 14px/1.4 Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a, a:visited, a:hover, a:active {
  color: inherit;
  text-decoration: none;
}

button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1.15rem;
  background: var(--green-dark);
  color: #fff;
}

.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 17px; }
.logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fff;
  color: var(--green-dark);
  display: grid;
  place-items: center;
}
.tr { display: flex; gap: 0.4rem; align-items: center; }
.ib {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}
.ib:hover { background: #ffffff22; }
.av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #d9f2e3;
  color: var(--green-dark);
  font-weight: 800;
  display: grid;
  place-items: center;
}
.av.sm { width: 28px; height: 28px; font-size: 12px; }

main { max-width: 1180px; padding: 1.1rem 1.15rem 2rem; }
.page-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.page-title { font-size: 20px; margin: 0; font-weight: 750; }
.crumb { color: var(--muted); font-size: 13px; }
.ml { margin-left: auto; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 9.5rem);
  grid-auto-rows: 8.5rem;
  gap: 0.75rem;
}
.home-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  font-weight: 750;
  text-align: center;
  padding: 0.4rem 0.75rem;
}
.home-tile:hover { border-color: #b7d7c4; }
.ti { width: 3.25rem; height: 3.25rem; border-radius: 14px; display: grid; place-items: center; color: var(--ink); }
.home-tile span.n { height: 2.3em; line-height: 1.15; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.card h2 { font-size: 15px; margin: 0 0 8px; }
.card + .card { margin-top: 0.75rem; }

.btn {
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn.sec { background: #fff; color: var(--green-dark); border: 1px solid #cfe3d6; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-row { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }

.gi {
  background: none;
  border: 0;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.gi:hover { background: var(--soft); }

.seg, .chips { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg { background: var(--soft); border-radius: 20px; padding: 2px; gap: 2px; }
.seg button, .chip {
  border: 0;
  background: transparent;
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  color: var(--ink);
}
.seg button.on, .chip.on { background: #fff; font-weight: 700; box-shadow: 0 1px 2px #0001; }
.chip { background: var(--soft); }

.lbl {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}
.field { display: block; min-width: 0; }
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}
.fields.end { align-items: end; }
input, select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
input:disabled { background: #f3f7f4; color: var(--muted); }
.checkline { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.checkline input { width: auto; }

.tip { position: relative; display: inline-flex; }
.info {
  font-style: normal;
  font-size: 10px;
  width: 14px;
  height: 14px;
  border: 1px solid #8aa394;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  cursor: help;
  line-height: 1;
}
.tip-bubble {
  display: none;
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  padding: 6px 8px;
  border-radius: 8px;
  width: max-content;
  max-width: 220px;
  z-index: 40;
  pointer-events: none;
}
.tip:hover .tip-bubble, .tip:focus-within .tip-bubble { display: block; }

.muted { color: var(--muted); }
.pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--soft);
  color: var(--green-dark);
  font-weight: 700;
  white-space: nowrap;
}
.pill.critical { background: #f1ead2; color: #6b5420; }

table { width: 100%; border-collapse: collapse; }
td, th { padding: 7px 6px; border-top: 1px solid #edf3ef; text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; border-top: 0; }
td.r, th.r { text-align: right; }
.table-wrap { overflow-x: auto; }

.it { display: flex; align-items: flex-start; gap: 10px; padding: 7px 2px; border-top: 1px solid #edf3ef; }
.it .s { margin-left: auto; color: var(--muted); font-size: 12px; padding-top: 1px; white-space: nowrap; }
.it .body { min-width: 0; }
.cb {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 6px;
  border: 2px solid var(--green);
  background: #fff;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  padding: 0;
  cursor: pointer;
  flex: none;
}
.it.done .cb { background: var(--green); }
.it.done .t { color: #8aa394; text-decoration: line-through; }
.t.critical { font-weight: 800; }
.note, .when { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.when { color: var(--green-dark); }
.sec-h {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 0 2px;
}
.prog { height: 6px; background: var(--soft); border-radius: 9px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--green); border-radius: 9px; }
.trip { padding: 10px 0; border-top: 1px solid #edf3ef; cursor: pointer; }
.trip:first-of-type { border-top: 0; }
.trip.on { background: #f0f9f3; margin: 0 -16px; padding: 10px 16px; }
.grid2 { display: grid; grid-template-columns: 300px 1fr; gap: 0.75rem; align-items: start; }
.banner {
  background: #fdeee8;
  color: #8a3b22;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 10px;
}
.list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cleared { margin-top: 12px; }
.cleared summary { cursor: pointer; font-weight: 700; color: var(--muted); }

.modal-back {
  position: fixed;
  inset: 0;
  background: #16301f66;
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  width: min(560px, 100%);
  padding: 14px 16px;
  box-shadow: 0 8px 28px #16301f22;
}
.modal h2 { margin: 0 0 12px; font-size: 16px; }

.signin-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.signin {
  width: min(380px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px 18px;
}
.signin .brand { color: var(--ink); margin-bottom: 14px; }
.signin h1 { font-size: 20px; margin: 0 0 12px; }
.stack { display: grid; gap: 10px; }
.host { margin: 14px 0 0; font-size: 12px; }

@media (max-width: 800px) {
  .grid2 { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); }
  .tip-bubble { left: auto; right: 0; top: calc(100% + 4px); transform: none; }
}
