/* =========================================================================
   PlacementFlow — Tips & discussions (student app.html).
   V6 of the Common Room page: three spaces, one discussion feed with up/down
   votes, sort + timeframe + a compact filter control, and on wide screens a
   feed-and-reader split. Fresh td-* classes; tp-* toolbar, status, compose and
   sheet rules carry over. Scoped to body.app-dashboard .tips-page (+ the
   header-lent .tp-page-actions node). The page frame sheet owns the frame,
   header and toolbar spacing. No !important.
   ========================================================================= */

body.app-dashboard .tips-page {
  --tp-brand: var(--pf-brand, #1f6fd6);
  --tp-brand-2: var(--pf-brand-2, #1559b0);
  --tp-brand-tint: var(--pf-brand-tint, #eaf2fd);
  --tp-brand-line: #bcd6f5;
  --tp-ink: var(--pf-brand-ink, #16233f);
  --tp-body: #33415c;
  --tp-slate: var(--pf-ink-2, #5d6b84);
  --tp-mist: var(--pf-ink-3, #8a97ad);
  --tp-line: var(--pf-line, #e9edf4);
  --tp-line-soft: #f1f4f9;
  --tp-ground: var(--pf-bg, #f6f8fc);
  --tp-surface: var(--pf-surface, #fff);
  --tp-green: var(--pf-green, #1a9e54);
  --tp-green-ink: #157a42;
  --tp-green-line: #bfe3cf;
  --tp-green-tint: #f2faf5;
  --tp-teal: var(--pf-teal, #0d9488);
  --tp-teal-ink: #0b7a70;
  --tp-teal-line: #bfe3de;
  --tp-teal-tint: #e9f7f5;
  --tp-amber: var(--pf-amber, #e08a1e);
  --tp-amber-ink: #b96f0c;
  --tp-amber-line: #f0d9b0;
  --tp-amber-tint: var(--pf-amber-tint, #fdf1df);
  --tp-team: #6a4bc4;
  --tp-red: #b3261e;
  --tp-down: #b3261e;
  --tp-down-tint: #fdf0ef;
  --tp-r: var(--pf-r, 14px);
  --tp-r-sm: var(--pf-r-sm, 10px);
  --tp-display: var(--font-application-display);
  --tp-ease: 140ms cubic-bezier(0.3, 0.7, 0.4, 1);
  --td-year: #1f6fd6;
  --td-year-tint: #eaf2fd;
  --td-exams: #b96f0c;
  --td-exams-tint: #fdf1df;
  --td-placement: #0b7a70;
  --td-placement-tint: #e9f7f5;
  --td-topbar: 66px;
  color: var(--tp-ink);
  /* the feed/reader split decides on THIS element's width: the content width
     after the app sidebar and the frame gutters, whatever the viewport */
  container-type: inline-size;
  container-name: tips;
}

/* visually hidden, read by assistive tech */
body.app-dashboard .tips-page .tp-sr,
body.app-dashboard .tp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- page-level actions (lent to the shared header) ---------- */
body.app-dashboard .tp-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.app-dashboard .tp-page-actions .tp-cta {
  display: flex;
  gap: 8px;
}
body.app-dashboard .tp-page-actions .tp-cta .btn.is-hidden {
  display: none;
}
body.app-dashboard .td-quiet-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--pf-line, #e9edf4);
  border-radius: 10px;
  background: var(--pf-surface, #fff);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--pf-ink-2, #5d6b84);
  cursor: pointer;
}
body.app-dashboard .td-quiet-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}
body.app-dashboard .td-quiet-btn:hover {
  background: var(--pf-bg, #f6f8fc);
  color: var(--pf-ink, #1b2740);
}
body.app-dashboard .td-quiet-btn:focus-visible,
body.app-dashboard .tp-info-btn:focus-visible {
  outline: 2px solid var(--pf-brand, #1f6fd6);
  outline-offset: 2px;
}
body.app-dashboard .tp-info-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--pf-line, #e9edf4);
  background: var(--pf-surface, #fff);
  color: var(--pf-ink-2, #5d6b84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  padding: 0;
}
body.app-dashboard .tips-page .tp-info-btn--inline {
  display: none;
}

/* ---------- the three spaces ---------- */
body.app-dashboard .tips-page .td-spaces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
body.app-dashboard .tips-page .td-space {
  position: relative;
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r);
  background: var(--tp-ground);
  padding: 11px 14px 10px;
  font-family: inherit;
  color: var(--tp-slate);
  cursor: pointer;
  min-width: 0;
  transition: background-color var(--tp-ease), border-color var(--tp-ease), box-shadow var(--tp-ease);
}
body.app-dashboard .tips-page .td-space--year { --td-dot: var(--td-year); --td-tint: var(--td-year-tint); }
body.app-dashboard .tips-page .td-space--exams { --td-dot: var(--td-exams); --td-tint: var(--td-exams-tint); }
body.app-dashboard .tips-page .td-space--placement { --td-dot: var(--td-placement); --td-tint: var(--td-placement-tint); }
body.app-dashboard .tips-page .td-space:hover {
  background: var(--tp-surface);
  border-color: #cfd8e6;
}
body.app-dashboard .tips-page .td-space.is-active {
  background: var(--td-tint, var(--tp-surface));
  border-color: var(--td-dot, var(--tp-ink));
  box-shadow: inset 3px 0 0 var(--td-dot, var(--tp-ink));
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-space.is-active .td-space-sub { color: var(--tp-body); }
body.app-dashboard .tips-page .td-space-count em {
  font-style: normal;
  color: var(--tp-amber-ink);
}
body.app-dashboard .tips-page .td-space.is-unavailable {
  border-style: dashed;
  background: transparent;
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-space:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 2px;
}
body.app-dashboard .tips-page .td-space-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
body.app-dashboard .tips-page .td-space-name::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
  background: var(--td-dot, var(--tp-mist));
}
body.app-dashboard .tips-page .td-space.is-unavailable .td-space-name::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--tp-mist);
}
body.app-dashboard .tips-page .td-space.is-active .td-space-name {
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-space-sub {
  font-size: 12px;
  line-height: 1.4;
  color: var(--tp-slate);
  overflow-wrap: anywhere;
}
body.app-dashboard .tips-page .td-space.is-unavailable .td-space-sub {
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-space-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tp-mist);
  font-variant-numeric: tabular-nums;
}

body.app-dashboard .tips-page .td-audience {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-audience[hidden] {
  display: none;
}
body.app-dashboard .tips-page .td-audience b {
  font-weight: 600;
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-audience-short {
  display: none;
}
body.app-dashboard .tips-page .td-audience-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--tp-mist);
}
body.app-dashboard .tips-page .td-audience-dot--year { background: var(--td-year); }
body.app-dashboard .tips-page .td-audience-dot--exams { background: var(--td-exams); }
body.app-dashboard .tips-page .td-audience-dot--placement { background: var(--td-placement); }

/* ---------- one toolbar: search · type · sort · timeframe · filter ---------- */
body.app-dashboard .tips-page .tp-filters.is-hidden {
  display: none;
}
body.app-dashboard .tips-page .tp-search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--tp-surface);
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  min-height: 40px;
  padding: 0 12px;
  color: var(--tp-mist);
  cursor: text;
  max-width: 360px;
  transition: border-color var(--tp-ease), box-shadow var(--tp-ease);
}
body.app-dashboard .tips-page .tp-search svg {
  width: 16px;
  height: 16px;
  flex: none;
}
body.app-dashboard .tips-page .tp-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  color: var(--tp-ink);
  padding: 8px 0;
  -webkit-appearance: none;
  appearance: none;
}
body.app-dashboard .tips-page .tp-search input::placeholder {
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .tp-search:focus-within {
  border-color: #9fb0cf;
  box-shadow: 0 0 0 3px rgba(34, 52, 92, 0.07);
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .tp-seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #e6eaf2;
  border-radius: 12px;
  max-width: 100%;
  box-sizing: border-box;
}
body.app-dashboard .tips-page .tp-chip {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-slate);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--tp-ease), color var(--tp-ease), box-shadow var(--tp-ease);
}
body.app-dashboard .tips-page .tp-chip [data-tp-count] {
  font-size: 11px;
  font-weight: 600;
  color: var(--tp-mist);
  font-variant-numeric: tabular-nums;
}
body.app-dashboard .tips-page .tp-chip:hover {
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .tp-chip.is-active {
  background: var(--tp-surface);
  color: var(--tp-ink);
  box-shadow: 0 1px 3px rgba(20, 33, 64, 0.14);
}
body.app-dashboard .tips-page .tp-chip.is-active [data-tp-count] {
  color: #22345c;
}

body.app-dashboard .tips-page .td-sortbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
body.app-dashboard .tips-page .td-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  background: var(--tp-surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-slate);
  cursor: pointer;
}
body.app-dashboard .tips-page .td-select[hidden] {
  display: none;
}
body.app-dashboard .tips-page .td-select-label {
  color: var(--tp-mist);
  font-weight: 500;
}
body.app-dashboard .tips-page .td-select select {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-ink);
  padding: 6px 0;
  cursor: pointer;
  min-width: 0;
}
body.app-dashboard .tips-page .td-select:focus-within {
  border-color: #9fb0cf;
  box-shadow: 0 0 0 3px rgba(34, 52, 92, 0.07);
}
body.app-dashboard .tips-page .td-select select:focus-visible {
  outline: none;
}

/* the compact filter control: a native disclosure, styled */
body.app-dashboard .tips-page .td-filter {
  position: relative;
}
body.app-dashboard .tips-page .td-filter-summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  background: var(--tp-surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-slate);
  cursor: pointer;
  user-select: none;
}
body.app-dashboard .tips-page .td-filter-summary::-webkit-details-marker {
  display: none;
}
body.app-dashboard .tips-page .td-filter-summary::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6h16M7 12h10M10 18h4'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6h16M7 12h10M10 18h4'/></svg>") center / contain no-repeat;
}
body.app-dashboard .tips-page .td-filter.is-active .td-filter-summary,
body.app-dashboard .tips-page .td-filter[open] .td-filter-summary {
  border-color: var(--tp-brand-line);
  background: var(--tp-brand-tint);
  color: var(--tp-brand-2);
}
body.app-dashboard .tips-page .td-filter-summary:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 2px;
}
body.app-dashboard .tips-page .td-filter-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--tp-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
body.app-dashboard .tips-page .td-filter-count[hidden] {
  display: none;
}
body.app-dashboard .tips-page .td-filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px 10px;
  border: 1px solid var(--tp-line);
  border-radius: 14px;
  background: var(--tp-surface);
  box-shadow: 0 12px 34px -14px rgba(20, 33, 64, 0.35);
}
body.app-dashboard .tips-page .td-filter-group {
  border: 0;
  margin: 0 0 8px;
  padding: 0;
  min-width: 0;
}
body.app-dashboard .tips-page .td-filter-group legend {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tp-mist);
  padding: 0;
  margin-bottom: 4px;
}
body.app-dashboard .tips-page .td-filter-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  font-size: 13px;
  color: var(--tp-ink);
  cursor: pointer;
}
body.app-dashboard .tips-page .td-filter-opt input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--tp-brand);
  flex: none;
}
body.app-dashboard .tips-page .td-filter-opt input:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 2px;
}
body.app-dashboard .tips-page .td-filter-opt span:first-of-type {
  flex: 1;
}
body.app-dashboard .tips-page .td-filter-n {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tp-mist);
  font-variant-numeric: tabular-nums;
}
body.app-dashboard .tips-page .td-filter-foot {
  border-top: 1px solid var(--tp-line-soft);
  padding-top: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
body.app-dashboard .tips-page .td-filter-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-link-btn {
  border: 0;
  background: none;
  padding: 4px 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-brand-2);
  cursor: pointer;
  white-space: nowrap;
}
body.app-dashboard .tips-page .td-link-btn:hover {
  text-decoration: underline;
}
body.app-dashboard .tips-page .td-link-btn:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* active filters, shown and removable */
body.app-dashboard .tips-page .td-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 12px;
}
body.app-dashboard .tips-page .td-active-filters[hidden] {
  display: none;
}
body.app-dashboard .tips-page .td-chips-label {
  font-size: 12px;
  color: var(--tp-mist);
  margin-right: 2px;
}
body.app-dashboard .tips-page .td-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--tp-brand-line);
  border-radius: 999px;
  background: var(--tp-brand-tint);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--tp-brand-2);
  cursor: pointer;
}
body.app-dashboard .tips-page .td-chip span {
  font-size: 11px;
}
body.app-dashboard .tips-page .td-chip:hover {
  background: #dbe8fb;
}
body.app-dashboard .tips-page .td-chip:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 2px;
}

