/* General text keeps its hierarchy; titles, metadata and bodies have independent settings. */
:root {
  --general-font-scale: 1;
  --general-font-size: 15px;
  --thread-title-font-size: 15px;
  --thread-title-font-weight: 700;
  --post-meta-font-size: 11px;
  --post-meta-font-weight: 400;
  --post-font-size: 15px;
  --post-font-weight: 400;
}
body {
  font-size: var(--general-font-size);
  font-weight: var(--general-bold-weight, 400);
}

/* Both navigation bars retain their original type sizes and weights. */
.home-bottom-bar, .thread-bottom-bar {
  --general-font-scale: 1;
  --general-bold-weight: initial;
  font-size: 16px;
  font-weight: 400;
}

#boardView .thread-title,
#homeView .hub-history-row .hub-row-title,
.hub-favorite-name,
.favorite-manager-copy > strong,
#pageTitle.thread-title-tappable,
#threadTitleNgText {
  font-size: var(--thread-title-font-size) !important;
  font-weight: var(--thread-title-font-weight) !important;
}

.post-body, .chain-body, .chain-pinned-root .chain-body, .bubble-text {
  font-size: var(--post-font-size) !important;
  font-weight: var(--post-font-weight) !important;
}
.bubble-text * { font-weight: inherit !important; }

.post-head, .chain-head,
.post-number, .post-name, .post-id-compact,
.chain-number, .chain-name, .chain-id,
.post-head .badge, .chain-head .badge,
.post-reply-mini, .tree-chain-reaction {
  font-size: var(--post-meta-font-size) !important;
  font-weight: var(--post-meta-font-weight) !important;
}
.post-head, .chain-head {
  height: auto !important;
  min-height: calc(var(--post-meta-font-size) * 1.4) !important;
  line-height: 1.4 !important;
  flex-wrap: wrap !important;
  gap: 2px 5px;
  overflow: visible;
}
.post-name, .chain-name { max-width: 12em; }
.post-id-compact, .chain-id { max-width: 100%; }
.post-reply-mini, .tree-chain-reaction { height: 1.4em !important; }
.post-reply-mini > span, .tree-chain-reaction > span {
  height: auto;
  line-height: 1;
}
.post-reply-mini .reply-arrow-svg, .tree-chain-reaction .reply-arrow-svg {
  flex-basis: 1.1em !important;
  width: 1.1em !important;
  height: 1.1em !important;
}

.type-control {
  padding: 12px 13px;
  border-bottom: 1px solid var(--ui-hairline);
}
.type-control:last-child { border-bottom: 0; }
.type-control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.type-control-heading label {
  min-width: 0;
  font-size: calc(15px * var(--general-font-scale, 1));
  line-height: 1.45;
  font-weight: var(--general-bold-weight, 600);
}
.type-control-heading small { font-weight: var(--general-bold-weight, 400); }
.type-control-heading button {
  flex: 0 0 auto;
  min-width: 50px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--ui-hairline);
  border-radius: 9px;
  background: var(--ui-bg);
  color: var(--ui-muted);
  font-size: calc(12px * var(--general-font-scale, 1));
  font-weight: 700;
}
.type-control-heading button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--ui-green) 25%, transparent);
  background: color-mix(in srgb, var(--ui-green) 8%, var(--ui-card));
  color: var(--ui-green);
}
.type-control-heading button:focus-visible {
  outline: 2px solid var(--ui-green);
  outline-offset: 2px;
}
.type-control-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.5em;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
}
.type-control-range input {
  width: 100%;
  min-width: 0;
  margin: 0;
  height: 28px;
  accent-color: var(--ui-green);
}
.type-control-range output {
  text-align: right;
  color: var(--ui-muted);
  font-size: calc(12px * var(--general-font-scale, 1));
  font-variant-numeric: tabular-nums;
}

.thread-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 1.7em;
  height: 1.7em;
  padding: 0 .45em;
  border-radius: 999px;
  background: #06b86b;
  color: #fff;
  font-size: calc(11px * var(--general-font-scale, 1));
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#boardView .thread-stats { flex-wrap: wrap; }
.thread-stats .thread-unread-badge { margin-left: auto; }
.hub-history-row { grid-template-columns: 42px minmax(0, 1fr) max-content; }
.hub-history-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: start;
  gap: 5px;
  min-width: 34px;
}
.thread-unread-badge.hub-favorite-unread {
  min-width: 1.5em;
  height: 1.5em;
  font-size: calc(10px * var(--general-font-scale, 1));
}
.favorite-manager-open { grid-template-columns: 42px minmax(0, 1fr) auto; }
.archive-clear-dates {
  display: block;
  margin: 8px 0 0 auto;
  font-size: calc(12px * var(--general-font-scale, 1));
}
