.pd-goal-story {
  --gw-blue: var(--blue, #1769e0);
  --gw-blue-soft: #edf4ff;
  --gw-green: var(--green, #147a4f);
  --gw-green-soft: #edf9f2;
  --gw-amber: #a76008;
  --gw-amber-soft: #fff8e8;
  --gw-purple: #6f42c1;
  --gw-purple-soft: #f4f0ff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  background: var(--surface);
}
.pd-goal-story * { box-sizing: border-box; }
.pd-goal-story h2,.pd-goal-story h3,.pd-goal-story p { margin: 0; }
.pd-goal-story h2 { font-size: 16px; line-height: 1.3; }
.pd-goal-story h3 { font-size: 12px; line-height: 1.35; }
.pd-goal-story button { letter-spacing: 0; }
.gw-title-band {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex: 0 0 auto;
}
.gw-title-band > div:first-child { display: inline-flex; align-items: center; gap: 7px; }
.gw-title-band > div:first-child > span { color: var(--gw-blue); }
.gw-title-band > div:first-child strong {
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", Arial, sans-serif;
  font-size: 15px;
  font-weight: 650;
  text-transform: uppercase;
}
.gw-presentation-button { margin-left: 4px; white-space: nowrap; }
.gw-presentation-button[aria-pressed=true] { color: white; background: var(--gw-blue); border-color: var(--gw-blue); }
.gw-quick-jump { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.gw-quick-jump > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.pd-workspace .gw-quick-button,.pd-workspace .gw-icon-button {
  position: relative;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 5px;
}
.gw-quick-button b {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border: 1px solid var(--surface);
  border-radius: 999px;
  background: var(--gw-amber);
  color: white;
  font-size: 9px;
}
.gw-quick-button[aria-pressed=true] { color: white; background: var(--gw-blue); border-color: var(--gw-blue); }
.gw-argument-ribbon-row {
  display: grid;
  grid-template-columns: 50px minmax(0,1fr);
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
}
.gw-ribbon-edit { display: grid; place-items: center; border-right: 1px solid var(--line); }
.gw-ribbon-edit .gw-icon-button { color: var(--gw-blue); border-color: var(--gw-blue); background: var(--gw-blue-soft); }
.gw-ribbon-shell { display: grid; grid-template-columns: 30px minmax(0,1fr) 30px; min-width: 0; }
.pd-workspace .gw-ribbon-arrow { width: 30px; min-width: 30px; padding: 4px; border: 0; border-radius: 0; color: var(--muted); }
.gw-ribbon-scroll { display: flex; gap: 6px; min-width: 0; padding: 7px; overflow-x: auto; scrollbar-width: thin; scroll-behavior: smooth; }
.gw-argument-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) 28px;
  gap: 5px;
  flex: 0 0 230px;
  min-height: 72px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
}
.gw-argument-card[aria-selected=true] { border-color: var(--gw-blue); background: var(--gw-blue-soft); box-shadow: inset 0 -3px var(--gw-blue); }
.pd-workspace .gw-argument-select {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  align-items: start;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.gw-argument-select > span:last-child { min-width: 0; }
.gw-argument-select strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; }
.gw-argument-select small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.gw-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--gw-blue);
  font-weight: 700;
}
.gw-story-grid {
  display: grid;
  grid-template-columns: minmax(260px,.8fr) minmax(300px,1fr) minmax(340px,1.15fr) minmax(340px,1.15fr);
  min-width: 1390px;
  min-height: 500px;
  flex: 1 0 auto;
  border-bottom: 1px solid var(--line);
}
.gw-story-grid > * { min-width: 0; border-right: 1px solid var(--line); }
.gw-story-grid > *:last-child { border-right: 0; }
.gw-positions { background: var(--surface-2); }
.gw-positions > header,.gw-pattern-pane > header,.gw-detail-pane > header {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 43px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 2;
}
.gw-positions > header .gw-icon-button,.gw-pattern-pane > header .gw-icon-button,.gw-detail-pane > header .gw-icon-button { margin-left: auto; }
.gw-pane-context { display: block; padding: 8px 9px 4px; color: var(--muted); font-size: 10px; }
.gw-position-list { display: grid; padding: 0 7px 10px; }
.gw-position-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) 28px;
  gap: 4px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}
