.tweets-page,
.tweets-admin-page,
.tweets-editor-page { padding-top: 2.3rem; padding-bottom: 5rem; }

.tweets-heading { display: flex; align-items: start; justify-content: space-between; gap: 2rem; padding-bottom: 1.8rem; border-bottom: 1px solid var(--line); }
.tweets-heading h1 { margin: .45rem 0 .65rem; color: var(--forest); font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.07em; line-height: 1; }
.tweets-heading p:not(.eyebrow) { max-width: 680px; margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.7; }
.tweets-count { flex-shrink: 0; padding-top: 1.5rem; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.tweets-count strong { color: var(--forest); font-size: 2rem; font-weight: 600; }

.admin-site .library-subnav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.1rem 0 2rem; padding: .45rem; background: var(--paper-deep); border: 1px solid var(--line); }
.admin-site .library-subnav a { display: inline-flex; align-items: center; min-height: 2.25rem; padding: .35rem .75rem; color: var(--muted); font-size: .76rem; font-weight: 700; }
.admin-site .library-subnav a:hover { color: var(--forest); background: var(--white); }
.admin-site .library-subnav a.is-active { color: var(--forest); background: var(--lime); }

.tweets-page { padding-top: 46px; }
.tweets-page .tweets-heading { padding-bottom: 28px; border-bottom: 0; }
.tweets-page .tweets-heading > div { width: 100%; }
.tweets-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tweets-page .tweets-count { padding-top: 0; }
.tweets-page .tweets-heading h1 { margin: 8px 0 15px; font-size: clamp(30px, 4vw, 48px); line-height: 1.25; letter-spacing: -.035em; }
.tweets-page .tweets-heading p:not(.eyebrow) { font-size: 15px; line-height: 1.85; }
.tweets-page .library-subnav a { min-height: 44px; }

