:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --bg-soft: #f9f6ef;
  --paper: rgba(255, 252, 246, 0.9);
  --paper-strong: #fffdf8;
  --paper-muted: rgba(255, 250, 242, 0.7);
  --line: rgba(94, 76, 54, 0.18);
  --line-strong: rgba(94, 76, 54, 0.3);
  --text: #1f1a17;
  --text-soft: #4f4337;
  --muted: #7a6c5f;
  --muted-faint: #a99b8d;
  --accent: #2c5673;
  --accent-soft: rgba(44, 86, 115, 0.08);
  --accent-strong: #18364a;
  --warm: #936239;
  --warm-soft: rgba(147, 98, 57, 0.08);
  --success: #295c45;
  --success-soft: rgba(41, 92, 69, 0.08);
  --danger: #8e4b40;
  --danger-soft: rgba(142, 75, 64, 0.08);
  --shadow-soft: 0 16px 40px rgba(53, 41, 28, 0.06);
  --shadow-strong: 0 24px 60px rgba(53, 41, 28, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --page-width: 1420px;
  --content-width: 880px;
  --rail-width: 168px;
  --header-height: 88px;
  --font-ui: "IBM Plex Sans SC", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-display: "Iowan Old Style", "Songti SC", "STSong", "Noto Serif SC", serif;
  --font-serif: "Iowan Old Style", "Songti SC", "STSong", "Noto Serif SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable both-edges;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(147, 98, 57, 0.05), transparent 26%),
    linear-gradient(180deg, #f8f4ec 0%, #f5f1e8 48%, #f1ebdf 100%);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 26%),
    linear-gradient(90deg, rgba(94, 76, 54, 0.025) 1px, transparent 1px);
  background-size: auto, 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 85%);
  opacity: 0.7;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(44, 86, 115, 0.16);
  color: var(--text);
}

.portal-page,
.article-page {
  position: relative;
}

.portal-shell,
.article-shell-inner {
  position: relative;
  z-index: 1;
}

.portal-shell {
  min-height: 100vh;
}

.site-brand-link,
.feed-link,
.source-link,
.back-link,
.text-action,
.action-link {
  text-decoration: none;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(94, 76, 54, 0.14);
  background: rgba(248, 244, 236, 0.9);
  backdrop-filter: blur(14px);
}

.portal-header-inner {
  width: min(var(--page-width), calc(100% - 36px));
  margin: 0 auto;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 28px;
  align-items: end;
  padding: 18px 0 16px;
}

.site-brand-link {
  display: inline-flex;
  align-items: flex-end;
}

.site-brand {
  display: grid;
  gap: 5px;
}

.brand-kicker,
.rail-mark,
.story-kicker,
.stream-index,
.thread-role,
.note-kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.site-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2vw, 2.2rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.portal-top-links,
.site-actions,
.section-head-split,
.section-head-metrics,
.stream-toolbar,
.daily-pick-head,
.card-actions,
.clip-actions,
.note-head,
.note-meta,
.feed-meta,
.feed-topline,
.feed-footer,
.article-topbar,
.article-meta-strip,
.auth-mode-switch,
.prompt-shortcuts,
.article-shortcuts,
.article-source-row,
.stream-row-top,
.stream-row-foot,
.stream-actions,
.takeaway-row,
.identity-row,
.auth-inline-field {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.portal-top-links {
  justify-content: center;
  gap: 18px;
}

.top-link,
.back-link {
  position: relative;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.1;
  transition: color 180ms ease;
}

.top-link::after,
.back-link::after,
.text-action::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms ease;
}

.top-link:hover,
.back-link:hover,
.text-action:hover {
  color: var(--text);
}

.top-link:hover::after,
.back-link:hover::after,
.text-action:hover::after {
  transform: scaleX(1);
}

.site-actions {
  justify-content: flex-end;
}

.portal-body {
  width: min(var(--page-width), calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(132px, var(--rail-width)) minmax(0, 1fr);
  gap: 34px;
  padding: 28px 0 40px;
}

.portal-rail {
  position: sticky;
  top: calc(var(--header-height) + 14px);
  align-self: start;
  padding: 10px 18px 0 0;
  border-right: 1px solid rgba(94, 76, 54, 0.12);
}

.rail-mark {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.rail-tabs {
  display: grid;
  gap: 4px;
}

.rail-tab {
  position: relative;
  display: block;
  padding: 9px 0 9px 16px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.2;
  border-radius: 999px;
  transition: color 180ms ease, transform 180ms ease;
}

.rail-tab::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%);
  transition: background 180ms ease, transform 180ms ease;
}