.gw-position-card.selected { background: var(--gw-blue-soft); box-shadow: inset 3px 0 var(--gw-blue); }
.pd-workspace .gw-position-card > button:first-child {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  align-items: start;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 9px 5px;
  border: 0;
  background: transparent;
  text-align: left;
}
.gw-position-card strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.gw-position-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.gw-position-star { display: inline-flex; margin-right: 5px; color: #d08a00; vertical-align: text-bottom; }
.gw-position-star svg { width: 13px; height: 13px; fill: currentColor; }
.gw-position-card .gw-position-audit { color: #74849a; font-size: 9px; }
.gw-two-line { display: -webkit-box; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gw-position-card .gw-default-timeline { color: var(--gw-purple); }
.gw-position-card > .gw-icon-button { margin-top: 8px; }
.gw-story-center { padding: 13px; overflow: auto; background: var(--surface); }
.gw-story-center > header { display: flex; align-items: flex-start; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.gw-story-center > header > div { flex: 1; min-width: 0; }
.gw-story-center > header small { color: var(--gw-green); font-size: 10px; text-transform: uppercase; }
.gw-story-center > header h2 { margin-top: 3px; overflow-wrap: anywhere; }
.gw-position-copy { padding: 10px 0; border-bottom: 1px solid var(--line); }
.gw-position-copy strong { display: block; margin-bottom: 4px; font-size: 12px; }
.gw-position-copy p { line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.gw-story-stack { display: grid; gap: 7px; padding-top: 10px; }
.gw-point-card { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.gw-point-card.selected { border-color: var(--gw-blue); box-shadow: inset 3px 0 var(--gw-blue); }
.pd-workspace .gw-point-heading {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto 18px;
  align-items: start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: var(--surface-2);
  text-align: left;
}
.gw-point-heading > span:first-child { color: var(--gw-blue); font-weight: 700; }
.gw-point-heading strong { display: block; overflow-wrap: anywhere; }
.gw-point-heading small { color: var(--muted); font-size: 10px; }
.gw-point-heading > span:nth-child(2) small { display: block; margin-top: 3px; }
.gw-point-links { padding: 4px 8px 7px 38px; }
.pd-workspace .gw-linked-record {
  display: grid;
  grid-template-columns: 18px 70px minmax(0,1fr) 17px;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 6px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.gw-linked-record:last-child { border-bottom: 0; }
.gw-linked-record.selected { color: var(--gw-purple); background: var(--gw-purple-soft); }
.gw-linked-record small { color: var(--muted); font-size: 10px; }
.gw-linked-record strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.gw-linked-record i { display: inline-flex; color: var(--muted); }
.gw-direct-records { display: grid; gap: 2px; padding-top: 6px; }
.gw-direct-records h3 { padding: 4px 2px; }
.gw-pattern-pane { overflow: auto; background: var(--surface-2); }
.gw-pattern-body,.gw-detail-body { padding: 10px; }
.gw-pattern-body > small,.gw-detail-type { display: flex; align-items: center; gap: 5px; color: var(--gw-purple); font-size: 10px; }
.gw-pattern-body > h2,.gw-detail-body > h2 { margin: 5px 0 7px; overflow-wrap: anywhere; }
.gw-pattern-body > p,.gw-detail-body p { line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.gw-pattern-body > section,.gw-detail-body > section { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); }
.gw-pattern-items { display: grid; gap: 5px; margin-top: 6px; }
.pd-workspace .gw-pattern-item {
  display: grid;
  grid-template-columns: 25px minmax(0,1fr) 16px;
  align-items: start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 7px;
  background: var(--surface);
  text-align: left;
}
.gw-pattern-item.selected { border-color: var(--gw-blue); background: var(--gw-blue-soft); }
.gw-pattern-item > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--gw-purple); background: var(--gw-purple-soft); font-weight: 700; }
.gw-pattern-item strong { display: block; overflow-wrap: anywhere; font-size: 11px; }
.gw-pattern-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.pd-workspace .gw-pattern-evidence { width: 100%; margin-top: 10px; }
.gw-detail-pane { overflow: auto; background: var(--surface); }
.gw-detail-type { color: var(--gw-blue); }
.gw-detail-body section h3 { margin-bottom: 5px; }
.gw-detail-body dl { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 6px; margin: 10px 0 0; }
.gw-detail-body dt { color: var(--muted); }
.gw-detail-body dd { margin: 0; overflow-wrap: anywhere; }
.gw-evidence-list,.gw-quick-list { display: grid; gap: 5px; margin-top: 6px; }
.pd-workspace .gw-evidence-list button,.pd-workspace .gw-quick-list button {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr) 17px;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 7px;
  background: var(--surface-2);
  text-align: left;
}
.gw-evidence-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-quick-list button > span:nth-child(2) { min-width: 0; }
.gw-quick-list button strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-quick-list button small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.gw-quick-summary { display: flex; align-items: center; gap: 6px; padding: 8px; border-left: 3px solid var(--gw-blue); background: var(--gw-blue-soft); }
.gw-file-preview [data-gw-file-preview] { min-height: 180px; max-height: 420px; overflow: auto; border: 1px solid var(--line); background: var(--surface-2); }
.gw-file-preview > button { width: 100%; margin-top: 7px; }
.gw-placeholder,.gw-loading,.gw-empty { padding: 18px 10px; color: var(--muted); line-height: 1.5; }
.gw-load-error { padding: 8px 12px; color: var(--red); background: #fff0f2; }
.gw-timeline { min-width: 1100px; padding: 8px 12px 5px; background: var(--surface); flex: 0 0 auto; }
.gw-timeline > header { display: flex; align-items: center; gap: 7px; min-height: 32px; }
.gw-timeline > header > span:first-of-type { padding: 3px 6px; border-radius: 999px; color: var(--gw-purple); background: var(--gw-purple-soft); font-size: 10px; }
.gw-timeline > header small { color: var(--muted); }
.gw-timeline > header .gw-icon-button { margin-left: 5px; }
.gw-timeline-legend { display: flex; align-items: center; gap: 5px; margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.gw-timeline-legend i { width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: var(--gw-purple); }
.gw-timeline-legend i.selected { background: var(--gw-amber); }
.gw-timeline-track { position: relative; height: 120px; margin: 5px 38px 0; }
.gw-track-line { position: absolute; top: 58px; left: 0; right: 0; height: 2px; background: var(--line); }
.gw-year-ticks { position: absolute; top: 53px; left: 0; right: 0; display: flex; justify-content: space-between; pointer-events: none; }
.gw-year-ticks span { padding-top: 14px; color: var(--muted); font-size: 9px; }
.pd-workspace .gw-timeline-event { position: absolute; left: var(--x); top: 59px; display: grid; justify-items: center; width: 118px; min-height: 0; padding: 0; transform: translateX(-50%); border: 0; background: transparent; text-align: center; }
.pd-workspace .gw-timeline-event.above { top: 4px; }
.gw-event-dot { display: block; width: 11px; height: 11px; margin-top: -6px; border: 2px solid var(--surface); border-radius: 50%; background: var(--gw-blue); box-shadow: 0 0 0 1px var(--gw-blue); }
.above .gw-event-dot { order: 2; margin-top: 4px; }
.gw-event-label { display: -webkit-box; overflow: hidden; max-width: 116px; padding: 4px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font-size: 9px; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gw-event-label small { display: block; color: var(--muted); font-size: 8px; }
.gw-timeline-event.pattern-member .gw-event-dot { background: var(--gw-purple); box-shadow: 0 0 0 2px #d9ccf5; }
.gw-timeline-event.pattern-member .gw-event-label { border-color: #bda9e4; background: var(--gw-purple-soft); }
.gw-timeline-event.selected .gw-event-dot { width: 16px; height: 16px; margin-top: -9px; background: var(--gw-amber); box-shadow: 0 0 0 3px #f4d4a8; }
.gw-timeline-event.above.selected .gw-event-dot { margin-top: 2px; }
.gw-timeline-event.selected .gw-event-label { border-color: var(--gw-amber); background: var(--gw-amber-soft); font-weight: 700; }
.gw-court-mode [data-gw-authoring] { display: none !important; }
.gw-court-mode .gw-ribbon-edit { display: none; }
.gw-court-mode .gw-argument-ribbon-row { grid-template-columns: minmax(0,1fr); }
.gw-court-mode .gw-story-grid { min-width: 1290px; grid-template-columns: minmax(250px,.75fr) minmax(300px,1fr) minmax(340px,1.15fr) minmax(340px,1.15fr); }
@media (prefers-color-scheme: dark) {
  .pd-goal-story { --gw-blue-soft:#172b49;--gw-green-soft:#173328;--gw-amber-soft:#392c13;--gw-purple-soft:#2a2144; }
  .gw-load-error { background:#3b1c25; }
}
@media (max-width: 1100px) {
  .gw-title-band { flex-wrap: wrap; }
  .gw-quick-jump { margin-left: 0; }
  .gw-presentation-button { margin-left: auto; }
  .gw-story-grid { min-width: 1240px; grid-template-columns: 250px 300px 345px 345px; }
}
