:root {
  --ivory:  #F5F1E8;
  --card:   #FFFDF8;
  --ink:    #22301F;
  --green:  #1F4D33;
  --green-deep: #163A26;
  --leaf:   #E08A3C;
  --muted:  #8A8676;
  --line:   #E5DDCB;
  --tl-green:  #2E7D46;
  --tl-lime:   #9BBB33;
  --tl-amber:  #E3A62E;
  --tl-orange: #D96C2C;
  --tl-red:    #C24036;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Public Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--ivory);
  font-size: 16.5px;
  line-height: 1.55;
}
main { max-width: 980px; margin: 0 auto; padding: 20px 20px 40px; }

/* ------------------------------------------------------------- typography */
.display {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--green-deep);
  margin: 14px 0 18px;
}
.display em { font-style: italic; font-weight: 600; color: var(--green); }
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--green-deep);
  margin: 14px 0 4px;
}
h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--green);
  margin: 28px 0 10px;
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede { color: var(--ink); max-width: 26em; }
.muted { color: var(--muted); font-size: 0.92em; }
.center { text-align: center; }
a { color: var(--green); }
.link { font-size: 0.95rem; }
.hint { font-size: 0.8rem; color: var(--muted); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; background: var(--ivory);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.leaf {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-deep);
}
.leaf img { width: 74%; height: 74%; display: block; }
.brand-text {
  font-family: "Fraunces", Georgia, serif; font-weight: 700;
  color: var(--green-deep); font-size: 1.05rem; line-height: 1.05;
  display: flex; flex-direction: column;
}
.brand-text small {
  font-family: "Public Sans", sans-serif; font-weight: 600;
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.topbar nav a {
  color: var(--green); text-decoration: none; margin-left: 16px;
  font-weight: 600; font-size: 0.9rem; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer { text-align: center; padding: 28px 0 40px; }

/* ------------------------------------------------------------------ hero */
.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px;
  align-items: center; padding: 30px 0 10px;
}
.today { color: var(--muted); font-size: 0.9rem; }
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--tl-lime); margin-right: 6px;
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 12px; padding-top: 8px; }
  .display { font-size: clamp(2.2rem, 10vw, 3rem); }
}

/* ----------------------------------------------------------------- panel */
.panel, .card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px;
  box-shadow: 0 12px 30px rgba(34, 48, 31, 0.06);
  margin: 12px 0;
}
.panel-title {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: 1.5rem; color: var(--green-deep); margin: 6px 0 16px;
}
.panel-foot {
  border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.empty {
  border: 1.5px dashed var(--line); border-radius: 14px;
  padding: 28px 18px; text-align: center; color: var(--muted);
}
.empty strong {
  font-family: "Fraunces", Georgia, serif; color: var(--ink);
  font-size: 1.1rem; display: block; margin-bottom: 4px;
}
.empty p { margin: 0; font-size: 0.92rem; }

/* ----------------------------------------------------------------- forms */
input, select {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--leaf); outline-offset: 1px;
}
.stack label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.88rem; }
.stack input, .stack select { margin-top: 6px; }
.form-row { display: flex; gap: 8px; align-items: center; }
button {
  background: var(--green); color: #FFFDF8; border: 0; border-radius: 12px;
  padding: 12px 20px; font-size: 1rem; font-family: inherit; font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--green-deep); }
button.big { width: 100%; padding: 16px; font-size: 1.05rem; margin-top: 8px; }
button:disabled { background: #B9BDAE; cursor: not-allowed; }
button.link {
  background: none; color: var(--green); padding: 4px;
  text-decoration: underline; font-size: 0.92rem; font-weight: 500;
}
button.link.danger { color: var(--tl-red); text-decoration: none; }
.inline-pass { display: flex; gap: 8px; width: 100%; max-width: 340px; }
.inline-pass button { border-radius: 12px; padding: 12px 16px; background: #8FA394; }
.inline-pass button:hover { background: var(--green); }

/* ------------------------------------------------------------ name grid */
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.name-btn {
  display: block; text-align: center; background: var(--ivory);
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 10px;
  text-decoration: none; font-weight: 600; color: var(--green-deep);
}
.name-btn:active, .name-btn:hover { background: #ECE6D8; }

/* ---------------------------------------------------------------- flash */
.flash { padding: 12px 16px; border-radius: 12px; margin: 12px 0; font-size: 0.95rem; }
.flash.ok { background: #E4EFE3; color: var(--tl-green); }
.flash.error { background: #F7E3DE; color: var(--tl-red); }

/* -------------------------------------------------------- day progress */
.day-progress {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; height: 48px; margin: 14px 0;
}
.day-progress .bar { position: absolute; inset: 0 auto 0 0; background: #DCE7D3; }
.day-progress.ok .bar { background: #C4DDBB; }
.day-progress span {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 100%; font-weight: 700; font-size: 0.95rem;
}

/* ----------------------------------------------------------- stat rows */
.stats { display: flex; flex-direction: column; gap: 10px; }
.stat-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
}
.stat-name { font-weight: 600; }
.tl {
  color: #fff; border-radius: 999px; padding: 7px 14px;
  font-weight: 700; white-space: nowrap; font-size: 0.92rem;
}
.tl small { font-weight: 400; opacity: 0.85; }
.tl-green  { background: var(--tl-green); }
.tl-lime   { background: var(--tl-lime); color: #2C3506; }
.tl-amber  { background: var(--tl-amber); color: #3D2A00; }
.tl-orange { background: var(--tl-orange); }
.tl-red    { background: var(--tl-red); }
.tl-grey   { background: #A6A493; }

/* --------------------------------------------------------------- tables */
.entries { width: 100%; border-collapse: collapse; }
.entries td { border-bottom: 1px solid var(--line); padding: 12px 6px; vertical-align: top; }
.entries .hrs { text-align: right; font-weight: 700; white-space: nowrap; }
.totals { display: flex; justify-content: space-around; text-align: center; }
.totals div { display: flex; flex-direction: column; gap: 4px; }
.totals strong { font-family: "Fraunces", Georgia, serif; font-size: 1.3rem; }

/* ---------------------------------------------------------------- admin */
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.row-gap { display: flex; gap: 12px; align-items: center; }
.assign { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.assign .check { font-weight: 400; font-size: 0.92em; }
.assign .check input { width: auto; }
.assign button { padding: 7px 16px; font-size: 0.88rem; }

@media (min-width: 520px) {
  .name-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .name-btn, button { transition: background 0.15s ease; }
}

/* ------------------------------------------------------------- crew v3 */
fieldset.crew { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 4px; margin: 0 0 14px; }
fieldset.crew legend { font-weight: 700; font-size: 0.88rem; color: var(--green); padding: 0 6px; }
.chip {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  background: #E9E3D3; color: var(--green-deep);
  border-radius: 999px; padding: 2px 9px; margin-left: 6px; vertical-align: middle;
}
.chip.subbie { background: #EFE0CC; color: #8A5A1B; }
.stat-row.done { opacity: 0.72; }
.stat-row.done .stat-name { text-decoration: line-through; text-decoration-thickness: 1px; }
