:root {
  --ink: #17324f;
  --muted: #5a6b7d;
  --line: #d8e6f2;
  --surface: #ffffff;
  --subtle: #f0f5fa;
  --accent: #07519a;
  --accent-deep: #063d76;
  --accent-light: #287aad;
  --accent-soft: #e8f0fa;
  --page: #eef7ff;
  --success: #16865c;
  --shadow: 0 18px 50px rgba(0, 60, 124, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  min-height: 64px;
  padding: 8px 24px;
  display: grid;
  grid-template-columns: calc(370px - 24px) minmax(0, 1fr);
  align-items: center;
  gap: 0;
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 14px rgba(0, 47, 101, 0.18);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  flex: 0 0 auto;
}

.brand {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 9px 9px 9px 3px;
  background: rgba(255, 255, 255, 0.16);
  color: white;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
}

.mode-switch {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  width: max-content;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  justify-self: end;
}

.mode-button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
}

.mode-button:hover,
.mode-button:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  outline: none;
}

.mode-button.is-active {
  background: white;
  color: var(--accent-deep);
  box-shadow: 0 2px 8px rgba(0, 47, 101, 0.2);
}

.sync-state {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  white-space: nowrap;
  justify-self: end;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.sync-state.is-ok .sync-dot {
  background: #7be0b2;
  box-shadow: 0 0 0 4px rgba(123, 224, 178, 0.18);
}

.workspace {
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(310px, 370px) minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
}

.inbox,
.reader {
  background: var(--surface);
  min-width: 0;
}

.inbox {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.article-search {
  display: flex;
  gap: 7px;
  width: 100%;
  margin: 0;
}

.mode-controls {
  min-height: 52px;
  flex: 0 0 auto;
  padding: 9px 24px;
  border-bottom: 1px solid var(--line);
  background: #f7fbff;
}

.article-search > input,
.source-filter-trigger {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  outline: none;
}

.article-search > input {
  flex: 1;
}

.date-filter {
  position: relative;
  flex: 0 0 auto;
}

.date-range-trigger {
  min-width: 132px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid #d8deea;
  background: white;
  color: #344054;
  white-space: nowrap;
}

.date-range-trigger:hover,
.date-range-trigger:focus-visible,
.date-filter.is-open .date-range-trigger {
  border-color: #8dbbe5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(7, 81, 154, 0.1);
}

.date-range-icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid #7a8598;
  border-radius: 3px;
  position: relative;
}

.date-range-icon::before {
  content: "";
  position: absolute;
  inset: 3px -1.5px auto;
  border-top: 1.5px solid #7a8598;
}

.date-range-chevron {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid #8b95a6;
  border-bottom: 1.5px solid #8b95a6;
  transform: translateY(-2px) rotate(45deg);
}

.date-filter.is-open .date-range-chevron {
  transform: translateY(2px) rotate(225deg);
}

.date-range-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(584px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 18px 42px rgba(0, 60, 124, 0.16);
}

.date-range-popover[hidden] {
  display: none;
}

.date-preset-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.article-search .date-preset-list button {
  border: 1px solid #e0e5ed;
  background: #f7f8fb;
  color: #566176;
}

.article-search .date-preset-list button:hover,
.article-search .date-preset-list button:focus-visible {
  border-color: #9bb0e8;
  color: var(--accent);
  outline: none;
}

.article-search .date-preset-list button.is-active {
  border-color: #aabdf0;
  background: var(--accent-soft);
  color: var(--accent);
}

.date-calendar {
  margin-top: 14px;
  border: 1px solid #e5e9f0;
  border-radius: 10px;
  overflow: hidden;
}

.calendar-toolbar {
  min-height: 38px;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  padding: 0 6px;
  border-bottom: 1px solid #edf0f5;
  color: #7a8598;
  font-size: 0.72rem;
  text-align: center;
}

.article-search .calendar-nav-button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #566176;
  font-size: 1.25rem;
  font-weight: 500;
}

.article-search .calendar-nav-button:hover,
.article-search .calendar-nav-button:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.article-search .calendar-nav-button:disabled {
  cursor: default;
  opacity: 0.25;
}

.calendar-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-panel {
  min-width: 0;
  padding: 12px;
}

.calendar-panel + .calendar-panel {
  border-left: 1px solid #edf0f5;
}

.calendar-panel h3 {
  margin: 0 0 10px;
  color: #344054;
  font-size: 0.8rem;
  font-weight: 680;
  text-align: center;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays {
  margin-bottom: 5px;
  color: #98a2b3;
  font-size: 0.66rem;
  text-align: center;
}

.calendar-weekdays span {
  padding: 4px 0;
}

.article-search .calendar-day {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #344054;
  font-size: 0.72rem;
  font-weight: 520;
}

.article-search .calendar-day::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px 0;
  background: transparent;
}

.article-search .calendar-day:hover:not(:disabled)::before,
.article-search .calendar-day:focus-visible:not(:disabled)::before {
  inset-inline: 2px;
  border-radius: 6px;
  background: #f0f7fd;
}

.article-search .calendar-day:focus-visible {
  outline: none;
}

.article-search .calendar-day.is-in-range::before {
  background: var(--accent-soft);
}

.article-search .calendar-day.is-range-start::before,
.article-search .calendar-day.is-range-end::before {
  inset-inline: 2px;
  border-radius: 6px;
  background: var(--accent);
}

.article-search .calendar-day.is-range-start,
.article-search .calendar-day.is-range-end {
  color: white;
  font-weight: 700;
}

.article-search .calendar-day.is-today:not(.is-range-start, .is-range-end) {
  color: var(--accent);
  font-weight: 700;
}

.article-search .calendar-day:disabled {
  cursor: not-allowed;
  color: #c7ced9;
}

