@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&display=swap");
:root {
  --bg: #FFFFFF;
  --panel: #fff;
  --sidebar: #FFFFFF;
  --text: #282828;
  --muted: #6c6c6c;
  --border: #dbdbdb;
  --accent: #25282b;
  --accent-soft: #FFFFFF;
  --high: #4d4d4d;
  --danger: #ae4034;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover,
a.btn:hover {
  background: #FFFFFF;
  border-color: #a8a8a8;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button.primary,
a.btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
button.primary:hover {
  background: #313131;
}
button.text-button {
  border: 0;
  background: transparent;
  padding: 7px;
  color: var(--muted);
  font-size: 12px;
}
button.text-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
:focus-visible {
  outline: 3px solid #919191;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
input,
select,
textarea {
  color: var(--text);
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  padding: 10px 11px;
  max-width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
  width: 100%;
  line-height: 1.65;
}
select {
  font-size: 12px;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  flex: none;
  width: 16px;
  height: 16px;
}
input[type="number"] {
  width: 100%;
}
.app-shell {
  display: grid;
  grid-template-columns: 266px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 34px 23px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font:
    800 23px/1.15 "Manrope",
    var(--font);
  letter-spacing: -1.1px;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  width: 39px;
  height: 41px;
  border-radius: 11px;
  font:
    italic 700 31px/1 Georgia,
    serif;
  padding-right: 3px;
  position: relative;
}

.brand-caption {
  display: block;
  font: 600 8px/2.5 var(--font);
  letter-spacing: 1.4px;
  color: var(--muted);
}
.tabs {
  display: grid;
  gap: 5px;
  margin: 38px 0 32px;
}
.tabs button {
  justify-content: flex-start;
  background: transparent;
  border: 0;
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
}
.tabs button.active {
  background: #dfdfdf;
  color: #373737;
}
.nav-icon {
  font-size: 22px;
  line-height: 1;
  width: 22px;
}
.nav-count {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #ffffff80;
}
.section-label,
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--muted);
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #7c7c7c;
}
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  margin: 14px 0 7px;
}
.field-help {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 16px;
}
.scan-settings #topics {
  background: #FFFFFF;
  font-size: 12px;
}
.settings-group {
  border-top: 1px solid #d4d4d4;
  padding: 13px 0;
  font-size: 12px;
}
.settings-group summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 550;
  list-style: none;
}
.settings-group[open] summary span {
  transform: rotate(45deg);
}
.settings-group select {
  width: 100%;
}
.age-range {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 16px;
}
.scan-button {
  width: 100%;
  justify-content: space-between !important;
  margin-top: 14px;
  padding: 12px !important;
}
.stop-button {
  width: 100%;
  margin-top: 8px;
}
.scan-note {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin: 10px 0 20px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 25px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
}
.sidebar-bottom button {
  margin-left: auto;
  font-size: 10px;
}
main {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 45px 54px 20px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 25px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
}
h1 {
  font-family: "Manrope", var(--font);
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -1.65px;
  margin: 14px 0 12px;
}
h1 span {
  color: #7e7e7e;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.content-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 54px;
  margin-bottom: 15px;
}
.section-title {
  font-size: 14px;
  font-weight: 650;
  display: flex;
  gap: 9px;
  align-items: center;
}
.count-pill {
  background: #FFFFFF;
  color: #585858;
  font-size: 10px;
  border-radius: 5px;
  padding: 1px 6px;
}
.toolbar-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.toolbar-actions select {
  background: transparent;
  border-color: transparent;
  padding: 6px 20px 6px 4px;
  color: var(--muted);
  font-size: 11px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 23px 25px;
  margin-bottom: 16px;
  position: relative;
  box-shadow: 0 2px 3px #28282802;
}
.card.is-replied {
  border-color: #b3b3b3;
  background: #FFFFFF;
  box-shadow: inset 3px 0 #767676;
}
.top {
  display: flex;
  gap: 11px;
  align-items: center;
}
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #6a6a6a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.author {
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.author:hover {
  text-decoration: underline;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}
