/* Pinned points-redeemable document (#community-workorder), console style: one document
   sheet (glyph · tag · title · summary · format line) over a redemption stub parted by a
   dashed perforation (terms, then the one solid green action).
   Every rule starts at `:root #community-workorder` so it outranks the shared
   `#community-notes .community-knowledge-card …` rules (1,1,0)/(1,1,1) whatever the load
   order, and no other note is touched. The card sizes itself by its own width (container
   cdoc), not the viewport: the reader column is ~836px at 1440, ~554px at 1024 and the
   whole phone width below that. */
:root #community-workorder.community-knowledge-card {
  position: relative; display: block; padding: 0;
  container: cdoc / inline-size;
  border-color: var(--line);
  background: radial-gradient(560px 200px at 100% 0, var(--accent-soft), transparent 72%), var(--surface);
  transition: border-color var(--dur-2) var(--ease);
}
/* Lit top edge: the pinned sheet catches the signal from the left. */
:root #community-workorder.community-knowledge-card::before {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-line) 30%, transparent 75%);
  pointer-events: none;
}
:root #community-workorder.community-knowledge-card:hover { border-color: var(--line-2); }

/* Sheet: the glyph holds the left column; text keeps one full-width column so long titles
   wrap on their own measure instead of a squeezed third of the card. */
:root #community-workorder .community-knowledge-card-main {
  display: grid; grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas: "glyph tag" "glyph title" "glyph summary" "glyph meta";
  align-items: start; column-gap: var(--s-5);
  padding: var(--s-6) var(--s-6) var(--s-5);
}
:root #community-workorder .community-doc-glyph { grid-area: glyph; display: block; width: 44px; height: auto; color: var(--line-2); overflow: visible; transition: color var(--dur-2) var(--ease); }
:root #community-workorder .community-doc-glyph path { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
:root #community-workorder .community-doc-glyph .community-doc-glyph-page { fill: var(--surface-2); }
:root #community-workorder .community-doc-glyph .community-doc-glyph-head { stroke: var(--accent); stroke-width: 2; filter: drop-shadow(0 0 3px var(--glow)); }
:root #community-workorder .community-doc-glyph .community-doc-glyph-line { stroke: var(--text-3); opacity: .6; }
:root #community-workorder.community-knowledge-card:hover .community-doc-glyph { color: var(--accent-line); }

:root #community-workorder .community-knowledge-tag {
  grid-area: tag; justify-self: start; align-items: center; gap: 7px;
  margin: 0 0 var(--s-3); padding: 2px 10px 2px 8px;
  border: 1px solid var(--accent-line); border-radius: var(--r-pill); background: var(--accent-soft);
  color: var(--accent); font-size: var(--fs-2xs); font-weight: var(--w-semibold); line-height: 1.5; letter-spacing: .04em;
}
:root #community-workorder .community-knowledge-tag::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 1px; background: currentColor; box-shadow: 0 0 6px var(--glow); }
:root #community-workorder.community-knowledge-card h2 {
  grid-area: title; margin: 0 0 var(--s-2);
  color: var(--text); font-size: var(--fs-xl); font-weight: var(--w-bold); line-height: 1.35; letter-spacing: .01em;
  overflow-wrap: break-word; text-wrap: balance;
}
:root #community-workorder .community-knowledge-card-main > h2 + p {
  grid-area: summary; max-width: 62ch; margin: 0 0 var(--s-4);
  color: var(--text-2); font-size: var(--fs-md); line-height: 1.65; text-wrap: pretty;
}
/* Format line, set like a colophon: monospaced fields parted by hairlines. The separators
   keep their " · " text for copy/paste and are hidden from assistive technology. */
:root #community-workorder .community-knowledge-card-main > .community-doc-meta {
  grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-3);
  max-width: none; margin: 0;
  color: var(--text-2); font: var(--w-medium) var(--fs-xs)/1.4 var(--font-mono); letter-spacing: .04em;
}
:root #community-workorder .community-doc-sep { flex: none; width: 1px; height: 11px; overflow: hidden; background: var(--line-2); font-size: 0; }

