/* =========================================================
   FORENTURE SIDEBAR
   Neutral typography, compact navigation, subtle highlights.
   Does not change sidebar width, resizing, or functionality.
   ========================================================= */

body.signed-in .workspace > aside.card {
  --side-bg: #f5f5f3;
  --side-text: #30312f;
  --side-muted: #858680;
  --side-heading: #73746e;
  --side-line: #e5e5e0;
  --side-hover: #ebebe7;
  --side-active: #e3e4de;

  background: var(--side-bg);
  color: var(--side-text);
  border-right: 1px solid var(--side-line);

  padding: 20px 12px 24px;

  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 14px;
  line-height: 1.45;

  scrollbar-width: thin;
  scrollbar-color: #d1d2cb transparent;
}

/* Consistent typography for controls. */
body.signed-in .workspace > aside.card button,
body.signed-in .workspace > aside.card input,
body.signed-in .workspace > aside.card select {
  font-family: inherit;
  letter-spacing: normal;
}

/* ---------- Top toolbar ---------- */

body.signed-in .workspace > aside.card > .row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
}

body.signed-in .workspace > aside.card #new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  min-height: 36px;
  padding: 7px 12px;

  background: #ffffff;
  color: #363732;
  border: 1px solid #dcded5;
  border-radius: 8px;

  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 2%);
}

body.signed-in .workspace > aside.card
#new:not(:disabled):hover {
  background: #fdfdfb;
  border-color: #bfc4b7;
}

body.signed-in .workspace > aside.card #new span {
  font-size: 17px;
  font-weight: 400;
}

/* Secondary actions have no persistent coloured fill. */
body.signed-in .workspace > aside.card button.secondary {
  background: transparent;
  color: #71756b;
  border: 1px solid transparent;
  border-radius: 7px;
  box-shadow: none;
}

body.signed-in .workspace > aside.card
button.secondary:not(:disabled):hover {
  background: var(--side-hover);
  color: #343a2f;
  border-color: transparent;
}

body.signed-in .workspace > aside.card #refresh {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 400;
}

/* ---------- Search ---------- */

body.signed-in .workspace > aside.card
:is(#search, #advisorTopicSearch) {
  box-sizing: border-box;

  width: 100%;
  max-width: none;
  min-width: 0;

  height: 35px;
  padding: 7px 10px;

  background: #eeefea;
  color: #383d32;
  border: 1px solid transparent;
  border-radius: 8px;

  font-size: 12px;
  font-weight: 400;
  line-height: 19px;

  box-shadow: none;
}

body.signed-in .workspace > aside.card
:is(#search, #advisorTopicSearch)::placeholder {
  color: #93978b;
}

body.signed-in .workspace > aside.card
:is(#search, #advisorTopicSearch):focus {
  background: #ffffff;
  border-color: #cbd1c0;
}

body.signed-in .workspace > aside.card > label,
body.signed-in .workspace > aside.card
#advisorTopicsPanel > label:not(.check) {
  margin: 10px 6px 6px;
  color: var(--side-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
}

body.signed-in .workspace > aside.card #count {
  margin: 7px 7px 15px;
  color: #92978a;
  font-size: 11px;
  line-height: 16px;
}

/* ---------- Section headings ---------- */

/* Headings are smaller and quieter than topic titles. */
body.signed-in .workspace > aside.card
:is(
  #myTopicsHeading,
  .assigned-users-header h3
) {
  color: var(--side-heading);

  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0.01em;

  text-transform: none;
}

body.signed-in .workspace > aside.card #myTopicsHeading {
  margin: 18px 7px 7px;
}

body.signed-in .workspace > aside.card #myTopicsHeader {
  align-items: center;
  gap: 8px;
  margin: 18px 7px 7px;
}

body.signed-in .workspace > aside.card
#myTopicsHeader #myTopicsHeading {
  margin: 0;
  font-size: 12px;
  line-height: 18px;
}

body.signed-in .workspace > aside.card
.assigned-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 26px;
  gap: 8px;
  margin: 15px 7px 5px;
}

/* Small actions beside headings. */
body.signed-in .workspace > aside.card
.assigned-users-header .assigned-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  min-height: 25px;

  margin: 0;
  padding: 0;

  background: transparent;
  color: #979e8a;
  border: 1px solid transparent;
  border-radius: 6px;

  font-size: 16px;
  line-height: 1;
}

body.signed-in .workspace > aside.card
#myTopicsHeader .compact-analyze {
  min-height: 25px;
  padding: 3px 6px;
  color: #7e8971;
  font-size: 11px;
  font-weight: 400;
  line-height: 17px;
}

/* ---------- Topic lists ---------- */

