/* pull-plan: FIG. 2, Build It. Trade tags, a SEQ schedule, a result line and RESET.
   Stacked rows in a narrow figure (phone artboard); five columns once the figure is
   440px wide (desktop artboard). Colours come only from the core tokens. */

.w-pull-plan {
  container: pull-plan / inline-size;
  /* filled tags and slots sit one step off the figure's paper: the project page draws figures on panel */
  --pp-fill: var(--sheet);
}

.w-pull-plan .pp-vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.w-pull-plan .pp-intro {
  font-size: 15px; line-height: 1.55; color: var(--ink-2);
}

/* trade tags */
.w-pull-plan .pp-pool {
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; margin-top: 12px;
}
.w-pull-plan .pp-trade {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; margin: 0;
  border: 1.5px solid var(--ink); border-radius: 0;
  background: var(--pp-fill); color: var(--ink);
  font-family: var(--font-narrow); font-weight: 600; font-size: 16px; line-height: 1.15; letter-spacing: .02em;
  text-align: left; touch-action: manipulation;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.w-pull-plan .pp-trade[aria-disabled="true"] {
  border-style: dashed; border-color: var(--ink-2); background: transparent; color: var(--ink-2);
}
@media (hover: hover) {
  .w-pull-plan .pp-trade:not([aria-disabled="true"]):hover { background: var(--hover); }
  .w-pull-plan .pp-reset:hover { background: var(--hover); }
}
.w-pull-plan .pp-ico { flex: none; display: block; width: 12px; height: 12px; }

/* the schedule: stacked rows by default */
.w-pull-plan .pp-table {
  display: flex; flex-direction: column; margin: 12px 0 0; padding: 0; list-style: none;
  border: 1.5px solid var(--ink);
}
.w-pull-plan .pp-slot {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; min-height: 40px;
}
.w-pull-plan .pp-slot + .pp-slot { border-top: 1px solid var(--line); }
.w-pull-plan .pp-slot.is-filled { background: var(--pp-fill); }
.w-pull-plan .pp-seq {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 0 10px; font-family: var(--font-mono); font-size: 12px; line-height: 1.3; letter-spacing: .06em; color: var(--ink-2);
}
.w-pull-plan .pp-nw { white-space: nowrap; }
/* the cross on a sent-back slot: before the name in rows, in the column head in columns */
.w-pull-plan .pp-ico--col { display: none; }
.w-pull-plan .pp-name {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 0;
  font-family: var(--font-narrow); font-weight: 600; font-size: 16px; line-height: 1.2; color: var(--ink-2);
}
.w-pull-plan .pp-slot.is-filled .pp-name { color: var(--ink); }
/* a sent-back attempt stays on the table, muted, with the bad slot marked */
.w-pull-plan .pp-table.is-sent-back .pp-slot.is-filled:not(.is-bad) { background: transparent; }
.w-pull-plan .pp-table.is-sent-back .pp-slot.is-filled:not(.is-bad) .pp-name { color: var(--ink-2); }
.w-pull-plan .pp-slot.is-bad .pp-seq,
.w-pull-plan .pp-slot.is-bad .pp-name { color: var(--accent); }
.w-pull-plan .pp-slot.is-bad { box-shadow: inset 3px 0 0 var(--accent); }

/* result line + RESET */
.w-pull-plan .pp-foot { display: flex; align-items: stretch; gap: 8px; margin-top: 12px; }
.w-pull-plan .pp-result {
  flex: 1; min-width: 0; min-height: 88px; margin: 0; padding: 11px 13px;
  border: 1px dashed var(--ink-2); color: var(--ink-2);
  font-size: 15px; line-height: 1.4;
}
.w-pull-plan .pp-result[data-tone="bad"] { padding: 10px 12px; border: 2px solid var(--accent); color: var(--accent); }
.w-pull-plan .pp-result[data-tone="ok"] { padding: 10px 12px; border: 2px solid var(--ink); color: var(--ink); }
.w-pull-plan .pp-reset {
  flex: none; min-height: 44px; min-width: 44px; padding: 0 14px; margin: 0;
  border: 1.5px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; line-height: 1.2; letter-spacing: .08em;
  touch-action: manipulation;
  transition: background-color .16s ease;
}

/* five columns once the figure is wide enough for "Structural steel" to break cleanly */
@container pull-plan (min-width: 440px) {
  .w-pull-plan .pp-table { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .w-pull-plan .pp-slot { display: flex; flex-direction: column; align-items: stretch; min-height: 78px; }
  .w-pull-plan .pp-slot + .pp-slot { border-top: 0; border-left: 1px solid var(--line); }
  .w-pull-plan .pp-seq { padding: 5px 8px; border-bottom: 1px solid var(--line); }
  .w-pull-plan .pp-name { display: block; padding: 6px 8px 8px; font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
  .w-pull-plan .pp-ico--row { display: none; }
  .w-pull-plan .pp-slot.is-bad .pp-ico--col { display: block; }
  .w-pull-plan .pp-slot.is-bad { box-shadow: inset 0 3px 0 var(--accent); }
  .w-pull-plan .pp-result { min-height: 44px; }
  .w-pull-plan .pp-reset { align-self: stretch; padding: 0 16px; }
}