.rail-tab:hover {
  color: var(--text);
  transform: translateX(2px);
}

.rail-tab.is-active,
.rail-tab[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.rail-tab.is-active::before,
.rail-tab[aria-current="page"]::before {
  background: var(--accent);
  transform: translateY(-50%) scale(1.15);
}

.portal-main {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.portal-main-home {
  min-height: calc(100svh - var(--header-height) - 68px);
  grid-template-rows: minmax(0, 1fr) auto;
  position: relative;
}

.portal-main-section {
  align-content: start;
}

.portal-stage,
.content-section,
.note-card,
.highlight-card,
.insight-card,
.feature-card,
.stat-card,
.headline-item,
.article-panel,
.modal-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.portal-stage,
.content-section,
.article-panel,
.modal-panel {
  padding: 26px 30px;
}

.portal-stage-home {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.section-head > div:first-child {
  max-width: 74ch;
}

.section-head h2,
.notes-library-head h3,
.insight-title,
.feature-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.section-head h2 {
  font-size: clamp(1.85rem, 2.5vw, 2.7rem);
  line-height: 1.02;
}

.section-head p,
.notes-library-head p,
.feature-copy,
.feed-summary,
.stream-row-summary,
.note-body,
.thread-content,
.selection-quote-card,
.article-panel p,
.article-source-row {
  color: var(--text-soft);
}

.section-head p,
.notes-library-head p {
  margin: 8px 0 0;
  font-size: 0.98rem;
  line-height: 1.65;
}

.section-head-metrics {
  justify-content: flex-end;
}

.section-editorial-head {
  padding-bottom: 22px;
}

.metric-pill,
.mini-pill,
.tag-pill,
.tag-pill-soft,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(94, 76, 54, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

.tag-pill,
.metric-pill {
  color: var(--text-soft);
}

.tag-pill-soft {
  background: rgba(44, 86, 115, 0.05);
  color: var(--accent);
}

.status-pill.is-read {
  background: rgba(94, 76, 54, 0.06);
  color: var(--muted);
}

.status-pill.is-fav {
  background: var(--warm-soft);
  color: var(--warm);
}

.status-pill.is-later {
  background: var(--success-soft);
  color: var(--success);
}

.chip-button,
.secondary-button,
.action-chip,
.toggle-chip,
.selection-menu-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(94, 76, 54, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.chip-button-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.chip-button:hover,
.secondary-button:hover,
.action-chip:hover,
.toggle-chip:hover,
.selection-menu-item:hover {
  color: var(--text);
  border-color: rgba(94, 76, 54, 0.28);
  background: #fffdf8;
  transform: translateY(-1px);
}

.chip-button.is-active,
.action-chip.is-active,
.toggle-chip.is-active,
.auth-mode-button.is-active {
  color: var(--accent-strong);
  border-color: rgba(44, 86, 115, 0.3);
  background: rgba(44, 86, 115, 0.1);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(24, 54, 74, 0.08);
  border-radius: 999px;
  background: var(--accent);
  color: #f7f9fb;
  font-size: 0.92rem;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(24, 54, 74, 0.18);
  transform: translateY(-1px);
}

.text-action {
  position: relative;
  color: var(--muted);
  font-size: 0.9rem;
}

.action-link {
  text-decoration: none;
}

.stream-toolbar {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(94, 76, 54, 0.12);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
}

.search-input,
.sort-select,
.input-group input,
.input-group textarea {
  width: 100%;
  border: 1px solid rgba(94, 76, 54, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  padding: 13px 15px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-input::placeholder,
.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--muted-faint);
}

.search-input:focus,
.sort-select:focus,
.input-group input:focus,
.input-group textarea:focus {
  border-color: rgba(44, 86, 115, 0.28);
  box-shadow: 0 0 0 4px rgba(44, 86, 115, 0.08);
  background: #fffefb;
}

.sort-select {
  min-width: 144px;
}

.input-group {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clip-form,
.article-note-form,
.login-form,
.auth-form,
.ai-thread-form {
  display: grid;
  gap: 16px;
}

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

.clip-actions {
  gap: 10px;
}

.feed-list,
.notes-list,
.thread-list,
.takeaway-list,
.insight-list {
  display: grid;
}

.panel-stream {
  padding-top: 6px;
}

.feed-list {
  gap: 0;
}

.stream-row {
  padding: 22px 0;
  border-top: 1px solid rgba(94, 76, 54, 0.12);
}

.stream-row:first-child {
  border-top: 0;
  padding-top: 6px;
}

.stream-row.is-lead {
  padding-top: 0;
}

.stream-row-main {
  min-width: 0;
}

.stream-row-top {
  gap: 10px;
  margin-bottom: 10px;
}

.stream-index,
.story-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.stream-meta,
.feed-side,
.note-date,
.share-card-meta,
.share-card-context,
.daily-secondary-note,
.daily-lead-body {
  color: var(--muted);
}

.stream-row-title,
.daily-lead-title,
.daily-secondary-title,
.headline-title,
.note-title,
.feed-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

.stream-row-title {
  font-size: 1.38rem;
}

.stream-row.is-lead .stream-row-title {
  font-size: clamp(1.7rem, 2.4vw, 2.45rem);
  max-width: 18ch;
}

.feed-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size 180ms ease, color 180ms ease;
}

.feed-link:hover,
.source-link:hover {
  color: var(--accent-strong);
  background-size: 100% 1px;
}

.stream-row-summary,
.feed-summary,
.headline-summary,
.daily-lead-summary,
.daily-secondary-summary,
.note-body,
.thread-content {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.74;
}

.stream-row-foot {
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 14px;
}

.stream-row-note {
  max-width: 56ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.stream-actions {
  justify-content: flex-end;
}

.stream-row.is-read .stream-row-title a,
.stream-row.is-read .stream-row-summary,
.stream-row.is-read .stream-row-note {
  color: var(--muted-faint);
}

.feed-card,
.feed-card-inner,
.feed-head,
.feed-main,
.headline-body {
  min-width: 0;
}

.feed-card {
  padding: 22px 0;
  border-top: 1px solid rgba(94, 76, 54, 0.12);
}

.feed-card:first-child {
  border-top: 0;
}

.feed-meta,
.daily-pick-head,
.headline-meta,
.note-meta {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(94, 76, 54, 0.28);
}

.feed-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 18px;
  align-items: start;
  margin-top: 10px;
}

.feed-title {
  font-size: 1.34rem;
}

.feed-side {
  padding-top: 6px;
  font-size: 0.94rem;
  line-height: 1.6;
}

.feed-footer {
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 14px;
}

.takeaway-row {
  gap: 8px;
}

.takeaway-row span,
.daily-lead-takeaways span,
.insight-pills .mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(94, 76, 54, 0.12);
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}

.daily-picks-grid {
  min-height: 0;
}

.daily-editorial-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 0;
  height: 100%;
  align-items: stretch;
  border-top: 1px solid rgba(94, 76, 54, 0.12);
}

.daily-lead-card,
.daily-secondary-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.daily-lead-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  padding: 22px 28px 0 0;
  border-right: 1px solid rgba(94, 76, 54, 0.12);
}

.daily-lead-title {
  font-size: clamp(1.8rem, 2.9vw, 3.1rem);
  max-width: 11ch;
}

.daily-lead-title.is-condensed {
  font-size: clamp(1.6rem, 2.45vw, 2.62rem);
  max-width: 12.5ch;
}

.daily-lead-summary {
  max-width: 58ch;
  font-size: 1.04rem;
  min-height: calc(1.74em * 4);
}

.daily-secondary-list {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 0;
  height: 100%;
  align-content: stretch;
}

.daily-secondary-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding: 22px 0 22px 26px;
  border-bottom: 1px solid rgba(94, 76, 54, 0.12);
}

.daily-secondary-card:last-child {
  border-bottom: 0;
}

.daily-secondary-title {
  font-size: 1.28rem;
}

.daily-secondary-summary {
  width: 100%;
  max-width: none;
  min-height: calc(1.55em * 2);
  margin-top: 6px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  word-break: break-word;
}

.daily-secondary-summary.is-empty {
  display: none;
}

.editorial-actions {
  margin-top: 6px;
}

.home-workstrip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workstrip-link {
  display: grid;
  gap: 8px;
  padding: 18px 20px 20px;
  border-top: 1px solid rgba(94, 76, 54, 0.16);
  color: var(--text-soft);
  transition: transform 180ms ease, color 180ms ease, border-color 180ms ease;
}

.workstrip-link:hover {
  color: var(--text);
  border-color: rgba(44, 86, 115, 0.22);
  transform: translateY(-1px);
}

.workstrip-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.workstrip-link strong {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.workstrip-link span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

body[data-page="home"] .daily-lead-summary,
body[data-page="home"] .daily-lead-title,
body[data-page="home"] .daily-secondary-title,
body[data-page="home"] .daily-secondary-summary,
body[data-page="home"] .workstrip-link strong,
body[data-page="home"] .workstrip-link span,
.stream-row-title a,
.stream-row-summary,
.stream-row-note,
.headline-title a,
.headline-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

body[data-page="home"] .daily-lead-title {
  -webkit-line-clamp: 4;
}

body[data-page="home"] .daily-lead-summary {
  -webkit-line-clamp: 4;
}

body[data-page="home"] .daily-secondary-summary {
  -webkit-line-clamp: 2;
  white-space: normal;
  max-width: none;
  width: 100%;
}

body[data-page="home"] .daily-secondary-title {
  -webkit-line-clamp: 3;
}

body[data-page="home"] .workstrip-link strong {
  -webkit-line-clamp: 2;
}

body[data-page="home"] .workstrip-link span {
  -webkit-line-clamp: 1;
}

.stream-row-title a {
  -webkit-line-clamp: 3;
}

.stream-row.is-lead .stream-row-title a {
  -webkit-line-clamp: 4;
}

.stream-row-summary,
.headline-summary {
  -webkit-line-clamp: 3;
}

.stream-row-note {
  -webkit-line-clamp: 2;
}

.headline-title a {
  -webkit-line-clamp: 2;
}

.notes-section {
  gap: 0;
}

.notes-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(320px, 0.84fr);
  gap: 22px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(94, 76, 54, 0.12);
}

.notes-composer-panel,
.notes-library-panel {
  min-width: 0;
}

.notes-composer-panel {
  padding-right: 10px;
}

.notes-library-panel {
  padding-left: 22px;
  border-left: 1px solid rgba(94, 76, 54, 0.12);
}

.notes-library-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(94, 76, 54, 0.1);
}