.calendar-day-spacer {
  height: 30px;
}

.date-range-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #edf0f5;
  color: #98a2b3;
  font-size: 0.7rem;
}

.selected-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #566176;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.article-search .date-range-footer button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

.source-filter {
  position: relative;
  width: 184px;
  min-width: 0;
  flex: 0 0 184px;
}

.source-filter-native {
  display: none;
}

.article-search .source-filter-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 9px;
  border-color: var(--line);
  background: white;
  color: #33475b;
  cursor: pointer;
  list-style: none;
  text-align: left;
  user-select: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.source-filter-trigger::-webkit-details-marker {
  display: none;
}

.source-filter-trigger:hover,
.source-filter-trigger:focus-visible,
.source-filter[open] .source-filter-trigger {
  border-color: #8dbbe5;
  background: #fbfdff;
  box-shadow: 0 0 0 3px rgba(7, 81, 154, 0.1);
  outline: none;
}

.source-filter-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 6px;
  background: var(--accent-soft);
}

.source-filter-icon::before {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(7, 81, 154, 0.14);
  content: "";
}

.source-filter-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.source-filter-chevron {
  width: 7px;
  height: 7px;
  flex: none;
  border-right: 1.5px solid #7b8da1;
  border-bottom: 1.5px solid #7b8da1;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 140ms ease;
}

.source-filter[open] .source-filter-chevron {
  transform: translateY(2px) rotate(225deg);
}

.source-filter-popover {
  position: absolute;
  z-index: 42;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 18px 42px rgba(0, 60, 124, 0.16);
}