.score {
  margin-left: auto;
  text-align: right;
  font-size: 11px;
  font-weight: 650;
  color: #5a5a5a;
  white-space: nowrap;
}
.score small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
}
.score.medium {
  color: #8a753e;
}
.score.low {
  color: var(--muted);
}
.text {
  font-size: 15px;
  line-height: 1.8;
  margin: 17px 0 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.metrics {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
  padding-bottom: 15px;
}
.metrics span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.metrics svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.why {
  background: #FFFFFF;
  border-radius: 7px;
  padding: 10px 12px;
  margin: 0 0 17px;
  font-size: 12px;
  line-height: 1.65;
  color: #5e5e5e;
}
.why b {
  color: #444444;
  font-size: 10px;
  margin-right: 6px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.actions .spacer {
  margin-left: auto;
}
.chip {
  font-size: 10px;
  background: #FFFFFF;
  border-radius: 4px;
  color: #666666;
  padding: 2px 6px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  color: #525252;
  font-size: 9px;
  font-weight: 650;
  padding: 3px 7px;
  border-radius: 4px;
  margin-left: 5px;
}
.replies {
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 17px;
}
.reply {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
}
.reply:first-child {
  margin-top: 0;
}
.reply-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.reply textarea {
  min-height: 95px;
  background: white;
  font-size: 14px;
  margin-bottom: 9px;
}
.reply .count {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}
.reply .count.over {
  color: var(--danger);
}
.reply p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0 12px;
  font-size: 14px;
}
.posted {
  background: #FFFFFF;
  border-color: #c8c8c8;
}
.posted .tag {
  color: #585858;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.7px;
}
.posted .saved-time {
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 8px;
}
.posted details {
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0;
}
.posted summary {
  cursor: pointer;
}
.posted .text-button {
  font-size: 10px;
}
.voice-note {
  color: #656565;
  font-size: 11px;
  margin-bottom: 10px;
}
.empty {
  text-align: center;
  padding: 65px 25px 70px;
  border: 1px dashed #cdcdcd;
  border-radius: 12px;
  background: #FFFFFF;
  margin-bottom: 18px;
}
.empty-symbol {
  font-size: 32px;
  color: #5c5c5c;
  width: 65px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cacaca;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: #FFFFFF;
}
.empty h2 {
  font:
    600 21px "Manrope",
    var(--font);
  letter-spacing: -0.6px;
  margin: 0 0 10px;
}
.empty p {
  color: var(--muted);
  font-size: 12px;
  max-width: 330px;
  margin: 0 auto 21px;
}
.activity {
  border-top: 1px solid var(--border);
  margin-top: 26px;
  font-size: 11px;
  color: var(--muted);
}
.activity summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  cursor: pointer;
}
.activity summary span:last-child {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 65%;
  font-size: 10px;
}
#log {
  max-height: 180px;
  overflow: auto;
  font:
    11px/1.7 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
}
.err {
  color: var(--danger);
}
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff0e8;
  color: #8e4836;
  padding: 10px 14px;
  margin-bottom: 20px;
  border: 1px solid #ebcabb;
  border-radius: 8px;
  font-size: 12px;
}
.notice button {
  background: transparent;
  border: 0;
  font-size: 19px;
  padding: 0 5px;
}
.scan-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 12px;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #bbbbbb;
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.history-filters {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.history-filters input[type="search"] {
  flex: 1;
  font-size: 12px;
  padding: 12px;
}
.toggle-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.toggle-label input {
  position: absolute;
  opacity: 0;
  width: 32px;
  height: 20px;
  margin: 0;
}
.switch-track {
  display: block;
  width: 31px;
  height: 18px;
  background: #cacaca;
  border-radius: 12px;
  position: relative;
  pointer-events: none;
}
.switch-track:after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  left: 3px;
  top: 3px;
  transition: transform 0.15s;
}
.toggle-label input:checked + .switch-track {
  background: var(--accent);
}
.toggle-label input:checked + .switch-track:after {
  transform: translateX(13px);
}
.toggle-label input:focus-visible + .switch-track {
  outline: 3px solid #919191;
  outline-offset: 3px;
}
.load-more {
  display: flex;
  margin: 20px auto;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: #3a3a3a;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 5px 20px #0002;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 9px;
  color: #808080;
}
footer span:first-child {
  letter-spacing: 1.6px;
  font-weight: 600;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  padding: 32px;
  max-width: 420px;
  width: calc(100% - 32px);
}
dialog::backdrop {
  background: #28282866;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font:
    600 28px "Manrope",
    var(--font);
  letter-spacing: -1px;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
dialog input {
  width: 100%;
}
dialog .actions {
  margin-top: 24px;
}
.manual-editor {
  margin-top: 14px;
}
.loading {
  padding: 45px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
@media (min-width: 1600px) {
  main {
    padding-top: 60px;
  }
}
@media (max-width: 1150px) {
  main {
    padding: 35px 30px;
  }
}
@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 215px minmax(0, 1fr);
  }
  .sidebar {
    padding: 26px 16px;
  }
  .brand {
    font-size: 20px;
  }
  .brand-caption {
    font-size: 7px;
  }
  .brand-mark {
    width: 34px;
    height: 37px;
  }
  main {
    padding: 30px 23px;
  }

  .content-toolbar {
    flex-wrap: wrap;
    gap: 7px;
  }
  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  .history-filters {
    flex-wrap: wrap;
    gap: 12px;
  }
  .history-filters input {
    flex-basis: 100%;
  }
  .card {
    padding: 19px;
  }
  .metrics {
    gap: 12px;
  }
  .chip {
    max-width: 160px;
  }
  .actions button,
  .actions a.btn {
    padding: 8px 10px;
    font-size: 11px;
  }
}
@media (max-width: 600px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    overflow: visible;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    font-size: 22px;
  }
  .brand-caption {
    font-size: 7px;
  }
  .tabs {
    margin: 20px 0 0;
    display: flex;
    gap: 8px;
  }
  .tabs button {
    flex: 1;
  }
  .scan-settings {
    margin-top: 24px;
  }
  .section-label {
    margin-bottom: 10px;
  }
  .scan-settings #topics {
    min-height: 65px;
    height: 65px;
  }
  .settings-group {
    padding: 11px 0;
  }
  .sidebar-bottom {
    display: none;
  }
  body[data-tab="history"] .scan-settings {
    display: none;
  }
  main {
    padding: 28px 20px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.2px;
  }
  h1 {
    font-size: 29px;
    letter-spacing: -1.3px;
  }

  .card {
    padding: 18px 16px;
  }
  .text {
    font-size: 14px;
  }
  .metrics {
    gap: 15px;
    flex-wrap: wrap;
  }
  .top {
    gap: 9px;
  }
  .score {
    font-size: 10px;
  }
  .post-meta {
    font-size: 9px;
  }
  .chip {
    max-width: 170px;
  }
  .actions {
    gap: 6px;
  }
  .actions .spacer {
    margin-left: 0;
  }
  .empty {
    padding: 45px 20px;
  }
  .section-title {
    font-size: 13px;
  }
  .history-filters input[type="search"] {
    width: 100%;
  }
  footer {
    font-size: 8px;
    gap: 10px;
  }
  .toast {
    width: calc(100% - 40px);
    text-align: center;
  }
  .reply {
    padding: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.mobile-settings {
  display: none;
}
@media (max-width: 600px) {
  .mobile-settings {
    display: flex;
    width: 100%;
    justify-content: space-between;
    background: transparent;
    border: 0;
    padding: 2px 0 8px;
    color: var(--muted);
  }
  .radar-options {
    display: none;
    padding-top: 16px;
  }
  .sidebar.settings-open .radar-options {
    display: block;
  }
  .sidebar.settings-open .mobile-settings span {
    transform: rotate(45deg);
  }
  .scan-settings {
    margin-top: 18px;
  }
  .scan-button {
    margin-top: 5px;
  }
  .scan-note {
    margin-bottom: 0;
  }
  .sidebar-bottom {
    display: flex;
    padding-top: 8px;
    margin-top: 0;
  }
  .sidebar-bottom .live-dot,
  .sidebar-bottom > span {
    display: none;
  }
  .sidebar-bottom button {
    padding: 0;
    font-size: 10px;
  }
  .sidebar {
    padding-bottom: 12px;
  }
}

@media (max-width: 600px) {
  .history-filters input[type="search"] {
    flex: 1 1 100%;
  }
}

.page-heading > div {
  min-width: 0;
}
.header-stats {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
  text-align: right;
  margin-top: 2px;
}
.header-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.header-stats strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.header-stats span {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 1250px) {
  .page-heading {
    flex-direction: column-reverse;
    gap: 18px;
  }
  .header-stats {
    align-self: flex-end;
  }
}
@media (max-width: 600px) {
  .page-heading {
    gap: 22px;
    padding-bottom: 20px;
    margin-bottom: 10px;
  }
  .header-stats {
    gap: 20px;
    margin-top: -8px;
  }
  .header-stats strong {
    font-size: 14px;
  }
  .header-stats span {
    font-size: 8px;
  }
}

/* X-style posts and reply threads. These rules stay inside feed/history cards. */
.tweet-card {
  --tweet-ink: #e7e9ea;
  --text: #e7e9ea;
  --muted: #8b98a5;
  --border: #2f3336;
  --panel: #000;
  --accent: #1d9bf0;
  color-scheme: dark;
  --tweet-muted: #8b98a5;
  --tweet-line: #2f3336;
  --tweet-blue: #1d9bf0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--tweet-ink);
  background: #000;
  border: 0;
  border-bottom: 1px solid #2f3336;
  border-radius: 0;
  padding: 16px;
  margin-bottom: 0;
  box-shadow: none;
}
.tweet-card.is-replied {
  background: #000;
  border-color: #2f3336;
  box-shadow: inset 3px 0 #767676;
}
.tweet-card .post-root,
.tweet-card .tweet-reply {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
}
.tweet-card .tweet-rail,
.tweet-card .reply-rail {
  position: relative;
}
.tweet-card .avatar {
  width: 40px;
  height: 40px;
  font-size: 13px;
  color: #a5b5c2;
  background: #202a33;
  position: relative;
  z-index: 1;
}
.tweet-card .tweet-rail::after,
.tweet-card .reply-rail::after {
  content: "";
  position: absolute;
  left: 19px;
  width: 2px;
  background: #2f3336;
  top: 46px;
  bottom: -20px;
  display: none;
}
.tweet-card.is-replied .tweet-rail::after {
  display: block;
}
.tweet-card .tweet-reply:not(:last-child) .reply-rail::after {
  display: block;
}
.tweet-card .tweet-body,
.tweet-card .reply-content {
  min-width: 0;
}
.tweet-card .top {
  align-items: flex-start;
  gap: 8px;
  min-height: 23px;
}
.tweet-card .tweet-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  min-width: 0;
}
.tweet-card .author {
  color: var(--tweet-ink);
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.tweet-card .tweet-handle,
.tweet-card .tweet-date {
  font-size: 14px;
  color: var(--tweet-muted);
  overflow-wrap: anywhere;
}
.tweet-card .tweet-origin {
  color: var(--tweet-muted);
  text-decoration: none;
  font-size: 18px;
  line-height: 20px;
  margin-left: auto;
  padding: 0 4px;
}
.tweet-card .tweet-copy {
  margin: 2px 0 0;
}
.tweet-card .tweet-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}
.tweet-card button.expand-text {
  border: 0;
  background: transparent;
  color: var(--tweet-blue);
  font-size: 14px;
  font-weight: 400;
  padding: 2px 0;
  border-radius: 0;
  margin-top: 3px;
  min-height: 28px;
}
.tweet-card button.expand-text:hover {
  text-decoration: underline;
}
.tweet-card .metrics {
  justify-content: space-between;
  max-width: 510px;
  gap: 12px;
  padding: 0;
  margin: 13px 0;
  color: var(--tweet-muted);
  font-size: 12px;
}
.tweet-card .metrics svg {
  width: 17px;
  height: 17px;
}
.tweet-card .metrics span {
  gap: 7px;
}
.tweet-card .post-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  border-top: 1px solid var(--tweet-line);
  padding-top: 11px;
  margin-top: 2px;
}
.tweet-card .chip {
  font-size: 11px;
  background: #16181c;
  color: var(--tweet-muted);
  border-radius: 4px;
  max-width: 100%;
}
.tweet-card .score {
  font-size: 11px;
  margin: 0;
  font-weight: 500;
  color: var(--tweet-muted);
}
.tweet-card .badge {
  font-size: 9px;
  font-weight: 600;
  background: #202020;
  color: #a0a0a0;
  border-radius: 4px;
  margin-left: 0;
}
.tweet-card .why {
  background: transparent;
  padding: 0;
  margin: 9px 0 11px;
  color: var(--tweet-muted);
  font-size: 12px;
}
.tweet-card .why summary {
  cursor: pointer;
  width: fit-content;
}
.tweet-card .why p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.tweet-card .actions {
  margin-top: 11px;
  gap: 8px;
}
.tweet-card .actions button,
.tweet-card .actions a.btn {
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 650;
  background: #000;
  border-color: #2f3336;
  color: var(--tweet-ink);
}
.tweet-card .actions button:hover,
.tweet-card .actions a.btn:hover {
  background: #181818;
}
.tweet-card .actions button.primary {
  background: #eff3f4;
  border-color: #eff3f4;
  color: #0f1419;
}
.tweet-card .actions button.primary:hover {
  background: #d7dbdc;
}
.tweet-card .actions button.text-button {
  color: var(--tweet-muted);
  border-color: transparent;
  font-weight: 400;
}
.tweet-card .replies {
  border: 0;
  margin: 0;
  padding: 0;
}
.tweet-card .thread-replies:empty,
.tweet-card .thread-drafts:empty {
  display: none;
}
.tweet-card .thread-replies {
  margin-top: 20px;
}
.tweet-card .tweet-reply {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0 0 20px;
}
.tweet-card .tweet-reply:last-child {
  padding-bottom: 0;
}
.tweet-card .self-avatar {
  background: #202020;
  color: #a0a0a0;
}
.tweet-card .reply-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}
.tweet-card .saved-time {
  font-size: 13px;
  color: var(--tweet-muted);
  margin: 0;
}
.tweet-card .posted .tag {
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
  color: #a0a0a0;
}
.tweet-card .replying-to {
  font-size: 13px;
  color: var(--tweet-muted);
  margin: 1px 0 4px;
}
.tweet-card .replying-to a {
  color: var(--tweet-blue);
  text-decoration: none;
}
.tweet-card .replying-to a:hover {
  text-decoration: underline;
}
.tweet-card .posted .original-draft {
  font-size: 12px;
  color: var(--tweet-muted);
  margin: 12px 0 0;
}
.tweet-card .original-draft .tweet-copy {
  border-left: 2px solid #2f3336;
  padding-left: 12px;
  margin-top: 8px;
}
.tweet-card .posted button.text-button {
  font-size: 11px;
  color: var(--tweet-muted);
  padding: 5px 0;
  margin-top: 7px;
  background: transparent;
}
.tweet-card .thread-drafts {
  margin: 18px 0 0 52px;
  padding-top: 16px;
  border-top: 1px solid var(--tweet-line);
}
.tweet-card .thread-drafts .reply {
  background: #000;
  border-color: #2f3336;
  border-radius: 12px;
}
.tweet-card .thread-drafts textarea {
  border: 0;
  padding: 3px 0;
  background: transparent;
  font:
    15px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}
