:root {
  --ink: #14283d;
  --paper: #eef1f4;
  --surface: #ffffff;
  --line: #d3dae1;
  --muted: #566676;
  --stamp: #1b6e53;
  --stamp-soft: #e3f1eb;
  --amber: #a35f0c;
  --amber-soft: #fbefdc;
  --red: #a8342f;
  --display: "Frank Ruhl Libre", "David", serif;
  --body: "Assistant", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }

/* ---------- header and the ladder switcher ---------- */
.top { background: var(--ink); color: #fff; }
.top-in {
  max-width: 60rem; margin: 0 auto; padding: 1rem 1.25rem 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap;
}
.brand { padding-bottom: 1rem; }
.brand-name { display: block; font-family: var(--display); font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.brand-sub { font-size: .9rem; opacity: .75; }

/* three rungs, each a step higher than the one before */
.rungs { display: flex; align-items: flex-end; gap: 2px; }
.rung {
  border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
  padding: .55rem 1.15rem .6rem; min-width: 6.5rem; text-align: start;
  display: grid; row-gap: 0; border-radius: 4px 4px 0 0;
}
.rung[data-role="secretary"] { padding-top: .55rem; }
.rung[data-role="manager"]   { padding-top: 1.1rem; }
.rung[data-role="ceo"]       { padding-top: 1.65rem; }
.rung-who  { font-weight: 700; font-size: 1.05rem; }
.rung-role { font-size: .85rem; opacity: .8; }
.rung:hover { background: rgba(255,255,255,.18); }
.rung[aria-current="true"] { background: var(--paper); color: var(--ink); }
.rung[aria-current="true"] .rung-role { opacity: 1; color: var(--muted); }
.rung:disabled { cursor: progress; }

/* ---------- page ---------- */
.page { max-width: 60rem; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.loading, .empty { color: var(--muted); }
.error { background: #fbe9e7; border-inline-start: 4px solid var(--red); padding: .9rem 1rem; }

.lede { font-family: var(--display); font-size: 1.6rem; font-weight: 500; line-height: 1.3; margin: 0 0 1.75rem; max-width: 34ch; }

section + section { margin-top: 2.25rem; }
h2 { font-family: var(--display); font-size: 1.25rem; font-weight: 700; margin: 0 0 .6rem; display: flex; align-items: baseline; gap: .6rem; }
h2 .count { font-family: var(--body); font-size: .9rem; font-weight: 600; color: var(--muted); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin: 0; padding: 0; list-style: none; }
.list > li { padding: .95rem 1.1rem; }
.list > li + li { border-top: 1px solid var(--line); }
.list > li.empty { padding: 1.1rem; }

/* an item */
.item-head { display: flex; gap: .85rem; align-items: flex-start; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.item-body { margin: .25rem 0 0; color: #2c3e50; max-width: 68ch; }
.meta { margin: .3rem 0 0; font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.late { color: var(--red); font-weight: 700; }
.done .item-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }

/* the ladder marker: where the item is waiting */
.ladder { display: flex; align-items: flex-end; gap: 2px; height: 1.5rem; margin-top: .2rem; flex: none; }
.ladder i { width: 6px; background: var(--line); border-radius: 1px; }
.ladder i:nth-child(1) { height: 33%; }
.ladder i:nth-child(2) { height: 66%; }
.ladder i:nth-child(3) { height: 100%; }
.ladder i.on { background: var(--amber); }
.ladder.ok i.on { background: var(--stamp); }
.ladder.no i.on { background: var(--red); }

.draft { margin-top: .75rem; }
.draft label { display: block; font-size: .88rem; font-weight: 600; color: var(--muted); margin-bottom: .2rem; }
textarea, input[type="text"], input[type="date"], select {
  border: 1px solid #b6c1cc; border-radius: 4px; background: #fff; padding: .45rem .6rem;
}
textarea { width: 100%; min-height: 5.2rem; resize: vertical; line-height: 1.45; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center; }
.actions input[type="text"] { flex: 1 1 12rem; min-width: 0; }
.btn { border: 1px solid var(--ink); background: #fff; border-radius: 4px; padding: .45rem .95rem; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--paper); }
.btn.approve { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.btn.approve:hover { background: #155a44; }
.btn.reject { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; cursor: progress; }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }

.tag { display: inline-block; font-size: .82rem; font-weight: 600; padding: .05rem .5rem; border-radius: 3px; background: var(--amber-soft); color: var(--amber); }
.tag.ok { background: var(--stamp-soft); color: var(--stamp); }
.tag.no { background: #fbe9e7; color: var(--red); }

/* people overview */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.person { background: var(--surface); padding: .9rem 1.1rem; }
.person b { display: block; }
.person span { font-size: .9rem; color: var(--muted); }
.person .big { font-family: var(--display); font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1.1; display: block; }

/* add form */
.add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .9rem 1.1rem; }
.add label { display: grid; gap: .15rem; font-size: .88rem; font-weight: 600; color: var(--muted); }
.add label.grow { flex: 1 1 16rem; }
.add label.grow input { width: 100%; }

details { margin-top: 2.25rem; }
summary { cursor: pointer; font-weight: 600; margin-bottom: .6rem; }

.log li { padding: .6rem 1.1rem; font-size: .95rem; }
.log time { color: var(--muted); font-size: .85rem; margin-inline-start: .5rem; }

.foot { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem 2.5rem; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .88rem; color: var(--muted); }

@media (max-width: 34rem) {
  html { font-size: 16px; }
  .top-in { align-items: stretch; }
  .rungs { width: 100%; }
  .rung { flex: 1; min-width: 0; padding-inline: .7rem; }
  .lede { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .rung, .btn { transition: background-color .12s; }
}
