:root {
  --green: #1A4731; --green-2: #2D6A4F; --cream: #FFFEF9; --paper: #FAF8F3; --line: #E2DDD4; --ink: #1F1D1B; --muted: #6B6560;
  --a: #1A4731; --b: #B7791F; --c: #8A8580; --red: #B42318; --red-bg: #FDECEA; --amber-bg: #FFF4E0; --green-bg: #E8F1EC;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.45 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
.top { position: sticky; top: 0; z-index: 20; background: var(--green); color: var(--cream); display: flex; align-items: center; gap: 18px; padding: 8px 20px; min-height: 56px; }
.top .brand { font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.top .brand small { font-weight: 500; opacity: .75; margin-left: 6px; }
.top nav { display: flex; flex-wrap: wrap; gap: 2px 4px; flex: 1; min-width: 0; }   /* a narrow desktop wraps to a second line, never cuts an item (review 055 H4) */
.top nav a { color: var(--cream); text-decoration: none; padding: 7px 10px; border-radius: 8px; white-space: nowrap; opacity: .85; font-weight: 500; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.14); opacity: 1; }
.top .who { font-size: 13px; opacity: .85; white-space: nowrap; }
.top .who button { background: none; border: 1px solid rgba(255,255,255,.4); color: var(--cream); border-radius: 8px; padding: 4px 9px; margin-left: 8px; cursor: pointer; }
.sample .linkbtn { background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; padding: 0 4px; }
.sample { background: var(--amber-bg); color: #7A4B00; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .06em; padding: 5px 10px; }
main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
h1 { font-size: 24px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters select, .filters input { background: var(--cream); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-height: 36px; }
.filters input { min-width: 180px; }
.btn { background: var(--green); color: var(--cream); border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; min-height: 36px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn.ghost { background: var(--cream); color: var(--green); border: 1px solid var(--line); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.group td { background: var(--amber-bg); color: #5C3A00; font-size: 13px; }
tr.click { cursor: pointer; } tr.click:hover td { background: #F6F3EC; }
.tier { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 700; color: #fff; font-size: 13px; }
.tier.A { background: var(--a); } .tier.B { background: var(--b); } .tier.C { background: var(--c); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #EFEBE3; color: var(--muted); white-space: nowrap; }
.pill.red { background: var(--red-bg); color: var(--red); } .pill.amber { background: var(--amber-bg); color: #7A4B00; } .pill.green { background: var(--green-bg); color: var(--green); }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.quote { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; color: var(--muted); font-size: 13px; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; } .stat b { display: block; font-size: 24px; } .stat span { color: var(--muted); font-size: 13px; }
.section { margin-bottom: 16px; } .section h2 { flex-wrap: wrap; } .section h2 { font-size: 16px; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list > div { padding: 12px 18px; border-bottom: 1px solid var(--line); } .list > div:last-child { border-bottom: 0; }
.empty { padding: 26px 18px; color: var(--muted); text-align: center; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.col { background: #F1EDE4; border-radius: var(--radius); padding: 10px; min-height: 240px; }
.col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin: 2px 4px 10px; color: var(--muted); display: flex; justify-content: space-between; }
.col.over { outline: 2px dashed var(--green-2); }
.kcard { background: var(--cream); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kcard .n { font-weight: 600; font-size: 14px; display: flex; gap: 7px; align-items: center; }
.kcard select { display: none; }
.task { display: flex; gap: 12px; align-items: flex-start; }
.task input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); }
.task .body { flex: 1; min-width: 0; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 10px 0 0; }
.bars div { flex: 1; background: var(--green-2); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.bars div.a { background: var(--a); } .bars div.b { background: var(--b); } .bars div.c { background: var(--c); }
.bars div span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.axis { display: flex; gap: 6px; font-size: 11px; color: var(--muted); } .axis span { flex: 1; text-align: center; }
.modal { position: fixed; inset: 0; background: rgba(20,20,20,.35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .card { width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.field { display: grid; gap: 4px; margin-bottom: 12px; } .field label { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 14px; z-index: 60; }
.hide-sm { }
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, 1fr); }
  .top { height: auto; flex-wrap: wrap; padding: 8px 16px; gap: 6px 12px; } .top nav { order: 3; flex-basis: 100%; } .top .who { margin-left: auto; }
  main { padding: 16px 16px 50px; }
  .hide-sm { display: none; }
  table.cards thead { display: none; } table.cards tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; } table.cards td { display: block; border: 0; padding: 3px 14px; }
  .kanban { grid-auto-flow: row; grid-auto-columns: auto; } .col { min-height: 0; } .kcard { cursor: default; } .kcard select { display: block; margin-top: 6px; width: 100%; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
  .filters input { min-width: 0; flex: 1 1 100%; } .filters select { flex: 1 1 calc(50% - 8px); }
}
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(400px, 100%); padding: 28px; }
.login h1 { color: var(--green); }
[hidden] { display: none !important; }
.grid2 > div { min-width: 0; }
.scroll-x { overflow-x: auto; }
@media (max-width: 860px) {
  .col[data-stage="new"] { order: 9; }
  .top nav { flex-wrap: wrap; overflow-x: visible; gap: 2px 4px; }   /* every item visible: two lines, never a cut "Im…" (review 021) */
  .top nav a { padding: 6px 9px; }
  .kanban { display: flex; flex-direction: column; }
}

/* C5 plan: a wide table of months scrolls sideways inside its card (also on a phone); the stage column stays in place */
.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.ramp th:first-child, table.ramp td:first-child { position: sticky; left: 0; background: var(--cream); z-index: 1; }
table.ramp td, table.ramp th { white-space: nowrap; }
/* C4a Social: the week calendar */
.soc-cell { vertical-align: top; min-width: 170px; white-space: normal !important; }
.soc-post { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; background: #fff; }
.soc-post:hover { border-color: var(--green); }
.soc-plan { border: 1px dashed var(--line); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; }