.tweet-card .scan-footnote {
  margin-left: 52px;
  color: var(--tweet-muted);
  font-size: 10px;
}
@media (max-width: 600px) {
  .tweet-card {
    padding: 14px 12px;
    border-radius: 0;
  }
  .tweet-card .post-root,
  .tweet-card .tweet-reply {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }
  .tweet-card .avatar {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }
  .tweet-card .tweet-rail::after,
  .tweet-card .reply-rail::after {
    left: 16px;
    top: 40px;
  }
  .tweet-card .tweet-handle,
  .tweet-card .tweet-date {
    font-size: 12px;
  }
  .tweet-card .tweet-text,
  .tweet-card .author {
    font-size: 14px;
  }
  .tweet-card .metrics {
    gap: 6px;
    font-size: 11px;
  }
  .tweet-card .metrics span {
    gap: 4px;
  }
  .tweet-card .metrics svg {
    width: 15px;
    height: 15px;
  }
  .tweet-card .actions {
    gap: 6px;
  }
  .tweet-card .actions button,
  .tweet-card .actions a.btn {
    font-size: 11px;
    padding: 7px 10px;
  }
  .tweet-card .thread-drafts {
    margin-left: 43px;
  }
  .tweet-card .scan-footnote {
    margin-left: 43px;
  }
  .tweet-card .posted .tag {
    margin-left: 0;
  }
}

