/* Reserve checklist: the planner's look (planner.css loads first) plus the checklist's own parts. */

.res-card, .ledger-layout .card, .modal .card { color-scheme: light; }

/* ---------- reserve picker ---------- */
.reserve-picker {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  padding: 18px clamp(16px, 3vw, 36px) 0;
}
.res-card {
  display: grid; gap: 4px; padding: 8px 10px; border-radius: 14px; min-width: 0;
  background: var(--zebra); color: var(--ink); box-shadow: inset 0 0 0 2px var(--paper-line), var(--shadow);
}
.res-card.is-active { background: #fff8ec; box-shadow: inset 0 0 0 3px var(--snake-d), var(--shadow); }
.res-select {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 8px; align-items: center;
  width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
}
.res-select:focus-visible, .tick:focus-visible, .link-btn:focus-visible { outline: 3px solid var(--toucan); outline-offset: 2px; }
.res-select img { width: 40px; height: 40px; object-fit: contain; grid-row: span 2; }
.res-name { font-weight: 700; font-size: 14px; line-height: 1.15; }
.res-count { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.res-count b { font-size: 16px; color: var(--snake-d); }
.res-select .bar { grid-column: 1 / -1; height: 6px; margin-top: 4px; }
.res-select .bar span { background: var(--snake-d); }
.res-card.is-locked .res-select img { filter: grayscale(1); opacity: .6; }
.res-unlock { font-size: 12.5px; }

/* ---------- layout ---------- */
.ledger-layout {
  display: grid; gap: 28px 26px; align-items: start; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "input" "output"; padding: 30px clamp(16px, 3vw, 36px) 30px;
}
.ledger-input { grid-area: input; min-width: 0; }
.ledger-output { grid-area: output; min-width: 0; }
@media (min-width: 1100px) {
  .ledger-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "input output"; }
}

/* ---------- roles this reserve needs, right under its headline ---------- */
.role-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 6px; }
.strip-count { margin-right: 4px; color: var(--snake-d); font-size: 16px; font-weight: 700; }
.role-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px;
  font-size: 14.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.role-tag--filled { background: #dfe8bf; color: var(--snake-dd); }
.role-tag--ecosystem { background: #ffe0bf; color: #8a4a12; box-shadow: inset 0 0 0 2px var(--toucan-d); }
.role-tag--prerequisite { background: var(--flamingo); color: #7a2440; box-shadow: inset 0 0 0 2px var(--flamingo-d); }
a.role-tag:hover { text-decoration: underline; }
.strip-key { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 14px; }
.strip-key .role-tag { padding: 1px 8px; font-size: 11px; font-weight: 600; box-shadow: none; }

/* ---------- canonical reserve species: the star and its notice ---------- */
.canon-key {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 16px; border-radius: 12px;
  background: #fff1d6; box-shadow: inset 0 0 0 2px var(--toucan); color: var(--bear-d); font-size: 15.5px; line-height: 1.35;
}
.canon-star { flex: none; font-size: 30px; line-height: 1; }
.star { font-size: 17px; line-height: 1; }

/* ---------- species tiles ---------- */
.role-groups { columns: 2 280px; column-gap: 20px; }
.role-group { break-inside: avoid; padding-bottom: 14px; scroll-margin-top: 16px; }
.role-group .sub-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 0; }
.group-why {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px;
  font: 600 12px/1.2 var(--font); letter-spacing: 0; text-transform: none; color: var(--ink-2);
}
.group-why img { width: 18px; height: 18px; }
.group-why span { margin-left: 4px; }
.group-why--gate { color: #8a4a12; }
.tick-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tick-grid > li { position: relative; min-width: 0; }
.tick {
  position: relative; display: grid; grid-template-rows: 64px; grid-auto-rows: auto; gap: 3px; justify-items: center; align-content: start;
  width: 100%; height: 100%; padding: 8px; border: 0; border-radius: 12px; cursor: pointer; text-align: center;
  color: var(--ink); background: var(--zebra); box-shadow: inset 0 0 0 2px var(--paper-line);
}
.tick:hover { box-shadow: inset 0 0 0 2px var(--snake); }
.tick.is-on { background: #eef0d2; box-shadow: inset 0 0 0 3px var(--snake-d); }
.tick-art { width: 100%; height: 64px; object-fit: contain; filter: drop-shadow(0 2px 3px rgb(51 48 41 / .25)) var(--acc-dim,); }
.tick > .acc-badge { top: 34px; left: 6px; }
.rel { position: relative; }
.tick-box {
  position: absolute; top: 8px; left: 8px; z-index: 1; width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; font-weight: 700; color: var(--zebra); background: #fff; box-shadow: inset 0 0 0 2px var(--toucan-d);
}
.tick.is-on .tick-box { background: var(--snake-d); box-shadow: none; }
.tick-name { font-weight: 700; font-size: 13.5px; line-height: 1.2; overflow-wrap: anywhere; }
.tick-roles { font-size: 11px; line-height: 1.2; color: var(--ink-2); }
.tick-wait { font-size: 11px; font-weight: 600; line-height: 1.2; color: #8a4a12; }
.bucket, .released-here { margin-top: 6px; }
.bucket .sub-head { color: var(--parrot-d); border-color: var(--parrot-d); }
.bucket-note, .released-here .note { margin: 0 0 10px; }

/* ---------- shared bits ---------- */
.link-btn { border: 0; padding: 0; background: none; color: var(--snake-d); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.callout { margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; background: var(--paper-2); color: var(--ink); }
.callout svg { vertical-align: -2px; }
.callout--ok { background: #dfe8bf; color: var(--snake-dd); }
.callout--bad { background: var(--flamingo); color: #7a2440; font-weight: 600; }
.callout--muted { color: var(--ink-2); }
.meters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin: 6px 0 4px; }
.facts { margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.facts summary { cursor: pointer; font-weight: 600; color: var(--snake-d); }
.facts ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.facts code { padding: 0 4px; border-radius: 4px; background: var(--paper-2); font: 11px/1.3 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.foot .facts { color: #b9ad98; }
.foot .facts summary { color: var(--snake-l); }
.foot .facts code { background: rgb(255 242 221 / .1); color: var(--zebra-d); }
.status { display: inline-flex; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.status--establish, .status--waits { background: #ffe0bf; color: #8a4a12; }
.status--blocked { background: var(--flamingo); color: #7a2440; }

/* ---------- releases: priority, available, completed ---------- */
.tier-head { margin-top: 18px; }
.tier-head:first-of-type { margin-top: 0; }
.tier-note { margin: -4px 0 8px; }
.rel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rel {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px 10px; align-items: start;
  padding: 8px 10px; border-radius: 12px; background: var(--zebra); box-shadow: inset 0 0 0 2px var(--paper-line);
}
.rel--priority { box-shadow: inset 0 0 0 2px var(--snake); }
.rel--done { background: #f1f2df; }
.rel-art { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fffaf0, var(--paper-2)); }
.rel-main { display: grid; gap: 3px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.rel-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rel-name { color: var(--ink); font-size: 15px; text-decoration: none; text-align: left; }
.rel-star { font-size: 18px; line-height: 1; }
.rel-line b { color: var(--ink); }
.rel-line img { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; }
.rel-note { color: var(--ink-3); font-style: italic; }
.group-list { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 1px; font-size: 12.5px; }
.group-list b { color: var(--ink); }
.rel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.rtags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.rtag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 3px; border-radius: 999px;
  background: #dfe8bf; color: var(--snake-dd); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.rtag img { width: 18px; height: 18px; object-fit: contain; }
.rtag-star { font-size: 13px; line-height: 1; }
.rtag--locked { background: var(--zebra); box-shadow: inset 0 0 0 1px var(--paper-line); }
.rtag--struck { background: var(--paper-2); color: var(--ink-3); text-decoration: line-through; box-shadow: none; }
.rtag--struck img, .rtag--struck .rtag-star { filter: grayscale(1); opacity: .5; }

/* ---------- species modal ---------- */
.where-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.where-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.where-list img { width: 24px; height: 24px; object-fit: contain; }
.group-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; }
.group-table th { padding: 0 6px; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.group-table td { padding: 5px 6px; background: var(--zebra); vertical-align: top; }
.group-table td:first-child { border-radius: 8px 0 0 8px; }
.group-table td:last-child { border-radius: 0 8px 8px 0; }
.group-table small { color: var(--ink-2); }

@media (max-width: 640px) {
  .reserve-picker { gap: 8px; }
  .res-card { padding: 6px 8px; }
  .res-select { grid-template-columns: 30px minmax(0, 1fr); }
  .res-select img { width: 30px; height: 30px; }
  .res-name { font-size: 13px; }
  .rel { grid-template-columns: 40px minmax(0, 1fr); }
  .rel-art { width: 40px; height: 40px; }
  .role-tag { font-size: 13.5px; padding: 4px 10px; }
  .canon-key { font-size: 14.5px; }
  .tick-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}
