/* Plan, readable layer: where we are, decision cards by urgency, compact phase items. */

/* Where we are: three plain answers before any chart. */
.where {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin: -4px 0 30px;
}
.where > div {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--rule) 70%, transparent);
  box-shadow: var(--shadow-2);
}
.where p {
  margin: 0;
}
.where-now {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--rule)) !important;
  box-shadow: var(--shadow-3) !important;
}
.where-kicker {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}
.where-next .where-kicker {
  color: var(--ink-3);
}
.where-decide .where-kicker {
  color: #7b3fe4;
}
.where-title {
  font: 720 20px/1.25 var(--display);
  color: var(--ink);
}
.where-meta {
  font-size: 14.5px;
  color: var(--ink-2);
}
.where-bar .bar {
  display: block;
  max-width: none;
  height: 8px;
  border-radius: 4px;
  background: var(--rule);
  overflow: hidden;
}
.where-bar .bar-fill {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  background: var(--accent);
  border-radius: 4px;
}

.pl-caption {
  margin: -6px 0 14px;
  font-size: 14.5px;
  color: var(--ink-3);
}
.pl-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 2px;
  border-radius: 2px;
  background: #7b3fe4;
  transform: rotate(45deg);
  vertical-align: 0;
}

/* Decisions: a question, its options, what the plan recommends, and when. */
.section-head {
  margin-bottom: 14px;
}
.section-head p {
  margin: 6px 0 0;
}
.dgroup {
  margin-bottom: 22px;
}
.dgroup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font: 700 17px/1.2 var(--display);
}
.dgroup-past .dgroup-head {
  color: var(--bad);
}
.dgroup-past .bucket-count {
  background: var(--bad-bg);
  color: var(--bad);
}
.dgroup-week .dgroup-head {
  color: var(--warn);
}
.dgroup-week .bucket-count {
  background: var(--warn-bg);
  color: var(--warn);
}
.dcards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.dcard {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px 16px 14px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--rule) 70%, transparent);
  box-shadow: var(--shadow-1);
  scroll-margin-top: 100px;
  transition:
    transform 200ms var(--ease-out),
    box-shadow 200ms;
}
.dcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.dcard:target {
  box-shadow:
    0 0 0 4px var(--marker),
    var(--shadow-2);
}
.dcard-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.dnum {
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--bg);
  font: 750 13px/1.2 var(--body);
}
.ddue {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.dgroup-past .ddue {
  color: var(--bad);
}
.dgroup-week .ddue {
  color: var(--warn);
}
.downer {
  margin-left: auto;
  font-size: 13.5px;
  color: var(--ink-3);
  font-weight: 600;
}
.dq {
  margin: 0;
  font: 680 17px/1.35 var(--display);
  color: var(--ink);
}
.doptions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.doptions li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--rule);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.drec {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
}
.drec b {
  display: block;
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 2px;
}
.dref {
  margin: 0;
  font-size: 13px;
  color: var(--good);
  font-weight: 650;
}
.dref::before {
  content: "✓ ";
}

.as-table {
  margin-top: 6px;
}
.as-table > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink-3);
  padding: 6px 0;
}
.as-table > summary:hover {
  color: var(--accent);
}
.as-table[open] > summary {
  margin-bottom: 10px;
}

/* Phase items: one line each (id, action, owner, window); details open in place. */
.items {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.item-row > details {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--rule) 70%, transparent);
  transition: box-shadow 200ms;
}
.item-row > details[open] {
  box-shadow: var(--shadow-2);
}
.item-row {
  scroll-margin-top: 100px;
}
.item-row:target > details {
  box-shadow: 0 0 0 4px var(--marker);
}
.item-row summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(90px, 170px) 190px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}
.item-row summary::-webkit-details-marker {
  display: none;
}
.item-id {
  font: 750 13.5px/1 var(--body);
  color: var(--accent);
}
.item-action {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.item-row details[open] .item-action {
  -webkit-line-clamp: unset;
}
.item-owner {
  font-size: 13.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-window {
  display: grid;
  gap: 4px;
}
.item-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
}
.item-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x, 0%);
  width: var(--w, 0%);
  border-radius: 3px;
  background: var(--ink-3);
}
.is-now .item-bar {
  background: var(--accent);
}
.is-done-window .item-bar {
  background: var(--pending);
}
.item-dates {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.is-done-window .item-action {
  color: var(--ink-3);
}
.item-more {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 16px 14px 74px;
}
.item-more dt {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
}
.item-more dd {
  margin: 2px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
}

@media (max-width: 719px) {
  .item-row summary {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .item-owner {
    display: none;
  }
  .item-window {
    grid-column: 2;
  }
  .item-more {
    padding-left: 16px;
  }
  .dcards {
    grid-template-columns: 1fr;
  }
}