/* The surrounding workspace keeps its existing theme. */
#feed:has(.tweet-card),
#histList:has(.tweet-card) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
#feed > .tweet-card,
#histList > .tweet-card {
  min-width: 0;
  margin: 0;
  border: 1px solid #2f3336;
  border-radius: 16px;
}
#feed > .tweet-card.is-replied,
#histList > .tweet-card.is-replied {
  border-color: #555555;
}
@media (max-width: 1100px) {
  #feed:has(.tweet-card),
  #histList:has(.tweet-card) {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  #feed:has(.tweet-card),
  #histList:has(.tweet-card) {
    gap: 16px;
  }
}
.tweet-card {
  padding: 16px;
}
.tweet-card .thread-drafts .reply {
  background: #080808;
}
.tweet-card .thread-drafts textarea {
  color: var(--tweet-ink);
}
.tweet-card .reply-label,
.tweet-card .field-help,
.tweet-card .reply .count {
  color: var(--tweet-muted);
}
.tweet-card .voice-note {
  color: #a0a0a0;
}
.tweet-card .err,
.tweet-card .reply .count.over {
  color: #ff8b85;
}
.tweet-card .actions button:disabled {
  opacity: 0.6;
}
.tweet-card .posted button.text-button:hover {
  color: #e7e9ea;
}
.tweet-card .metrics .metric-likes:hover {
  color: #f91880;
}
.tweet-card .metrics .metric-reposts:hover {
  color: #5d5d5d;
}
.tweet-card .metrics .metric-replies:hover,
.tweet-card .metrics .metric-views:hover {
  color: #1d9bf0;
}
@media (max-width: 600px) {
  .tweet-card {
    padding: 14px 12px;
  }
}

