/* Shared sizing; deliberately scoped to the audited portal surfaces.
   Keep tool routes, authentication and metering independent of presentation. */
:root {
  --layout-reading-width: 1320px;
  --layout-work-width: 1440px;
  --layout-gutter: clamp(16px, 2.4vw, 32px);
  --layout-body: 1rem;
  --layout-small: .8125rem;
  --layout-card-title: 1.25rem;
  --layout-control: 44px;
}

/* Tool discovery: one filter surface, equal-width cards, content-driven heights. */
.tools-page .tools-hero__inner {
  width: min(var(--layout-reading-width), calc(100% - 2 * var(--layout-gutter)));
  min-height: 0; padding: 26px 0; gap: 28px;
  grid-template-columns: minmax(0, 1fr) 300px;
}
.tools-page .tools-hero h1 { font-size: clamp(1.75rem, 2.8vw, 2.5rem); margin: 8px 0 10px; line-height: 1.22; }
.tools-page .tools-hero__copy p { font-size: .9375rem; line-height: 1.7; }
.tools-page .tools-hero__copy > span { font-size: .6875rem; }
.tools-page .tools-hero__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; padding: 10px; gap: 8px; border-radius: 16px; }
.tools-page .tools-hero__facts > div:nth-child(n) { grid-row: auto; min-height: 0; padding: 10px 4px; gap: 6px; justify-content: center; }
.tools-page .tools-hero__facts > div:nth-child(n) strong { font-size: 1.625rem; }
.tools-page .tools-hero__facts span { font-size: .75rem; }
/* These task buttons duplicate the immediately following library filters. */
.tools-page .tools-journey { display: none; }
.tools-page .tools-library { width: min(var(--layout-reading-width), calc(100% - 2 * var(--layout-gutter))); padding: 24px 0 48px; }
.tools-page .tools-library__heading { grid-template-columns: minmax(0, 1fr) minmax(260px, 440px); gap: 20px; align-items: center; }
.tools-page .tools-library__heading h2 { font-size: 1.375rem; margin: 0; }
.tools-page .tools-library__heading p, .tools-page .tools-library__heading > div > span { display: none; }
.tools-page .tool-search { min-height: 46px; }
.tools-page .tool-search input { font-size: 1rem; }
.tools-page .tool-filters { margin-top: 14px; gap: 8px; }
.tools-page .tool-filters button { min-height: var(--layout-control); font-size: .875rem; }
.tools-page .tool-results { margin: 12px 0; font-size: var(--layout-small); }
.tools-page .packmate-feature { min-height: 0; padding: 18px 22px; margin-bottom: 18px; gap: 24px; border-radius: 16px; }
.tools-page .packmate-feature__badge, .tools-page .packmate-feature ul { display: none; }
.tools-page .packmate-feature h2 { font-size: 1.375rem; margin: 0 0 6px; }
.tools-page .packmate-feature p { font-size: .875rem; line-height: 1.6; }
.tools-page .packmate-feature__action { min-height: var(--layout-control); font-size: .875rem; padding: 0 16px; }
.tools-page .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tools-page .tools-grid .tool-card:nth-child(n) { grid-column: auto; min-width: 0; min-height: 0; padding: 20px; }
.tools-page .tool-card__icon { width: 36px; height: 36px; border-radius: 10px; }
.tools-page .tool-card__icon svg { width: 23px; height: 23px; }
.tools-page .tool-card__number { font-size: 1.5rem; }
.tools-page .tool-card__meta { margin-top: 10px; gap: 8px; }
.tools-page .tool-card__meta > span, .tools-page .tool-card__status { font-size: .75rem; }
.tools-page .tool-card__eyebrow { margin-top: 8px; font-size: .6875rem; }
.tools-page .tool-card h2 { font-size: var(--layout-card-title); margin: 7px 0 8px; line-height: 1.35; overflow-wrap: anywhere; }
.tools-page .tool-card__description { min-height: 0; font-size: .9375rem; line-height: 1.65; }
.tools-page .tool-card__use-case { margin-top: 12px; padding: 8px 10px; }
.tools-page .tool-card__use-case p, .tools-page .tool-card__use-case span { font-size: .8125rem; line-height: 1.6; }
.tools-page .tool-card ul { margin: 12px 0; gap: 6px; }
.tools-page .tool-card li { padding: 4px 7px; font-size: .75rem; }
.tools-page .tool-card__footer { padding-top: 10px; }
.tools-page .tool-card__footer > span { font-size: .8125rem; }
.tools-page .tool-card__footer button { min-height: var(--layout-control); font-size: .875rem; }
.tools-page .tools-expert h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }

/* Member overview: make the next action prominent without reducing body text. */
.profile-workspace-view .dashboard-hero { padding: 24px; min-height: 0; gap: 24px; grid-template-columns: minmax(0, 1fr) 300px; }
.profile-workspace-view .dashboard-hero__copy h1 { font-size: clamp(1.625rem, 2.3vw, 2.125rem); line-height: 1.3; }
.profile-workspace-view .dashboard-hero__copy > p { font-size: .9375rem; line-height: 1.7; }
.profile-workspace-view .dashboard-hero__tags { margin-top: 12px; gap: 6px; flex-direction: row; }
.profile-workspace-view .dashboard-hero__tags span { font-size: .75rem; min-height: 30px; }
.profile-workspace-view .dashboard-hero__status { padding: 16px; }
.profile-workspace-view .completion-bar span { font-size: .8125rem; }
.profile-workspace-view .dashboard-hero__status > div:nth-child(2) { margin-top: 12px; padding-top: 10px; }
.profile-workspace-view .dashboard-hero__status > div:nth-child(2) span { font-size: .75rem; }
.profile-workspace-view .dashboard-hero__status > div:nth-child(2) strong { font-size: .8125rem; }
.profile-workspace-view .dashboard-hero__status > button { min-height: var(--layout-control); font-size: .875rem; margin-top: 12px; }
.profile-workspace-view .dashboard-hero__member-number { margin-top: 10px; padding-top: 10px; }
.profile-workspace-view .dashboard-hero__member-number span { font-size: .6875rem; }
.profile-workspace-view .dashboard-hero__member-number small { font-size: .75rem; }
.profile-workspace-view .dashboard-card h2 { font-size: var(--layout-card-title); line-height: 1.35; }
.profile-workspace-view .dashboard-card > p { font-size: .9375rem; line-height: 1.7; }
.profile-workspace-view .dashboard-card > button { font-size: .875rem; min-height: var(--layout-control); }

/* Chat uses the available window height; only the message pane scrolls. */
.packmate-page .packmate-header { min-height: 66px; flex-shrink: 0; }
.packmate-page .packmate-main { flex: none; height: calc(100dvh - 128px); min-height: 400px; grid-template-columns: 290px minmax(0, 1fr); margin: 12px auto; }
.packmate-page .packmate-sidebar { min-height: 0; overflow-y: auto; padding: 22px; }
.packmate-page .packmate-sidebar h1 { font-size: 1.5rem; line-height: 1.3; }
.packmate-page .packmate-sidebar > p { font-size: .875rem; line-height: 1.65; }
.packmate-page .packmate-license-badge small { display: none; }
.packmate-page .packmate-license-badge strong { font-size: .8125rem; }
.packmate-page .packmate-expert-escalation > span { font-size: .8125rem; }
.packmate-page .packmate-expert-escalation > p { font-size: .8125rem; line-height: 1.6; }
.packmate-page .packmate-expert-escalation > button { min-height: var(--layout-control); font-size: .875rem; }
.packmate-page .packmate-workspace { min-height: 0; display: flex; flex-direction: column; }
.packmate-page .packmate-workspace__heading { min-height: 66px; padding: 10px 18px; gap: 12px; flex-shrink: 0; }
.packmate-page .packmate-workspace__heading strong { font-size: .9375rem; }
.packmate-page .packmate-workspace__heading small { font-size: .75rem; line-height: 1.5; }
.packmate-page .packmate-workspace__heading > span { font-size: .8125rem; }
.packmate-page .packmate-messages { flex: 1; min-height: 0; max-height: none; padding: 20px; overscroll-behavior: contain; }
.packmate-page .packmate-message { max-width: 92%; }
.packmate-page .packmate-message p, .packmate-page .packmate-message li { font-size: 1rem; line-height: 1.75; }
.packmate-page .packmate-message small { font-size: .75rem; }
.packmate-page .packmate-composer { flex-shrink: 0; padding: 12px 16px; }
.packmate-page .packmate-composer textarea { font-size: 1rem; min-height: 68px; }
.packmate-page .packmate-error { flex-shrink: 0; font-size: .875rem; }
.packmate-page .packmate-footer { flex-shrink: 0; }