/* ---------- status lines, notices, the space panel ---------- */
body.app-dashboard .tips-page .tp-status {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tp-slate);
  margin: 0 0 12px;
}
body.app-dashboard .tips-page .tp-status.is-error { color: var(--tp-red); }
body.app-dashboard .tips-page .tp-status.is-success { color: var(--tp-green); }
body.app-dashboard .tips-page .tp-status.is-hidden { display: none; }
body.app-dashboard .tips-page .tp-offline-note {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  background: var(--tp-ground);
  font-size: 13px;
  line-height: 1.5;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .tp-offline-note.is-hidden { display: none; }
body.app-dashboard .tips-page .tp-band.is-hidden { display: none; }
body.app-dashboard .tips-page .td-panel {
  max-width: 640px;
  padding: 24px 22px;
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r);
  background: var(--tp-ground);
}
body.app-dashboard .tips-page .td-panel.is-hidden { display: none; }
body.app-dashboard .tips-page .td-panel b {
  display: block;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-panel p {
  margin: 6px 0 0;
  max-width: 58ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-panel .btn {
  margin-top: 14px;
}

/* ---------- layout: the feed, and the reader beside it ---------- */
body.app-dashboard .tips-page .td-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
  background: var(--tp-ground);
}
body.app-dashboard .tips-page .td-feed-col {
  min-width: 0;
}
body.app-dashboard .tips-page .td-feed {
  display: grid;
  gap: 10px;
}
body.app-dashboard .tips-page .td-quick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
/* popular this week: a quiet discovery line, only when it earns its place */
body.app-dashboard .tips-page .td-popular {
  display: grid;
  gap: 6px;
  padding: 10px 12px 10px;
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  background: var(--tp-surface);
}
body.app-dashboard .tips-page .td-popular-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-popular-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px 14px;
}
body.app-dashboard .tips-page .td-popular-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 0;
  border-left: 3px solid var(--tp-brand-line);
  background: none;
  padding: 2px 0 2px 10px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  transition: border-color var(--tp-ease), background-color var(--tp-ease);
}
body.app-dashboard .tips-page .td-popular-item:hover {
  border-left-color: var(--tp-brand);
  background: var(--tp-ground);
}
body.app-dashboard .tips-page .td-popular-item:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 2px;
}
body.app-dashboard .tips-page .td-popular-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--tp-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.app-dashboard .tips-page .td-popular-item:hover .td-popular-title { color: var(--tp-brand-2); }
body.app-dashboard .tips-page .td-popular-meta {
  font-size: 12px;
  color: var(--tp-mist);
  font-variant-numeric: tabular-nums;
}
body.app-dashboard .tips-page .td-popular-score {
  font-weight: 700;
  color: var(--tp-brand-2);
}
body.app-dashboard .tips-page .td-feed.is-hidden { display: none; }
body.app-dashboard .tips-page .td-shelf-label {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-reader {
  display: none;
}

/* ---------- vote controls ---------- */
body.app-dashboard .tips-page .td-vote {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--tp-slate);
  font-variant-numeric: tabular-nums;
}
body.app-dashboard .tips-page .td-vote--rail {
  flex-direction: column;
  gap: 0;
  padding: 2px 0;
}
body.app-dashboard .tips-page .td-vote-btn {
  width: 34px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--tp-slate);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color var(--tp-ease), color var(--tp-ease), border-color var(--tp-ease);
}
body.app-dashboard .tips-page .td-vote-btn svg {
  width: 18px;
  height: 18px;
}
body.app-dashboard .tips-page .td-vote-btn:hover {
  background: var(--tp-ground);
  border-color: var(--tp-line);
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-vote-btn--up:hover { color: var(--tp-brand-2); }
body.app-dashboard .tips-page .td-vote-btn--down:hover { color: var(--tp-down); }
body.app-dashboard .tips-page .td-vote-btn--up.is-on {
  color: #fff;
  background: var(--tp-brand);
  border-color: var(--tp-brand);
}
body.app-dashboard .tips-page .td-vote-btn--down.is-on {
  color: #fff;
  background: var(--tp-down);
  border-color: var(--tp-down);
}
body.app-dashboard .tips-page .td-vote-btn:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 1px;
}
body.app-dashboard .tips-page .td-score {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--tp-ink);
  line-height: 1;
  padding: 3px 0;
}
body.app-dashboard .tips-page .td-vote.is-up .td-score { color: var(--tp-brand-2); }
body.app-dashboard .tips-page .td-vote.is-down .td-score { color: var(--tp-down); }
body.app-dashboard .tips-page .td-vote--pill,
body.app-dashboard .tips-page .td-vote--thread {
  border: 1px solid var(--tp-line);
  border-radius: 999px;
  padding: 1px 2px;
  background: var(--tp-surface);
}
body.app-dashboard .tips-page .td-vote--pill .td-vote-btn {
  width: 30px;
  height: 28px;
  border-radius: 999px;
}
body.app-dashboard .tips-page .td-vote--pill .td-vote-btn svg {
  width: 15px;
  height: 15px;
}
body.app-dashboard .tips-page .td-vote--pill .td-score {
  font-size: 12.5px;
  min-width: 18px;
}
body.app-dashboard .tips-page .td-vote--thread {
  padding: 2px 4px 2px 2px;
  gap: 4px;
}
body.app-dashboard .tips-page .td-voters {
  font-size: 12px;
  font-weight: 500;
  color: var(--tp-mist);
  padding: 0 6px 0 2px;
  white-space: nowrap;
}