/* Shared MyReply icon system: geometry is generated, layout belongs here. */
[data-action-icon]::before {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: .45em;
  vertical-align: -.18em;
  flex: none;
  background: currentColor;
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
}
.brand-mark { padding: 0; }
.brand-mark .mr-icon { width: 27px; height: 27px; }
.tabs .mr-icon { width: 21px; height: 21px; }
.section-title > .mr-icon { color: var(--accent); margin-right: 6px; }
.section-label .mr-icon { width: 16px; height: 16px; margin-right: 5px; }
.settings-group summary { display: flex; align-items: center; gap: 8px; }
.settings-group summary > .mr-icon:last-child { margin-left: auto; width: 15px; height: 15px; transition: transform .15s ease; }
.settings-group[open] summary > .mr-icon:last-child { transform: rotate(180deg); }
.scan-button > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.metric .mr-icon { width: 18px; height: 18px; }
.tweet-origin[data-action-icon]::before { width: 18px; height: 18px; margin: 0; }
.empty-symbol.mr-icon { width: 42px; height: 42px; border: 0; border-radius: 0; background: var(--accent); }
.badge::before, .posted .tag::before { content: ""; display:inline-block; width:13px; height:13px; margin-right:5px; vertical-align:-2px; background:currentColor; mask:url("icons/check.svg") center/contain no-repeat; }
@media (prefers-reduced-motion: reduce) { .settings-group summary > .mr-icon { transition: none; } }