@media (max-width: 1000px) {
  .tools-page .tools-hero__inner { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tools-page .tools-hero__facts { max-width: 480px; }
  .tools-page .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-workspace-view .dashboard-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .profile-workspace-view .dashboard-hero__status { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 20px; align-items: center; }
  .profile-workspace-view .dashboard-hero__status > div:nth-child(2) { margin: 0; padding: 0; border: 0; }
  .profile-workspace-view .dashboard-hero__status > button { margin: 0; }
  .profile-workspace-view .dashboard-hero__member-number { grid-column: 2; grid-row: 2; margin: 0; padding: 0; border: 0; }
}
@media (max-width: 700px) {
  #top .hero-inner { min-height: 0; padding: 26px 0 20px; }
  #top .hero-copy { width: 100%; }
  #top .hero h1 { font-size: clamp(1.875rem, 8.5vw, 2.25rem); line-height: 1.2; }
  #top .hero-copy p { max-width: 100%; font-size: 1rem; line-height: 1.7; }
  #top .role-entries { position: relative; inset: auto; margin-top: 28px; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #top .role-entry { min-height: 72px; padding: 12px 14px; grid-template-columns: 42px minmax(0, 1fr) 22px; gap: 12px; }
  #top .role-entry__icon { width: 42px; height: 42px; }
  #top .role-entry__icon svg { width: 32px; height: 32px; }
  #top .role-entry__copy strong { font-size: 1.125rem; }
  .tools-page .tools-hero__inner { padding: 20px 0; gap: 12px; }
  .tools-page .tools-hero__copy > span, .tools-page .tools-hero__copy p { display: none; }
  .tools-page .tools-hero h1 { margin: 0; }
  .tools-page .tools-hero__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px; gap: 4px; max-width: none; }
  .tools-page .tools-hero__facts > div:nth-child(n) { padding: 6px; }
  .tools-page .tools-hero__facts > div:nth-child(n) strong { font-size: 1.375rem; }
  .tools-page .tools-hero__facts span { font-size: .6875rem; }
  .tools-page .tools-library { padding-top: 16px; }
  .tools-page .tools-library__heading { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tools-page .tools-library__heading > div { display: none; }
  .tools-page .tool-filters { gap: 6px; margin-top: 10px; }
  .tools-page .tool-filters button { font-size: .8125rem; padding: 0 12px; }
  .tools-page .packmate-feature { padding: 16px; gap: 12px; grid-template-columns: minmax(0, 1fr); }
  .tools-page .packmate-feature__action { justify-self: start; }
  .tools-page .tools-grid { grid-template-columns: minmax(0, 1fr); }
  .tools-page .tools-grid .tool-card:nth-child(n) { grid-column: auto; }
  .tools-page .tool-card__description { font-size: 1rem; }
  .profile-workspace-view .dashboard-hero { padding: 20px; }
  .profile-workspace-view .dashboard-hero__copy h1 { font-size: 1.625rem; }
  .profile-workspace-view .dashboard-hero__tags { flex-wrap: wrap; }
  .profile-workspace-view .dashboard-hero__status { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .profile-workspace-view .dashboard-hero__status > div:nth-child(2) { display: none; }
  .profile-workspace-view .dashboard-hero__member-number { grid-column: auto; grid-row: auto; }
  .profile-workspace-view .dashboard-hero__member-number small { display: none; }
  .packmate-page .packmate-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); margin: 6px auto; height: calc(100dvh - 116px); }
  .packmate-page .packmate-sidebar { padding: 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; overflow: visible; }
  .packmate-page .packmate-sidebar h1 { font-size: 1rem; margin: 0; }
  .packmate-page .packmate-sidebar > span, .packmate-page .packmate-sidebar > p,
  .packmate-page .packmate-license-badge { display: none; }
  .packmate-page .packmate-expert-escalation { margin: 0; padding: 0; border: 0; background: transparent; }
  .packmate-page .packmate-expert-escalation > span, .packmate-page .packmate-expert-escalation > p { display: none; }
  .packmate-page .packmate-expert-escalation > button { margin: 0; padding: 0 12px; white-space: nowrap; }
  .packmate-page .packmate-workspace__heading { padding: 10px 12px; }
  .packmate-page .packmate-workspace__heading > span { display: none; }
  .packmate-page .packmate-messages { padding: 14px 12px; }
  .packmate-page .packmate-message { max-width: 100%; gap: 8px; }
  .packmate-page .packmate-message > div { padding: 12px; }
  .packmate-page .packmate-composer { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
}

.profile-workspace-view .dashboard-card p { font-size: .8755rem; line-height: 1.7; }
.packmate-page .packmate-starters button { font-size: .8125rem; line-height: 1.6; }
.packmate-page .packmate-starters > span, .packmate-page .packmate-boundary small { font-size: .75rem; }
@media (max-width: 700px) {
  #top .hero { min-height: 0; height: auto; }
  #top .hero h1, .tools-page .tools-hero h1 { text-wrap: balance; }
}
@media (min-width: 701px) and (max-width: 1000px) {
  .tools-page .tools-header__inner { grid-template-columns: minmax(0, 1fr) auto; min-height: 72px; gap: 16px; }
  .tools-page .tools-header__section { display: none; }
  .tools-page .tools-header__actions { white-space: nowrap; }
  .packmate-page .packmate-header { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .packmate-page .packmate-header > span { display: none; }
}
@media (max-width: 380px) {
  .personal-header .personal-header__inner { width: calc(100% - 20px); grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .personal-header .personal-brand { width: 112px; max-width: 100%; }
  .personal-header .personal-header__actions { gap: 6px; }
}
@media (min-width: 701px) and (max-width: 900px) {
  #top .hero { min-height: 0; height: auto; }
  #top .hero-inner { min-height: 0; padding: 28px 0 22px; }
  #top .hero-copy { width: 100%; }
  #top .hero h1 { font-size: 2.5rem; }
  #top .role-entries { position: relative; inset: auto; margin-top: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  #top .role-entry { padding: 14px; min-height: 100px; grid-template-columns: 28px minmax(0, 1fr) 18px; gap: 8px; }
  #top .role-entry__icon { width: 28px; height: 34px; }
  #top .role-entry__icon svg { width: 25px; height: 25px; }
  #top .role-entry__copy strong { font-size: 1rem; }
}
