/* Goal Core Beta C1-R2 · unified Goal space
   Consumes tokens from goal-tokens.css.  Visual hierarchy:
   the single most valuable action today is the strongest element. */

.goal-space {
  min-height: 100vh;
  background: var(--goal-bg);
  color: var(--goal-text);
}

/* ---- Top bar ---- */
.goal-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: var(--goal-content-max);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
}
.goal-brand {
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  letter-spacing: 0.04em;
  color: var(--goal-primary);
  white-space: nowrap;
}
.goal-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.goal-tabs[hidden],
.goal-onboarding[hidden] {
  display: none;
}
.goal-tabs::-webkit-scrollbar { display: none; }
.goal-tabs button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--goal-text-muted);
  font-size: var(--text-sm);
  min-height: 36px;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.goal-tabs button:hover { color: var(--goal-text); background: var(--goal-surface-subtle); }
.goal-tabs button[aria-current="page"] {
  background: var(--goal-primary-soft);
  color: var(--goal-primary);
  font-weight: var(--weight-bold);
}
.goal-logout {
  font-size: var(--text-sm);
  color: var(--goal-text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.goal-account-links { display:flex; align-items:center; gap:12px; }
.goal-account-links > a { color:var(--goal-text-muted); text-decoration:none; font-size:.9rem; }
.goal-form textarea { min-height:120px; padding:12px; border:1px solid var(--goal-line); border-radius:10px; font:inherit; resize:vertical; }
.goal-logout:hover { color: var(--goal-error); }

/* ---- Main layout ---- */
.goal-main {
  max-width: var(--goal-content-max);
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-9);
}

/* ---- Onboarding ---- */
.goal-onboarding {
  display: flex;
  justify-content: center;
  padding: var(--space-9) 0 0;
}
.goal-onboarding-inner {
  width: min(540px, 100%);
  background: var(--goal-surface);
  border: 1px solid var(--goal-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-7) var(--space-6);
}
.goal-onboarding h1 {
  margin: var(--space-2) 0 var(--space-2);
  font-size: var(--text-2xl);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.goal-onboarding-hint {
  color: var(--goal-text-secondary);
  margin: 0 0 var(--space-5);
  font-size: var(--text-base);
}
.goal-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-4);
}
.goal-preset {
  border: 1px solid var(--goal-border-strong);
  background: var(--goal-surface);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  min-height: 40px;
  color: var(--goal-primary);
  cursor: pointer;
  font-size: var(--text-sm);
}
.goal-preset:hover { background: var(--goal-primary-soft); border-color: var(--goal-primary); }
.goal-onboarding-submit { margin-top: var(--space-5); width: 100%; }

/* ---- View headers ---- */
.goal-view-head { margin: var(--space-5) 0 var(--space-4); }
.goal-view-head h1 {
  margin: 4px 0 0;
  font-size: var(--text-xl);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ---- Panels ---- */
.goal-panel-list {
  display: grid;
  gap: var(--space-4);
}
.goal-main-action {
  font-size: var(--text-2xl);
  line-height: 1.3;
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  margin: var(--space-2) 0 var(--space-3);
}
.goal-reason { color: var(--goal-text-secondary); font-size: var(--text-sm); margin: var(--space-2) 0; }
.goal-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--goal-text-muted);
  font-size: var(--text-sm);
  margin: var(--space-3) 0;
}
.goal-basis { color: var(--goal-primary); font-weight: var(--weight-bold); }

/* ---- Today: the one most valuable action ---- */
.goal-today-card {
  border-color: var(--goal-border-strong);
  box-shadow: var(--shadow-card);
}
.goal-today-card .goal-main-action { font-size: var(--text-3xl); }
.goal-reason-toggle {
  margin: var(--space-3) 0;
  border: 1px solid var(--goal-border);
  border-radius: var(--radius-md);
  background: var(--goal-surface-subtle);
}
.goal-reason-toggle summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: var(--text-sm);
  color: var(--goal-text-secondary);
  user-select: none;
  list-style: none;
}
.goal-reason-toggle summary::-webkit-details-marker { display: none; }
.goal-reason-toggle summary::before { content: "\25B8"; margin-right: 8px; color: var(--goal-text-muted); display: inline-block; transition: transform 120ms ease; }
.goal-reason-toggle[open] summary::before { transform: rotate(90deg); }
.goal-reason-toggle .goal-reason-toggle-body { padding: 0 14px 12px; font-size: var(--text-sm); color: var(--goal-text-secondary); }

.goal-levels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}
.goal-level {
  border: 1px solid var(--goal-border-strong);
  background: var(--goal-surface);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  min-height: 40px;
  font-size: var(--text-sm);
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--goal-text);
}
.goal-level:hover { border-color: var(--goal-primary); }
.goal-level.selected {
  border-color: var(--goal-primary);
  background: var(--goal-primary-soft);
  color: var(--goal-primary);
  font-weight: var(--weight-bold);
}

.goal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
  align-items: center;
}
.goal-actions .primary { padding: 12px 26px; font-size: var(--text-md); }
.goal-actions .ghost { padding: 8px 12px; font-size: var(--text-sm); }

/* ---- Resource list ---- */
.goal-resource-list { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.goal-resource {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--goal-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--goal-surface);
}
.goal-resource strong { display: block; font-size: var(--text-base); }
.goal-resource .goal-resource-type {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--goal-primary);
  background: var(--goal-primary-soft);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  margin-right: 6px;
}
.goal-resource-badge {
  font-size: var(--text-xs);
  color: var(--goal-success);
  background: var(--goal-success-soft);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  white-space: nowrap;
}
.goal-resource-badge.unbound { color: var(--goal-text-muted); background: var(--goal-surface-subtle); }
.goal-resource-open {
  color: var(--goal-primary);
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
  font-weight: var(--weight-semibold);
}
.goal-resource-open:hover { text-decoration: underline; }
.goal-resource-file-details { display: grid; gap: 5px; margin-top: 8px; color: var(--goal-text-secondary); line-height: 1.5; }
.goal-resource-file-details small { color: var(--goal-text-muted); }
.goal-resource-file-preview pre { max-height: 180px; overflow: auto; margin: 8px 0 0; padding: 9px; border-radius: 8px; background: var(--goal-surface-subtle); white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: var(--text-xs); text-align: left; }
.goal-resource-remove { padding: 5px 8px; font-size: var(--text-xs); color: var(--goal-danger, #9b3f3f); }
.goal-resource-selection-explanation { margin: 10px 0 0; padding: 9px 11px; border-left: 3px solid var(--goal-primary); color: var(--goal-text-secondary); text-align: left; }
.goal-resource-feedback { margin-top: var(--space-5); padding: var(--space-4); border: 1px solid var(--goal-border); border-radius: var(--radius-md); background: var(--goal-surface-subtle); text-align: left; }
.goal-resource-feedback-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-3); }

/* ---- Session: quieter focus ---- */
.goal-session-card {
  max-width: var(--goal-content-narrow);
  margin: 0 auto;
  text-align: center;
}
.goal-session-card .goal-main-action { font-size: var(--text-2xl); }
.goal-session-card .goal-meta-line { justify-content: center; }
.goal-session-card .goal-actions { justify-content: center; }
.goal-session-status {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}
.goal-session-status.running { color: var(--goal-primary); background: var(--goal-primary-soft); }
.goal-session-status.paused { color: var(--goal-warning); background: var(--goal-warning-soft); }
.goal-session-elapsed {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--goal-text);
  font-variant-numeric: tabular-nums;
}
#session-elapsed { font-size: var(--text-2xl); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }

body.goal-session .goal-topbar { opacity: 0.86; }
body.goal-session .goal-view-head { margin-top: var(--space-3); }
body.goal-session .goal-view-head h1 { font-size: var(--text-lg); }

/* ---- Finish + feedback ---- */
.goal-finish-panel {
  margin-top: var(--space-4);
  border-top: 1px dashed var(--goal-border-strong);
  padding-top: var(--space-4);
  text-align: left;
}
.goal-feedback { text-align: center; }
.goal-feedback .goal-actions { justify-content: center; }
.goal-feedback-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-3);
  border-radius: 50%;
  background: var(--goal-success-soft);
  color: var(--goal-success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* ---- Route ---- */
.goal-route-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-4);
}
.goal-route-node { text-align: center; }
.goal-route-node .goal-route-stage {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
}
.goal-route-node.current .goal-route-stage { color: var(--goal-primary); }
.goal-route-arrow { color: var(--goal-text-muted); font-size: var(--text-lg); }
.goal-route-focus {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--goal-border);
  color: var(--goal-text-secondary);
  font-size: var(--text-base);
}
.goal-route-focus strong { color: var(--goal-text); }

/* ---- Timeline ---- */
.goal-timeline-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-4);
}
.goal-timeline-date { color: var(--goal-text-muted); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.goal-timeline-body strong { font-size: var(--text-md); }
.goal-timeline-result { margin-top: 4px; color: var(--goal-text-secondary); font-size: var(--text-sm); }
.goal-timeline-record { color: var(--goal-text-muted); font-size: var(--text-sm); margin-top: 2px; }

/* ---- Review ---- */
.goal-growth-loop { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: var(--space-4); margin: var(--space-5) 0; }
.goal-growth-loop article { padding: var(--space-4); border: 1px solid var(--goal-border); border-radius: var(--radius-lg); background: var(--goal-surface); }
.goal-growth-loop p { margin: 0 0 var(--space-2); line-height: 1.6; }
.goal-growth-now { border-color: var(--goal-accent) !important; box-shadow: 0 8px 24px rgba(38, 93, 73, .12); }
.goal-growth-next h3 { margin: 0 0 var(--space-2); }
.goal-growth-loop ul { margin: var(--space-3) 0 0; padding-left: 20px; }
@media (max-width: 900px) { .goal-growth-loop { gap: var(--space-3); } }
@media (max-width: 640px) { .goal-growth-loop { grid-template-columns: 1fr; overflow-x: hidden; } .goal-growth-loop article { min-width: 0; } .goal-next-action button, #review-ai { min-height: 44px; } }
.goal-review-list { display: grid; gap: var(--space-2); margin: var(--space-3) 0; color: var(--goal-text); font-size: var(--text-base); }
.goal-artifact-create { margin-top: var(--space-5); border-top: 1px solid var(--goal-border); padding-top: var(--space-4); }
.goal-artifact-create summary { cursor: pointer; color: var(--goal-accent); font-weight: 700; }
.goal-artifact-form { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.goal-artifact-form textarea { min-height: 112px; resize: vertical; }
.goal-outcome-group { display: grid; gap: var(--space-3); }
.goal-artifact-card { display: grid; gap: var(--space-2); }
.goal-artifact-card h2, .goal-artifact-card p { margin: 0; }
.goal-artifact-meta { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--goal-muted); font-size: var(--text-sm); }
.goal-next-action { margin-top: var(--space-5); padding: var(--space-4); border: 1px solid var(--goal-border); border-radius: var(--radius-lg); background: var(--goal-surface-subtle); }
.goal-next-action h3 { margin: var(--space-1) 0 var(--space-2); font-size: var(--text-lg); }
.goal-next-action p { margin: 0 0 var(--space-3); }
.goal-ai-output {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--goal-surface-subtle);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  color: var(--goal-text-secondary);
}
.goal-ai-output:empty { display: none; }

/* ---- Loading ---- */
.goal-state-panel {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-2);
}
.goal-state-panel p { margin: 0; color: var(--goal-text-secondary); }
.goal-state-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--goal-border);
  border-top-color: var(--goal-primary);
  border-radius: 50%;
  animation: goal-spin 800ms linear infinite;
}
.goal-error-state {
  border-color: color-mix(in srgb, var(--goal-error) 30%, var(--goal-border));
  background: color-mix(in srgb, var(--goal-error) 4%, var(--goal-surface));
}
.goal-error-state h2 { margin: 0; font-size: var(--text-lg); }
.goal-state-retry { margin-top: var(--space-2); }
@keyframes goal-spin { to { transform: rotate(360deg); } }

.goal-loading {
  display: grid;
  gap: var(--space-3);
}
.goal-loading .goal-skeleton {
  height: 96px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--goal-surface-subtle), #f6faf8, var(--goal-surface-subtle));
  background-size: 200% 100%;
  animation: goal-shimmer 1.4s ease-in-out infinite;
}
@keyframes goal-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .goal-state-spinner,
  .goal-loading .goal-skeleton { animation: none; }
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .goal-topbar {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-3);
  }
  .goal-main { padding: 0 var(--space-3) 96px; }
  .goal-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--goal-surface);
    border-top: 1px solid var(--goal-border);
    justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
  }
  .goal-tabs button {
    flex: 1;
    padding: 10px 6px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    min-height: 44px;
  }
  .goal-onboarding { padding: var(--space-6) 0 0; }
  .goal-onboarding-inner { padding: var(--space-6) var(--space-5); }
  .goal-onboarding h1 { font-size: var(--text-xl); }
  .goal-main-action { font-size: var(--text-xl); }
  .goal-today-card .goal-main-action { font-size: var(--text-2xl); }
  .goal-view-head h1 { font-size: var(--text-lg); }
  .goal-timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .goal-route-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .goal-route-arrow { transform: rotate(90deg); text-align: center; }
  .goal-actions .primary { flex: 1 1 auto; }
  .goal-resource { align-items: flex-start; flex-wrap: wrap; }
  .goal-session-card { text-align: center; }
  .goal-topbar .goal-logout { font-size: var(--text-xs); }
}