.section-label { justify-content: flex-start; gap: 6px; }
.section-label .live-dot { margin-left: auto; }

/* Two-voice identity: a white tile, graphite outline, yellow reply. */
.brand-mark { background:#fff; color:#25282b; border:1.5px solid #d9dde3; border-radius:10px; }
.brand-mark .mr-icon { width:34px; height:34px; }

/* Two Voices: white canvas, graphite controls, small yellow highlights. */
:root { --bg:#fff; --panel:#fff; --sidebar:#fafbfc; --text:#25282b; --muted:#6b7078; --border:#e8eaed; --accent:#25282b; --accent-soft:#f3f4f6; --high:#25282b; --highlight:#ebcb32; }
.tabs button.active { color:var(--text); background:#f3f4f6; box-shadow:inset 3px 0 var(--highlight); }
button.primary:hover { background:#3a3d41; }
.live-dot, h1 span { color:var(--highlight); }
.live-dot { background:var(--highlight); }
:focus-visible { outline-color:#a68c14; }
.tweet-card.is-replied { box-shadow:none; }
#feed > .tweet-card.is-replied, #histList > .tweet-card.is-replied { border-color:#5c542e; }
.tweet-card .badge, .tweet-card .posted .tag { color:#ebcb32; background:transparent; }

.tweet-card .self-avatar, .tweet-card .voice-note, .tweet-card .metrics .metric-reposts:hover { color:#ebcb32; }

/* First use: a quiet introduction, a single sign-in action, then personal interests. */
.welcome-dialog { max-width: 520px; width: calc(100% - 32px); padding: 32px; border: 1px solid #dde1e6; border-radius: 20px; color: #25282b; background: #fff; max-height: calc(100dvh - 32px); overflow: auto; }
.welcome-dialog::backdrop { background: rgb(37 40 43 / 45%); backdrop-filter: blur(4px); }
.welcome-dialog h2 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; letter-spacing: -.8px; margin: 24px 0 16px; }
.welcome-dialog p { line-height: 1.55; }
.welcome-dialog .eyebrow { display: flex; align-items: center; gap: 12px; }
.welcome-dialog .eyebrow .mr-icon { width: 36px; height: 36px; }
.welcome-dialog .welcome-steps { padding-left: 22px; margin: 24px 0; }
.welcome-steps li { padding: 6px 0 6px 8px; }
.google-login { display: flex; align-items: center; justify-content: center; gap: 12px; text-align: center; background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 600; padding: 14px; border-radius: 10px; text-decoration: none; margin: 24px 0 12px; }
.google-login[hidden] { display: none; }
.topic-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.consent-line { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.consent-line input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; accent-color: #25282b; }
.welcome-dialog .actions { flex-wrap: wrap; gap: 16px; margin-top: 24px; }


/* Semantic contrast: keep active, busy, unavailable and destructive distinct. */
:root {
  --text: #25282b; --muted: #626a73; --border: #d8dde3;
  --accent: #25282b; --accent-soft: #f3f5f7; --highlight: #ebcb32;
  --disabled-bg: #e9ecef; --disabled-text: #616872;
  --danger: #b42332; --warning: #855c00;
}
button:disabled { opacity: 1; color: var(--disabled-text); background: var(--disabled-bg); border-color: var(--border); }
button.primary:disabled { color: var(--disabled-text); background: var(--disabled-bg); border-color: var(--border); }
#scan[aria-busy="true"] { color: #fff; background: var(--accent); border-color: var(--accent); opacity: 1; }
#scan[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border: 2px solid #707780; border-top-color: var(--highlight); border-radius: 50%; animation: spin .8s linear infinite; }
.scan-progress { color: var(--text); background: var(--accent-soft); border: 1px solid var(--border); }
.spinner { border-color: #c4cbd2; border-top-color: var(--text); }
:focus-visible { outline: 3px solid #806800; outline-offset: 3px; }
.tweet-card { --tweet-muted: #adb5bd; --muted: #adb5bd; --danger: #ffaaa0; --disabled-text: #adb5bd; --disabled-bg: #30353a; }
.tweet-card .actions button:disabled { opacity: 1; color: var(--disabled-text); background: var(--disabled-bg); border-color: #454b52; }
.tweet-card .err, .tweet-card .reply .count.over { color: var(--danger); }
.tweet-card .metrics .metric-likes:hover, .tweet-card .metrics .metric-reposts:hover,
.tweet-card .metrics .metric-replies:hover, .tweet-card .metrics .metric-views:hover { color: var(--highlight); }
.tweet-card :focus-visible { outline-color: var(--highlight); }
@media (prefers-reduced-motion: reduce) { .spinner, #scan[aria-busy="true"]::after { animation: none; } }