.tweets-content { max-width: 900px; margin: 0 auto; }
.tweets-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1rem; }
.tweets-section-heading h2 { margin: .35rem 0 0; color: var(--forest); font-size: 1.35rem; letter-spacing: -.04em; }
.tweets-network-note { max-width: 350px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: right; }
.tweet-stream { display: grid; gap: 1.15rem; }
.tweet-card { min-width: 0; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.tweet-card-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.tweet-card-title { min-width: 0; }
.tweet-card-title h3 { margin: .35rem 0 0; color: var(--forest); font-size: 1.15rem; line-height: 1.35; overflow-wrap: anywhere; }
.tweet-source-link { flex: 0 0 auto; color: var(--forest); font-size: .76rem; font-weight: 700; text-align: right; text-decoration: underline; text-underline-offset: 3px; }
.tweet-source-link:hover { color: var(--forest-soft); }
.tweet-note { margin: .8rem 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.tweet-embed-panel { position: relative; min-height: 130px; margin-top: 1rem; padding: .8rem; background: #f8f7f1; border: 1px solid var(--line); }
.tweet-embed-container { position: relative; width: min(100%, 550px); min-height: 1px; margin: 0 auto; }
.tweet-embed-staging { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.tweet-embed-container iframe { display: block; width: 100% !important; max-width: 550px; margin: 0 auto; border: 0; border-radius: 12px; }
.tweet-embed-loading { display: grid; min-height: 110px; place-items: center; color: var(--muted); font-size: .76rem; text-align: center; }
.tweet-embed-loading[hidden],
.tweet-embed-error[hidden] { display: none; }
.tweet-embed-error { display: grid; gap: .75rem; min-height: 110px; place-items: center; align-content: center; color: var(--danger); font-size: .78rem; line-height: 1.6; text-align: center; }
.tweet-embed-error p { margin: 0; }
.tweet-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.tweets-empty-state { margin-top: 1rem; background: var(--white); }
.tweets-pagination { margin-top: 1.8rem; }

.public-site .tweets-page .tweets-content { max-width: 1060px; }
.public-site .tweets-page .tweet-stream { gap: 0; }
.public-site .tweets-page .tweet-card { display: grid; gap: 20px; width: 100%; max-width: 550px; margin: 0 auto; padding: 32px 0; background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.public-site .tweets-page .tweet-context { min-width: 0; }
.public-site .tweets-page .tweet-card-title h3 { margin: 0; font-size: 22px; line-height: 1.5; letter-spacing: -.025em; }
.public-site .tweets-page .tweet-note { margin: 12px 0 0; font-size: 15px; line-height: 1.85; }
.public-site .tweets-page .tweet-source-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; max-width: 100%; margin-top: 12px; padding: 4px 0; font-size: 14px; text-align: left; }
.public-site .tweets-page .tweet-embed-panel { min-width: 0; margin: 0; padding: 0; background: transparent; border: 0; }
.public-site .tweets-page .tweet-error-actions .button { min-height: 44px; }

@media (min-width: 1200px) {
  .public-site .tweets-page .tweet-card { grid-template-columns: minmax(0, 1fr) minmax(0, 550px); align-items: start; gap: 48px; max-width: none; padding: 40px 0; }
  .public-site .tweets-page .tweet-context { padding-top: 8px; }
}

.tweets-admin-content,
.tweets-editor-content { min-width: 0; }
.tweets-admin-summary { margin: -1rem 0 1rem; color: var(--muted); font-size: .76rem; }
.tweets-admin-summary strong { color: var(--forest); font-size: 1.15rem; }
.tweet-admin-table-scroll { margin-top: .2rem; }
.tweet-admin-table { min-width: 800px; }
.tweet-admin-table td:first-child { max-width: 420px; }
.tweet-admin-table td strong { overflow-wrap: anywhere; }
.tweet-admin-source { display: block; margin-top: .45rem; color: var(--forest); font-size: .7rem; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 2px; }
.tweets-admin-empty { margin-top: .8rem; background: var(--white); }

.tweet-editor-form { display: grid; gap: 1rem; max-width: 900px; }
.tweet-editor-panel,
.tweet-editor-preview { padding: 1.3rem; background: var(--white); border: 1px solid var(--line); }
.tweet-editor-panel .panel-heading,
.tweet-editor-preview .panel-heading { display: block; margin-bottom: 1.2rem; }
.tweet-editor-panel .panel-heading h3,
.tweet-editor-preview .panel-heading h3 { margin: 0; color: var(--forest); font-size: 1.35rem; letter-spacing: -.04em; }
.tweet-editor-panel .panel-heading p:not(.eyebrow),
.tweet-editor-preview .panel-heading p:not(.eyebrow) { margin: .45rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.65; }
.tweet-editor-panel > .field + .field { margin-top: 1rem; }
.tweet-editor-panel textarea { min-height: 8rem; resize: vertical; }
.tweet-form-error { margin-bottom: 1rem; padding: .8rem 1rem; color: #8b3025; background: #fff0ed; border: 1px solid #e9b4ac; }
.tweet-form-error strong { display: block; }
.tweet-form-error p { margin: .35rem 0 0; font-size: .78rem; line-height: 1.6; }
.tweet-editor-preview-card { margin: 0; }
.tweet-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; padding-top: .25rem; }
.tweet-editor-help { flex: 1 1 280px; margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.6; }

@media (max-width: 760px) {
  .tweets-page,
  .tweets-admin-page,
  .tweets-editor-page { padding-top: 1.8rem; }
  .tweets-heading { flex-direction: column; gap: .8rem; }
  .tweets-count { padding-top: 0; }
  .tweets-section-heading { align-items: start; flex-direction: column; gap: .55rem; }
  .tweets-network-note { max-width: none; text-align: left; }
  .tweet-card-header { flex-direction: column; gap: .65rem; }
  .tweet-source-link { text-align: left; }
  .tweet-editor-panel,
  .tweet-editor-preview { padding: 1rem; }
}

@media (max-width: 520px) {
  .tweets-page .tweets-heading h1 { font-size: 30px; }
  .tweets-page .library-subnav { margin-bottom: 24px; }
  .tweet-card { padding: .8rem; }
  .tweet-embed-panel { padding: .4rem; }
  .tweet-editor-actions { align-items: stretch; flex-direction: column; }
  .tweet-editor-actions .button { width: 100%; }
}

@media (max-width: 360px) {
  .tweet-card { padding: 8px; }
  .tweet-embed-panel { padding: 0; }
}