/* Guided Product Experience R1 -------------------------------------------------
   Desktop is a calm workspace; mobile is a deliberately reduced action surface. */
:root {
  --guided-sidebar: 228px;
  --guided-content: 1240px;
  --guided-green: #0f7a5c;
  --guided-green-dark: #085d46;
  --guided-mint: #eef8f2;
}

.goal-space { background: #f6f8f6; color: #17231e; }
.goal-topbar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--guided-sidebar); height: 100vh; padding: 28px 20px 20px;
  display: flex; flex-direction: column; align-items: stretch; gap: 22px;
  border-right: 1px solid #e1e8e3; background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
}
.goal-brand { padding: 2px 8px 20px; color: var(--guided-green-dark); font-size: 21px; font-weight: 850; }
.goal-brand-mark { box-shadow: 0 8px 18px rgba(15,122,92,.2); }
.goal-tabs { display: grid; gap: 7px; }
.goal-tabs button {
  min-height: 46px; padding: 0 14px; display: flex; align-items: center;
  border-radius: 13px; text-align: left; font-size: 15px;
}
.goal-tabs button::before { content: "○"; width: 24px; color: #70877c; font-size: 13px; }
.goal-tabs button[aria-current="page"] { background: #eaf6f0; color: var(--guided-green-dark); }
.goal-tabs button[aria-current="page"]::before { content: "●"; color: var(--guided-green); }
.goal-discover-link { min-height: 44px; padding: 0 14px; display: flex; align-items: center; border-top: 1px solid #edf1ee; color: #53665d; }
.goal-assistant-entry { margin-top: auto; padding: 12px; border: 1px solid #e1e9e4; border-radius: 14px; background: #fafcfb; }
.goal-account-links { padding: 12px 8px 0; border-top: 1px solid #edf1ee; justify-content: space-between; }
.goal-main { width: auto; max-width: none; margin: 0 0 0 var(--guided-sidebar); padding: 28px clamp(28px, 4vw, 56px) 64px; }
#app-view, #onboarding { width: min(100%, var(--guided-content)); margin: 0 auto; }
.goal-view-head { margin: 2px 0 20px; }
.goal-view-head h1 { font-size: clamp(24px, 2vw, 32px); }
.goal-context-bar { margin: 0 0 18px; border: 0; background: transparent; padding: 0; }
.goal-context-status small { background: #edf6f1; color: #507064; }

.goal-guided-intro { display: flex; align-items: center; gap: 18px; }
.goal-guided-intro .goal-brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--guided-green); color: #fff; }
.goal-guided-intro h1 { margin: 2px 0 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.18; }
.goal-onboarding { min-height: calc(100vh - 92px); display: grid; place-items: center; }
.goal-onboarding[hidden] { display: none; }
.goal-onboarding-inner { width: min(100%, 760px); padding: clamp(26px, 5vw, 48px); border: 1px solid #e0e9e3; box-shadow: 0 24px 70px rgba(26,63,48,.09); }
.goal-onboarding-hint { max-width: 650px; margin-top: 22px; font-size: 17px; line-height: 1.75; }
.goal-onboarding-now { margin: 0 0 24px; color: var(--guided-green-dark); font-weight: 800; }
.goal-presets { grid-template-columns: repeat(3, 1fr); }
.goal-preset { min-height: 72px; line-height: 1.45; }
.goal-starter-result { grid-template-columns: minmax(0, 1fr) 190px; }
.goal-starter-template { display: inline-block; margin-top: 5px; color: var(--guided-green); font-size: 13px; font-weight: 800; }
.goal-starter-details { grid-template-columns: 1fr 1fr; }

.goal-guided-shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.goal-today-card { margin: 0; padding: 0; overflow: hidden; border-radius: 24px; box-shadow: 0 18px 55px rgba(27,65,50,.08); }
.goal-today-position { padding: 17px 30px; background: #f2f8f4; }
.goal-today-hero { padding: 34px 34px 18px; align-items: flex-start; }
.goal-today-hero .goal-main-action { margin: 7px 0 10px; font-size: clamp(27px, 3vw, 39px); line-height: 1.24; }
.goal-today-why { max-width: 720px; margin: 0; color: #5b6f65; font-size: 15px; line-height: 1.7; }
.goal-ready-line { display: flex; gap: 20px; padding: 0 34px 18px; color: #36725d; font-size: 13px; }
.goal-primary-resource { margin: 0 34px 20px; padding: 16px 18px; display: grid; gap: 4px; border: 1px solid #dbe9e0; border-radius: 15px; background: #f5faf7; }
.goal-primary-resource > span { color: #608075; font-size: 12px; font-weight: 750; }
.goal-primary-resource > strong { font-size: 16px; }
.goal-primary-resource > small { color: #697c73; line-height: 1.5; }
.goal-primary-resource.unavailable { background: #fff9ef; border-color: #efe0bd; }
.goal-start-zone { margin: 0; padding: 20px 34px; display: flex; justify-content: space-between; align-items: center; background: #f1f8f4; border-top: 1px solid #dceae2; }
.goal-start-zone > div { display: grid; gap: 3px; }
.goal-start-zone > div span { color: #667a70; font-size: 13px; }
.goal-start-zone .primary { min-width: 190px; border-radius: 12px; background: linear-gradient(135deg, var(--guided-green), #0a986e); box-shadow: 0 10px 24px rgba(15,122,92,.22); }
.goal-plan-details { border-top: 1px solid #edf1ee; }
.goal-plan-details > summary { padding: 15px 34px; cursor: pointer; color: #5b6f65; font-size: 13px; text-align: center; }
.goal-plan-details .goal-action-steps { margin-top: 18px; }
.goal-today-rail { display: grid; gap: 12px; }
.goal-today-rail section { padding: 20px; display: grid; gap: 8px; border: 1px solid #e0e8e3; border-radius: 18px; background: rgba(255,255,255,.9); }
.goal-today-rail span { color: #668077; font-size: 12px; font-weight: 800; }
.goal-today-rail strong { font-size: 16px; }
.goal-today-rail p { margin: 0; color: #4e6259; font-size: 13px; line-height: 1.62; }
.goal-today-rail small { color: var(--guided-green); }

.goal-action-workspace { overflow: hidden; border: 1px solid #dce7df; border-radius: 24px; background: #fff; box-shadow: 0 20px 60px rgba(26,64,49,.08); }
.goal-action-workspace.goal-session-card { text-align: left; }
.goal-workspace-head { padding: 28px 32px; display: flex; justify-content: space-between; gap: 24px; background: linear-gradient(120deg, #eef9f2, #fbfdfb); border-bottom: 1px solid #dce9e1; }
.goal-workspace-head h2 { margin: 5px 0 7px; font-size: clamp(25px, 3vw, 36px); }
.goal-workspace-head p { margin: 0; color: #5c7167; }
.goal-workspace-time { display: grid; align-content: center; gap: 4px; min-width: 126px; text-align: right; color: var(--guided-green-dark); }
.goal-workspace-time small { color: #6e8178; }
.goal-workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 0; }
.goal-workspace-layout > main { min-width: 0; padding: 28px 32px 36px; }
.goal-real-example { border: 1px solid #dce7e0; border-radius: 18px; overflow: hidden; }
.goal-example-head { padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; background: #f5f9f6; }
.goal-example-head > span { color: var(--guided-green); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.goal-example-head > strong { font-size: 15px; }
.goal-example-head > small { margin-left: auto; color: #687b72; }
.goal-example-timeline { display: grid; }
.goal-example-timeline > div { padding: 14px 18px; display: grid; grid-template-columns: 74px 1fr; gap: 13px; border-top: 1px solid #edf1ee; }
.goal-example-timeline b { color: var(--guided-green); font-size: 12px; }
.goal-example-timeline p { margin: 0; line-height: 1.6; }
.goal-table-wrap { overflow-x: auto; }
.goal-real-example table { width: 100%; border-collapse: collapse; }
.goal-real-example th, .goal-real-example td { padding: 12px 16px; border: 1px solid #e7ece9; text-align: center; }
.goal-real-example th { background: #fafcfb; }
.goal-example-question { margin: 0; padding: 18px; background: #f8fbf9; font-weight: 800; }
.goal-do-now { margin-top: 24px; }
.goal-work-sheet { display: grid; gap: 16px; margin-top: 12px; }
.goal-work-sheet label { display: grid; gap: 6px; color: #24372f; font-weight: 750; }
.goal-work-sheet label > span, .goal-choice-field legend > span { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 7px; border-radius: 50%; background: #e1f1e7; color: var(--guided-green-dark); font-size: 12px; }
.goal-work-sheet label > small { color: #73847c; font-weight: 500; }
.goal-work-sheet textarea, .goal-work-sheet input, .goal-resource-form textarea, .goal-resource-form input, .goal-resource-form select { width: 100%; padding: 12px 13px; border: 1px solid #ccd9d1; border-radius: 11px; background: #fff; font: inherit; }
.goal-work-sheet textarea:focus, .goal-work-sheet input:focus { outline: 3px solid rgba(15,122,92,.14); border-color: var(--guided-green); }
.goal-location-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.goal-choice-field { margin: 0; padding: 14px; border: 1px solid #d9e4dd; border-radius: 13px; }
.goal-choice-field > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.goal-choice-field label { display: flex; align-items: center; gap: 6px; padding: 10px; border: 1px solid #e4eae6; border-radius: 9px; }
.goal-choice-field input { width: auto; }
.goal-relation-practice { gap: 12px; }
.goal-relation-item { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid #d9e4dd; border-radius: 13px; }
.goal-relation-item legend { padding: 0 4px; color: #24372f; font-weight: 750; line-height: 1.55; }
.goal-relation-item select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #ccd9d1; border-radius: 10px; background: #fff; font: inherit; }
.goal-relation-item .goal-check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: #667a70; font-size: 13px; font-weight: 600; }
.goal-relation-item .goal-check input { width: auto; }
.goal-optional-step { padding: 13px; border: 1px dashed #cedbd3; border-radius: 12px; }
.goal-optional-step summary { cursor: pointer; color: var(--guided-green-dark); font-weight: 750; }
.goal-optional-step label { margin-top: 12px; }
.goal-coach-panel { padding: 28px 22px; border-left: 1px solid #e2eae5; background: #f8faf8; }
.goal-help-actions { display: grid; gap: 8px; margin: 14px 0; }
.goal-help-actions button { min-height: 43px; background: #fff; text-align: left; }
.goal-help-content { min-height: 112px; padding: 14px; border-radius: 12px; background: #edf7f1; color: #3e5c4f; font-size: 13px; line-height: 1.65; }
.goal-help-content p { margin: 0; }
.goal-help-content ol { margin: 0; padding-left: 20px; }
.goal-workspace-resource { margin-top: 18px; padding-top: 18px; display: grid; gap: 5px; border-top: 1px solid #dde7e1; }
.goal-workspace-resource span { color: #71847b; font-size: 11px; font-weight: 800; }
.goal-workspace-resource small { color: #667970; line-height: 1.5; }
.goal-workspace-footer { padding: 17px 24px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-top: 1px solid #dfe8e2; background: #fbfcfb; }
.goal-workspace-footer > span { color: #75877e; font-size: 12px; }
.goal-finish-preview { padding: 13px; border-radius: 12px; background: #eff8f3; }
.goal-finish-preview span { color: #537366; font-size: 12px; font-weight: 800; }
.goal-finish-preview p { margin: 6px 0 0; line-height: 1.6; }

.goal-visible-intelligence { margin: 20px auto; padding: 18px; max-width: 830px; border: 1px solid #cae3d5; border-radius: 15px; background: #f1f9f4; text-align: left; }
.goal-visible-intelligence strong { display: block; line-height: 1.7; }
.goal-outcome-copy { max-width: 760px; margin: 0 auto 12px; color: #4e6259; line-height: 1.65; }
.goal-growth-path { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; margin: 18px auto; max-width: 850px; text-align: left; }
.goal-growth-path > div { padding: 14px; border-radius: 13px; background: #f7faf8; }
.goal-growth-path span { color: var(--guided-green); font-size: 11px; font-weight: 850; }
.goal-growth-path p { margin: 5px 0 0; font-size: 13px; line-height: 1.55; }
.goal-growth-path > b { align-self: center; color: #88a89a; }

.goal-add-resource { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; border: 1px solid #cfe4d8; border-radius: 20px; background: linear-gradient(120deg, #eef9f3, #fbfdfc); }
.goal-add-resource h2 { margin: 4px 0 7px; }
.goal-add-resource p { margin: 0; color: #586d63; line-height: 1.6; }
.goal-resource-form { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 18px; border-top: 1px solid #d5e4dc; }
.goal-resource-form[hidden] { display: none; }
.goal-resource-form label { display: grid; gap: 6px; font-weight: 750; }
.goal-resource-form label:has(textarea), .goal-resource-form .goal-check, .goal-resource-form .goal-actions, .goal-resource-form > p { grid-column: 1 / -1; }
.goal-resource-form .goal-check { display: flex; align-items: center; }
.goal-resource-form .goal-check input { width: auto; }
.goal-no-dead-end { text-align: left; }
.goal-undo-toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; padding: 13px 15px; display: flex; align-items: center; gap: 16px; border-radius: 12px; background: #153c2f; color: #fff; box-shadow: 0 14px 34px rgba(14,45,34,.25); }
.goal-undo-toast button { border: 0; background: transparent; color: #8ef0c7; font-weight: 800; cursor: pointer; }

@media (min-width: 901px) {
  .goal-topbar[aria-hidden="true"] { display: none; }
}

@media (min-width: 721px) and (max-width: 1000px) {
  :root { --guided-sidebar: 92px; }
  .goal-topbar { padding-inline: 10px; }
  .goal-brand { justify-content: center; padding-inline: 0; }
  .goal-brand > span:last-child, .goal-discover-link, .goal-assistant-entry, .goal-account-links { display: none; }
  .goal-tabs button { justify-content: center; padding: 6px; text-align: center; font-size: 13px; }
  .goal-tabs button::before { display: none; }
  .goal-guided-shell { grid-template-columns: 1fr; }
  .goal-today-rail { grid-template-columns: repeat(2, 1fr); }
  .goal-workspace-layout { grid-template-columns: 1fr; }
  .goal-coach-panel { border-left: 0; border-top: 1px solid #e2eae5; }
}

@media (max-width: 720px) {
  body.goal-space { padding-bottom: 72px; }
  .goal-topbar { position: sticky; inset: 0; width: 100%; height: 60px; padding: 8px 16px; display: flex; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid #e4eae6; }
  .goal-brand { padding: 0; font-size: 18px; }
  .goal-brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .goal-tabs { position: fixed; z-index: 40; inset: auto 0 0; height: 66px; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); grid-template-columns: repeat(5, 1fr); gap: 2px; border-top: 1px solid #dde5e0; background: rgba(255,255,255,.98); }
  .goal-tabs button { min-height: 52px; padding: 4px 2px; display: grid; place-items: center; gap: 1px; border-radius: 9px; text-align: center; font-size: 11px; }
  .goal-tabs button::before { display: block; width: auto; font-size: 10px; }
  .goal-discover-link, .goal-assistant-entry, .goal-account-links { display: none; }
  .goal-main { margin: 0; padding: 14px 14px 34px; }
  #goal-message:empty { display: none; }
  .goal-context-bar { display: none; }
  .goal-view-head { margin: 0 0 11px; }
  #view-today .goal-view-head h1 { font-size: 20px; }
  .goal-guided-shell { display: block; }
  .goal-today-rail { display: none; }
  .goal-today-card { border-radius: 19px; }
  .goal-today-position { padding: 12px 16px; }
  .goal-today-hero { padding: 21px 18px 12px; display: block; }
  .goal-today-hero .goal-main-action { margin: 5px 0 9px; font-size: 25px; }
  .goal-today-why { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; }
  .goal-time-chip { display: inline-block; margin-top: 10px; padding: 5px 9px; }
  .goal-ready-line { padding: 0 18px 12px; gap: 10px; font-size: 11px; }
  .goal-primary-resource { margin: 0 18px 14px; padding: 12px 13px; }
  .goal-primary-resource > small { display: none; }
  .goal-start-zone { padding: 15px 18px; display: grid; gap: 12px; }
  .goal-start-zone .primary { width: 100%; min-height: 50px; }
  .goal-plan-details { display: none; }
  .goal-onboarding { min-height: auto; place-items: start; }
  .goal-onboarding-inner { padding: 22px 18px; border-radius: 19px; }
  .goal-guided-intro { align-items: flex-start; }
  .goal-guided-intro h1 { font-size: 28px; }
  .goal-onboarding-hint { font-size: 15px; }
  .goal-presets { grid-template-columns: 1fr; }
  .goal-preset { min-height: 52px; text-align: left; }
  .goal-starter-result { display: grid; grid-template-columns: 1fr; }
  .goal-starter-details { grid-template-columns: 1fr; }
  .goal-starter-cta { width: 100%; }
  .goal-workspace-head { padding: 20px 18px; display: grid; }
  .goal-workspace-head h2 { font-size: 25px; }
  .goal-workspace-time { display: flex; justify-content: space-between; text-align: left; }
  .goal-workspace-layout { grid-template-columns: 1fr; }
  .goal-workspace-layout > main { padding: 18px 16px 24px; }
  .goal-example-timeline > div { grid-template-columns: 62px 1fr; padding: 12px; }
  .goal-location-grid { grid-template-columns: 1fr; }
  .goal-choice-field > div { grid-template-columns: 1fr 1fr; }
  .goal-coach-panel { padding: 20px 16px; border-left: 0; border-top: 1px solid #e2eae5; }
  .goal-workspace-footer { position: sticky; bottom: 66px; z-index: 3; padding: 12px 14px; background: rgba(255,255,255,.98); }
  .goal-workspace-footer > span { display: none; }
  .goal-workspace-footer .goal-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .goal-growth-path { grid-template-columns: 1fr; }
  .goal-growth-path > b { transform: rotate(90deg); justify-self: center; }
  .goal-interpretation { grid-template-columns: 1fr; text-align: left; }
  .goal-add-resource { grid-template-columns: 1fr; padding: 18px; }
  .goal-add-resource .primary { width: 100%; }
  .goal-resource-form { grid-template-columns: 1fr; }
  .goal-resource-form > * { grid-column: 1 !important; }
  .goal-undo-toast { left: 12px; right: 12px; bottom: 78px; justify-content: space-between; }
}

.goal-resource-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .goal-resource-meta { flex-direction: column; align-items: flex-end; gap: 4px; }
}
/* P0 Product Convergence: Starter Pack and Action Contract */
.goal-starter-result {
  display: grid;
  grid-template-areas:
    "intro"
    "details"
    "cta";
  gap: 18px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--goal-border, #dce7df);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 50px rgba(23, 107, 85, .08);
}

.goal-starter-intro { grid-area: intro; }

.goal-starter-intro > :last-child { margin-bottom: 0; }

.goal-starter-details {
  grid-area: details;
  display: grid;
  gap: 18px;
}

.goal-starter-cta { grid-area: cta; }

.goal-starter-result ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--goal-text-soft, #51635b);
}

.goal-starter-resource,
.goal-contract {
  padding: 18px;
  border: 1px solid #dce7df;
  border-radius: 18px;
  background: #f7faf7;
}

.goal-starter-resource {
  display: grid;
  gap: 6px;
}

.goal-starter-resource span {
  color: #176b55;
  font-size: .86rem;
}

.goal-contract dl {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
}

.goal-contract summary {
  color: #176b55;
  font-weight: 800;
  cursor: pointer;
}

.goal-contract dl div {
  display: grid;
  grid-template-columns: minmax(72px, 100px) 1fr;
  gap: 12px;
}

.goal-contract dt {
  color: #176b55;
  font-weight: 700;
}

.goal-contract dd {
  margin: 0;
  color: var(--goal-text-soft, #51635b);
}

#existing-context-wrap textarea {
  width: 100%;
  resize: vertical;
}

@media (max-width: 640px) {
  .goal-contract dl div { grid-template-columns: 1fr; gap: 3px; }
  .goal-starter-result {
    grid-template-areas:
      "intro"
      "cta"
      "details";
    border-radius: 18px;
  }
  .goal-starter-cta { width: 100%; }
}

.goal-discover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.goal-discover-grid .goal-panel { display: grid; align-content: start; gap: 12px; }

@media (max-width: 900px) {
  .goal-discover-grid { grid-template-columns: 1fr; }
}

/* Professional Value Convergence R1 · final product shell */
.goal-brand { display: flex; align-items: center; gap: 10px; }
.goal-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #176b55, #239272);
  font-size: 16px;
}
.goal-discover-link small { display: none; }
.goal-discover-link {
  color: var(--goal-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}
.goal-assistant-entry { display: none; }

.goal-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0 4px;
  padding: 13px 16px;
  border: 1px solid #d9e8df;
  border-radius: 16px;
  background: rgba(247, 251, 248, .9);
}
.goal-context-bar[hidden] { display: none; }
.goal-context-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.goal-context-label,
.goal-brief-label {
  color: var(--goal-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.goal-context-trail { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 700; }
.goal-context-trail b { color: #9db4aa; font-weight: 500; }
.goal-context-status { display: flex; align-items: center; gap: 10px; color: var(--goal-text-secondary); font-size: 13px; }
.goal-context-status small { padding: 4px 8px; border-radius: 999px; background: #fff4d7; color: #7b5c11; white-space: nowrap; }

.goal-today-card {
  overflow: hidden;
  padding: 0;
  border: 1px solid #cfdfd6;
  border-radius: 24px;
  background: rgba(255, 255, 255, .9);
}
.goal-today-position {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 22px;
  border-bottom: 1px solid #dfeae4;
  background: #f3f8f4;
}
.goal-today-position > span { color: var(--goal-primary); font-size: 12px; font-weight: 800; white-space: nowrap; }
.goal-today-position > div { display: flex; gap: 9px; align-items: center; font-size: 14px; font-weight: 700; }
.goal-today-position b { color: #9db4aa; }
.goal-today-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 42px) clamp(22px, 4vw, 44px) 22px;
}
.goal-today-hero .goal-main-action { max-width: 780px; margin-bottom: 0; }
.goal-time-chip { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; background: #edf6f0; color: #176b55; font-size: 13px; }
.goal-today-card .goal-reason-toggle {
  margin: 0 clamp(22px, 4vw, 44px) 24px;
  border: 0;
  border-left: 3px solid #3a9a76;
  border-radius: 0 14px 14px 0;
  background: #f5faf7;
}
.goal-today-card .goal-reason-toggle summary { padding: 13px 16px 6px; color: #176b55; font-weight: 800; }
.goal-today-card .goal-reason-toggle-body { padding: 0 16px 13px; }
.goal-fact-basis { margin: 7px 0 0; color: var(--goal-text-muted); font-size: 13px; }
.goal-mobile-essentials { display: none; }
.goal-action-steps { margin: 0 clamp(22px, 4vw, 44px) 20px; }
.goal-action-steps ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 12px 0 0; padding: 0; list-style: none; }
.goal-action-steps li { position: relative; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; min-height: 46px; padding-right: 12px; font-size: 12px; }
.goal-action-steps li:not(:last-child)::after { content: ""; position: absolute; left: 28px; right: 0; top: 22px; height: 1px; background: #d7e5dd; z-index: 0; }
.goal-action-steps li span { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #dff0e6; color: #176b55; font-weight: 800; }
.goal-action-steps li b { position: relative; z-index: 1; padding: 3px; background: rgba(255,255,255,.9); line-height: 1.4; }
.goal-today-support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 18px;
  padding: 0 clamp(22px, 4vw, 44px) 22px;
}
.goal-brief-block,
.goal-today-card .goal-contract {
  margin: 0;
  padding: 18px;
  border: 1px solid #dce7df;
  border-radius: 18px;
  background: #fbfdfb;
}
.goal-brief-block .goal-resource { padding: 12px 0 0; border: 0; background: transparent; }
.goal-today-card .goal-contract dl { margin-top: 14px; }
.goal-resource-category { margin-right: 6px; color: #476b5c; }
.goal-resource-purpose,
.goal-resource-next { margin: 8px 0 0; color: var(--goal-text-secondary); font-size: 13px; line-height: 1.55; }
.goal-resource-purpose b,
.goal-resource-next b { color: #2d5a49; }
.goal-resource-usage { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; color: var(--goal-text-muted); font-size: 12px; }
.goal-outcome-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 0 clamp(22px, 4vw, 44px) 20px;
  padding: 16px 18px;
  border-radius: 17px;
  background: #eef6f1;
}
.goal-outcome-flow div { display: grid; gap: 4px; }
.goal-outcome-flow span { color: var(--goal-text-muted); font-size: 12px; }
.goal-outcome-flow strong { font-size: 14px; line-height: 1.5; }
.goal-outcome-flow > b { color: #75a48f; }
.goal-today-card > .goal-levels { margin: 0 clamp(22px, 4vw, 44px) 10px; }
.goal-secondary-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 clamp(22px, 4vw, 44px) 18px; }
.goal-secondary-actions button { min-height: 40px; }
.goal-start-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 25;
  width: min(380px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid #d5e3db;
  border-radius: 18px;
  background: #f7faf8;
  color: var(--goal-text-muted);
  font-size: 13px;
  box-shadow: 0 14px 36px rgba(30, 73, 55, .16);
}
.goal-start-zone .primary { min-width: 154px; min-height: 50px; font-size: 16px; }

.goal-route-overview,
.goal-resource-context,
.goal-outcome-meaning {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 24px;
  border: 1px solid #d7e6dd;
  border-radius: 20px;
  background: linear-gradient(135deg, #f1f8f3, #fbfdfb);
}
.goal-route-overview h2,
.goal-resource-context h2,
.goal-outcome-meaning h2 { margin: 4px 0 8px; }
.goal-route-overview > div:first-child { max-width: 420px; }
.goal-route-overview .goal-route-row { flex: 1; grid-template-columns: 1fr auto 1fr auto 1fr; margin-top: 0; }
.goal-stage-ribbon { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; align-items: stretch; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; margin-top: 14px; padding: 0 14px; border: 1px solid #d7e5dd; border-radius: 18px; background: #fff; overflow-x: auto; }
.goal-stage-ribbon > b { align-self: center; color: #b5c8be; font-weight: 500; }
.goal-stage-ribbon-item { display: grid; align-content: center; gap: 5px; min-width: 112px; min-height: 108px; padding: 13px 10px; text-align: center; border: 1px solid transparent; }
.goal-stage-ribbon-item > span { display: grid; place-items: center; width: 25px; height: 25px; margin: 0 auto; border-radius: 50%; background: #edf2ef; color: #61766c; font-size: 11px; font-weight: 800; }
.goal-stage-ribbon-item strong { font-size: 12px; line-height: 1.35; }
.goal-stage-ribbon-item small { color: var(--goal-text-muted); font-size: 10px; }
.goal-stage-ribbon-item.current { margin: -1px 0; border-color: #3c9874; border-radius: 13px; background: #f2f9f5; }
.goal-stage-ribbon-item.current > span { background: #176b55; color: #fff; }
.goal-stage-ribbon-item.current small { color: #176b55; font-weight: 800; }
.goal-stage-insight { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(260px, .55fr); align-items: center; gap: 16px; margin-top: 12px; padding: 14px 18px; border: 1px solid #d6e7dd; border-radius: 16px; background: linear-gradient(90deg, #eff8f2, #f8fbf9); }
.goal-stage-insight > span { padding: 6px 9px; border-radius: 999px; background: #176b55; color: #fff; font-size: 11px; font-weight: 800; }
.goal-stage-insight strong { color: #175b47; }
.goal-stage-insight p { margin: 4px 0 0; color: var(--goal-text-secondary); font-size: 12px; }
.goal-stage-insight > div:last-child { display: grid; gap: 3px; padding-left: 16px; border-left: 1px solid #cfdfd6; }
.goal-stage-insight small { color: var(--goal-text-muted); }
.goal-stage-insight b { font-size: 12px; line-height: 1.4; }
.goal-professional-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 22px; margin-top: 22px; align-items: start; }
.goal-stage-track,
.goal-capability-map { padding: 24px; border: 1px solid #dce7df; border-radius: 22px; background: rgba(255,255,255,.84); }
.goal-section-heading { margin-bottom: 20px; }
.goal-section-heading h2 { margin: 4px 0 0; }
.goal-stage-node { display: grid; grid-template-columns: 40px 1fr; gap: 14px; position: relative; padding-bottom: 22px; }
.goal-stage-node:last-child { padding-bottom: 0; }
.goal-stage-node:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 34px; bottom: 0; width: 1px; background: #d3e2da; }
.goal-stage-marker { position: relative; z-index: 1; }
.goal-stage-marker span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #c9dbd1; background: #fff; color: #6d8278; font-size: 13px; font-weight: 800; }
.goal-stage-node.current .goal-stage-marker span { border-color: #176b55; background: #176b55; color: #fff; box-shadow: 0 0 0 5px #e5f2ea; }
.goal-stage-heading { display: flex; justify-content: space-between; gap: 12px; }
.goal-stage-heading small { color: var(--goal-text-muted); }
.goal-stage-heading h2 { margin: 3px 0 0; font-size: 18px; }
.goal-stage-heading em { align-self: start; padding: 3px 7px; border-radius: 999px; background: #fff4d7; color: #7b5c11; font-size: 11px; font-style: normal; white-space: nowrap; }
.goal-stage-body > p { color: var(--goal-text-secondary); font-size: 13px; }
.goal-stage-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.goal-stage-details div { display: grid; gap: 3px; padding: 10px; border-radius: 12px; background: #f7faf8; }
.goal-stage-details b { color: #176b55; font-size: 11px; }
.goal-stage-details span { font-size: 12px; line-height: 1.45; }
.goal-stage-node:not(.current) .goal-stage-details { display: none; }
.goal-capability-map { display: grid; gap: 10px; }
.goal-capability-node { padding: 14px; border: 1px solid #e0e9e4; border-radius: 14px; background: #fff; }
.goal-capability-node.current { border-color: #6aaa8d; background: #f2f8f4; }
.goal-capability-node small { color: var(--goal-text-muted); }
.goal-capability-node h3 { margin: 2px 0 0; font-size: 15px; }
.goal-capability-node > p { margin: 7px 0 0; color: var(--goal-text-secondary); font-size: 12px; }
.goal-capability-node details { margin-top: 10px; }
.goal-capability-node summary { color: #176b55; font-size: 12px; font-weight: 800; cursor: pointer; }
.goal-capability-node ul { display: grid; gap: 8px; margin: 10px 0; padding: 0; list-style: none; }
.goal-capability-node li { display: grid; gap: 2px; }
.goal-capability-node li b { font-size: 12px; }
.goal-capability-node li span { color: var(--goal-text-muted); font-size: 11px; }
.goal-resource-context,
.goal-outcome-meaning { align-items: center; }
.goal-resource-context > p,
.goal-outcome-meaning > p { max-width: 520px; margin: 0; color: var(--goal-text-secondary); line-height: 1.65; }
.goal-decision-loop { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; }
.goal-decision-loop > div { display: grid; align-content: start; gap: 5px; min-height: 138px; padding: 16px; border: 1px solid #dce7df; border-radius: 16px; background: #fff; }
.goal-decision-loop > div > span { color: #68a188; font-size: 12px; font-weight: 800; }
.goal-decision-loop small { color: var(--goal-text-muted); }
.goal-decision-loop strong { font-size: 13px; line-height: 1.5; }
.goal-decision-loop > b { align-self: center; color: #9ab4a8; }
.goal-starter-professional { padding: 16px; border-radius: 16px; background: #f1f8f3; }
.goal-starter-professional > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 9px 0; font-size: 12px; }
.goal-starter-professional span.current { color: #176b55; font-weight: 800; }
.goal-starter-professional b { color: #9ab4a8; }
.goal-starter-professional small { color: #7b5c11; }
.goal-deep-path { min-width: 0; max-width: 100%; margin-top: 18px; padding: 22px; border: 1px solid #d7e5dd; border-radius: 22px; background: #fff; overflow: hidden; }
.goal-deep-path-track { display: flex; width: 100%; max-width: 100%; gap: 8px; align-items: stretch; overflow-x: auto; padding-bottom: 6px; }
.goal-deep-node { display: grid; grid-template-columns: 30px minmax(190px, 1fr); gap: 10px; min-width: 260px; padding: 14px; border: 1px solid #e0e9e4; border-radius: 15px; background: #fafcfb; }
.goal-deep-node.current { border-color: #318164; background: #eef8f2; box-shadow: inset 0 0 0 1px #318164; }
.goal-deep-index { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e5eee9; color: #48675a; font-size: 12px; font-weight: 800; }
.goal-deep-node.current .goal-deep-index { background: #176b55; color: #fff; }
.goal-deep-node small { color: var(--goal-text-muted); }
.goal-deep-node h3 { margin: 3px 0 6px; font-size: 14px; }
.goal-deep-node p { margin: 0; color: var(--goal-text-secondary); font-size: 11px; line-height: 1.5; }
.goal-deep-gate { display: grid; gap: 3px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #dfe9e3; }
.goal-deep-gate span { color: #176b55; font-size: 10px; font-weight: 800; }
.goal-deep-gate b { font-size: 10px; line-height: 1.45; }
.goal-deep-arrow { align-self: center; color: #9ab4a8; }
.goal-interpretation { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 16px; padding: 12px; border: 1px solid #cfe3d8; border-radius: 16px; background: #f4faf6; }
.goal-interpretation > div { display: grid; align-content: start; gap: 4px; padding: 9px; border-radius: 10px; background: rgba(255,255,255,.78); }
.goal-interpretation span { color: #176b55; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.goal-interpretation strong { font-size: 11px; line-height: 1.5; }
.goal-professional-outcome { display: grid; gap: 10px; margin: 12px 0; padding: 14px; border: 1px solid #cfe1d7; border-radius: 14px; }
.goal-professional-outcome legend { padding: 0 6px; color: #176b55; font-weight: 800; }
.goal-outcome-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.goal-outcome-fields label { display: grid; gap: 4px; }
.goal-check { display: flex !important; gap: 7px; align-items: center; }
.goal-check input { width: auto; }
.goal-professional-resources { display: grid; grid-template-columns: 1fr; gap: 12px; }
.goal-professional-resource { padding: 15px; border: 1px solid #dce7df; border-radius: 15px; background: #fbfdfb; }
.goal-professional-resource > div { display: flex; justify-content: space-between; gap: 10px; }
.goal-professional-resource span { color: #176b55; font-size: 10px; font-weight: 800; }
.goal-professional-resource h3 { margin: 0; font-size: 14px; }
.goal-professional-resource p { margin: 8px 0 0; color: var(--goal-text-secondary); font-size: 11px; line-height: 1.5; }
.goal-professional-resource small { display: block; margin-top: 10px; color: #7b5c11; }

@media (min-width: 961px) {
  .goal-space { padding-left: 248px; background: #f5f8f6; }
  .goal-topbar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 248px;
    max-width: none;
    margin: 0;
    padding: 28px 20px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    border-right: 1px solid #dce7e0;
    background: rgba(250, 252, 250, .96);
    backdrop-filter: blur(14px);
  }
  .goal-brand { padding: 0 8px 16px; font-size: 19px; }
  .goal-tabs { flex: none; flex-direction: column; overflow: visible; gap: 5px; }
  .goal-tabs button {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 9px 12px;
    border-radius: 12px;
    text-align: left;
  }
  .goal-discover-link small { display: block; color: #8ba096; font-size: 10px; font-weight: 500; }
  .goal-tabs button::after { content: attr(data-en); color: #8ba096; font-size: 10px; font-weight: 500; }
  .goal-tabs button[aria-current="page"] { box-shadow: inset 3px 0 0 #176b55; }
  .goal-discover-link { display: grid; grid-template-columns: 1fr auto; padding: 12px; border-top: 1px solid #e3ebe6; border-bottom: 1px solid #e3ebe6; }
  .goal-discover-link:hover { color: #176b55; }
  .goal-assistant-entry { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; margin-top: auto; padding: 12px; border: 1px solid #dbe7e0; border-radius: 14px; background: #f5f9f6; }
  .goal-assistant-dot { width: 9px; height: 9px; border-radius: 50%; background: #78aa93; }
  .goal-assistant-entry div { display: grid; gap: 2px; }
  .goal-assistant-entry strong { font-size: 12px; }
  .goal-assistant-entry small { color: var(--goal-text-muted); font-size: 9px; }
  .goal-assistant-entry em { color: #7b8e85; font-size: 9px; font-style: normal; }
  .goal-account-links { justify-content: space-between; padding: 0 8px; gap: 6px; }
  .goal-account-links > a { font-size: 12px; }
  .goal-main { max-width: 1240px; padding: 0 clamp(28px, 4vw, 58px) 72px; }
  .goal-view-head { margin-top: 28px; }
  .goal-view-head h1 { font-size: 25px; }
}

@media (max-width: 960px) {
  .goal-discover-link { margin-left: auto; }
  .goal-context-status { display: none; }
  .goal-professional-layout { grid-template-columns: 1fr; }
  .goal-capability-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal-capability-map .goal-section-heading { grid-column: 1 / -1; }
  .goal-decision-loop { grid-template-columns: 1fr 1fr; }
  .goal-decision-loop > b { display: none; }
  .goal-stage-ribbon { display: flex; }
  .goal-stage-ribbon-item { flex: 0 0 118px; }
  .goal-stage-ribbon > b { flex: 0 0 auto; }
  .goal-stage-insight { grid-template-columns: auto 1fr; }
  .goal-stage-insight > div:last-child { grid-column: 2; padding-left: 0; border-left: 0; }
  .goal-interpretation { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .goal-topbar { min-height: 56px; }
  .goal-brand { font-size: 15px; }
  .goal-brand-mark { width: 30px; height: 30px; }
  .goal-discover-link { padding: 8px; }
  .goal-account-links a:not(.goal-logout) { display: none; }
  .goal-context-bar { margin-top: 14px; padding: 11px 12px; }
  .goal-context-main { display: grid; gap: 5px; width: 100%; }
  .goal-context-trail { gap: 5px; font-size: 12px; overflow-x: auto; white-space: nowrap; }
  .goal-view-head { margin: 14px 0 12px; }
  #view-today .goal-view-head { margin: 10px 0 8px; }
  #view-today .goal-view-head h1 { font-size: 18px; }
  .goal-today-card { border-radius: 18px; }
  .goal-today-card { display: flex; flex-direction: column; }
  .goal-today-position { display: none; }
  .goal-today-card .goal-reason-toggle { order: 1; margin-top: 16px; }
  .goal-today-hero { order: 2; display: grid; gap: 10px; padding: 8px 16px 12px; }
  .goal-mobile-essentials { order: 3; display: grid; gap: 7px; margin: 0 16px 12px; padding: 11px 13px; border: 1px solid #dce7df; border-radius: 13px; background: #fbfdfb; }
  .goal-mobile-essentials div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: start; }
  .goal-mobile-essentials span { color: #176b55; font-size: 11px; font-weight: 800; }
  .goal-mobile-essentials strong { font-size: 11px; line-height: 1.4; }
  .goal-today-card .goal-main-action { font-size: 23px; }
  .goal-time-chip { justify-self: start; }
  .goal-today-card .goal-reason-toggle { margin: 0 16px 14px; }
  .goal-action-steps { order: 4; margin: 0 16px 14px; }
  .goal-action-steps ol { grid-template-columns: 1fr 1fr; gap: 8px; }
  .goal-action-steps li { padding: 7px; border: 1px solid #e0e9e4; border-radius: 11px; background: #fbfdfb; }
  .goal-action-steps li::after { display: none; }
  .goal-today-support-grid { order: 5; grid-template-columns: 1fr; padding: 0 16px 14px; }
  .goal-brief-block,
  .goal-today-card .goal-contract { padding: 14px; }
  .goal-outcome-flow { order: 6; grid-template-columns: 1fr; margin: 0 16px 14px; }
  .goal-outcome-flow > b { transform: rotate(90deg); justify-self: center; }
  .goal-today-card > .goal-levels { order: 7; margin: 0 16px 8px; }
  .goal-level { padding: 7px 10px; font-size: 12px; }
  .goal-secondary-actions { order: 8; padding: 0 16px 12px; }
  .goal-secondary-actions .ghost { padding: 7px 8px; font-size: 12px; }
  .goal-start-zone { order: 9; left: 14px; right: 14px; bottom: 73px; width: auto; padding: 11px 14px; border-radius: 16px; }
  .goal-start-zone span { display: none; }
  .goal-start-zone .primary { width: 100%; }
  .goal-route-overview,
  .goal-resource-context,
  .goal-outcome-meaning { display: grid; gap: 14px; padding: 18px; }
  .goal-route-overview .goal-route-row { grid-template-columns: 1fr; }
  .goal-stage-track,
  .goal-capability-map { padding: 16px; }
  .goal-stage-details { grid-template-columns: 1fr; }
  .goal-capability-map { grid-template-columns: 1fr; }
  .goal-decision-loop { grid-template-columns: 1fr; }
  .goal-decision-loop > div { min-height: 0; }
  .goal-deep-path { padding: 16px; }
  .goal-deep-node { min-width: 225px; }
  .goal-interpretation { grid-template-columns: 1fr; }
  .goal-outcome-fields,
  .goal-professional-resources { grid-template-columns: 1fr; }
}

/* Final cascade guard for the guided workspace over inherited R1 shell rules. */
.goal-guided-shell .goal-start-zone {
  position: static; right: auto; bottom: auto; width: auto;
  margin: 0; padding: 20px 34px; border-width: 1px 0 0; border-radius: 0;
  box-shadow: none;
}
.goal-plan-details .goal-today-support-grid { display: block; padding: 0 34px 18px; }
.goal-plan-details .goal-contract { width: 100%; }
.goal-plan-details .goal-contract dl { grid-template-columns: 1fr; }
.goal-action-workspace .goal-actions { margin: 0; }
.goal-action-workspace .goal-workspace-footer { position: static; }

@media (max-width: 720px) {
  .goal-topbar { backdrop-filter: none; }
  .goal-guided-shell .goal-today-card { display: block; }
  .goal-guided-shell .goal-today-position,
  .goal-guided-shell .goal-today-hero,
  .goal-guided-shell .goal-ready-line,
  .goal-guided-shell .goal-primary-resource,
  .goal-guided-shell .goal-start-zone,
  .goal-guided-shell .goal-plan-details { order: initial; }
  .goal-guided-shell .goal-today-position { display: none; }
  .goal-guided-shell .goal-start-zone { left: auto; right: auto; bottom: auto; width: auto; padding: 15px 18px; border-radius: 0; }
  .goal-guided-shell .goal-start-zone > div { display: grid; }
  .goal-guided-shell .goal-start-zone > div span { display: block; }
  .goal-plan-details .goal-today-support-grid { padding: 0 18px 14px; }
  .goal-plan-details .goal-contract dl { grid-template-columns: 1fr; }
  .goal-action-workspace .goal-workspace-footer { position: sticky; bottom: 66px; }
}

/* Product Fidelity + Continuity Convergence R1 -----------------------------
   Final cascade: one action center, one factual continuity narrative, fewer
   boxes, and a deliberately composed desktop/tablet/mobile workspace. */
:root {
  --fidelity-sidebar: 216px;
  --fidelity-ink: #15231d;
  --fidelity-soft: #607169;
  --fidelity-line: #dfe7e2;
  --fidelity-paper: #fff;
}

.goal-space {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f4f7f5;
  color: var(--fidelity-ink);
}
.goal-nav-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #547067;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}
.goal-nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.goal-starter-result[hidden] { display: none !important; }
.goal-tabs button[aria-current="page"] .goal-nav-icon {
  background: rgba(255,255,255,.72);
  color: var(--guided-green-dark);
}
.goal-tabs button::before,
.goal-tabs button::after { content: none !important; display: none !important; }
.goal-view-head .section-eyebrow { margin-bottom: 5px; }
.goal-view-head h1 { max-width: 760px; font-weight: 760; letter-spacing: -.025em; }
.goal-panel { border-color: var(--fidelity-line); box-shadow: none; }

.goal-onboarding { align-items: center; padding-top: 18px; }
.goal-onboarding-inner { width: min(100%, 840px); border-radius: 28px; }
.goal-onboarding-step[hidden] { display: none; }
.goal-step-count {
  margin: 0 0 10px;
  color: var(--guided-green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.goal-onboarding-step > label { font-size: 18px; font-weight: 780; }
.goal-onboarding-step > input,
.goal-onboarding-step > select { min-height: 52px; margin-top: 9px; font-size: 16px; }
.goal-onboarding-next { width: 100%; margin-top: 18px; }
.goal-onboarding-actions { display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 10px; margin-top: 22px; }
.goal-onboarding-actions .primary { width: 100%; }

.goal-continuity-note {
  margin: 0 34px 20px;
  padding: 14px 16px;
  border-left: 3px solid #55a181;
  border-radius: 0 14px 14px 0;
  background: #f1f8f4;
}
.goal-continuity-note > span { color: var(--guided-green); font-size: 12px; font-weight: 850; }
.goal-continuity-note p { margin: 7px 0 0; color: #425a50; font-size: 13px; line-height: 1.58; }
.goal-continuity-note small { display: block; margin-top: 8px; color: #687c73; }
.goal-continuity-resource {
  margin-top: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--guided-green-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.goal-recovery-panel {
  margin-bottom: 18px;
  padding: 22px 24px;
  border-color: #cfe2d7;
  border-radius: 20px;
  background: linear-gradient(120deg, #edf7f1, #fbfdfc 72%);
}
.goal-recovery-panel h2 { margin: 5px 0 8px; font-size: 22px; }
.goal-recovery-panel .goal-actions { margin-top: 14px; }
.goal-recovery-details { margin-top: 14px; }
.goal-recovery-details summary { color: #436558; cursor: pointer; font-size: 13px; font-weight: 750; }
.goal-recovery-fields { display: grid; gap: 8px; max-width: 620px; margin-top: 12px; }
.goal-recovery-fields select,
.goal-recovery-fields input { min-height: 44px; }

#view-resources .goal-panel-list { gap: 18px; }
#view-resources .goal-resource-context {
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--fidelity-line);
  border-radius: 0;
  background: transparent;
}
#view-resources .goal-panel-list > .goal-panel {
  padding: 22px 0;
  border-width: 1px 0 0;
  border-radius: 0;
  background: transparent;
}
#view-resources .goal-panel-list > .goal-panel:first-child { border-top: 0; }
#view-resources .goal-add-resource {
  margin-top: 8px;
  padding: 22px;
  border: 1px dashed #9fc8b5;
  background: #f5faf7;
}
#view-resources .goal-resource {
  padding: 14px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}
.goal-resource-details { margin-top: 10px; color: #52675d; }
.goal-resource-details summary { color: var(--guided-green-dark); cursor: pointer; font-size: 12px; font-weight: 750; }
.goal-resource-details p { margin: 7px 0 0; font-size: 12px; line-height: 1.55; }
.goal-resource-details small { display: block; margin-top: 8px; color: #76877f; }
.goal-professional-resource .goal-use-resource { margin-top: 12px; min-height: 40px; }

/* Product-fidelity polish: keep the first layer quiet and reveal detail on demand. */
.goal-today-position > small {
  margin-left: auto;
  color: #688078;
  font-size: 12px;
  font-weight: 650;
}
.goal-route-focus-card {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 9px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid #d9e5de;
  border-radius: 24px;
  background: linear-gradient(145deg, #f4faf6 0%, #ffffff 72%);
  box-shadow: 0 18px 50px rgba(24, 69, 49, .07);
}
.goal-route-focus-card > p,
.goal-route-focus-card h2,
.goal-route-now-next p { margin: 0; }
.goal-route-focus-card > p { color: var(--guided-green); font-size: 12px; font-weight: 800; }
.goal-route-focus-card h2 { font-size: clamp(25px, 3.2vw, 38px); letter-spacing: -.035em; }
.goal-route-now-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 14px;
}
.goal-route-now-next > div {
  min-height: 126px;
  padding: 20px;
  border: 1px solid #dce8e1;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
}
.goal-route-now-next span { display: block; margin-bottom: 7px; color: #668078; font-size: 12px; font-weight: 800; }
.goal-route-now-next strong { display: block; margin-bottom: 8px; font-size: 18px; }
.goal-route-now-next p { color: #586d63; font-size: 13px; line-height: 1.58; }
.goal-route-now-next > b { color: #90a79d; font-size: 22px; }
.goal-route-details { min-width: 0; max-width: 100%; margin-top: 18px; border-top: 1px solid var(--fidelity-line); overflow: hidden; }
.goal-route-details > summary {
  padding: 17px 2px;
  color: #49675a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.goal-route-details[open] > summary { margin-bottom: 10px; }

@media (min-width: 961px) {
  .goal-space { padding-left: var(--fidelity-sidebar); }
  .goal-topbar { width: var(--fidelity-sidebar); padding: 26px 16px 18px; }
  .goal-tabs button {
    grid-template-columns: 28px 1fr;
    gap: 10px;
    min-height: 48px;
    padding: 8px 10px;
  }
  .goal-main {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px clamp(28px, 3vw, 46px) 72px;
  }
  #app-view:has(#view-today:not([hidden])) #goal-context-bar { display: none; }
  .goal-guided-shell { grid-template-columns: minmax(0, 1fr) 268px; gap: 26px; }
  .goal-today-card { border-color: #d7e3dc; }
  .goal-today-position { padding: 14px 30px; }
  .goal-today-hero { padding: 30px 34px 16px; }
  .goal-today-hero .goal-main-action { max-width: 690px; font-size: clamp(29px, 2.5vw, 37px); }
  .goal-today-rail { gap: 0; padding: 4px 0; }
  .goal-today-rail section {
    padding: 20px 4px;
    border: 0;
    border-bottom: 1px solid var(--fidelity-line);
    border-radius: 0;
    background: transparent;
  }
  .goal-today-rail section:last-child { border-bottom: 0; }
  .goal-plan-details > summary { text-align: left; }
  .goal-action-workspace { max-width: 1120px; margin: 0 auto; }
  .goal-workspace-time { color: var(--fidelity-soft); font-size: 13px; font-weight: 600; }
  .goal-workspace-time #session-elapsed { font-size: 14px; }
  body.goal-first-use { padding-left: 0; }
  body.goal-first-use .goal-topbar {
    position: absolute;
    inset: 25px auto auto 30px;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  body.goal-first-use .goal-topbar > :not(.goal-brand) { display: none !important; }
  body.goal-first-use .goal-brand { padding: 0; opacity: .9; }
  body.goal-first-use .goal-main { max-width: none; margin: 0; padding: 24px 40px 64px; }
  body.goal-first-use #onboarding { width: min(100%, 980px); min-height: calc(100vh - 48px); margin-inline: auto; }
  body.goal-first-use .goal-onboarding-inner { width: min(100%, 820px); }
  .goal-guided-shell { grid-template-columns: minmax(0, 1fr) 232px; }
  .goal-today-rail section { padding: 17px 2px; }
}

@media (min-width: 721px) and (max-width: 960px) {
  :root { --fidelity-sidebar: 82px; }
  .goal-space { padding-left: var(--fidelity-sidebar); }
  .goal-topbar { width: var(--fidelity-sidebar); }
  .goal-tabs button { display: grid; justify-items: center; gap: 3px; font-size: 11px; }
  .goal-nav-icon { width: 29px; height: 29px; font-size: 18px; }
  .goal-main { margin: 0; padding: 22px 28px 64px; }
  .goal-today-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.goal-first-use { padding-left: 0; }
  body.goal-first-use .goal-topbar { display: none; }
  body.goal-first-use .goal-main { padding-inline: 28px; }
}

@media (max-width: 720px) {
  .goal-space { background: #fbfcfb; }
  .goal-main { padding: 12px 14px 28px; }
  .goal-topbar { background: rgba(255,255,255,.98); }
  .goal-tabs button { display: grid; grid-template-columns: 1fr; justify-items: center; align-content: center; gap: 2px; font-size: 11px; }
  .goal-nav-icon { width: 24px; height: 24px; font-size: 17px; }
  .goal-tabs button[aria-current="page"] .goal-nav-icon { background: transparent; }
  .goal-view-head { margin: 10px 0 8px; }
  #view-today .goal-view-head .section-eyebrow { display: none; }
  #view-today .goal-view-head h1 { font-size: 20px; }
  .goal-guided-shell .goal-today-card { border: 0; border-radius: 0; box-shadow: none; }
  .goal-guided-shell .goal-today-hero { padding: 4px 2px 10px; }
  .goal-guided-shell .goal-today-hero .section-eyebrow { color: #557167; }
  .goal-guided-shell .goal-today-hero .goal-main-action { font-size: 25px; line-height: 1.3; }
  .goal-guided-shell .goal-today-why { font-size: 14px; line-height: 1.62; }
  .goal-guided-shell .goal-time-chip { padding: 5px 9px; }
  .goal-guided-shell .goal-ready-line { display: none; }
  .goal-guided-shell .goal-primary-resource {
    margin: 3px 2px 12px;
    padding: 12px 13px;
    border-radius: 13px;
  }
  .goal-guided-shell .goal-primary-resource small { display: none; }
  .goal-guided-shell .goal-start-zone {
    padding: 10px 2px 14px;
    border: 0;
    background: transparent;
  }
  .goal-guided-shell .goal-start-zone > div { display: none; }
  .goal-guided-shell .goal-start-zone .primary { min-height: 52px; font-size: 16px; }
  .goal-guided-shell .goal-reason-toggle { margin: 0 2px 10px; background: transparent; }
  .goal-guided-shell .goal-plan-details > summary { padding: 12px 2px; text-align: left; }
  .goal-continuity-note { margin: 2px 2px 12px; }
  .goal-today-rail { display: none; }
  .goal-recovery-panel { padding: 18px; }
  .goal-recovery-panel h2 { font-size: 19px; }
  .goal-recovery-panel .goal-actions { display: grid; }
  .goal-recovery-panel .goal-actions button { width: 100%; min-height: 46px; }
  .goal-onboarding { padding-top: 8px; }
  .goal-onboarding-inner { padding: 24px 18px; border: 0; border-radius: 0; box-shadow: none; }
  .goal-guided-intro .goal-brand-mark { display: none; }
  .goal-guided-intro h1 { font-size: 29px; }
  .goal-onboarding-hint { margin-top: 14px; font-size: 15px; }
  .goal-presets { display: grid; grid-template-columns: 1fr; }
  .goal-preset { min-height: 48px; text-align: left; }
  .goal-onboarding-actions { grid-template-columns: auto 1fr; }
  .goal-action-workspace { border: 0; border-radius: 0; box-shadow: none; }
  .goal-workspace-head { padding: 18px 2px; background: transparent; }
  .goal-workspace-head h2 { font-size: 24px; }
  .goal-workspace-time { min-width: 0; color: #6b7d75; font-size: 11px; }
  .goal-workspace-time #session-elapsed { font-size: 12px; }
  .goal-workspace-layout > main { padding: 18px 2px 24px; }
  .goal-coach-panel { margin-inline: -2px; padding: 20px 14px; }
  #view-resources .goal-resource-context { padding: 0 0 14px; }
  #view-resources .goal-add-resource { grid-template-columns: 1fr; padding: 18px; }
  #view-resources .goal-add-resource .primary { width: 100%; }
  .goal-route-focus-card { padding: 21px 17px; border-radius: 18px; }
  .goal-route-now-next { grid-template-columns: 1fr; gap: 10px; }
  .goal-route-now-next > div { min-height: 0; padding: 16px; }
  .goal-route-now-next > b { justify-self: center; transform: rotate(90deg); font-size: 18px; }
}

/* Product Polish Closeout Final ------------------------------------------
   Calm Chinese typography, semantic resources, and a true mobile focus mode. */
.goal-space {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
}
.goal-assistant-entry[hidden] { display: none !important; }
.goal-discover-link small { display: none !important; }
.section-eyebrow,
.goal-step-count,
.goal-today-position > span,
.goal-today-rail span,
.goal-continuity-note > span { font-weight: 600; letter-spacing: .035em; }
.goal-view-head h1 {
  font-size: clamp(24px, 2vw, 27px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.018em;
}
.goal-main-action,
.goal-today-hero .goal-main-action,
.goal-workspace-head h2 {
  font-weight: 600;
  letter-spacing: -.025em;
}
.goal-guided-intro h1 {
  max-width: 680px;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -.025em;
}
.goal-onboarding-inner { box-shadow: 0 16px 44px rgba(26,63,48,.06); }
.goal-onboarding-now,
.goal-onboarding-step > label { font-weight: 600; }
.goal-preset { font-weight: 500; }
.primary,
.secondary,
.ghost,
.danger {
  border-radius: 10px;
  font-weight: 600;
  box-shadow: none;
}
.ghost { font-weight: 500; }
.goal-panel h2,
.goal-route-now-next strong,
.goal-professional-resource h3,
.goal-resource strong { font-weight: 600; }
.goal-route-focus-card {
  padding: clamp(24px, 3vw, 32px);
  border-radius: 20px;
  box-shadow: none;
}
.goal-route-focus-card h2 { font-size: clamp(25px, 2.6vw, 32px); font-weight: 600; }
.goal-route-now-next { align-items: start; }
.goal-route-now-next > div { min-height: 0; height: auto; border-radius: 14px; }
.goal-route-now-next span,
.goal-route-details > summary { font-weight: 600; }
.goal-action-workspace { border-radius: 20px; box-shadow: 0 12px 36px rgba(26,64,49,.055); }
.goal-workspace-head h2 { font-size: clamp(27px, 2.5vw, 32px); line-height: 1.28; }
.goal-workspace-head > div:first-child > p:last-child { font-size: 15px; line-height: 1.65; }
.goal-workspace-progress {
  margin: 0;
  color: var(--guided-green);
  font-size: 13px;
  font-weight: 600;
}
.goal-workspace-time { font-weight: 500; }
.goal-workspace-time span { font-weight: 600; }
.goal-workspace-time #session-elapsed {
  color: #6e8178;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}
.goal-work-sheet label,
.goal-optional-step summary,
.goal-example-question { font-weight: 600; }
.goal-example-head > span,
.goal-workspace-resource span,
.goal-finish-preview span { font-weight: 600; letter-spacing: .02em; }
.goal-more-help { border-top: 1px solid #e1e9e4; }
.goal-more-help summary {
  min-height: 44px;
  padding: 11px 2px;
  color: #526b60;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.goal-more-help button { width: 100%; margin-top: 7px; }
.goal-resource-body {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.goal-resource-kind-icon {
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e8f3ed;
  color: #176b55 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
.goal-resource-kind-label {
  margin-right: 7px;
  color: #557267;
  font-size: 12px;
}
.goal-professional-resource {
  padding: 16px;
  border-radius: 14px;
  background: #fff;
}
.goal-professional-resource-head {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr);
  justify-content: initial !important;
  gap: 12px !important;
}
.goal-professional-resource-head small {
  margin: 0 0 4px;
  color: #557267;
  font-size: 12px;
  font-weight: 500;
}
.goal-professional-resource h3 { font-size: 16px; line-height: 1.45; }
.goal-professional-resource p { font-size: 13px; line-height: 1.6; }
.goal-professional-resource > small { font-size: 12px; }
.goal-companion-line {
  margin: 0 0 20px;
  color: #365f50;
  font-size: 16px;
}
.goal-companion-package,
.goal-recovery-package { max-width: 880px; margin-inline: auto; }
.goal-recovery-standard { margin-top: 10px; }
.goal-resource-workspace {
  display: grid;
  grid-template-columns: minmax(180px, .72fr) minmax(0, 2fr) minmax(190px, .78fr);
  gap: 18px;
  align-items: start;
}
.goal-resource-mobile-tools { display: none; }
.goal-resource-tree,
.goal-resource-rail {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid #dfe8e2;
  border-radius: 16px;
  background: #f8fbf9;
}
.goal-resource-tree button { justify-content: flex-start; }
.goal-resource-tree-path { line-height: 1.8; }
.goal-resource-center { min-width: 0; display: grid; gap: 16px; }
.goal-resource-breadcrumb { color: #557267; font-size: 13px; }
.goal-resource-content { margin-top: 14px; }
.goal-resource-content > summary { color: #315f4f; cursor: pointer; font-weight: 600; }
.goal-resource-document { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border-radius: 14px; background: #f8fbf9; }
.goal-resource-document h4 { margin: 0; font-size: 17px; }
.goal-resource-document ol { display: grid; gap: 9px; margin: 0; padding-left: 22px; }
.goal-resource-document li span { display: block; color: #557267; }
#view-resources .goal-add-resource {
  border-radius: 14px;
  background: #f7faf8;
}

@media (min-width: 961px) {
  .goal-today-hero .goal-main-action { font-size: clamp(28px, 2.25vw, 32px); line-height: 1.32; }
  .goal-topbar .goal-assistant-entry { display: none !important; }
}

@media (max-width: 720px) {
  .goal-space { font-size: 15px; }
  .goal-guided-intro h1 { font-size: 26px; line-height: 1.32; }
  .goal-onboarding-hint { line-height: 1.65; }
  .goal-guided-shell .goal-today-hero .goal-main-action {
    max-width: 350px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.34;
  }
  .goal-workspace-head h2 {
    max-width: 350px;
    font-size: 23px;
    line-height: 1.34;
  }
  .goal-workspace-head > div:first-child > p:last-child { font-size: 15px; }
  .goal-workspace-time { align-items: center; font-size: 12px; }
  .goal-workspace-time span { order: -1; }
  .goal-help-content { min-height: 0; }
  .goal-professional-resource p { font-size: 13px; }
  body.goal-session { min-height: 100dvh; padding-bottom: 0; scroll-padding-bottom: 104px; }
  body.goal-session .goal-tabs { display: none !important; }
  body.goal-session .goal-main {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }
  body.goal-session .goal-view-head { margin-bottom: 6px; }
  body.goal-session .goal-action-workspace .goal-workspace-footer {
    position: sticky;
    bottom: 0;
    z-index: 12;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top-color: #d9e3dd;
    box-shadow: 0 -8px 24px rgba(25,54,43,.07);
  }
  body.goal-session .goal-workspace-footer .goal-actions {
    display: grid;
    grid-template-columns: minmax(76px,.75fr) minmax(96px,1fr) auto;
    gap: 8px;
  }
  body.goal-session .goal-workspace-footer .goal-actions button {
    min-height: 46px;
    padding-inline: 12px;
  }
  body.goal-session .goal-work-sheet textarea,
  body.goal-session .goal-work-sheet input,
  body.goal-session .goal-choice-field { scroll-margin-bottom: 128px; }
}

/* User-approved typography baseline ---------------------------------------
   Authority: the calm 390x844 focused-action reference. Importance comes
   from spacing and placement; typography stays within regular-to-semibold. */
.goal-space {
  --goal-title-page: 24px;
  --goal-title-action: 28px;
  --goal-title-section: 17px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
}
.goal-space :where(h1, h2, h3) {
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.015em;
}
.goal-space :where(strong, b, th, legend) { font-weight: 600; }
.goal-space :where(p, li, label, input, textarea, select, button) { line-height: 1.6; }
.goal-space :where(.section-eyebrow, .goal-step-count, .goal-muted, small) {
  font-weight: 400;
  letter-spacing: 0;
}
.goal-brand { font-weight: 600; }
.goal-view-head h1 {
  font-size: var(--goal-title-page);
  font-weight: 600;
  line-height: 1.4;
}
.goal-guided-intro h1 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.38;
}
.goal-onboarding-now,
.goal-onboarding-step > label,
.goal-step-count { font-weight: 500; }
.goal-today-hero .goal-main-action,
.goal-today-card .goal-main-action {
  font-size: var(--goal-title-action);
  font-weight: 600;
  line-height: 1.42;
}
.goal-workspace-head h2 {
  font-size: var(--goal-title-action);
  font-weight: 600;
  line-height: 1.42;
}
.goal-route-focus-card h2 { font-size: 28px; font-weight: 600; line-height: 1.4; }
.goal-route-now-next strong,
.goal-panel h2,
.goal-section-heading h2,
.goal-stage-heading h2,
.goal-add-resource h2,
.goal-recovery-panel h2,
.goal-error-state h2,
.goal-empty-panel h2 {
  font-size: var(--goal-title-section);
  font-weight: 600;
  line-height: 1.5;
}
.goal-professional-resource h3,
.goal-capability-node h3,
.goal-deep-node h3,
.goal-next-action h3,
.goal-resource strong,
.goal-workspace-resource strong { font-size: 15px; font-weight: 600; line-height: 1.5; }
.goal-context-trail,
.goal-today-position > div,
.goal-today-position > span,
.goal-today-rail span,
.goal-primary-resource > span,
.goal-continuity-note > span,
.goal-workspace-progress,
.goal-brief-label,
.goal-example-head > span,
.goal-workspace-resource span,
.goal-resource-details summary,
.goal-reason-toggle summary,
.goal-plan-details summary,
.goal-route-details > summary,
.goal-more-help summary { font-weight: 500; }
.goal-action-steps li span,
.goal-deep-index,
.goal-stage-marker span,
.goal-stage-ribbon-item > span,
.goal-stage-ribbon-item.current small,
.goal-decision-loop > div > span,
.goal-deep-gate span,
.goal-interpretation span,
.goal-professional-outcome legend { font-weight: 500; }
.goal-example-question,
.goal-work-sheet label,
.goal-choice-field label,
.goal-resource-form label { font-weight: 500; }
.primary,
.secondary { font-weight: 600; }
.ghost,
.goal-continuity-resource,
.goal-resource-open,
.goal-use-resource { font-weight: 500; }

@media (max-width: 960px) {
  .goal-space {
    --goal-title-page: 22px;
    --goal-title-action: 25px;
    --goal-title-section: 17px;
  }
  .goal-guided-intro h1 { font-size: 27px; }
  .goal-route-focus-card h2 { font-size: 25px; }
  .goal-resource-workspace { grid-template-columns: 170px minmax(0, 1fr); }
  .goal-resource-rail { display: none; }
}

@media (max-width: 720px) {
  .goal-space {
    --goal-title-page: 20px;
    --goal-title-action: 22px;
    --goal-title-section: 16px;
    font-size: 15px;
    line-height: 1.65;
  }
  .goal-view-head h1,
  #view-today .goal-view-head h1 { font-size: var(--goal-title-page); }
  .goal-guided-intro h1 { font-size: 24px; font-weight: 600; line-height: 1.42; }
  .goal-guided-shell .goal-today-hero .goal-main-action,
  .goal-today-card .goal-main-action,
  .goal-workspace-head h2 {
    max-width: 354px;
    font-size: var(--goal-title-action);
    font-weight: 600;
    line-height: 1.45;
  }
  .goal-route-focus-card h2 { font-size: 23px; }
  .goal-route-now-next strong { font-size: 16px; }
  .goal-workspace-head > div:first-child > p:last-child,
  .goal-guided-shell .goal-today-why,
  .goal-onboarding-hint { font-size: 15px; line-height: 1.7; }
  .goal-professional-resource h3,
  .goal-resource strong,
  .goal-workspace-resource strong { font-size: 15px; }
  .goal-resource-workspace { display: block; }
  .goal-resource-tree { display: none; }
  .goal-resource-breadcrumb { display: block; margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .goal-resource-document { padding: 13px; }
  .goal-companion-package,
  .goal-recovery-package { margin-inline: 0; }
}

/* Final Visual Convergence R1 --------------------------------------------
   Preserve the green brand while making action, content, and next step the
   dominant reading order at each viewport. */
.goal-guided-shell {
  width: min(100%, 1120px);
  margin-inline: auto;
  grid-template-columns: minmax(0, 1fr) 238px;
  gap: 28px;
}
.goal-companion-package { max-width: none; margin-inline: 0; }
.goal-today-rail { gap: 0; }
.goal-today-rail section {
  padding: 18px 2px;
  border: 0;
  border-bottom: 1px solid var(--fidelity-line);
  border-radius: 0;
  background: transparent;
}
.goal-today-rail section:last-child { border-bottom: 0; }
.goal-today-rail strong { font-size: 15px; line-height: 1.55; }
.goal-today-rail small { line-height: 1.55; }
.goal-recovery-package .goal-start-zone {
  position: static;
  width: auto;
  margin: 18px 0 0;
  padding: 16px 18px;
  border-width: 1px;
  border-radius: 14px;
  box-shadow: none;
}

.goal-step-meter {
  width: min(280px, 55vw);
  height: 3px;
  margin: 9px 0 16px;
  border-radius: 999px;
  background: #dfe9e3;
  overflow: hidden;
}
.goal-step-meter i { display: block; width: 25%; height: 100%; background: var(--guided-green); }
.goal-action-workspace { max-width: 1160px; }
.goal-workspace-layout { grid-template-columns: minmax(0, 1fr) 270px; }
.goal-coach-panel { background: #fbfcfb; }
.goal-workspace-footer > span { color: #73847c; font-size: 12px; }

.goal-resource-workspace {
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
}
.goal-resource-workspace.has-context {
  grid-template-columns: 180px minmax(0, 1fr) 220px;
}
.goal-resource-tree,
.goal-resource-rail { padding: 16px; border-radius: 14px; box-shadow: none; }
.goal-resource-tree-path { display: grid; gap: 4px; }
.goal-resource-tree-path b { color: #9aaca4; font-size: 11px; transform: rotate(90deg); transform-origin: center; }
.goal-resource-tree-path span:last-child { color: var(--guided-green-dark); font-weight: 600; }
.goal-resource-tree-list { display: grid; gap: 4px; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--fidelity-line); list-style: none; }
.goal-resource-tree-list li { padding: 7px 9px; color: #6b7c74; font-size: 13px; }
.goal-resource-tree-list li.current { border-radius: 9px; background: #eaf5ef; color: var(--guided-green-dark); font-weight: 600; }
.goal-resource-return {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--guided-green-dark);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.goal-resource-center > .goal-panel { padding: 22px; background: #fff; }
.goal-professional-resource { padding: 0; border: 0; background: transparent; }
.goal-professional-resource + .goal-professional-resource { padding-top: 20px; border-top: 1px solid var(--fidelity-line); }
.goal-resource-modes {
  display: flex;
  gap: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--fidelity-line);
  color: #6b7c74;
  font-size: 12px;
}
.goal-resource-modes span:first-child { color: var(--guided-green-dark); font-weight: 600; }
.goal-resource-document { border-radius: 12px; }

/* Bounded Agent panel: explicit confirmation, calm surface, no token in DOM. */
.goal-topbar .goal-assistant-entry {
  display: flex !important;
  width: 100%;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid #dbe7e0;
  border-radius: 14px;
  background: #f5f9f6;
  color: var(--goal-text, #17231e);
  text-align: left;
  cursor: pointer;
}
.goal-topbar .goal-assistant-entry:hover { border-color: #a9cbb9; background: #edf7f1; }
.goal-topbar .goal-assistant-entry[hidden] { display: none !important; }
.goal-assistant-entry > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.goal-assistant-entry strong { font-size: 12px; }
.goal-assistant-entry small { color: var(--goal-text-muted, #718179); font-size: 10px; line-height: 1.35; }
.goal-assistant-chevron { margin-left: auto; color: var(--guided-green, #0f7a5c); font-size: 22px; line-height: 1; }
.goal-agent-panel {
  position: fixed;
  z-index: 90;
  right: 24px;
  bottom: 24px;
  width: min(430px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d8e6dd;
  border-radius: 20px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 70px rgba(24, 63, 47, .2);
}
.goal-agent-panel[hidden] { display: none !important; }
.goal-agent-head { display: flex; gap: 18px; justify-content: space-between; padding: 20px 20px 14px; border-bottom: 1px solid #e8efea; }
.goal-agent-head h2 { margin: 2px 0 5px; font-size: 21px; }
.goal-agent-head p:last-child { max-width: 340px; margin: 0; color: #5e7268; font-size: 12px; line-height: 1.6; }
.goal-agent-close { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #f1f6f3; color: #52675d; font-size: 25px; line-height: 1; cursor: pointer; }
.goal-agent-close:hover { background: #e5f1ea; }
.goal-agent-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 20px; border-bottom: 1px solid #eef3ef; }
.goal-agent-quick button { min-height: 40px; padding: 7px 12px; border: 1px solid #dce9e1; border-radius: 999px; background: #f8fbf9; color: #3e6253; font-size: 13px; }
.goal-agent-quick button:hover { border-color: #9fc5b1; background: #edf7f1; }
.goal-agent-thread { min-height: 120px; max-height: 310px; display: grid; align-content: start; gap: 10px; overflow-y: auto; padding: 16px 20px; background: #fbfdfb; }
.goal-agent-message { max-width: 92%; margin: 0; padding: 10px 12px; border-radius: 13px; color: #344f43; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.goal-agent-message.agent { justify-self: start; background: #edf7f1; }
.goal-agent-message.user { justify-self: end; background: #e7f0eb; color: #24523f; }
.goal-agent-message.error { background: #fff5ee; color: #80553f; }
.goal-agent-proposal-card { display: grid; gap: 10px; padding: 16px; border: 1px solid #cfe2d7; border-radius: 16px; background: #fff; box-shadow: 0 8px 26px rgba(24, 63, 47, .08); }
.goal-agent-proposal-card .section-eyebrow { margin: 0; }
.goal-agent-proposal-card h3 { margin: 0; color: #203c30; font-size: 17px; line-height: 1.45; }
.goal-agent-proposal-card > p:not(.section-eyebrow) { margin: 0; color: #526b60; font-size: 13px; line-height: 1.65; }
.goal-agent-proposal-card dl { display: grid; gap: 8px; margin: 0; }
.goal-agent-proposal-card dl div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; }
.goal-agent-proposal-card dt { color: #708178; font-size: 12px; }
.goal-agent-proposal-card dd { margin: 0; color: #314b40; font-size: 12px; line-height: 1.55; }
.goal-agent-proposal-card details { color: #526b60; font-size: 12px; }
.goal-agent-proposal-card summary { min-height: 32px; cursor: pointer; }
.goal-agent-proposal-card ul { margin: 6px 0 0; padding-left: 18px; }
.goal-agent-proposal-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.goal-agent-proposal-actions button { min-height: 44px; }
.goal-agent-form { display: grid; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid #e8efea; }
.goal-agent-form > label { color: #3f5c4f; font-size: 13px; font-weight: 650; }
.goal-agent-form textarea { min-height: 48px; resize: vertical; }
.goal-agent-form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal-agent-form-row .goal-muted { min-height: 18px; font-size: 11px; }
@media (min-width: 721px) and (max-width: 1000px) {
  .goal-topbar .goal-assistant-entry {
    position: fixed;
    z-index: 80;
    right: 20px;
    bottom: 20px;
    width: auto;
    margin: 0;
    box-shadow: 0 12px 34px rgba(24, 63, 47, .16);
  }
  .goal-assistant-entry > span:nth-child(2) small,
  .goal-assistant-chevron { display: none; }
}
@media (max-width: 720px) {
  .goal-topbar .goal-assistant-entry { display: flex !important; width: auto; margin: 0 0 0 auto; padding: 8px 9px; border-radius: 12px; }
  .goal-assistant-entry > span:nth-child(2) small,
  .goal-assistant-chevron { display: none; }
  .goal-assistant-entry strong { font-size: 12px; }
  .goal-agent-panel { left: 10px; right: 10px; bottom: 76px; width: auto; max-height: calc(100dvh - 92px); border-radius: 18px; }
  .goal-agent-head { padding: 16px 16px 12px; }
  .goal-agent-quick { padding: 10px 16px; }
  .goal-agent-quick button { min-height: 44px; }
  .goal-agent-thread { max-height: 34dvh; padding: 13px 16px; }
  .goal-agent-form { padding: 12px 16px 14px; }
}

.goal-decision-loop { grid-template-columns: 1fr auto 1fr auto 1fr; }
.goal-decision-loop > div { min-height: 118px; }
.goal-outcome-meaning h2 { font-size: 20px; }

@media (min-width: 721px) and (max-width: 960px) {
  .goal-guided-shell { grid-template-columns: 1fr; width: min(100%, 700px); }
  .goal-shell-focus, .goal-shell-bottom { display: none !important; }
  .goal-today-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .goal-today-rail section { border-bottom: 0; border-top: 1px solid var(--fidelity-line); }
  .goal-workspace-layout { grid-template-columns: 1fr; }
  .goal-resource-workspace,
  .goal-resource-workspace.has-context { grid-template-columns: 160px minmax(0, 1fr); }
  .goal-resource-rail { display: none; }
}

@media (max-width: 720px) {
  .goal-guided-shell { display: block; width: 100%; }
  .goal-today-rail { display: none; }
  .goal-recovery-package .goal-start-zone { margin-top: 14px; padding: 10px 0 0; border-width: 1px 0 0; border-radius: 0; background: transparent; }
  .goal-recovery-package .goal-start-zone > div { display: none; }
  .goal-recovery-package .goal-start-zone .primary { width: 100%; min-height: 52px; }
  .goal-step-meter { margin: 8px 0 14px; }
  .goal-workspace-head { padding-top: 10px; }
  .goal-workspace-layout { grid-template-columns: 1fr; }
  .goal-workspace-layout > main { padding-top: 12px; }
  .goal-resource-workspace,
  .goal-resource-workspace.has-context { display: block; }
  .goal-resource-mobile-tools {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
  }
  .goal-resource-mobile-tools button {
    min-height: 44px;
    padding: 0 9px;
    border: 0;
    background: transparent;
    color: var(--guided-green-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
  }
  .goal-resource-mobile-tools label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .goal-resource-mobile-tools input { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; background: #fff; }
  .goal-resource-center > .goal-panel { padding: 16px 0; border-width: 1px 0 0; border-radius: 0; background: transparent; }
  .goal-resource-modes { gap: 14px; overflow-x: auto; }
  .goal-decision-loop { grid-template-columns: 1fr; }
}

/* Desktop Product Polish R1 ------------------------------------------------
   One restrained navigation tool, one stable content grid, and one compact
   context rail.  These rules intentionally leave the approved tablet/mobile
   action surfaces untouched. */
@media (min-width: 961px) {
  :root {
    --fidelity-sidebar: 190px;
    --guided-content: 1180px;
  }

  .goal-space { padding-left: var(--fidelity-sidebar); }

  .goal-topbar {
    width: var(--fidelity-sidebar);
    padding: 20px 12px 16px;
    gap: 12px;
    background: rgba(255, 255, 255, .98);
  }
  .goal-brand { padding: 3px 8px 12px; font-size: 19px; }
  .goal-brand-mark { box-shadow: 0 5px 12px rgba(15, 122, 92, .16); }
  .goal-tabs { gap: 3px; }
  .goal-tabs button {
    position: relative;
    min-height: 44px;
    padding: 7px 9px;
    border-radius: 10px;
  }
  .goal-tabs button[aria-current="page"] {
    background: #eff7f2;
    color: var(--guided-green-dark);
  }
  .goal-tabs button[aria-current="page"]::after {
    content: "" !important;
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    display: block !important;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--guided-green);
  }
  .goal-tabs button[aria-current="page"] .goal-nav-icon { background: transparent; }
  .goal-discover-link {
    min-height: 40px;
    margin-top: 8px;
    padding: 0 9px;
    border-top: 1px solid #edf1ee;
    font-size: 13px;
  }
  .goal-account-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-top: auto;
    padding: 11px 7px 0;
  }
  .goal-account-links > a {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 5px;
    color: #687b72;
    font-size: 12px;
  }
  .goal-account-links > .goal-logout {
    grid-column: 1 / -1;
    border-top: 1px solid #edf1ee;
    color: #7a8982;
  }

  .goal-main {
    max-width: none;
    margin: 0;
    padding: 30px clamp(32px, 3.5vw, 48px) 72px;
  }
  #app-view { width: min(100%, var(--guided-content)); }
  .goal-view-head { margin: 0 0 18px; }
  .goal-view-head h1 { max-width: 800px; }

  .goal-guided-shell {
    width: 100%;
    margin-inline: 0;
    grid-template-columns: minmax(0, 1fr) 248px;
    gap: 28px;
  }
  .goal-today-card { border-radius: 18px; box-shadow: 0 10px 32px rgba(27, 65, 50, .055); }
  .goal-today-position { padding: 13px 30px; }
  .goal-today-hero { padding: 28px 30px 15px; }
  .goal-primary-resource { margin-inline: 30px; }
  .goal-start-zone { padding: 18px 30px; }
  .goal-plan-details .goal-today-support-grid { padding-inline: 30px; }
  .goal-today-rail { padding-top: 2px; }
  .goal-today-rail section { padding: 16px 2px; }

  .goal-action-workspace {
    max-width: none;
    margin: 0;
    border-radius: 18px;
  }
  .goal-workspace-head { padding: 26px 30px; }
  .goal-workspace-layout { grid-template-columns: minmax(0, 1fr) 256px; }
  .goal-workspace-layout > main { padding: 26px 30px 34px; }
  .goal-coach-panel { padding: 26px 20px; }

  .goal-resource-workspace { grid-template-columns: 194px minmax(0, 1fr); gap: 24px; }
  .goal-resource-workspace.has-context { grid-template-columns: 194px minmax(0, 1fr) 250px; }
  .goal-resource-tree,
  .goal-resource-rail { padding: 16px; background: #fafcfb; }
  .goal-resource-center { gap: 18px; }
  .goal-resource-center > .goal-panel { padding: 24px; }

  #view-outcomes .goal-panel-list,
  #view-review .goal-panel-list,
  #view-route .goal-panel-list { max-width: none; }
  .goal-outcome-meaning,
  .goal-route-overview { padding: 22px 24px; }
  .goal-decision-loop > div { min-height: 112px; }
}

/* Full-Value V1 PC shell ---------------------------------------------------
   The frozen five-view authority is desktop-only.  Mobile keeps the existing
   focused-action surface below 721px. */
@media (min-width: 961px) {
  :root { --goal-pc-sidebar: 240px; --goal-pc-surface: #fffdf9; --goal-pc-line: #e8e2d7; }
  .goal-space { padding-left: var(--goal-pc-sidebar); background: #fbf9f4; }
  .goal-topbar {
    width: var(--goal-pc-sidebar); padding: 24px 12px 16px;
    border-right: 1px solid var(--goal-pc-line); background: #f7f4ed;
  }
  .goal-brand { padding: 2px 8px 14px; }
  .goal-shell-focus {
    display: grid; gap: 4px; margin: 0 4px 15px; padding: 11px 12px;
    border: 1px solid #ebe6dc; border-radius: 12px; background: #f4f2ec;
  }
  .goal-shell-focus > span, .goal-shell-stage span { color: #809187; font-size: 11px; }
  .goal-shell-focus strong { overflow: hidden; color: #335e4e; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .goal-shell-focus small { overflow: hidden; color: #8a968d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .goal-tabs { gap: 4px; }
  .goal-tabs button { min-height: 42px; border-radius: 10px; }
  .goal-discover-link { display: none; }
  .goal-account-links { order: 5; display: flex; gap: 10px; margin: 12px 8px 0; padding: 10px 0 0; border-top: 1px solid var(--goal-pc-line); }
  .goal-account-links > a { min-height: auto; padding: 0; font-size: 11px; }
  .goal-account-links > .goal-logout { border: 0; }
  .goal-shell-bottom { display: grid; gap: 12px; margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--goal-pc-line); }
  .goal-shell-stage { display: grid; gap: 7px; }
  .goal-shell-stage > div { display: flex; justify-content: space-between; gap: 8px; }
  .goal-shell-stage small { color: #708177; font-size: 11px; }
  .goal-shell-stage strong { color: #365f4f; font-size: 13px; }
  .goal-shell-stage i { display: block; width: 100%; height: 3px; overflow: hidden; border-radius: 99px; background: #e5e0d6; }
  .goal-shell-stage i::after { content: ""; display: block; width: inherit; height: 100%; border-radius: inherit; background: #5e977d; }
  .goal-shell-user { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .goal-shell-user > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #d4e4d9; color: #356554; font-size: 12px; }
  .goal-shell-user strong { overflow: hidden; color: #405d51; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .goal-shell-user small { padding: 2px 5px; border-radius: 6px; background: #edf5ef; color: #4b7a64; font-size: 10px; }
  .goal-main { padding: 28px clamp(32px, 3.5vw, 48px) 72px; }
  #app-view { width: min(100%, 1180px); }
}

@media (max-width: 720px) {
  .goal-shell-focus, .goal-shell-bottom { display: none !important; }
}

/* Full-Value V1 five-view compositions: real data only ------------------- */
.goal-route-layout { display: grid; gap: 24px; }
.goal-route-main { display: grid; gap: 16px; min-width: 0; }
.goal-route-summary-hero, .goal-route-section, .goal-route-context > section,
.goal-outcome-comparison, .goal-review-narrative, .goal-review-changes,
.goal-review-adjustment { border: 1px solid #e7dfd3; border-radius: 18px; background: #fffdf9; box-shadow: 0 8px 24px rgba(64, 70, 55, .045); }
.goal-route-summary-hero { display: grid; gap: 18px; padding: 24px; overflow: hidden; background: linear-gradient(135deg, #fffefb, #f7f4ec); }
.goal-route-summary-copy { min-width: 0; }
.goal-route-summary-copy h2 { margin: 4px 0 2px; font-size: 30px; }
.goal-route-focus-label { margin: 0; color: #537367; }
.goal-route-objective { display: grid; gap: 3px; margin: 15px 0 0; }
.goal-route-objective span, .goal-route-next-line span, .goal-route-context span { color: #7c8d83; font-size: 12px; }
.goal-route-next-line { display: flex; gap: 10px; margin: 12px 0; font-size: 13px; }
.goal-route-continue { min-height: 40px; }
.goal-route-micro { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 14px 2px 2px; }
.goal-route-micro > div { display: grid; min-width: 0; gap: 3px; flex: 1; text-align: center; }
.goal-route-micro i { display: grid; width: 18px; height: 18px; place-self: center; border: 2px solid #a9bdb0; border-radius: 50%; color: #fff; font-size: 11px; font-style: normal; }
.goal-route-micro .passed i { border-color: #83aa91; background: #83aa91; }
.goal-route-micro .current i { border: 5px solid #39735c; background: #f5f7ef; }
.goal-route-micro span { color: #86958d; font-size: 10px; }
.goal-route-micro strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.goal-route-micro > b { color: #b4c0b6; }
.goal-route-section { padding: 20px 22px; }
.goal-route-section > h2, .goal-route-context > h2, .goal-outcome-comparison h2, .goal-review-narrative h2, .goal-review-changes h2, .goal-review-adjustment h2 { margin: 0; font-size: 17px; }
.goal-route-section > p { margin: 5px 0 16px; color: #738178; font-size: 13px; }
.goal-route-milestones { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.goal-route-milestone { position: relative; display: grid; gap: 5px; min-width: 0; padding: 12px; border-radius: 12px; background: #faf8f2; }
.goal-route-milestone i { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #d8d5ca; border-radius: 50%; color: #879188; font-size: 11px; font-style: normal; }
.goal-route-milestone.current { background: #edf5ef; }
.goal-route-milestone.current i, .goal-route-milestone.passed i { border-color: #6e9b7d; color: #39735c; }
.goal-route-milestone strong { font-size: 13px; }
.goal-route-milestone small { color: #77877d; font-size: 11px; line-height: 1.45; }
.goal-route-focus-flow, .goal-outcome-comparison > div { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.goal-route-focus-flow > div, .goal-outcome-comparison article { min-width: 0; padding: 12px; border: 1px solid #eee7dc; border-radius: 11px; background: #fcfaf6; }
.goal-route-focus-flow > div.current, .goal-outcome-comparison article.current { border-color: #cee0d3; background: #edf5ef; }
.goal-route-focus-flow span, .goal-outcome-comparison span { display: block; margin-bottom: 5px; color: #829187; font-size: 11px; }
.goal-route-focus-flow strong { display: block; font-size: 13px; }
.goal-route-why p { max-width: 760px; margin-bottom: 0; color: #4a6157; }
.goal-route-details { padding: 0 2px; border-top: 1px solid #e9e3d8; }
.goal-route-details > summary { padding: 16px 0; color: #416b59; cursor: pointer; font-size: 13px; font-weight: 600; }
.goal-route-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; padding: 4px 0 16px; }
.goal-route-details-grid article { display: grid; gap: 5px; padding: 12px; border: 1px solid #ede6da; border-radius: 10px; background: #fcfaf6; }
.goal-route-details-grid article.current { border-color: #cee0d3; background: #edf5ef; }
.goal-route-details-grid span { color: #7f9086; font-size: 11px; }
.goal-route-details-grid strong { font-size: 13px; }
.goal-route-details-grid p { margin: 0; color: #64766c; font-size: 12px; line-height: 1.55; }
.goal-route-context { display: grid; align-content: start; gap: 12px; }
.goal-route-context > h2 { padding: 3px 4px; color: #355f4e; font-size: 15px; }
.goal-route-context > section { display: grid; gap: 7px; padding: 16px; }
.goal-route-context strong { color: #365f4f; font-size: 15px; }
.goal-route-context small, .goal-route-context p { margin: 0; color: #66796f; font-size: 12px; line-height: 1.6; }
.goal-resource-block > .goal-muted { margin-top: -4px; }
.goal-outcome-comparison { margin: 18px 0; padding: 20px; }
.goal-outcome-comparison > div { margin-top: 14px; }
.goal-outcome-comparison p { margin: 0; color: #596c62; font-size: 13px; line-height: 1.55; }
.goal-review-narrative { padding: 22px 24px; background: linear-gradient(135deg, #fffefb, #f7f4ec); }
.goal-review-narrative h2 { margin-top: 6px; font-size: 22px; }
.goal-review-narrative > p:last-child { margin-bottom: 0; color: #65776d; }
.goal-review-changes, .goal-review-adjustment { margin-top: 16px; padding: 20px 22px; }
.goal-review-changes > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 13px; }
.goal-review-changes article { padding: 12px; border-radius: 10px; background: #faf8f3; color: #4c6459; font-size: 13px; line-height: 1.55; }
.goal-review-adjustment p { color: #496356; }
.goal-review-adjustment small { color: #74857b; }

@media (min-width: 961px) {
  .goal-route-layout { grid-template-columns: minmax(0, 1fr) 270px; align-items: start; }
  .goal-route-summary-hero { grid-template-columns: minmax(0, 1.15fr) minmax(270px, .85fr); min-height: 220px; padding: 24px 26px; }
  .goal-route-micro { align-self: center; padding: 24px 0; }
}

@media (max-width: 720px) {
  .goal-route-summary-hero, .goal-route-section, .goal-route-context > section, .goal-outcome-comparison, .goal-review-narrative, .goal-review-changes, .goal-review-adjustment { border-radius: 14px; }
  .goal-route-summary-hero { padding: 17px; }
  .goal-route-summary-copy h2 { font-size: 24px; }
  .goal-route-context { display: none; }
  .goal-route-focus-flow, .goal-outcome-comparison > div { grid-template-columns: 1fr; }
  .goal-route-focus-flow > b, .goal-outcome-comparison > div > b { display: none; }
}