.source-filter-heading {
  padding: 7px 9px 8px;
  color: #7b8da1;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.source-filter-options {
  max-height: min(330px, calc(100vh - 170px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #bed1e2 transparent;
  scrollbar-width: thin;
}

.article-search .source-filter-option {
  width: 100%;
  min-height: 40px;
  height: auto;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #33475b;
  font-size: 0.78rem;
  font-weight: 560;
  text-align: left;
}

.article-search .source-filter-option:hover,
.article-search .source-filter-option:focus-visible {
  background: #f0f7fd;
  color: var(--accent-deep);
  outline: none;
}

.article-search .source-filter-option.is-selected {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
}

.source-option-check {
  color: var(--accent);
  font-size: 0.75rem;
  text-align: center;
}

.source-option-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-option-count {
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f0f5fa;
  color: #6d8195;
  font-size: 0.66rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.source-filter-option.is-selected .source-option-count {
  background: rgba(7, 81, 154, 0.12);
  color: var(--accent);
}

.article-search input:focus,
.source-filter-trigger:focus-visible {
  border-color: #8dbbe5;
  box-shadow: 0 0 0 3px rgba(7, 81, 154, 0.1);
}

.article-search button {
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 650;
}

.search-submit {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

.search-submit:disabled {
  cursor: wait;
  opacity: 0.58;
}

.search-clear {
  border: 1px solid #d8deea;
  background: white;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: calc(370px - 24px) minmax(0, 1fr);
    gap: 0;
  }
}

@media (max-width: 980px) {

  .brand > span:last-child {
    display: none;
  }
}

.daily-toolbar {
  display: flex;
  min-width: 0;
  min-height: 40px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.date-tabs {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  gap: 14px;
  min-height: 40px;
  padding: 0 12px;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}

.date-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 2px 0 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.date-tab:hover:not(:disabled),
.date-tab:focus-visible:not(:disabled) {
  color: var(--ink);
  outline: none;
}

.date-tab:disabled {
  cursor: default;
  color: #b9c0cb;
  opacity: 0.62;
}

.date-tab:disabled small {
  color: inherit;
}

.date-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.date-tab small {
  margin-left: 4px;
  color: #98a2b3;
  font-size: 0.64rem;
  font-weight: 550;
}

.unread-only-toggle {
  position: relative;
  display: flex;
  min-width: max-content;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.71rem;
  font-weight: 620;
  user-select: none;
}

.unread-only-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.unread-checker {
  position: relative;
  width: 15px;
  height: 15px;
  flex: none;
  border: 1px solid #bcc5d2;
  border-radius: 4px;
  background: white;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.unread-checker::after {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 4px;
  height: 7px;
  border: solid white;
  border-width: 0 2px 2px 0;
  content: "";
  opacity: 0;
  transform: rotate(45deg) scale(0.8);
  transition: opacity 120ms ease, transform 120ms ease;
}

.unread-only-toggle:hover {
  color: var(--ink);
}

.unread-only-toggle input:checked + .unread-checker {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 111, 191, 0.11);
}

.unread-only-toggle input:checked + .unread-checker::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.unread-only-toggle:has(input:checked) {
  color: var(--accent);
}

.unread-only-toggle input:focus-visible + .unread-checker {
  outline: 2px solid rgba(76, 111, 191, 0.3);
  outline-offset: 2px;
}

.read-divider {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 12px 18px 7px;
  color: #7f8999;
  background: #f8f9fb;
  font-size: 0.72rem;
  font-weight: 650;
}

.read-divider::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #e5e9f0;
  color: #697386;
  font-size: 0.62rem;
}

.read-divider strong {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e9edf3;
  color: #697386;
  font-size: 0.66rem;
  text-align: center;
}

.article-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.article-card {
  width: 100%;
  padding: 10px 18px 11px;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  background: white;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 130ms ease, box-shadow 130ms ease;
}

.article-card:hover {
  background: #f6faff;
}

.article-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.article-card.is-active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.article-card.is-read:not(.is-active) {
  background: #fbfcfd;
}

.article-card.is-read:not(.is-active) .card-title {
  color: #7a8598;
  font-weight: 520;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.card-source {
  max-width: 72%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #98a2b3;
  font-weight: 500;
}

.card-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.read-label {
  color: #a5adba;
  font-size: 0.68rem;
}

.card-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 620;
  line-height: 1.4;
  letter-spacing: -0.01em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-highlight {
  padding: 0 0.1em;
  border-radius: 3px;
  background: #ffe082;
  color: #3e2f00;
  font-weight: 700;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.article-card.is-active .search-highlight {
  background: #ffd54f;
}

.reader {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-reader-nav {
  display: none;
}

.reader-empty,
.reader-loading,
.reader-error {
  min-height: 70vh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: var(--subtle);
  color: var(--accent);
  font-size: 1.5rem;
}

.reader-empty h2,
.reader-error h2 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 1.1rem;
}

.reader-empty p,
.reader-error p,
.list-placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.list-placeholder {
  padding: 34px 22px;
  text-align: center;
}

.load-more {
  display: block;
  width: calc(100% - 36px);
  margin: 14px 18px;
  padding: 10px 14px;
  border: 1px solid #d8deea;
  border-radius: 9px;
  background: white;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.load-more:hover,
.load-more:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.load-more:disabled {
  cursor: wait;
  opacity: 0.62;
}

.load-complete {
  padding: 16px 18px 20px;
  color: #98a2b3;
  font-size: 0.76rem;
  text-align: center;
}

.reader-article {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 76px) clamp(24px, 6vw, 72px) 110px;
}

.reader-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 720;
  line-height: 1.38;
  letter-spacing: -0.02em;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 18px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.original-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
}

.reader-source-inline {
  color: #98a2b3;
}

.original-link:hover {
  text-decoration: underline;
}

.article-body {
  margin-top: 34px;
  color: #253047;
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.article-body p,
.article-body div,
.article-body section {
  margin: 0 0 1.15em;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.8em 0 0.7em;
  line-height: 1.45;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em auto;
  border-radius: 8px;
}

.hidden-gif {
  display: flex;
  width: min(100%, 420px);
  min-height: 76px;
  margin: 1.5em auto;
  padding: 14px 18px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border: 1px dashed #cbd3df;
  border-radius: 8px;
  background: #f7f8fa;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.hidden-gif:hover {
  border-color: #aab5c5;
  background: #f1f3f7;
}

.hidden-gif span {
  color: #566176;
  font-size: 0.86rem;
  font-weight: 650;
}

.hidden-gif small {
  font-size: 0.75rem;
}

.article-body a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid #aac0f7;
  color: #4f5e77;
}

.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: inherit;
  font-size: 0.92rem;
}

.article-body td,
.article-body th {
  padding: 8px 10px;
  border: 1px solid var(--line);
}

.telegram-list-heading {
  min-height: 96px;
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.telegram-workspace {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
}

.telegram-inbox {
  border-right: 0;
  background: #f8fafc;
}

.telegram-heading-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.chat-analysis-running {
  display: inline-block;
  margin-left: 5px;
  color: #3562c8;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 650;
}

.manage-chats-button,
.secondary-button,
.primary-button,
.sync-analyze-button {
  appearance: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 650;
}

.manage-chats-button {
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--accent);
  font-size: 0.72rem;
}

.manage-chats-button:hover,
.secondary-button:hover {
  background: var(--subtle);
}

.eyebrow,
.section-label {
  display: block;
  color: #8792a5;
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.telegram-list-heading h1,
.telegram-detail-header h2,
.setup-panel h2 {
  margin: 5px 0 0;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.telegram-list-heading h1 {
  font-size: 1.12rem;
}

.message-total {
  flex: none;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 0.7rem;
}

.chat-list {
  flex: 1;
  min-height: 0;
  padding: 10px;
  overflow-y: auto;
}

.chat-card {
  width: 100%;
  margin-bottom: 6px;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.chat-card:hover {
  border-color: #e1e6ee;
  background: white;
}

.chat-card.is-active {
  border-color: #cbd8fb;
  background: linear-gradient(135deg, #f7f9ff 0%, #eaf0ff 100%);
  box-shadow: 0 5px 16px rgba(37, 87, 214, 0.08);
}

.chat-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.chat-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.chat-card-top strong {
  overflow: hidden;
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-card-top span,
.chat-focus,
.chat-error {
  color: var(--muted);
  font-size: 0.72rem;
}

.chat-card-top span {
  flex: none;
}

.chat-focus {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-error {
  display: block;
  margin-top: 5px;
  color: #b54747;
}

.telegram-sidebar-note {
  margin: 18px;
  padding: 14px;
  border: 1px dashed #cfd6e3;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.telegram-sidebar-note strong,
.telegram-sidebar-note span {
  display: block;
}

.telegram-sidebar-note strong {
  margin-bottom: 3px;
  color: var(--ink);
}

.telegram-reader {
  background:
    radial-gradient(circle at 72% 0%, rgba(213, 224, 255, 0.42), transparent 34%),
    #f5f7fa;
}

.setup-panel {
  width: min(620px, calc(100% - 48px));
  margin: clamp(48px, 9vh, 100px) auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow);
}

.setup-panel h2 {
  font-size: 1.45rem;
}

.setup-panel > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.setup-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.setup-step {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.step-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: #eef1f6;
  color: #98a2b3;
  font-weight: 800;
}

.setup-step.is-done .step-check {
  background: #e7f6ef;
  color: var(--success);
}

.setup-step strong,
.setup-step small {
  display: block;
}

.setup-step strong {
  font-size: 0.9rem;
}

.setup-step small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.setup-footnote {
  margin-top: 16px;
  color: #8792a5;
  font-size: 0.74rem;
}

.telegram-detail {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 34px clamp(24px, 3.8vw, 54px) 80px;
}

.telegram-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 0 2px;
}

.analysis-actions {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

.sync-analyze-button,
.primary-button {
  padding: 9px 13px;
  border: 1px solid #1849bd;
  background: var(--accent);
  color: white;
  font-size: 0.78rem;
  box-shadow: 0 5px 14px rgba(37, 87, 214, 0.18);
}

.sync-analyze-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sync-analyze-button .button-hover-label {
  display: none;
}

.sync-analyze-button.has-hover-label:hover .button-default-label,
.sync-analyze-button.has-hover-label:focus-visible .button-default-label {
  display: none;
}

.sync-analyze-button.has-hover-label:hover .button-hover-label,
.sync-analyze-button.has-hover-label:focus-visible .button-hover-label {
  display: inline;
}

.sync-analyze-button:hover,
.primary-button:hover {
  background: #1e49b8;
}

.sync-analyze-button:disabled,
.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.inline-error {
  margin-top: 15px;
  padding: 10px 12px;
  border: 1px solid #f2c7c7;
  border-radius: 8px;
  background: #fff5f5;
  color: #a43838;
  font-size: 0.8rem;
}

.telegram-detail-header h2 {
  margin-top: 7px;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.25;
}

.telegram-detail-header p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.telegram-date-tabs {
  display: flex;
  min-height: 42px;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.telegram-date-tabs .date-tab {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 8px;
  font-size: 0.78rem;
}

.telegram-date-tabs .rolling-tab {
  flex: none;
  min-height: 42px;
  padding-inline: 13px;
  border: 1px solid #dce2eb;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(31, 42, 61, 0.04);
}

.telegram-date-divider {
  width: 1px;
  height: 24px;
  flex: none;
  margin: 0 1px;
  background: #d8dee8;
}

.telegram-natural-date-tabs {
  display: flex;
  min-height: 42px;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e1e6ee;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 4px 14px rgba(31, 42, 61, 0.04);
}

.telegram-topic-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.telegram-topic-tabs .topic-tab {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #657086;
  font-size: 0.72rem;
  box-shadow: none;
}

.telegram-topic-tabs .topic-tab:hover,
.telegram-topic-tabs .topic-tab:focus-visible {
  border-color: #bfc9da;
  background: white;
  color: #354057;
}

.telegram-topic-tabs .topic-tab.is-active {
  border-color: #cad5ef;
  background: #e9eefb;
  color: #234caa;
  font-weight: 650;
}

.telegram-topic-tabs .topic-tab small {
  margin-left: 5px;
  color: #9aa3b2;
  font-size: 0.61rem;
}

.telegram-topic-tabs .topic-tab.is-active small {
  color: #7188bd;
}

.telegram-date-tabs .date-tab.is-active {
  background: var(--ink);
  color: white;
  box-shadow: 0 3px 9px rgba(23, 32, 51, 0.18);
}

.telegram-date-tabs .date-tab.is-active small {
  color: rgba(255, 255, 255, 0.66);
}

.empty-date {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
  margin-top: 18px;
}

.analysis-card {
  min-height: 118px;
  padding: 20px;
  border: 1px solid #e2e7ef;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(34, 48, 78, 0.055);
}

.analysis-card .section-label {
  color: #68758d;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
}

.analysis-panel {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.analysis-panel-heading {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  list-style: none;
}

.analysis-panel-heading::-webkit-details-marker {
  display: none;
}

.analysis-panel-heading::after {
  content: "›";
  flex: 0 0 auto;
  color: #8a94a7;
  font-size: 1.15rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 140ms ease;
}

.analysis-panel[open] > .analysis-panel-heading {
  border-bottom-color: #edf0f5;
}

.analysis-panel[open] > .analysis-panel-heading::after {
  transform: rotate(-90deg);
}

.analysis-panel-count {
  margin-left: auto;
  color: #939daf;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
}

.analysis-not-generated {
  display: flex;
  grid-column: 1 / -1;
  min-height: 58px;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border: 1px dashed #d5dce8;
  border-radius: 14px;
  background: rgba(248, 250, 253, 0.82);
  color: #778398;
  font-size: 0.78rem;
}

.analysis-not-generated-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #e9eefb;
  color: #4966ad;
  font-size: 0.63rem;
  font-weight: 760;
}

.analysis-summary {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 0;
  border-color: #d7e1fa;
  background:
    linear-gradient(110deg, rgba(235, 241, 255, 0.9), rgba(255, 255, 255, 0.96) 62%),
    white;
  box-shadow: 0 10px 28px rgba(37, 87, 214, 0.07);
}

.analysis-summary .analysis-panel-body {
  padding: 5px 24px 22px;
}

.analysis-placeholder {
  display: grid;
  min-height: 78px;
  place-items: center;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--subtle);
  color: #8792a5;
  font-size: 0.8rem;
  line-height: 1.55;
  text-align: center;
}

.analysis-placeholder.compact {
  min-height: 68px;
  margin: 0;
}

.analysis-copy {
  max-width: 940px;
  margin: 13px 0 0;
  color: #27344d;
  font-size: 0.94rem;
  line-height: 1.82;
  letter-spacing: 0.005em;
}

.analysis-meta {
  margin-top: 14px;
  color: #8490a4;
  font-size: 0.7rem;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.topic-list > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #294fba;
  font-size: 0.78rem;
  font-weight: 620;
}

.topic-list small {
  color: #7890ce;
  font-size: 0.66rem;
}

.analysis-topics {
  grid-column: 1 / -1;
  height: auto;
  padding: 0;
  overflow: visible;
}

.analysis-notable {
  grid-column: 1 / -1;
  height: auto;
  padding: 0;
  overflow: visible;
}

.ai-topic-list {
  margin: 0;
  padding: 8px 10px 10px;
  overflow: visible;
}

.ai-topic {
  margin-top: 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f8fafc;
  transition: border-color 140ms ease, background 140ms ease;
}

.ai-topic:hover {
  border-color: #dfe5ef;
  background: #f6f8fc;
}

.ai-topic[open] {
  border-color: #d6e0f7;
  background: #fbfcff;
}

.ai-topic > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}

.ai-topic > summary::-webkit-details-marker {
  display: none;
}

.ai-topic > summary::after {
  content: "›";
  flex: 0 0 auto;
  color: #8a94a7;
  font-size: 1.2rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 140ms ease;
}

.ai-topic[open] > summary::after {
  content: "›";
  transform: rotate(-90deg);
}

.ai-topic > summary > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.ai-topic > summary small {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #e8eefc;
  color: var(--accent);
  font-size: 0.67rem;
}

.ai-topic > summary strong {
  color: #263248;
  font-size: 0.84rem;
  line-height: 1.4;
}

.ai-topic > summary em {
  margin-left: auto;
  color: #8a94a7;
  font-size: 0.68rem;
  font-style: normal;
  white-space: nowrap;
}

.ai-topic-body {
  padding: 3px 18px 18px 48px;
}

.ai-topic-body > p {
  margin: 11px 0 0;
  color: #3a465b;
  font-size: 0.82rem;
  line-height: 1.78;
  white-space: pre-wrap;
}

.ai-topic-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ai-topic-participants .participants-label {
  margin-right: 3px;
  color: #8a94a7;
  font-size: 0.68rem;
}

.ai-topic-person {
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: #f1f4f9;
}

.ai-topic-participants .ai-topic-person strong {
  color: var(--person-accent);
  font-size: 0.68rem;
  font-weight: 600;
}

.ai-topic-person .person-avatar {
  width: 20px;
  height: 20px;
  font-size: 0.58rem;
}

.ai-topic-sources {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 12px;
}

.ai-topic-sources article {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #e4e8ef;
  border-radius: 8px;
  background: white;
}

.ai-topic-sources article > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: #8a94a7;
  font-size: 0.66rem;
}

.ai-topic-sources article > div strong {
  color: var(--person-accent);
}

.ai-topic-sources p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #46536a;
  font-size: 0.72rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-topic-sources .topic-source-media {
  color: #8a94a7;
}

.ai-topic-sources img,
.notable-preview {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 220px;
  margin: 8px 0;
  border-radius: 7px;
  object-fit: contain;
}

.ai-topic-sources .topic-source-thumb {
  grid-column: 3;
  width: 64px;
  height: 46px;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
}

.ai-topic-sources a {
  color: var(--accent);
  font-size: 0.68rem;
  text-decoration: none;
}

.source-time-link {
  margin-left: auto;
  color: #8a94a7 !important;
  text-decoration: none;
}

.source-time-link:hover,
.source-time-link:focus-visible {
  color: var(--accent) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notable-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  overflow: visible;
}

.notable-list article {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #e7ebf2;
  border-radius: 10px;
  background: #fafbfc;
}

.notable-list article:last-child {
  border-bottom: 1px solid #e7ebf2;
}

.notable-list article > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.68rem;
}

.notable-context {
  display: inline-flex;
  flex: none;
  align-items: center;
}

.notable-context .source-time-link {
  margin-left: 0;
}

.notable-list article > div strong {
  color: var(--person-accent);
}

.notable-list p {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0;
  color: #354057;
  font-size: 0.78rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.notable-list a {
  color: var(--accent);
  font-size: 0.7rem;
  text-decoration: none;
}

.notable-reason {
  display: block;
  margin: 7px 0;
  padding-left: 8px;
  border-left: 2px solid #e6b85c;
  color: #77633c;
  font-size: 0.68rem;
  line-height: 1.5;
}

.chat-manager {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 32px clamp(22px, 4vw, 50px) 70px;
}

.chat-manager > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.chat-manager h2 {
  margin: 5px 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.secondary-button {
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-size: 0.76rem;
}

.manager-help {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.chat-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccd4e1;
  border-radius: 9px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  outline: none;
}

.chat-search:focus,
.focus-input:focus {
  border-color: #8aabf3;
  box-shadow: 0 0 0 3px rgba(37, 87, 214, 0.1);
}

.available-chat-list {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: white;
}

.available-chat-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f5;
}

.available-chat-row:last-child {
  border-bottom: 0;
}

.available-chat-row > input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.available-chat-copy {
  flex: 1;
  min-width: 0;
}

.available-chat-copy strong,
.available-chat-copy small {
  display: block;
}

.available-chat-copy strong {
  font-size: 0.86rem;
}

.available-chat-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.focus-input {
  width: 100%;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  outline: none;
}

.focus-input:disabled {
  display: none;
}

.manager-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 0;
  background: linear-gradient(to bottom, rgba(248, 249, 252, 0), #f8f9fc 22%);
  color: var(--muted);
  font-size: 0.78rem;
}

.message-section {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #e1e6ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 24px rgba(34, 48, 78, 0.04);
}

.message-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
}

.message-section-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.message-section-heading span {
  color: var(--muted);
  font-size: 0.72rem;
}

.message-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-y: visible;
  overflow-x: hidden;
  background: white;
}

.telegram-message {
  padding: 8px 12px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #edf0f5;
  transition: opacity 130ms ease, filter 130ms ease;
}

.message-list.is-speaker-focus-active .telegram-message.is-speaker-muted {
  opacity: 0.24;
  filter: saturate(0.45);
}

.telegram-message.is-watched-sender {
  border-left-color: #5678cc;
  background: #f5f7fd;
}

.telegram-message.is-overlap {
  background: #f1f3f6;
}

.telegram-message.is-overlap.is-watched-sender {
  border-left-color: #7187bc;
  background: #eceff6;
}

.telegram-message:last-child {
  border-bottom: 0;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.66rem;
}

.message-meta > strong,
.message-meta .person-identity > strong {
  font-size: 0.72rem;
}

.message-meta .person-avatar {
  width: 20px;
  height: 20px;
  font-size: 0.56rem;
}

.message-group-count {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f0f3f8;
  color: #7d8799;
  font-size: 0.62rem;
  white-space: nowrap;
}

.message-overlap-label {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid #d6dbe3;
  border-radius: 999px;
  background: #e4e7ec;
  color: #70798a;
  font-size: 0.6rem;
  white-space: nowrap;
}

.message-group-count + .message-overlap-label {
  margin-left: 0;
}

.message-overlap-label + .message-time-link {
  margin-left: 0;
}

.message-burst {
  margin-top: 3px;
}

.message-burst-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 5px 0;
  border-top: 1px solid #edf0f5;
}

.message-burst-item:first-child {
  border-top: 0;
}

.message-burst.is-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.message-burst.is-compact .message-burst-item {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.message-burst.is-compact .message-burst-body p {
  font-size: 0.78rem;
  line-height: 1.4;
}

.message-burst.is-compact .message-time-link {
  margin: 0;
  padding: 2px 5px;
  border-radius: 999px;
  background: #eef1f6;
  color: #788399;
  font-size: 0.61rem;
  line-height: 1.2;
}

.message-burst-body {
  min-width: 0;
}

.message-burst-body > p,
.message-burst-body > .message-copy {
  margin-top: 0;
}

.message-burst-body > .telegram-image-link {
  margin-top: 0;
}

.message-burst-item > .message-time-link {
  margin-top: 2px;
}

.person-identity {
  --person-bg: #e8eefc;
  --person-accent: #365aa6;
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.person-identity > strong {
  overflow: hidden;
  color: var(--person-accent);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-avatar {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(23, 32, 51, 0.06);
  border-radius: 50%;
  background: var(--person-bg);
  color: var(--person-accent);
  font-size: 0.64rem;
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.02em;
}

.person-tone-0 { --person-bg: #e7efff; --person-accent: #315db7; }
.person-tone-1 { --person-bg: #dff4ef; --person-accent: #157566; }
.person-tone-2 { --person-bg: #fff0ce; --person-accent: #946000; }
.person-tone-3 { --person-bg: #eee8ff; --person-accent: #6749b8; }
.person-tone-4 { --person-bg: #fde7ee; --person-accent: #ae4566; }
.person-tone-5 { --person-bg: #def2f7; --person-accent: #197487; }
.person-tone-6 { --person-bg: #ffead8; --person-accent: #a85115; }
.person-tone-7 { --person-bg: #e4f2e5; --person-accent: #397647; }
.person-tone-8 { --person-bg: #e8eafd; --person-accent: #505ca3; }
.person-tone-9 { --person-bg: #f5e5f3; --person-accent: #873f87; }

.sender-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.sender-control:hover strong,
.sender-control:focus-visible strong {
  filter: brightness(0.82);
}

.sender-control:focus-visible {
  outline: 2px solid #b8c8f5;
  outline-offset: 3px;
  border-radius: 3px;
}

.sender-follow-action {
  position: absolute;
  z-index: 4;
  top: calc(100% + 6px);
  left: 0;
  width: max-content;
  padding: 5px 8px;
  border: 1px solid #d8dee9;
  border-radius: 6px;
  background: #202a3d;
  box-shadow: 0 5px 16px rgb(31 42 61 / 16%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.sender-control:hover .sender-follow-action,
.sender-control:focus-visible .sender-follow-action {
  opacity: 1;
  transform: translateY(0);
}

.sender-control:disabled {
  cursor: wait;
}

.message-time-link {
  margin-left: auto;
  color: #8a94a7;
  font-size: 0.66rem;
  text-decoration: none;
}

.message-time-link::after {
  content: "↗";
  display: inline-block;
  width: 0;
  margin-left: 0;
  overflow: hidden;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-3px);
  transition: width 120ms ease, margin-left 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.telegram-message:hover .message-time-link,
.message-time-link:focus-visible {
  color: var(--accent);
}

.telegram-message:hover .message-time-link::after,
.message-time-link:focus-visible::after {
  width: 0.8em;
  margin-left: 3px;
  opacity: 1;
  transform: translateX(0);
}

.telegram-message p {
  margin: 4px 0 0;
  color: #2c374c;
  font-size: 0.81rem;
  line-height: 1.52;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-copy {
  margin-top: 4px;
}

.message-copy > summary {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  color: #2c374c;
  cursor: pointer;
  font-size: 0.81rem;
  line-height: 1.52;
  list-style: none;
}

.message-copy > summary::-webkit-details-marker {
  display: none;
}

.message-copy > summary span {
  flex: 1;
  min-width: 0;
}

.message-copy > summary em {
  flex: none;
  color: var(--accent);
  font-size: 0.67rem;
  font-style: normal;
  white-space: nowrap;
}

.message-copy > summary em::after {
  content: "展开全文";
}

.message-copy[open] > summary span {
  display: none;
}

.message-copy[open] > summary em::after {
  content: "收起全文";
}

.message-copy[open] > p {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed #e4e8ef;
}

.telegram-image-link {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-top: 9px;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
  vertical-align: top;
}

.telegram-image-preview {
  display: block;
  width: auto;
  max-width: min(100%, 420px);
  max-height: 300px;
  border-radius: 8px;
  background: #f3f5f8;
  object-fit: contain;
}

.settings-workspace {
  min-height: calc(100vh - 64px);
  background: #f2f4f8;
  overflow-y: auto;
}

.settings-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 80px;
}

.settings-page-heading,
.settings-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.settings-page-heading {
  margin-bottom: 26px;
}

.settings-page-heading h1 {
  margin: 5px 0 7px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.04em;
}

.settings-page-heading p,
.danger-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.settings-panel {
  min-height: 320px;
}

.settings-loading {
  padding: 70px 24px;
  color: var(--muted);
  text-align: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.settings-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid #e0e5ed;
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 30px rgba(26, 39, 67, 0.04);
}

.settings-card-heading {
  margin-bottom: 21px;
  align-items: center;
}

.settings-card-heading h2 {
  margin: 4px 0 0;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
}

.config-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f0f2f6;
  color: #778195;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.config-badge.is-configured {
  background: #e8f7f1;
  color: #137153;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: #404b60;
  font-size: 0.78rem;
  font-weight: 650;
}

.form-field-wide,
.form-submit,
.form-inline-status,
.ai-inactive-note {
  grid-column: 1 / -1;
}

.form-field input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #d8dee9;
  border-radius: 7px;
  outline: none;
  background: #fcfdff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
}

.form-field textarea {
  width: 100%;
  min-height: 290px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  outline: none;
  background: #fcfdff;
  color: #273248;
  font: 500 0.8rem/1.72 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

.form-field input:focus {
  border-color: #8eacf0;
  box-shadow: 0 0 0 3px rgba(37, 87, 214, 0.08);
}

.form-field textarea:focus {
  border-color: #8eacf0;
  box-shadow: 0 0 0 3px rgba(37, 87, 214, 0.08);
}

.form-field small,
.reset-list small {
  color: #8a94a7;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.45;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #404b60;
  font-size: 0.78rem;
  font-weight: 650;
}

.toggle-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form-inline-status,
.ai-inactive-note {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 9px 11px;
  border-radius: 7px;
  background: #f5f7fb;
  color: var(--muted);
  font-size: 0.75rem;
}

.form-submit {
  width: fit-content;
  justify-self: end;
}

.settings-notice {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #cceadd;
  border-radius: 8px;
  background: #effaf6;
  color: #14664d;
  font-size: 0.8rem;
}

.settings-notice.is-error {
  border-color: #f0cdc7;
  background: #fff5f3;
  color: #a43b2c;
}

.storage-card {
  grid-row: span 2;
}

.prompt-card {
  grid-column: 1 / -1;
}

.prompt-intro {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.prompt-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.prompt-privacy-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f6fa;
  color: #7b8699;
  font-size: 0.7rem;
  line-height: 1.55;
}

.storage-segments {
  display: flex;
  padding: 3px;
  border-radius: 8px;
  background: #f0f2f6;
}

.storage-segments button {
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 650;
}

.storage-segments button.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(26, 39, 67, 0.1);
}

.storage-overview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 8px 0 25px;
}

.storage-donut {
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  position: relative;
}

.storage-donut svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.storage-donut-track,
.storage-donut-segment {
  fill: none;
  stroke-width: 5.5;
}

.storage-donut-track {
  stroke: #e8ecf3;
}

.storage-donut-segment {
  stroke-linecap: butt;
}

.storage-donut > div {
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  width: 90px;
  text-align: center;
}

.storage-donut strong {
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.storage-donut span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.65rem;
}

.storage-donut small {
  flex-basis: 100%;
  margin-top: 2px;
  color: #98a2b3;
  font-size: 0.66rem;
}

.storage-legend {
  display: grid;
  gap: 10px;
}

.storage-legend-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto 40px;
  gap: 8px;
  align-items: center;
  font-size: 0.76rem;
}

.storage-swatch {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.storage-color-0 { background-color: #2557d6; stroke: #2557d6; }
.storage-color-1 { background-color: #14a27d; stroke: #14a27d; }
.storage-color-2 { background-color: #f59e0b; stroke: #f59e0b; }
.storage-color-3 { background-color: #8b5cf6; stroke: #8b5cf6; }
.storage-color-4 { background-color: #e15d44; stroke: #e15d44; }

.storage-legend-label,
.storage-legend-row small {
  color: var(--muted);
}

.storage-legend-row small {
  text-align: right;
}

.storage-details {
  border-top: 1px solid #e8ebf1;
}

.storage-detail-row,
.reset-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f4;
  font-size: 0.77rem;
}

.storage-detail-row > span:first-child,
.reset-list > div > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.storage-detail-row small {
  color: #8a94a7;
  font-size: 0.68rem;
}

.settings-note {
  margin: 15px 0 0;
  color: #8a94a7;
  font-size: 0.69rem;
  line-height: 1.55;
}

.danger-card {
  grid-column: 1 / -1;
  border-color: #ead9d5;
}

.danger-card .eyebrow {
  color: #b24b3b;
}

.reset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin-top: 14px;
}

.reset-list button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #e2bcb5;
  border-radius: 6px;
  background: #fff8f7;
  color: #a43b2c;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.reset-list button.is-strong {
  background: #b84636;
  color: white;
}

.reset-list button:disabled,
.form-submit:disabled {
  cursor: wait;
  opacity: 0.55;
}

 @media (max-width: 900px) {
  body {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .topbar {
    min-height: 58px;
    padding: 8px 12px;
    grid-template-columns: auto 1fr;
    gap: 10px;
  }

  .brand > span:last-child {
    display: inline;
  }

  .brand {
    gap: 7px;
    font-size: 0.86rem;
  }

  .sync-state {
    display: none;
  }

  .mode-switch {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .mode-button {
    min-height: 36px;
    padding: 0 12px;
  }

  .workspace {
    display: block;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .inbox {
    height: 100%;
    max-height: none;
    border-bottom: 0;
  }

  body[data-mobile-view="list"] .reader {
    display: none;
  }

  body[data-mobile-view="reader"] .topbar,
  body[data-mobile-view="reader"] .mode-controls,
  body[data-mobile-view="reader"] .inbox {
    display: none !important;
  }

  body[data-mobile-view="reader"] .reader {
    display: block;
    height: 100%;
  }

  .date-tabs {
    min-height: 40px;
    padding: 0 10px;
  }

  .unread-only-toggle {
    padding: 0 7px;
  }

  .article-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 9px 12px;
  }

  .source-filter {
    width: 100%;
    max-width: none;
    flex-basis: auto;
    grid-column: 1 / -1;
  }

  .source-filter-popover {
    width: min(320px, calc(100vw - 24px));
  }

  .date-filter {
    grid-column: 1 / -1;
  }

  .date-range-trigger {
    width: 100%;
  }

  .date-range-popover {
    width: min(420px, calc(100vw - 24px));
  }

  .calendar-panels {
    grid-template-columns: 1fr;
  }

  .calendar-panel:nth-child(2) {
    display: none;
  }

  .calendar-panel + .calendar-panel {
    border-left: 0;
  }

  .article-card {
    min-height: 72px;
    padding: 11px 14px 12px;
  }

  .card-title {
    font-size: 0.96rem;
    line-height: 1.42;
  }

  .reader {
    min-height: 0;
    overflow-y: auto;
    background: var(--page);
  }

  .mobile-reader-nav {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(6, 61, 118, 0.96);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.72rem;
    font-weight: 650;
    backdrop-filter: blur(14px);
  }

  .mobile-reader-back {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1;
  }

  .mobile-reader-back-icon {
    width: 8px;
    height: 8px;
    flex: none;
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    transform: rotate(45deg);
  }

  .reader-article {
    width: 100%;
    padding: 26px 18px calc(72px + env(safe-area-inset-bottom));
    background: white;
  }

  .reader-title {
    font-size: clamp(1.3rem, 6vw, 1.65rem);
    line-height: 1.42;
  }

  .reader-meta {
    margin-top: 14px;
    padding-bottom: 20px;
  }

  .article-body {
    margin-top: 26px;
    font-size: 1rem;
    line-height: 1.86;
  }

  .telegram-inbox {
    display: block;
    max-height: none;
    overflow: hidden;
    background: #f8fafc;
  }

  .telegram-list-heading {
    min-height: 64px;
    padding: 11px 14px 9px;
  }

  .telegram-list-heading .eyebrow {
    display: none;
  }

  .telegram-list-heading h1 {
    margin-top: 0;
    font-size: 1rem;
  }

  .telegram-heading-actions {
    flex-direction: row;
    align-items: center;
  }

  .telegram-inbox .chat-list {
    display: flex;
    gap: 8px;
    padding: 9px 14px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .telegram-inbox .chat-card {
    min-width: min(250px, 76vw);
    margin: 0;
    border-color: #e3e7ee;
    background: white;
  }

  .telegram-inbox .chat-card.is-active {
    border-color: #bdcdf6;
  }

  .telegram-reader {
    min-height: calc(100vh - 190px);
  }





















  .telegram-detail {
    padding: 24px 16px 60px;
  }

  .telegram-detail-header {
    flex-direction: column;
    gap: 16px;
  }

  .analysis-actions {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .sync-analyze-button {
    margin-left: auto;
  }

  .chat-manager {
    padding: 28px 18px 60px;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
  }

  .analysis-summary {
    grid-column: auto;
    padding: 0;
  }

  .analysis-summary .analysis-panel-body {
    padding: 3px 18px 18px;
  }

  .analysis-topics {
    grid-column: auto;
    height: auto;
    min-height: 0;
  }

  .analysis-notable {
    grid-column: auto;
    height: auto;
    min-height: 0;
  }

  .ai-topic-list,
  .notable-list {
    max-height: none;
    overflow: visible;
  }

  .notable-list {
    grid-template-columns: 1fr;
  }

  .ai-topic > summary {
    align-items: flex-start;
  }

  .ai-topic > summary em {
    display: none;
  }

  .ai-topic-body {
    padding: 2px 14px 16px;
  }

  .ai-topic-sources article {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ai-topic-sources article > div,
  .ai-topic-sources p {
    grid-column: 1;
  }

  .ai-topic-sources .topic-source-thumb {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 54px;
    height: 42px;
  }

  .telegram-date-tabs {
    width: 100%;
    margin-top: 18px;
  }

  .message-section {
    margin-top: 12px;
    padding: 16px;
  }

  .setup-panel {
    width: calc(100% - 32px);
    margin: 28px auto;
    padding: 22px;
  }

  .sync-state span:last-child {
    display: none;
  }

  .settings-workspace {
    min-height: calc(100vh - 58px);
  }

  .settings-shell {
    width: calc(100% - 28px);
    padding: 28px 0 60px;
  }

  .settings-page-heading {
    align-items: flex-end;
  }

  .settings-page-heading p {
    display: none;
  }

  .settings-grid,
  .reset-list {
    grid-template-columns: 1fr;
  }

  .storage-card {
    grid-row: auto;
  }

  .storage-overview {
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 18px;
  }

  .storage-donut {
    width: 122px;
    height: 122px;
  }

}

@media (max-width: 480px) {
  .mode-button {
    padding: 0 9px;
    font-size: 0.76rem;
  }





  .settings-card {
    padding: 19px;
  }

  .settings-form,
  .storage-overview {
    grid-template-columns: 1fr;
  }

  .form-field-wide,
  .form-submit,
  .form-inline-status,
  .ai-inactive-note {
    grid-column: auto;
  }

  .storage-donut {
    margin: 0 auto;
  }
}