/* ---------- the discussion card ---------- */
body.app-dashboard .tips-page .td-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "vote main"
    "vote aside"
    "vote foot";
  column-gap: 12px;
  row-gap: 0;
  background: var(--tp-surface);
  border: 1px solid var(--tp-line);
  border-radius: 14px;
  padding: 12px 16px 10px 10px;
  min-width: 0;
  transition: border-color var(--tp-ease), box-shadow var(--tp-ease);
}
body.app-dashboard .tips-page .td-card:hover {
  border-color: #cfd8e6;
  box-shadow: 0 6px 18px -14px rgba(20, 33, 64, 0.35);
}
/* questions lead with the conversation: an amber hairline at the top of the
   card and the reply affordance as a spoken line */
body.app-dashboard .tips-page .td-card--question {
  border-top: 3px solid var(--tp-amber-line);
}
body.app-dashboard .tips-page .td-card--question .td-activity::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12a8 8 0 0 1-8 8H8l-5 3 1.6-4.5A8 8 0 1 1 21 12z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12a8 8 0 0 1-8 8H8l-5 3 1.6-4.5A8 8 0 1 1 21 12z'/></svg>") center / contain no-repeat;
}
/* tips carry more of their content up front */
body.app-dashboard .tips-page .td-card--tip .td-body.is-clamped,
body.app-dashboard .tips-page .td-card--clinician .td-body.is-clamped,
body.app-dashboard .tips-page .td-card--team .td-body.is-clamped {
  -webkit-line-clamp: 4;
}
body.app-dashboard .tips-page .td-card--tip .td-body,
body.app-dashboard .tips-page .td-card--clinician .td-body,
body.app-dashboard .tips-page .td-card--team .td-body {
  font-size: 14.5px;
  line-height: 1.6;
}
body.app-dashboard .tips-page .td-card--clinician {
  border-left: 3px solid var(--tp-teal-line);
}
body.app-dashboard .tips-page .td-card--question .td-body.is-clamped {
  -webkit-line-clamp: 2;
}
body.app-dashboard .tips-page .td-card > .td-vote { grid-area: vote; align-self: start; }
body.app-dashboard .tips-page .td-card > .td-main { grid-area: main; min-width: 0; }
body.app-dashboard .tips-page .td-card > .td-aside { grid-area: aside; min-width: 0; }
body.app-dashboard .tips-page .td-card > .td-foot { grid-area: foot; }
body.app-dashboard .tips-page .td-aside:empty { display: none; }