/* Override the earlier fixed-height and serif-font rules. */
body.signed-in .workspace > aside.card #history {
  display: flex !important;
  flex-direction: column;

  gap: 2px !important;

  height: auto !important;
  min-height: 0 !important;
  margin: 4px 0 12px !important;
  padding: 0 !important;
}

body.signed-in .workspace > aside.card
#history > .topic-row {
  display: flex;
  align-items: center;
  flex: 0 0 auto;

  gap: 2px;

  height: 34px !important;
  min-height: 34px !important;

  margin: 0 !important;
  padding: 0 !important;

  border-radius: 7px;
}

/* Use the same row rhythm in every topic section. */
body.signed-in .workspace > aside.card
:is(
  #history,
  #advisorUsersList,
  #sharedTopicsPanel,
  #caseSamplesPanel
) .history-item {
  display: block;

  width: 100%;
  min-width: 0;

  height: 32px !important;
  min-height: 32px !important;

  margin: 1px 0 !important;
  padding: 6px 10px !important;

  background: transparent;
  color: var(--side-text);
  border: 1px solid transparent;
  border-radius: 7px;

  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;

  font-size: 13px;
  font-weight: 400;
  line-height: 18px !important;
  letter-spacing: 0;

  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  box-shadow: none;
}

body.signed-in .workspace > aside.card
#history .topic-row > .history-item {
  flex: 1;
  width: auto;
  margin: 0 !important;
}

/* Hover is deliberately subtle. */
body.signed-in .workspace > aside.card
:is(
  #history,
  #advisorUsersList,
  #sharedTopicsPanel,
  #caseSamplesPanel
) .history-item:not(:disabled):hover {
  background: var(--side-hover);
  color: #272c23;
}

/* Selected topic: neutral fill, no stripe or heavy border. */
body.signed-in .workspace > aside.card
#history .history-item.active {
  background: var(--side-active);
  color: #2e3627;
  border-color: transparent;
  font-weight: 500;
  box-shadow: none;
}

/* Give the dots button the same row height. */
body.signed-in .workspace > aside.card
#history .topic-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 28px;
  width: 28px;

  height: 30px !important;
  min-height: 30px !important;

  margin: 0 !important;
  padding: 0 !important;

  background: transparent;
  color: #9ba38f;
  border: 0;
  border-radius: 6px;

  font-size: 20px;
  line-height: 1 !important;
}

body.signed-in .workspace > aside.card
#history .topic-menu-trigger:not(:disabled):hover {
  background: #e1e5d9;
  color: #526241;
}

/* ---------- Assigned-user groups ---------- */

body.signed-in .workspace > aside.card
#advisorUsersList > details {
  margin: 7px 0 !important;
}

body.signed-in .workspace > aside.card
#advisorUsersList > details > summary {
  padding: 5px 6px;
  color: #59684b;
  border-radius: 6px;

  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
}

body.signed-in .workspace > aside.card
#advisorUsersList > details > summary:hover {
  background: var(--side-hover);
}

body.signed-in .workspace > aside.card .assigned-user-name {
  font-size: 12px;
  font-weight: 500;
}

body.signed-in .workspace > aside.card .assigned-user-count {
  margin-left: 4px;
  color: #9aa58b;
  font-size: 11px;
  font-weight: 400;
}

body.signed-in .workspace > aside.card
#advisorUsersList .advisorAnalyzeUser {
  min-height: 23px;
  padding: 2px 5px;
  font-size: 10px;
  line-height: 17px;
}

body.signed-in .workspace > aside.card .check {
  margin: 9px 6px;
  gap: 7px;
  color: #869477;
  font-size: 11px;
  line-height: 17px;
}

body.signed-in .workspace > aside.card .check input {
  accent-color: #788d65;
}

/* ---------- Section spacing ---------- */

body.signed-in .workspace > aside.card
:is(
  #sharedTopicsPanel,
  #caseSamplesPanel,
  #advisorTopicsPanel
) {
  margin-bottom: 6px;
}

/* Faint dividers instead of strong separators. */
body.signed-in .workspace > aside.card hr {
  height: 0;
  margin: 16px 6px 11px;

  border: 0;
  border-top: 1px solid var(--side-line);
}

/* Supporting descriptions stay secondary. */
body.signed-in .workspace > aside.card .small {
  color: var(--side-muted);
  font-size: 11px;
  line-height: 17px;
}

body.signed-in .workspace > aside.card
:is(
  #sharedTopicsStatus,
  #advisorTopicsStatus
) {
  margin: 6px 7px;
}

/* ---------- Export and account actions ---------- */

body.signed-in .workspace > aside.card
.sidebar-export-label {
  margin: 12px 7px 5px;
  color: var(--side-heading);
  font-size: 11px;
}

body.signed-in .workspace > aside.card
.sidebar-export-actions {
  gap: 4px;
  margin: 0 0 6px;
}