.notes-library-head h3 {
  font-size: 1.5rem;
  line-height: 1.08;
}

.notes-list {
  gap: 14px;
  margin-top: 18px;
}

.note-card,
.highlight-card,
.insight-card,
.feature-card,
.stat-card,
.headline-item {
  padding: 20px 22px;
}

.note-head {
  justify-content: space-between;
  align-items: start;
}

.note-title {
  margin-top: 4px;
  font-size: 1.28rem;
}

.note-date {
  font-size: 0.8rem;
}

.highlight-quote,
.note-quote {
  margin: 14px 0 0;
  padding: 0 0 0 16px;
  border-left: 2px solid rgba(44, 86, 115, 0.22);
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--text);
}

.note-source-line {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.source-link {
  border-bottom: 1px solid rgba(94, 76, 54, 0.2);
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: color 180ms ease, background-size 180ms ease;
}

.insight-card {
  display: grid;
  gap: 14px;
}

.insight-title {
  font-size: 1.32rem;
  line-height: 1.08;
}

.insight-list {
  gap: 10px;
}

.insight-row,
.trend-row,
.identity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(94, 76, 54, 0.08);
  color: var(--text-soft);
}

.insight-row:first-child,
.trend-row:first-child,
.identity-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.insight-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.headline-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
}