body.app-dashboard .tips-page .td-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--tp-mist);
  min-width: 0;
}
body.app-dashboard .tips-page .td-meta .td-avatar {
  margin-right: 2px;
}
body.app-dashboard .tips-page .td-name {
  font-weight: 600;
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-role::before,
body.app-dashboard .tips-page .td-when::before {
  content: "\00b7";
  margin-right: 6px;
  color: #c3ccdb;
}
body.app-dashboard .tips-page .td-role {
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-kind {
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--tp-ground);
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-kind--question { background: var(--tp-amber-tint); color: var(--tp-amber-ink); }
body.app-dashboard .tips-page .td-kind--clinician { background: var(--tp-green-tint); color: var(--tp-green-ink); }
body.app-dashboard .tips-page .td-kind--team { background: #f1edfc; color: var(--tp-team); }
body.app-dashboard .tips-page .td-scope {
  font-weight: 600;
  color: var(--tp-teal-ink);
}
body.app-dashboard .tips-page .td-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: #e6eaf2;
  color: #34456b;
}
body.app-dashboard .tips-page .td-avatar--sm { width: 24px; height: 24px; font-size: 10px; }
body.app-dashboard .tips-page .td-avatar--xs { width: 18px; height: 18px; font-size: 8.5px; }
body.app-dashboard .tips-page .td-avatar--anon {
  background: var(--tp-ground);
  color: var(--tp-mist);
  box-shadow: inset 0 0 0 1px var(--tp-line);
}
body.app-dashboard .tips-page .td-avatar--t0 { background: #e3edfb; color: #1c4f9c; }
body.app-dashboard .tips-page .td-avatar--t1 { background: #e0f4f1; color: #0b6d64; }
body.app-dashboard .tips-page .td-avatar--t2 { background: #ede8fb; color: #5236a8; }
body.app-dashboard .tips-page .td-avatar--t3 { background: #fdeedb; color: #8c5307; }
body.app-dashboard .tips-page .td-avatar--t4 { background: #fbe6e9; color: #a02f45; }
body.app-dashboard .tips-page .td-avatar--t5 { background: #e3f4e8; color: #1d6b3c; }

body.app-dashboard .tips-page .td-title {
  margin: 5px 0 0;
}
body.app-dashboard .tips-page .td-title-btn {
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--tp-ink);
  text-align: left;
  cursor: pointer;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  max-width: 72ch;
  transition: color var(--tp-ease);
}
body.app-dashboard .tips-page .td-title-btn:hover {
  color: var(--tp-brand-2);
}
body.app-dashboard .tips-page .td-body {
  margin: 5px 0 0;
  max-width: 66ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--tp-body);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
body.app-dashboard .tips-page .td-body.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.app-dashboard .tips-page .td-more {
  margin-top: 3px;
  border: 0;
  background: none;
  padding: 2px 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-brand-2);
  cursor: pointer;
}
body.app-dashboard .tips-page .td-more:hover {
  text-decoration: underline;
}

/* the best answer, previewed */
body.app-dashboard .tips-page .td-preview {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin-top: 10px;
  border: 0;
  border-left: 3px solid #d5dce8;
  border-radius: 0 10px 10px 0;
  background: var(--tp-ground);
  padding: 8px 12px 9px 11px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  color: var(--tp-body);
}
body.app-dashboard .tips-page .td-preview--reviewed {
  border-left-color: var(--tp-green);
  background: var(--tp-green-tint);
}
body.app-dashboard .tips-page .td-preview--clinician {
  border-left-color: var(--tp-teal);
  background: var(--tp-teal-tint);
}
body.app-dashboard .tips-page .td-preview--accepted {
  border-left-color: var(--tp-brand);
  background: var(--tp-brand-tint);
}
body.app-dashboard .tips-page .td-preview--none {
  cursor: default;
  font-size: 12.5px;
  color: var(--tp-mist);
  margin-top: 8px;
}
body.app-dashboard .tips-page .td-preview-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-preview--reviewed .td-preview-label { color: var(--tp-green-ink); }
body.app-dashboard .tips-page .td-preview--clinician .td-preview-label { color: var(--tp-teal-ink); }
body.app-dashboard .tips-page .td-preview--accepted .td-preview-label { color: var(--tp-brand-2); }
body.app-dashboard .tips-page .td-preview-who {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-preview-who b {
  font-weight: 600;
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-preview-score {
  font-weight: 600;
  color: var(--tp-slate);
  font-variant-numeric: tabular-nums;
}
body.app-dashboard .tips-page .td-preview-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.5;
}
body.app-dashboard .tips-page .td-preview:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 2px;
}

body.app-dashboard .tips-page .td-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--tp-line-soft);
}
body.app-dashboard .tips-page .td-activity {
  border: 0;
  background: none;
  padding: 4px 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-brand-2);
  cursor: pointer;
  text-align: left;
}
body.app-dashboard .tips-page .td-activity:hover {
  text-decoration: underline;
}
body.app-dashboard .tips-page .td-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
body.app-dashboard .tips-page .td-act {
  border: 0;
  background: none;
  border-radius: 8px;
  padding: 3px 8px;
  min-height: 28px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-slate);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--tp-ease), color var(--tp-ease);
}
body.app-dashboard .tips-page .td-act:hover {
  background: var(--tp-ground);
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-act.is-on {
  color: var(--tp-green-ink);
}
body.app-dashboard .tips-page .td-act:focus-visible,
body.app-dashboard .tips-page .td-activity:focus-visible,
body.app-dashboard .tips-page .td-title-btn:focus-visible,
body.app-dashboard .tips-page .td-more:focus-visible,
body.app-dashboard .tips-page .tp-back:focus-visible,
body.app-dashboard .tips-page .td-reader-close:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* quick tips: the same card, compact */
body.app-dashboard .tips-page .td-card--quick {
  background: #fbfcfe;
  border-color: var(--tp-line-soft);
  padding: 7px 12px 5px 6px;
  border-radius: 12px;
  row-gap: 0;
}
body.app-dashboard .tips-page .td-card--quick .td-meta {
  font-size: 11.5px;
}
body.app-dashboard .tips-page .td-card--quick .td-meta .td-avatar {
  width: 18px;
  height: 18px;
  font-size: 8.5px;
}
body.app-dashboard .tips-page .td-card--quick .td-title {
  margin-top: 3px;
}
body.app-dashboard .tips-page .td-card--quick .td-title-btn {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #22304d;
}
body.app-dashboard .tips-page .td-card--quick .td-vote--rail {
  padding: 0;
}
body.app-dashboard .tips-page .td-card--quick .td-vote-btn {
  width: 28px;
  height: 26px;
}
body.app-dashboard .tips-page .td-card--quick .td-vote-btn svg {
  width: 15px;
  height: 15px;
}
body.app-dashboard .tips-page .td-card--quick .td-score {
  font-size: 13px;
}
body.app-dashboard .tips-page .td-card--quick .td-foot {
  border-top: 0;
  padding-top: 0;
  margin-top: 2px;
}
body.app-dashboard .tips-page .td-card--quick .td-activity {
  display: none;
}
body.app-dashboard .tips-page .td-card--quick .td-actions {
  margin-left: 0;
}
body.app-dashboard .tips-page .td-card--quick .td-act {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 12px;
  color: var(--tp-mist);
}

/* selected discussion (reader open) */
body.app-dashboard .tips-page .td-card.is-selected {
  border-color: var(--tp-brand-line);
  box-shadow: inset 3px 0 0 var(--tp-brand);
  background: #f3f7fe;
}

/* ---------- wide feed (no reader): the best answer sits beside the post ---------- */
@container tips (min-width: 1000px) {
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-card {
    grid-template-columns: auto minmax(0, 1fr) minmax(280px, 36%);
    grid-template-areas:
      "vote main aside"
      "vote foot aside";
    column-gap: 16px;
  }
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-aside {
    align-self: start;
    padding-left: 16px;
    border-left: 1px solid var(--tp-line-soft);
    min-height: 100%;
  }
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-aside:empty {
    display: block;
  }
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-preview {
    margin-top: 0;
  }
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-preview--none {
    margin-top: 2px;
  }
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-card--quick {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "vote main"
      "vote foot";
  }
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-card--quick .td-aside {
    display: none;
  }
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-quick-row .td-card--quick {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "vote main"
      "vote foot";
  }
  /* nothing to preview: no empty column, the post takes the row */
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-card:has(.td-aside:empty) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "vote main"
      "vote foot";
  }
  body.app-dashboard .tips-page .td-layout:not(.is-reading) .td-card:has(.td-aside:empty) .td-aside {
    display: none;
  }

  /* ---------- reading: compact feed beside the reader ---------- */
  body.app-dashboard .tips-page .td-layout.is-reading {
    grid-template-columns: minmax(340px, 2fr) minmax(0, 3fr);
    gap: 16px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-feed {
    gap: 5px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-quick-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "vote main"
      "vote foot";
    padding: 7px 10px 6px 6px;
    border-radius: 11px;
    border-top-width: 1px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-card--question {
    border-top: 1px solid var(--tp-line);
    box-shadow: inset 0 3px 0 var(--tp-amber-line);
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-card.is-selected {
    box-shadow: inset 3px 0 0 var(--tp-brand);
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-title-btn {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-aside,
  body.app-dashboard .tips-page .td-layout.is-reading .td-body,
  body.app-dashboard .tips-page .td-layout.is-reading .td-more,
  body.app-dashboard .tips-page .td-layout.is-reading .td-actions,
  body.app-dashboard .tips-page .td-layout.is-reading .td-role,
  body.app-dashboard .tips-page .td-layout.is-reading .td-scope {
    display: none;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-vote--rail {
    flex-direction: row;
    gap: 0;
    padding: 0;
    margin-top: 2px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-vote-btn {
    width: 26px;
    height: 24px;
    border-radius: 7px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-vote-btn svg {
    width: 14px;
    height: 14px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-score {
    font-size: 12.5px;
    min-width: 18px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-meta {
    font-size: 11.5px;
    gap: 3px 5px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-meta .td-avatar {
    width: 18px;
    height: 18px;
    font-size: 8.5px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-title {
    margin-top: 3px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-title-btn {
    font-size: 13.5px;
    line-height: 1.35;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-card--quick .td-title-btn {
    font-size: 13px;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-foot {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-activity {
    font-size: 12px;
    padding: 2px 0;
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-card--quick {
    background: var(--tp-ground);
  }
  body.app-dashboard .tips-page .td-layout.is-reading .td-reader {
    display: block;
    position: sticky;
    top: calc(var(--td-topbar) + 12px);
    max-height: calc(100vh - var(--td-topbar) - 24px);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--tp-line);
    border-radius: 16px;
    background: var(--tp-surface);
    box-shadow: 0 16px 40px -28px rgba(20, 33, 64, 0.35);
  }
}

/* ---------- the reader pane ---------- */
body.app-dashboard .tips-page .td-reader-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid var(--tp-line-soft);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}
body.app-dashboard .tips-page .td-reader-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-reader-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--tp-line);
  border-radius: 9px;
  background: var(--tp-surface);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-slate);
  cursor: pointer;
}
body.app-dashboard .tips-page .td-reader-close:hover {
  background: var(--tp-ground);
  color: var(--tp-ink);
}
body.app-dashboard .tips-page .td-reader-body {
  padding: 4px 20px 20px;
}
body.app-dashboard .tips-page .td-reader-body .tp-thread {
  max-width: none;
}

/* ---------- impact card ---------- */
body.app-dashboard .tips-page .td-impact {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--tp-green-line);
  background: var(--tp-green-tint);
  border-radius: var(--tp-r);
  padding: 12px 14px;
  color: #1f4a35;
}
body.app-dashboard .tips-page .td-impact-copy { flex: 1; min-width: 0; }
body.app-dashboard .tips-page .td-impact-copy b { display: block; font-size: 14px; font-weight: 600; }
body.app-dashboard .tips-page .td-impact-copy small { font-size: 12px; color: #3f6a54; }
body.app-dashboard .tips-page .td-impact-x {
  border: 0;
  background: none;
  color: #3f6a54;
  font-size: 13px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  flex: none;
}

/* ---------- empty state ---------- */
body.app-dashboard .tips-page .tp-empty {
  padding: 28px 22px;
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r);
  background: var(--tp-ground);
}
body.app-dashboard .tips-page .tp-empty b {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--tp-ink);
  text-wrap: pretty;
}
body.app-dashboard .tips-page .tp-empty p {
  margin: 5px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--tp-slate);
  max-width: 52ch;
}
body.app-dashboard .tips-page .tp-empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
body.app-dashboard .tips-page .tp-empty-actions:empty { display: none; }

/* ---------- Saved & notes sheet ---------- */
body.app-dashboard .pp-sheet.td-sheet { max-width: 560px; margin: 0 auto; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-sec { margin-top: 16px; }
body.app-dashboard :is(.td-sheet, .td-drawer) h4 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #16233f;
}
body.app-dashboard :is(.td-sheet, .td-drawer) h4 small { font-size: 12px; font-weight: 500; color: #8a97ad; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-count { font-size: 12px; font-weight: 600; color: #8a97ad; font-variant-numeric: tabular-nums; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-list { display: grid; border: 1px solid #e9edf4; border-radius: 12px; overflow: hidden; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid #f1f4f9;
  background: #fff;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #33415c;
  cursor: pointer;
}
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-item:first-child { border-top: 0; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-item:hover { background: #f6f8fc; color: #16233f; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-hint { margin: 0; font-size: 13px; line-height: 1.5; color: #5d6b84; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-notes {
  width: 100%;
  border: 1px solid #e9edf4;
  border-radius: 10px;
  background: #f6f8fc;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: #16233f;
  resize: vertical;
  box-sizing: border-box;
}
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-notes:focus-visible { outline: 2px solid #1f6fd6; outline-offset: 1px; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-row .tp-status { margin: 0; font-size: 12px; color: #1a9e54; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-rules p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.55; color: #5d6b84; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-sheet-item:focus-visible,
body.app-dashboard :is(.td-sheet, .td-drawer) .pp-sheet-close-x:focus-visible { outline: 2px solid #1f6fd6; outline-offset: 2px; }

/* ---------- compose FAB (phones only) ---------- */
body.app-dashboard .tips-page .tp-fab { display: none; }

/* ---------- back pill (compose + thread) ---------- */
body.app-dashboard .tips-page .tp-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tp-slate);
  border: 1px solid var(--tp-line);
  border-radius: 999px;
  padding: 6px 13px;
  background: var(--tp-surface);
  margin-bottom: 16px;
  cursor: pointer;
}
body.app-dashboard .tips-page .tp-back:hover { color: var(--tp-ink); }

/* The compose page lends its Back to the shared page header (data-pf-page-actions), outside .tips-page, so it takes
   the header's quiet-action language instead: the same 36px hairline button as "Saved & notes", with an icon. */
body.app-dashboard .pf-pagehead-actions .tp-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--pf-ctl-h, 36px);
  margin: 0;
  padding: 0 13px 0 11px;
  border: 1px solid var(--pf-line, #e9edf4);
  border-radius: 10px;
  background: var(--pf-surface, #fff);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--pf-ink-2, #5d6b84);
  cursor: pointer;
}
body.app-dashboard .pf-pagehead-actions .tp-back svg {
  width: 15px;
  height: 15px;
  flex: none;
}
body.app-dashboard .pf-pagehead-actions .tp-back:hover {
  background: var(--pf-bg, #f6f8fc);
  color: var(--pf-ink, #1b2740);
}
body.app-dashboard .pf-pagehead-actions .tp-back:focus-visible {
  outline: 2px solid var(--pf-brand, #1f6fd6);
  outline-offset: 2px;
}

/* ---------- the discussion (its own page, or inside the reader) ---------- */
body.app-dashboard .tips-page .tp-thread {
  max-width: 760px;
  padding: 4px 0 8px;
}
body.app-dashboard .tips-page .tp-tags {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
body.app-dashboard .tips-page .tp-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--tp-line);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--tp-slate);
  white-space: nowrap;
}
body.app-dashboard .tips-page .tp-tag--q { color: var(--tp-amber-ink); border-color: var(--tp-amber-line); background: var(--tp-amber-tint); }
body.app-dashboard .tips-page .tp-tag--clin { color: var(--tp-green-ink); border-color: var(--tp-green-line); background: var(--tp-green-tint); }
body.app-dashboard .tips-page .tp-tag--team { color: var(--tp-team); border-color: #ddd2f5; background: #f1edfc; }
body.app-dashboard .tips-page .tp-tag--scope { color: var(--tp-teal-ink); border-color: var(--tp-teal-line); background: var(--tp-teal-tint); }
body.app-dashboard .tips-page .tp-tag--answered { color: var(--tp-green-ink); border-color: var(--tp-green-line); background: var(--tp-green-tint); }
body.app-dashboard .tips-page .tp-tag--removed { color: var(--tp-red); border-color: #ecc8c5; background: #fdf0ef; }
body.app-dashboard .tips-page .tp-thread h2 {
  font-family: var(--tp-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 10px 0 6px;
  color: var(--tp-ink);
  text-wrap: pretty;
  max-width: 40ch;
}
body.app-dashboard .tips-page .tp-thread h2:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 4px;
  border-radius: 6px;
}
body.app-dashboard .tips-page .tp-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tp-mist);
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
body.app-dashboard .tips-page .tp-meta b { color: var(--tp-ink); font-weight: 600; }
body.app-dashboard .tips-page .tp-meta-note { font-size: 11.5px; }
body.app-dashboard .tips-page .tp-meta button {
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .tp-meta button:hover { color: var(--tp-brand-2); }
body.app-dashboard .tips-page .tp-meta .tp-actions { margin-left: auto; display: flex; gap: 14px; }
body.app-dashboard .tips-page .td-thread-vote {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
body.app-dashboard .tips-page .tp-thread-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--tp-body);
  margin: 12px 0 0;
  max-width: 66ch;
  white-space: pre-line;
}
body.app-dashboard .tips-page .tp-thread-body.is-hidden { display: none; }

/* answers */
body.app-dashboard .tips-page #tips-thread-replies {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}
body.app-dashboard .tips-page .td-answers-empty {
  margin: 0;
  font-size: 13.5px;
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-answers-divider {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-answer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding: 12px 14px 10px 10px;
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  background: var(--tp-surface);
}
body.app-dashboard .tips-page .td-answer > .td-vote { margin-top: 2px; }
body.app-dashboard .tips-page .td-answer--reviewed {
  border-color: var(--tp-green-line);
  border-left: 3px solid var(--tp-green);
  background: var(--tp-green-tint);
}
body.app-dashboard .tips-page .td-answer--clinician {
  border-color: var(--tp-teal-line);
  border-left: 3px solid var(--tp-teal);
  background: var(--tp-surface);
}
body.app-dashboard .tips-page .td-answer--accepted {
  border-color: var(--tp-brand-line);
  border-left: 3px solid var(--tp-brand);
  background: var(--tp-brand-tint);
}
body.app-dashboard .tips-page .td-answer-main { min-width: 0; }
body.app-dashboard .tips-page .td-answer-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
body.app-dashboard .tips-page .td-status--reviewed { background: var(--tp-green); color: #fff; }
body.app-dashboard .tips-page .td-status--clinician { background: var(--tp-teal-tint); color: var(--tp-teal-ink); }
body.app-dashboard .tips-page .td-status--accepted { background: var(--tp-brand-tint); color: var(--tp-brand-2); border: 1px solid var(--tp-brand-line); }
body.app-dashboard .tips-page .td-status-detail { font-size: 12px; color: var(--tp-slate); }
body.app-dashboard .tips-page .td-answer-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--tp-body);
  white-space: pre-line;
  max-width: 66ch;
  overflow-wrap: anywhere;
}
body.app-dashboard .tips-page .td-answer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--tp-mist);
}
body.app-dashboard .tips-page .td-answer-meta b { font-weight: 600; color: var(--tp-ink); }
body.app-dashboard .tips-page .td-role-chip {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tp-ground);
  font-size: 11px;
  font-weight: 600;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-role-chip--clinician { background: var(--tp-teal-tint); color: var(--tp-teal-ink); }
body.app-dashboard .tips-page .td-answer-when::before { content: "\00b7"; margin-right: 6px; color: #c3ccdb; }
body.app-dashboard .tips-page .td-answer-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
body.app-dashboard .tips-page .td-act--accept { color: var(--tp-brand-2); }
body.app-dashboard .tips-page .td-act--accept.is-on { color: var(--tp-brand-2); background: var(--tp-brand-tint); }
body.app-dashboard .tips-page .td-act--accept small { font-size: 11px; font-weight: 500; color: var(--tp-mist); }

body.app-dashboard .tips-page .tp-thread .tp-composer {
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  background: var(--tp-ground);
  padding: 12px 14px;
  margin-top: 16px;
}
body.app-dashboard .tips-page .tp-thread .tp-composer.is-hidden { display: none; }
body.app-dashboard .tips-page .tp-composer textarea {
  width: 100%;
  border: 1px solid var(--tp-line);
  border-radius: 9px;
  background: var(--tp-surface);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--tp-ink);
  resize: vertical;
  box-sizing: border-box;
}
body.app-dashboard .tips-page .tp-composer-foot { display: flex; align-items: center; gap: 12px; margin-top: 9px; flex-wrap: wrap; }
body.app-dashboard .tips-page .tp-composer-note { font-size: 11.5px; color: var(--tp-mist); font-weight: 500; }
body.app-dashboard .tips-page .tp-composer-foot .tp-status { margin: 0; font-size: 11.5px; }
body.app-dashboard .tips-page .tp-composer-foot button[type="submit"] { margin-left: auto; }
body.app-dashboard .tips-page .tips-report-reply,
.tips-report-reply { margin: 6px 0 0; font-size: 12.5px; color: #5d6b84; }

/* ---------- report and save dialogs (tips-specific, live outside the page) ----------
   The shared preview box is a two-column grid built for "title + chip"; a reply
   excerpt landed in the auto column and the title collapsed to nothing. Wrap
   instead, and give the dialog room for long titles and excerpts. */
body.app-dashboard .tips-report-choice-panel,
body.app-dashboard .tips-save-choice-panel {
  width: min(540px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.1rem 1.25rem 1.15rem;
  border-radius: 14px;
  box-sizing: border-box;
}
body.app-dashboard .tips-report-choice .tips-save-choice-preview,
body.app-dashboard .tips-save-choice .tips-save-choice-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  min-width: 0;
}
body.app-dashboard .tips-report-choice .tips-save-choice-preview strong,
body.app-dashboard .tips-save-choice .tips-save-choice-preview strong {
  flex: 1 1 240px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.4;
}
body.app-dashboard .tips-report-choice .tips-save-choice-preview span,
body.app-dashboard .tips-save-choice .tips-save-choice-preview span {
  flex: none;
}
body.app-dashboard .tips-report-choice .tips-save-choice-preview p,
body.app-dashboard .tips-save-choice .tips-save-choice-preview p {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
body.app-dashboard .tips-report-choice .tips-report-reply {
  padding: 0.5rem 0.65rem;
  border-left: 3px solid #d5dce8;
  border-radius: 0 8px 8px 0;
  background: #f6f8fc;
  font-size: 12.5px;
  line-height: 1.5;
  color: #33415c;
}
body.app-dashboard .tips-report-choice .tips-report-reply b {
  color: #16233f;
}
body.app-dashboard .tips-report-choice .tips-report-choice-panel h2,
body.app-dashboard .tips-save-choice .tips-save-choice-panel h2 {
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  body.app-dashboard .tips-report-choice-panel,
  body.app-dashboard .tips-save-choice-panel {
    width: 100%;
    max-height: calc(100dvh - 1.5rem);
  }
}

/* ---------- Saved & notes: a drawer on desktop, a sheet on phones ---------- */
body.app-dashboard .td-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1400;
  width: min(440px, 100vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -18px 0 50px rgba(10, 22, 44, 0.22);
  border-left: 1px solid #e9edf4;
}
body.app-dashboard .td-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 12px 22px;
  border-bottom: 1px solid #f1f4f9;
}
body.app-dashboard .td-drawer-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #16233f;
}
body.app-dashboard .td-drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid #e9edf4;
  border-radius: 10px;
  background: #fff;
  color: #5d6b84;
  font-size: 15px;
  cursor: pointer;
}
body.app-dashboard .td-drawer-close:hover { background: #f6f8fc; color: #16233f; }
body.app-dashboard .td-drawer-close:focus-visible,
body.app-dashboard .td-tab:focus-visible { outline: 2px solid #1f6fd6; outline-offset: 2px; }
body.app-dashboard .td-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  margin: 12px 22px 0;
  background: #e6eaf2;
  border-radius: 12px;
}
body.app-dashboard .td-tab {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #5d6b84;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
body.app-dashboard .td-tab[aria-selected="true"] {
  background: #fff;
  color: #16233f;
  box-shadow: 0 1px 3px rgba(20, 33, 64, 0.14);
}
body.app-dashboard .td-tab small { font-weight: 600; color: #8a97ad; font-variant-numeric: tabular-nums; }
body.app-dashboard .td-drawer-body {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 22px 22px;
}
body.app-dashboard .td-drawer-foot {
  padding: 12px 22px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f1f4f9;
  font-size: 12px;
  line-height: 1.5;
  color: #8a97ad;
}
body.app-dashboard .td-drawer-foot b { color: #5d6b84; font-weight: 600; }
body.app-dashboard .td-panel-view[hidden] { display: none; }
/* the same tabs inside the phone sheet */
body.app-dashboard .pp-sheet.td-sheet .td-tabs { margin: 10px 0 0; }
body.app-dashboard .pp-sheet.td-sheet .td-drawer-body { padding: 12px 0 0; overflow: visible; }
body.app-dashboard .pp-sheet.td-sheet .td-drawer-foot { padding: 12px 0 0; border-top: 1px solid #f1f4f9; margin-top: 14px; }

/* ---------- compose page ---------- */
body.app-dashboard .tips-page .tp-compose {
  display: block;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 8px;
}
/* the compose view still carried the legacy card chrome (padding + margin) that
   the frame retires for the feed view; an empty composer must fit a laptop
   viewport, so the same retirement applies here, page-locally */
/* Out-specifies student-redesign.css `body.app-dashboard #section-tips-compose.tips-compose-page` (1,2,1 + !important). */
body.pf-frame-v1.app-dashboard #section-tips-compose.tips-compose-page {
  padding: 0 !important;
  margin-bottom: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
/* the lead row: one supporting line, the type switch beside it */
body.app-dashboard .tips-page .td-compose-lead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
body.app-dashboard .tips-page .td-compose-lead .tp-compose-copy {
  margin: 0;
  flex: 1 1 320px;
  max-width: none;
  font-size: 14px;
}
body.app-dashboard .tips-page .td-compose-lead .tp-mode {
  margin: 0;
  flex: none;
}
body.app-dashboard .tips-page .td-compose-space {
  margin-bottom: 14px;
}
body.app-dashboard .tips-page .tp-field { margin-bottom: 12px; }
body.app-dashboard .tips-page .tp-field label { margin-bottom: 5px; }
/* anonymity beside the audience, one quiet row */
body.app-dashboard .tips-page .td-compose-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 2px 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--tp-ground);
  font-size: 13px;
  line-height: 1.45;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-anon-compact {
  flex: none;
  cursor: pointer;
}
body.app-dashboard .tips-page .td-anon-compact .tp-anon-copy b { font-size: 13px; color: var(--tp-ink); display: inline; }
body.app-dashboard .tips-page .td-anon-compact .tp-anon-copy small { font-size: 12.5px; color: var(--tp-mist); display: inline; }
body.app-dashboard .tips-page .td-compose-summary {
  flex: 1 1 320px;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-compose-summary::before {
  content: "\00b7";
  margin-right: 8px;
  color: #c3ccdb;
}
body.app-dashboard .tips-page .td-compose-summary:empty { display: none; }
body.app-dashboard .tips-page .td-compose-summary b { color: var(--tp-ink); font-weight: 600; }
/* the final row: the patient rule at the left, the submit at the right */
body.app-dashboard .tips-page .td-compose-foot {
  flex: 1 1 320px;
  min-width: 0;
  display: grid;
  gap: 2px;
}
body.app-dashboard .tips-page .td-safety-line {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--tp-slate);
}
body.app-dashboard .tips-page .td-safety-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tp-amber);
  vertical-align: 1px;
  margin-right: 6px;
}
/* <details> is inlined so "Learn more" sits in the sentence; its content stays a block (Chromium hides closed
   details content with content-visibility, which does not apply to inline boxes) and drops below when opened. */
body.app-dashboard .tips-page .td-safety-more {
  display: inline;
}
body.app-dashboard .tips-page .td-safety-more summary {
  display: inline;
  list-style: none;
  cursor: pointer;
  margin-left: 2px;
  font-weight: 600;
  color: var(--tp-brand-2);
}
body.app-dashboard .tips-page .td-safety-more summary::-webkit-details-marker { display: none; }
body.app-dashboard .tips-page .td-safety-more summary:hover { text-decoration: underline; }
body.app-dashboard .tips-page .td-safety-more summary:focus-visible { outline: 2px solid var(--tp-brand); outline-offset: 2px; border-radius: 4px; }
body.app-dashboard .tips-page .td-safety-more[open] summary::after { content: ":"; }
body.app-dashboard .tips-page .td-safety-more span {
  display: block;
  margin-top: 2px;
  color: #7a5511;
}
@container tips (min-width: 700px) {
  body.app-dashboard .tips-page .tp-mode-btn { min-height: 36px; padding: 0 18px; }
}
body.app-dashboard .tips-page .tp-compose .tp-scope {
  display: flex; align-items: center; gap: 7px; margin: 0;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tp-mist);
}
body.app-dashboard .tips-page .tp-compose .tp-scope i { width: 7px; height: 7px; border-radius: 50%; background: var(--tp-brand); flex: none; }
body.app-dashboard .tips-page .tp-compose h2 {
  font-family: var(--tp-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 8px 0 4px; color: var(--tp-ink);
}
body.app-dashboard .tips-page .tp-compose-copy { font-size: 13.5px; line-height: 1.5; color: var(--tp-slate); margin: 0 0 4px; max-width: 60ch; }
body.app-dashboard .tips-page .tp-mode {
  display: flex; gap: 2px; padding: 3px; background: #e6eaf2; border-radius: 12px; margin: 0 0 18px; width: max-content; max-width: 100%;
}
body.app-dashboard .tips-page .tp-mode-btn {
  border: 0; border-radius: 10px; min-height: 34px; padding: 0 16px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--tp-slate); background: none; cursor: pointer;
}
body.app-dashboard .tips-page .tp-mode-btn.is-active { background: var(--tp-surface); color: var(--tp-ink); box-shadow: 0 1px 3px rgba(20, 33, 64, 0.14); }
body.app-dashboard .tips-page .td-pick-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
body.app-dashboard .tips-page .td-pick {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0 8px;
  min-height: 48px;
  padding: 4px 14px;
  transition: background-color 160ms cubic-bezier(0.3, 0.7, 0.4, 1), border-color 160ms cubic-bezier(0.3, 0.7, 0.4, 1), box-shadow 160ms cubic-bezier(0.3, 0.7, 0.4, 1);
}
body.app-dashboard .tips-page .td-pick:hover:not(.is-unavailable) { background: var(--tp-surface); border-color: #cfd8e6; }
body.app-dashboard .tips-page .td-pick-name::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--td-dot, var(--tp-mist));
  vertical-align: 1px;
}
body.app-dashboard .tips-page .td-pick--year { --td-dot: var(--td-year); }
body.app-dashboard .tips-page .td-pick--exams { --td-dot: var(--td-exams); }
body.app-dashboard .tips-page .td-pick--placement { --td-dot: var(--td-placement); }
body.app-dashboard .tips-page .td-pick-sub {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
body.app-dashboard .tips-page .td-pick-sub::before { content: "\00b7"; margin-right: 6px; color: #c3ccdb; }
body.app-dashboard .tips-page .td-pick {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 0 8px; min-height: 48px; text-align: left; border: 1px solid var(--tp-line); border-radius: 12px; background: var(--tp-ground);
  padding: 4px 14px; font-family: inherit; color: var(--tp-slate); cursor: pointer; min-width: 0; box-sizing: border-box;
}
body.app-dashboard .tips-page .td-pick.is-active { background: var(--td-tint, var(--tp-surface)); border-color: var(--td-dot, var(--tp-ink)); box-shadow: inset 3px 0 0 var(--td-dot, var(--tp-ink)); color: var(--tp-ink); }
body.app-dashboard .tips-page .td-pick--year { --td-tint: var(--td-year-tint); }
body.app-dashboard .tips-page .td-pick--exams { --td-tint: var(--td-exams-tint); }
body.app-dashboard .tips-page .td-pick--placement { --td-tint: var(--td-placement-tint); }
body.app-dashboard .tips-page .td-pick.is-unavailable { border-style: dashed; background: transparent; color: var(--tp-mist); cursor: not-allowed; }
body.app-dashboard .tips-page .td-pick:focus-visible { outline: 2px solid var(--tp-brand); outline-offset: 2px; }
body.app-dashboard .tips-page .td-pick-name { font-size: 13.5px; font-weight: 600; flex: none; white-space: nowrap; }
body.app-dashboard .tips-page .td-pick-sub { font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
body.app-dashboard .tips-page .tp-compose-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--tp-slate); }
body.app-dashboard .tips-page .tp-compose-note:empty { display: none; }
body.app-dashboard .tips-page .tp-anon {
  position: relative; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--tp-line); border-radius: 11px;
  padding: 11px 13px; background: var(--tp-ground); margin-bottom: 14px; cursor: pointer;
}
body.app-dashboard .tips-page .tp-anon input { position: absolute; opacity: 0; width: 1px; height: 1px; }
body.app-dashboard .tips-page .tp-anon-box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #cdd7e6; background: var(--tp-surface);
  display: flex; align-items: center; justify-content: center; flex: none; color: #fff; font-size: 11px; font-weight: 600; margin-top: 1px;
}
body.app-dashboard .tips-page .tp-anon input:checked + .tp-anon-box { background: var(--tp-green); border-color: var(--tp-green); }
body.app-dashboard .tips-page .tp-anon input:checked + .tp-anon-box::before { content: "\2713"; }
body.app-dashboard .tips-page .tp-anon input:focus-visible + .tp-anon-box { outline: 2px solid var(--tp-brand); outline-offset: 2px; }
body.app-dashboard .tips-page .tp-anon-copy b { display: block; font-size: 13px; font-weight: 600; color: var(--tp-ink); }
body.app-dashboard .tips-page .tp-anon-copy small { display: block; font-size: 12px; line-height: 1.45; color: var(--tp-slate); }
body.app-dashboard .tips-page .tp-anon--inline { border: 0; background: none; padding: 0; margin: 0; align-items: center; }
body.app-dashboard .tips-page .tp-anon--inline .tp-anon-box { width: 17px; height: 17px; margin-top: 0; font-size: 9px; }
body.app-dashboard .tips-page .tp-anon--inline .tp-anon-copy b { font-size: 12px; color: var(--tp-slate); }
body.app-dashboard .tips-page .tp-field { margin-bottom: 14px; }
body.app-dashboard .tips-page .tp-field label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tp-mist); margin-bottom: 6px;
}
body.app-dashboard .tips-page .tp-field input,
body.app-dashboard .tips-page .tp-field textarea {
  width: 100%; border: 1px solid var(--tp-line); border-radius: 9px; background: var(--tp-surface); padding: 10px 12px;
  font: inherit; font-size: 15px; color: var(--tp-ink); box-sizing: border-box;
}
body.app-dashboard .tips-page .tp-field textarea { resize: vertical; line-height: 1.55; min-height: 150px; }
body.app-dashboard .tips-page .tp-field input:focus-visible,
body.app-dashboard .tips-page .tp-field textarea:focus-visible,
body.app-dashboard .tips-page .tp-composer textarea:focus-visible { outline: 2px solid var(--tp-brand); outline-offset: 1px; }
body.app-dashboard .tips-page .tp-safety {
  border: 0; border-left: 3px solid var(--tp-amber-line); background: var(--tp-amber-tint); border-radius: 0 10px 10px 0; padding: 9px 13px;
  font-size: 12.5px; line-height: 1.5; color: #7a5511; margin-bottom: 18px;
}
body.app-dashboard .tips-page .tp-safety b { display: block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 3px; }
body.app-dashboard .tips-page .tp-compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding-top: 2px; }
body.app-dashboard .tips-page .tp-compose-actions .btn.primary { min-height: 40px; padding: 0 22px; font-size: 14px; }
body.app-dashboard .tips-page .tp-compose-actions .tp-status { margin: 0; }
body.app-dashboard .tips-page .tp-compose-actions .tp-status:empty { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  /* Phones: the audience summary takes its own line under the anonymity toggle (no leading separator). */
  body.app-dashboard .tips-page .td-compose-summary { flex-basis: 100%; }
  body.app-dashboard .tips-page .td-compose-summary::before { content: none; }
  /* Phones: the fixed instrument capsule (shared/student-sidebar.js, sealed for ECG Studio so not editable here) anchors
     to a section's own h1/h2 and the V6 composer has none, so it would ride over the composer's first row. It is
     hidden while composing, as the profile editor (html.pfx-editing) and message threads already do. */
  html.pf-th-on body.pf-frame-v1:has(#section-tips-compose.is-active) .pf-th { display: none !important; }
  body.app-dashboard .tp-page-actions .tp-cta,
  body.app-dashboard .tp-page-actions .td-quiet-btn { display: none; }

  body.app-dashboard .tips-page .td-spaces { gap: 6px; margin-bottom: 10px; }
  body.app-dashboard .tips-page .td-space { padding: 9px 9px 9px 10px; border-radius: 12px; align-content: start; }
  body.app-dashboard .tips-page .td-space-name { font-size: 12.5px; line-height: 1.25; letter-spacing: -0.01em; }
  body.app-dashboard .tips-page .td-space-name::before { width: 8px; height: 8px; margin-right: 6px; vertical-align: 0; }
  body.app-dashboard .tips-page .td-space-sub,
  body.app-dashboard .tips-page .td-space-count { display: none; }
  body.app-dashboard .tips-page .td-audience { flex-wrap: nowrap; align-items: flex-start; }
  body.app-dashboard .tips-page .td-audience-dot { margin-top: 5px; }
  body.app-dashboard .tips-page .td-audience-full { display: none; }
  body.app-dashboard .tips-page .td-audience-short { display: inline; }

  body.app-dashboard .tips-page .tp-search { flex: 1 1 auto; max-width: none; min-width: 0; min-height: 44px; }
  body.app-dashboard .tips-page .tp-info-btn--inline { display: inline-flex; width: 44px; height: 44px; border-radius: 12px; }
  body.app-dashboard .tips-page .tp-seg { flex: 1 1 100%; }
  body.app-dashboard .tips-page .td-sortbar { flex: 1 1 100%; }
  body.app-dashboard .tips-page .td-select { flex: 1 1 auto; min-height: 40px; }
  body.app-dashboard .tips-page .td-filter { margin-left: auto; }
  body.app-dashboard .tips-page .td-filter-panel { right: 0; left: auto; }

  body.app-dashboard .tips-page .td-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "main main"
      "aside aside"
      "vote foot";
    column-gap: 10px;
    padding: 12px 14px 8px;
    border-radius: 12px;
  }
  body.app-dashboard .tips-page .td-card > .td-vote { align-self: center; }
  body.app-dashboard .tips-page .td-vote--rail {
    flex-direction: row;
    gap: 0;
    padding: 0;
    margin-top: 8px;
    border: 1px solid var(--tp-line);
    border-radius: 999px;
  }
  body.app-dashboard .tips-page .td-vote--rail .td-vote-btn { width: 36px; height: 32px; border-radius: 999px; }
  body.app-dashboard .tips-page .td-layout { padding: 10px; border-radius: 14px; }
  body.app-dashboard .tips-page .td-quick-row { grid-template-columns: 1fr; }
  body.app-dashboard .tips-page .td-card--question { border-top-width: 3px; }
  body.app-dashboard .tips-page .td-drawer { display: none; }
  body.app-dashboard .tips-page .td-foot { margin-top: 8px; padding-top: 0; border-top: 0; flex-wrap: nowrap; gap: 8px; }
  body.app-dashboard .tips-page .td-activity { flex: 1 1 auto; min-width: 0; min-height: 32px; line-height: 1.3; }
  body.app-dashboard .tips-page .td-actions { flex: none; gap: 0; }
  body.app-dashboard .tips-page .td-act { min-height: 32px; padding: 4px 6px; }
  body.app-dashboard .tips-page .td-title-btn { font-size: 16px; }
  body.app-dashboard .tips-page .td-body { font-size: 14.5px; }
  body.app-dashboard .tips-page .td-card--quick .td-foot { margin-top: 6px; }
  body.app-dashboard .tips-page .td-pick-group { grid-template-columns: 1fr; }
  body.app-dashboard .tips-page .td-answer { padding: 10px 12px 8px 10px; }
  body.app-dashboard .tips-page .td-answer-actions { margin-left: 0; width: 100%; }

  body.app-dashboard .tips-page .tp-fab {
    display: flex; position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
    width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; z-index: 1200;
    background: var(--tp-brand); color: #fff; align-items: center; justify-content: center;
    box-shadow: 0 14px 30px -8px rgba(21, 93, 196, 0.55);
  }
  body.app-dashboard .tips-page .tp-fab.is-hidden { display: none; }
  body.app-dashboard .tips-page .tp-fab:active { transform: scale(0.94); }
  body.app-dashboard .tips-page .tp-meta .tp-actions { margin-left: 0; width: 100%; }
  body.app-dashboard #section-tips-compose .tp-compose-actions {
    position: sticky; bottom: 0; background: rgba(255, 255, 255, 0.97); padding: 10px 0 12px; border-top: 1px solid var(--tp-line-soft);
  }
}

/* ---------- micro-interactions ---------- */
@keyframes td-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes td-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@keyframes td-reader-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}
body.app-dashboard .tips-page .td-score {
  display: inline-block;
  transition: color 150ms cubic-bezier(0.3, 0.7, 0.4, 1);
}
body.app-dashboard .tips-page .td-score.is-bumped {
  animation: td-bump 180ms cubic-bezier(0.3, 0.7, 0.4, 1);
}
body.app-dashboard .tips-page .td-vote-btn:active {
  transform: scale(0.92);
}
body.app-dashboard .tips-page .td-act.is-bumped {
  animation: td-bump 160ms cubic-bezier(0.3, 0.7, 0.4, 1);
}
body.app-dashboard .tips-page .td-feed.is-fresh > * {
  animation: td-fade-in 160ms cubic-bezier(0.3, 0.7, 0.4, 1) both;
}
body.app-dashboard .tips-page .td-reader.is-entering {
  animation: td-reader-in 170ms cubic-bezier(0.3, 0.7, 0.4, 1) both;
}
body.app-dashboard .tips-page .td-answer.is-new {
  animation: td-fade-in 180ms cubic-bezier(0.3, 0.7, 0.4, 1) both;
}
body.app-dashboard .tips-page .td-card {
  transition: border-color 150ms cubic-bezier(0.3, 0.7, 0.4, 1), box-shadow 150ms cubic-bezier(0.3, 0.7, 0.4, 1), background-color 150ms cubic-bezier(0.3, 0.7, 0.4, 1);
}
body.app-dashboard .tips-page .td-space {
  transition: background-color 160ms cubic-bezier(0.3, 0.7, 0.4, 1), border-color 160ms cubic-bezier(0.3, 0.7, 0.4, 1), box-shadow 160ms cubic-bezier(0.3, 0.7, 0.4, 1);
}
body.app-dashboard :is(.td-sheet, .td-drawer) .td-empty-saved {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 26px 12px 22px;
  text-align: center;
  color: #8a97ad;
}
body.app-dashboard :is(.td-sheet, .td-drawer) .td-empty-saved svg { margin-bottom: 4px; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-empty-saved b { font-size: 14.5px; font-weight: 600; color: #16233f; }
body.app-dashboard :is(.td-sheet, .td-drawer) .td-empty-saved p { margin: 0; max-width: 30ch; font-size: 13px; line-height: 1.5; color: #5d6b84; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body.app-dashboard .tips-page .td-score.is-bumped,
  body.app-dashboard .tips-page .td-act.is-bumped,
  body.app-dashboard .tips-page .td-feed.is-fresh > *,
  body.app-dashboard .tips-page .td-reader.is-entering,
  body.app-dashboard .tips-page .td-answer.is-new { animation: none; }
  body.app-dashboard .tips-page .td-vote-btn:active { transform: none; }
  body.app-dashboard .tips-page .td-score { transition: none; }
  body.app-dashboard .tips-page { --tp-ease: 0s; }
  body.app-dashboard .td-quiet-btn,
  body.app-dashboard .tips-page .td-space,
  body.app-dashboard .tips-page .tp-search,
  body.app-dashboard .tips-page .tp-chip,
  body.app-dashboard .tips-page .td-title-btn,
  body.app-dashboard .tips-page .td-act,
  body.app-dashboard .tips-page .td-vote-btn,
  body.app-dashboard .tips-page .td-card { transition: none; }
  body.app-dashboard .tips-page .tp-fab:active { transform: none; }
  body.app-dashboard .tips-page .td-reader-bar { backdrop-filter: none; }
}

/* ---------- V4 additions: sheet chrome on phones, compose columns ---------- */
body.app-dashboard .pp-sheet.td-sheet .td-drawer-head {
  padding: 2px 0 6px;
  border-bottom: 0;
}
body.app-dashboard .pp-sheet.td-sheet .td-drawer-close {
  width: 34px;
  height: 34px;
}
body.app-dashboard .pp-sheet.td-sheet { max-height: 84dvh; }
/* the destination choices stack on phones */
@media (max-width: 768px) {
  body.app-dashboard .tips-page .td-pick-group { grid-template-columns: 1fr; gap: 8px; }
  body.app-dashboard .tips-page .td-pick { flex-wrap: wrap; min-height: 44px; }
  body.app-dashboard .tips-page .td-pick-sub { white-space: normal; flex-basis: 100%; }
  body.app-dashboard .tips-page .td-pick-sub::before { content: none; }
  body.app-dashboard .tips-page .td-compose-lead .tp-mode { flex: 1 1 100%; width: auto; }
  body.app-dashboard .tips-page .td-compose-lead .tp-mode-btn { flex: 1; }
  body.app-dashboard .tips-page .tp-compose-actions .btn.primary { width: 100%; }
}
/* the discovery line is for browsing, not for the compact list beside a reader */
@container tips (min-width: 1000px) {
  body.app-dashboard .tips-page .td-layout.is-reading .td-popular { display: none; }
}