body.signed-in .workspace > aside.card
.sidebar-small-action {
  min-height: 28px;
  padding: 4px 8px;

  color: #748761;
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
}

body.signed-in .workspace > aside.card #manageAdvisors {
  min-height: 30px;
  padding: 5px 8px;

  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

body.signed-in .workspace > aside.card #logout {
  margin-top: 5px;
  background: transparent;
  color: #849972;
  border-color: transparent;
}

/* ---------- Keyboard and motion ---------- */

body.signed-in .workspace > aside.card
:is(button, input, summary):focus-visible {
  outline: 2px solid #95a984;
  outline-offset: 2px;
}

body.signed-in .workspace > aside.card button {
  transition:
    background-color 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

@media (prefers-reduced-motion: reduce) {
  body.signed-in .workspace > aside.card button {
    transition: none;
  }
}

/* Sidebar refinement: larger text and inline search. */

body.signed-in .workspace > aside.card {
  font-size: 16px;
}

/* Search label and input on one line. */
body.signed-in .workspace > aside.card .sidebar-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

body.signed-in .workspace > aside.card
.sidebar-search-row > label {
  flex: 0 0 auto;
  margin: 0;
  color: var(--side-heading, #73746e);
  font-size: 13px;
  line-height: 19px;
  white-space: nowrap;
}

body.signed-in .workspace > aside.card
.sidebar-search-row > #search {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

/* Search fields: previously 12px. */
body.signed-in .workspace > aside.card
:is(#search, #advisorTopicSearch) {
  height: 37px;
  font-size: 14px;
  line-height: 21px;
}

/* Primary and secondary top actions. */
body.signed-in .workspace > aside.card #new {
  font-size: 15px;
  line-height: 22px;
}

body.signed-in .workspace > aside.card #refresh {
  font-size: 14px;
}

/* Supporting text: previously 11px. */
body.signed-in .workspace > aside.card
:is(.small, #count, .sidebar-export-label, .check) {
  font-size: 13px;
  line-height: 19px;
}

/* Section titles: previously 12px. */
body.signed-in .workspace > aside.card
:is(
  #myTopicsHeading,
  #myTopicsHeader #myTopicsHeading,
  .assigned-users-header h3
) {
  font-size: 14px;
  line-height: 20px;
}

/* Topic titles: previously 13px.
   Slightly taller rows accommodate the larger text. */
body.signed-in .workspace > aside.card
:is(
  #history,
  #advisorUsersList,
  #sharedTopicsPanel,
  #caseSamplesPanel
) .history-item {
  box-sizing: border-box;
  height: 36px !important;
  min-height: 36px !important;
  padding: 7px 10px !important;

  font-size: 15px;
  line-height: 20px !important;
}

body.signed-in .workspace > aside.card
#history > .topic-row {
  height: 38px !important;
  min-height: 38px !important;
}

/* Assigned-user labels and actions. */
body.signed-in .workspace > aside.card
#advisorUsersList > details > summary {
  font-size: 14px;
  line-height: 22px;
}

body.signed-in .workspace > aside.card .assigned-user-name {
  font-size: 14px;
}

body.signed-in .workspace > aside.card .assigned-user-count {
  font-size: 13px;
}

body.signed-in .workspace > aside.card
#advisorUsersList .advisorAnalyzeUser {
  font-size: 12px;
  line-height: 19px;
}

body.signed-in .workspace > aside.card
#myTopicsHeader .compact-analyze {
  font-size: 13px;
  line-height: 19px;
}

/* Export and adviser actions share a flexible row. */
body.signed-in .workspace > aside.card
.sidebar-export-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

body.signed-in .workspace > aside.card
.sidebar-small-action {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
  line-height: 20px;
}

body.signed-in .workspace > aside.card #manageAdvisors {
  min-height: 32px;
  margin: 0;
  padding: 5px 8px;
  font-size: 14px;
  line-height: 20px;
}
body.signed-in .workspace > aside.card
#manageAdvisors[hidden] {
  display: none !important;
}
/* Do not leave a blank gap when the status has no message. */
body.signed-in .workspace > aside.card
#advisorTopicsStatus:empty {
  display: none;
}

/* Search history: label and input on one aligned row. */
body.signed-in .workspace > aside.card .sidebar-search-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;

  width: 100%;
  min-width: 0;
  gap: 10px;

  margin: 0 0 12px;
  padding: 0;
}

body.signed-in .workspace > aside.card
.sidebar-search-row > label {
  display: block;
  flex: 0 0 auto;

  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;

  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
}

body.signed-in .workspace > aside.card
.sidebar-search-row > input#search {
  box-sizing: border-box;
  display: block;
  flex: 1 1 0;

  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;

  height: 37px;
  margin: 0 !important;
  padding: 7px 10px;

  font-size: 14px;
  line-height: 21px;
}