.headline-marker {
  color: var(--muted);
  font-size: 0.84rem;
}

.headline-title {
  font-size: 1.28rem;
}

.headline-meta,
.headline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.feature-title {
  font-size: 1.18rem;
  line-height: 1.08;
}

.feature-copy {
  margin: 10px 0 0;
  line-height: 1.65;
}

.empty-state {
  padding: 28px 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.empty-state.small {
  padding: 18px 0;
  font-size: 0.92rem;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 29, 24, 0.24);
  backdrop-filter: blur(5px);
}

.modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100svh - 40px);
  overflow: auto;
  background: var(--paper-strong);
  box-shadow: var(--shadow-strong);
}

.auth-modal-panel {
  width: min(620px, 100%);
}

.auth-panel-wrap {
  margin-top: 16px;
}

.auth-inline-field {
  gap: 10px;
}

.auth-inline-field input {
  flex: 1 1 240px;
}

.login-form,
.auth-form {
  margin-top: 16px;
}

.article-page {
  background:
    radial-gradient(circle at top left, rgba(147, 98, 57, 0.05), transparent 24%),
    linear-gradient(180deg, #f8f3ea 0%, #f3ece1 100%);
}

.article-shell {
  width: min(1720px, calc(100vw - 14px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.article-shell-inner {
  display: grid;
  gap: 18px;
}

.article-hero {
  position: relative;
  padding: 2px 0 16px;
  border-bottom: 1px solid rgba(94, 76, 54, 0.14);
}

.article-topbar {
  display: block;
  min-height: 88px;
  padding-right: 178px;
}

.brand-block {
  width: calc(100% - 178px);
  max-width: none;
  margin-left: 98px;
}

.article-topbar h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 3vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 600;
  width: 100%;
  max-width: none;
  text-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.article-topbar h1.is-fluid-single-line {
  text-wrap: nowrap;
  white-space: nowrap;
}

.back-link {
  position: absolute;
  top: 14px;
  right: 0;
  padding-top: 0;
}

.article-meta-strip {
  margin-top: 18px;
  margin-left: 98px;
}

.article-panel {
  width: min(1288px, calc(100% - 72px));
  margin: 0 auto;
  padding: 30px 46px 34px;
  background: rgba(255, 253, 248, 0.96);
}

.article-main-panel > .section-head {
  align-items: start;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(94, 76, 54, 0.12);
}

.article-main-panel > .section-head > div:first-child {
  max-width: 72ch;
}

.article-main-panel > .section-head h2 {
  font-size: 1.62rem;
  line-height: 1.08;
}

.article-source-row {
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(94, 76, 54, 0.12);
  color: var(--muted);
  font-size: 0.94rem;
}

.article-prose {
  font-family: var(--font-serif);
  font-size: clamp(1.08rem, 0.8vw + 0.92rem, 1.2rem);
  line-height: 1.92;
  color: var(--text);
  letter-spacing: 0.01em;
}

.article-prose p {
  margin: 0 0 1.18em;
  color: var(--text);
}

.article-prose p.section {
  margin: 2.4em 0 0.75em;
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.annotated-note {
  padding: 0 2px;
  border-radius: 6px;
  background: rgba(44, 86, 115, 0.08);
  text-decoration: underline wavy rgba(44, 86, 115, 0.6);
  text-underline-offset: 0.18em;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.annotated-note:hover {
  background: rgba(44, 86, 115, 0.14);
  color: var(--accent-strong);
}

.article-inline-notes {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(94, 76, 54, 0.12);
}

.takeaway-list {
  gap: 10px;
}

.takeaway-item {
  padding: 12px 14px;
  border-left: 2px solid rgba(44, 86, 115, 0.3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(44, 86, 115, 0.05);
  color: var(--text-soft);
  line-height: 1.7;
}

.selection-context-menu {
  position: fixed;
  z-index: 50;
  display: grid;
  gap: 6px;
  min-width: 182px;
  padding: 8px;
  border: 1px solid rgba(94, 76, 54, 0.16);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.selection-menu-item {
  justify-content: flex-start;
  width: 100%;
}

.article-modal .modal-panel.article-dialog-panel {
  width: min(860px, 100%);
}

.article-share-panel {
  width: min(980px, 100%);
}

.selection-quote-card,
.share-banner {
  padding: 14px 16px;
  border-left: 2px solid rgba(44, 86, 115, 0.28);
  border-radius: 0 18px 18px 0;
  background: rgba(44, 86, 115, 0.05);
  line-height: 1.72;
}

.article-shortcuts {
  margin: 14px 0 6px;
}

.article-shortcuts .secondary-button {
  min-height: 36px;
}

.thread-list {
  gap: 10px;
}

.thread-message {
  padding: 14px 16px;
  border: 1px solid rgba(94, 76, 54, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.thread-message.user {
  background: rgba(44, 86, 115, 0.08);
  border-color: rgba(44, 86, 115, 0.16);
}

.thread-message.assistant {
  background: rgba(147, 98, 57, 0.06);
}

.thread-role {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.thread-content {
  margin-top: 8px;
  line-height: 1.76;
}

.share-card-preview {
  width: min(100%, 540px);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  display: grid;
  place-items: stretch;
  border-radius: 28px;
  overflow: hidden;
}

.share-card-preview > svg,
.share-card-preview > img {
  display: block;
  width: 100%;
  height: 100%;
}

.share-card-preview .empty-state.small {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: grid;
  gap: 10px;
}

.toast {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(31, 26, 23, 0.92);
  color: #f8f5ee;
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: var(--shadow-soft);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.portal-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 1px solid rgba(44, 86, 115, 0.28);
  border-radius: 999px;
  background: transparent;
  pointer-events: none;
  z-index: 80;
  opacity: 0;
  transition: opacity 180ms ease, transform 120ms ease, border-color 180ms ease;
}

.portal-cursor::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: rgba(44, 86, 115, 0.14);
}

.portal-cursor.is-visible {
  opacity: 0.9;
}

.portal-cursor.is-pressed {
  border-color: rgba(24, 54, 74, 0.42);
  transform: scale(1.18);
}

@media (max-width: 1280px) {
  .portal-body {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 24px;
  }

  .daily-editorial-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .daily-lead-card {
    padding-right: 0;
    padding-bottom: 24px;
    border-right: 0;
    border-bottom: 1px solid rgba(94, 76, 54, 0.12);
  }

  .daily-secondary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .daily-secondary-card {
    padding-left: 0;
    padding-right: 18px;
  }

  .daily-secondary-card:last-child {
    padding-right: 0;
  }

  .notes-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .notes-library-panel {
    padding-left: 0;
    border-left: 0;
    padding-top: 22px;
    border-top: 1px solid rgba(94, 76, 54, 0.12);
  }
}

@media (min-width: 981px) {
  body[data-page="home"] .portal-body {
    padding-bottom: 24px;
  }

  body[data-page="home"] .portal-main-home {
    height: calc(100svh - 158px);
    min-height: calc(100svh - 158px);
    overflow: hidden;
    gap: 18px;
  }

  body[data-page="home"] .portal-stage-home {
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  body[data-page="home"] .daily-picks-grid,
  body[data-page="home"] .daily-editorial-layout,
  body[data-page="home"] .daily-secondary-list {
    min-height: 0;
    height: 100%;
  }

  body[data-page="home"] .home-workstrip {
    position: static;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(94, 76, 54, 0.12);
    background: transparent;
  }

  body[data-page="home"] .workstrip-link {
    padding: 12px 14px 14px;
    border-top: 0;
  }

  body[data-page="home"] .daily-lead-card,
  body[data-page="home"] .daily-secondary-card {
    overflow: hidden;
  }
}

@media (max-width: 980px) {
  :root {
    --header-height: auto;
  }

  .portal-header-inner {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
    padding: 16px 0 18px;
  }

  .portal-top-links,
  .site-actions {
    justify-content: flex-start;
  }

  .portal-body {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .portal-rail {
    position: static;
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(94, 76, 54, 0.12);
  }

  .rail-tabs {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
  }

  .rail-tab {
    padding: 11px 12px 11px 18px;
    border: 1px solid rgba(94, 76, 54, 0.12);
    background: rgba(255, 255, 255, 0.55);
  }

  .stream-toolbar {
    grid-template-columns: 1fr;
  }

  .feed-head {
    grid-template-columns: 1fr;
  }

  .home-workstrip {
    grid-template-columns: 1fr;
  }

  .article-topbar {
    display: grid;
    padding-right: 0;
  }

  .article-panel {
    padding: 28px 26px;
  }

  .brand-block,
  .article-meta-strip {
    margin-left: 0;
    max-width: none;
    width: 100%;
  }

  .back-link {
    position: static;
    margin-top: 10px;
  }

  .article-main-panel > .section-head {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 720px) {
  .portal-header-inner,
  .portal-body,
  .article-shell {
    width: calc(100% - 24px);
  }

  .portal-stage,
  .content-section,
  .article-panel,
  .modal-panel {
    padding: 20px 18px;
    border-radius: 24px;
  }

  .section-head,
  .section-head-split,
  .notes-library-head,
  .stream-row-foot,
  .feed-footer {
    flex-direction: column;
    align-items: start;
  }

  .section-head-metrics,
  .stream-actions,
  .site-actions {
    justify-content: flex-start;
  }

  .clip-grid,
  .daily-secondary-list {
    grid-template-columns: 1fr;
  }

  .daily-secondary-card {
    padding-right: 0;
  }

  .daily-lead-title {
    max-width: none;
  }

  .stream-row-title {
    font-size: 1.22rem;
  }

  .stream-row.is-lead .stream-row-title {
    font-size: 1.55rem;
  }

  .note-card,
  .highlight-card,
  .insight-card,
  .feature-card,
  .stat-card,
  .headline-item {
    padding: 18px;
  }

  .headline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .article-topbar h1 {
    font-size: 2.35rem;
  }

  .article-panel {
    padding: 24px 18px;
  }

  .article-prose {
    font-size: 1.03rem;
    line-height: 1.9;
  }

  .selection-context-menu {
    min-width: 160px;
  }

  .share-card-surface {
    min-height: auto;
    padding: 0;
  }

  .share-card-preview {
    width: min(100%, 420px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