/* Stub: terms on the text column, the action on the right; the action drops under the
   terms when both do not fit (long English copy at ~554px) and spans the stub on phones. */
:root #community-workorder .community-doc-actions {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5);
  margin: 0; padding: var(--s-4) var(--s-6) var(--s-4) calc(var(--s-6) + 44px + var(--s-5));
  border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
  background: var(--surface-2);
}
:root #community-workorder .community-doc-actions::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 8px);
}
:root #community-workorder .community-doc-terms {
  display: grid; gap: 2px; flex: 1 1 15rem; min-width: 0; max-width: none; margin: 0;
  color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5;
}
:root #community-workorder .community-doc-terms > span + span { color: var(--text-3); font-size: var(--fs-xs); }
:root #community-workorder .community-doc-cta {
  flex: none; display: inline-flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 40px; padding: 0 var(--s-4) 0 18px;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-ink);
  font-size: var(--fs-sm); font-weight: var(--w-bold); line-height: 1.3; text-decoration: none; white-space: nowrap;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
:root #community-workorder .community-doc-cta b { font: var(--w-bold) 1.08em/1 var(--font-mono); font-variant-numeric: tabular-nums; }
:root #community-workorder .community-doc-cta-arrow { display: inline-block; font-weight: var(--w-semibold); transition: transform var(--dur-2) var(--ease); }
:root #community-workorder .community-doc-cta:hover { color: var(--accent-ink); text-decoration: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px var(--glow); }
:root #community-workorder .community-doc-cta:hover .community-doc-cta-arrow { transform: translate(2px, -2px); }
:root #community-workorder .community-doc-cta:active { transform: translateY(1px); }
:root #community-workorder .community-doc-cta:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Narrow card (phones; ~328–358px): the glyph shrinks into the tag row, text runs the full
   width and the action becomes a full-width 44px bar. */
@container cdoc (max-width: 519.98px) {
  :root #community-workorder .community-knowledge-card-main {
    grid-template-columns: 26px minmax(0, 1fr); grid-template-areas: "glyph tag" "title title" "summary summary" "meta meta";
    column-gap: 10px; padding: var(--s-4) var(--s-4) var(--s-4);
  }
  :root #community-workorder .community-doc-glyph { width: 26px; align-self: center; margin-bottom: var(--s-3); }
  :root #community-workorder .community-knowledge-tag { align-self: center; }
  :root #community-workorder.community-knowledge-card h2 { font-size: var(--fs-lg); line-height: 1.4; }
  :root #community-workorder .community-knowledge-card-main > h2 + p { margin-bottom: var(--s-3); font-size: var(--fs-sm); }
  :root #community-workorder .community-doc-actions { padding: var(--s-3) var(--s-4) var(--s-4); }
  :root #community-workorder .community-doc-cta { flex: 1 1 100%; min-height: 44px; white-space: normal; }
}
@media (pointer: coarse) { :root #community-workorder .community-doc-cta { min-height: 44px; } }

@media (prefers-reduced-motion: reduce) {
  :root #community-workorder.community-knowledge-card,
  :root #community-workorder :is(.community-doc-glyph, .community-doc-cta, .community-doc-cta-arrow) { transition: none; }
  :root #community-workorder .community-doc-cta:is(:hover, :active),
  :root #community-workorder .community-doc-cta:hover .community-doc-cta-arrow { transform: none; }
}
@media (forced-colors: active) {
  :root #community-workorder.community-knowledge-card::before, :root #community-workorder .community-doc-actions::before { background: CanvasText; }
  :root #community-workorder .community-doc-glyph :is(path, .community-doc-glyph-head, .community-doc-glyph-line) { stroke: CanvasText; opacity: 1; filter: none; }
  :root #community-workorder .community-doc-sep { background: CanvasText; }
}
