/**
 * rSocials — all extracted CSS.
 *
 * Combined from inline CSS blocks previously in mod.ts:
 * - Campaign page styles
 * - Thread builder styles
 * - Thread read-only styles
 * - Thread gallery styles
 * - Demo feed styles
 */

/* ── Campaign page ── */

.campaign-page { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.campaign-page__header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rs-input-border); }
.campaign-page__icon { font-size: 3rem; }
.campaign-page__title { margin: 0; font-size: 1.5rem; color: var(--rs-text-primary); }
.campaign-page__desc { margin: 0.25rem 0 0.5rem; color: var(--rs-text-secondary); font-size: 0.9rem; line-height: 1.5; }
.campaign-page__stats { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.8rem; color: var(--rs-text-muted); }
.campaign-phase { margin-bottom: 2rem; }
.campaign-phase__title { font-size: 1.15rem; color: var(--rs-text-primary); margin: 0 0 1rem; display: flex; align-items: center; gap: 0.5rem; }
.campaign-phase__days { font-size: 0.8rem; color: var(--rs-text-muted); font-weight: 400; }
.campaign-phase__posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.campaign-post {
	background: var(--rs-bg-surface); border: 1px solid var(--rs-input-border); border-radius: 0.75rem; padding: 1rem;
	transition: border-color 0.15s;
}
.campaign-post:hover { border-color: var(--rs-primary); }
.campaign-post__header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.campaign-post__platform {
	width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
	color: white; font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.campaign-post__meta { flex: 1; min-width: 0; }
.campaign-post__meta strong { display: block; font-size: 0.8rem; color: var(--rs-text-primary); text-transform: capitalize; }
.campaign-post__date { font-size: 0.7rem; color: var(--rs-text-muted); }
.campaign-post__step { font-size: 0.65rem; color: var(--rs-primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.campaign-status { font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em; white-space: nowrap; }
.campaign-status--scheduled { background: rgba(34,197,94,0.15); color: var(--rs-success, #34d399); }
.campaign-status--draft { background: rgba(251,191,36,0.15); color: var(--rs-warning, #fbbf24); }
.campaign-post__content { font-size: 0.8rem; color: var(--rs-text-secondary); line-height: 1.5; margin: 0 0 0.5rem; }
.campaign-post__tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.campaign-tag { font-size: 0.65rem; color: var(--rs-accent, #7dd3fc); }
.campaign-page__actions { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.campaign-action-btn {
	padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
	cursor: pointer; transition: all 0.15s; text-decoration: none; display: inline-flex; align-items: center;
}
.campaign-action-btn--primary { background: var(--rs-primary); color: white; border: none; }
.campaign-action-btn--primary:hover { background: var(--rs-primary-hover); }
.campaign-action-btn--outline { background: transparent; color: var(--rs-text-secondary); border: 1px solid var(--rs-input-border); }
.campaign-action-btn--outline:hover { border-color: var(--rs-primary); color: var(--rs-primary-hover, #c4b5fd); }
.campaign-modal-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex;
	align-items: center; justify-content: center; z-index: 1000;
}
.campaign-modal-overlay[hidden] { display: none; }
.campaign-modal {
	background: var(--rs-bg-surface); border: 1px solid var(--rs-input-border); border-radius: 0.75rem;
	padding: 1.5rem; width: 90%; max-width: 540px; display: flex; flex-direction: column; gap: 1rem;
}
.campaign-modal__header { display: flex; align-items: center; justify-content: space-between; }
.campaign-modal__header h3 { margin: 0; font-size: 1.1rem; color: var(--rs-text-primary); }
.campaign-modal__close {
	background: none; border: none; color: var(--rs-text-muted); font-size: 1.5rem; cursor: pointer;
	line-height: 1; padding: 0;
}
.campaign-modal__close:hover { color: var(--rs-text-primary); }
.campaign-modal__textarea {
	width: 100%; min-height: 200px; background: var(--rs-input-bg); color: var(--rs-input-text); border: 1px solid var(--rs-input-border);
	border-radius: 8px; padding: 0.75rem; font-family: inherit; font-size: 0.85rem; resize: vertical;
	line-height: 1.5; box-sizing: border-box;
}
.campaign-modal__textarea:focus { outline: none; border-color: var(--rs-primary); }
.campaign-modal__textarea::placeholder { color: var(--rs-text-muted); }
.campaign-modal__row { display: flex; gap: 0.75rem; align-items: center; }
.campaign-modal__select {
	flex: 1; background: var(--rs-input-bg); color: var(--rs-input-text); border: 1px solid var(--rs-input-border);
	border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.85rem;
}
.campaign-modal__select:focus { outline: none; border-color: var(--rs-primary); }

/* ── Thread builder ── */

.thread-page { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; min-height: 80vh; }
.thread-page__header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.thread-page__header h1 { margin: 0; font-size: 1.5rem; color: var(--rs-text-primary); background: linear-gradient(135deg, #7dd3fc, #c4b5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.thread-page__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.thread-btn { padding: 0.5rem 1rem; border-radius: 8px; border: none; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.thread-btn--primary { background: var(--rs-primary); color: white; }
.thread-btn--primary:hover { background: var(--rs-primary-hover); }
.thread-btn--outline { background: transparent; color: var(--rs-text-secondary); border: 1px solid var(--rs-input-border); }
.thread-btn--outline:hover { border-color: var(--rs-primary); color: var(--rs-primary-hover, #c4b5fd); }
.thread-btn--success { background: var(--rs-success); color: white; }
.thread-btn--success:hover { opacity: 0.85; }
.thread-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.thread-compose { position: sticky; top: 1rem; align-self: start; display: flex; flex-direction: column; gap: 1rem; }
.thread-compose__textarea {
	width: 100%; min-height: 320px; background: var(--rs-bg-surface); color: var(--rs-text-primary); border: 1px solid var(--rs-input-border);
	border-radius: 0.75rem; padding: 1rem; font-family: inherit; font-size: 0.9rem; resize: vertical;
	line-height: 1.6; box-sizing: border-box;
}
.thread-compose__textarea:focus { outline: none; border-color: var(--rs-primary); }
.thread-compose__textarea::placeholder { color: var(--rs-text-muted); }
.thread-compose__fields { display: flex; gap: 0.75rem; }
.thread-compose__input {
	flex: 1; background: var(--rs-bg-surface); color: var(--rs-text-primary); border: 1px solid var(--rs-input-border);
	border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.85rem; box-sizing: border-box;
}
.thread-compose__input:focus { outline: none; border-color: var(--rs-primary); }
.thread-compose__input::placeholder { color: var(--rs-text-muted); }
.thread-compose__title {
	width: 100%; background: var(--rs-bg-surface); color: var(--rs-text-primary); border: 1px solid var(--rs-input-border);
	border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.85rem; box-sizing: border-box;
}
.thread-compose__title:focus { outline: none; border-color: var(--rs-primary); }
.thread-compose__title::placeholder { color: var(--rs-text-muted); }
.thread-drafts { grid-column: 1 / -1; }
.thread-drafts__toggle { cursor: pointer; user-select: none; }
.thread-drafts__list {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem;
	margin-top: 0.75rem;
}
.thread-drafts__list[hidden] { display: none; }
.thread-drafts__empty { color: var(--rs-text-muted); font-size: 0.8rem; padding: 0.5rem 0; }
.thread-draft-item {
	display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem;
	background: var(--rs-bg-surface); border: 1px solid var(--rs-input-border); border-radius: 8px;
	transition: border-color 0.15s; cursor: pointer;
}
.thread-draft-item:hover { border-color: var(--rs-primary); }
.thread-draft-item--active { border-color: var(--rs-primary); background: rgba(99,102,241,0.1); }
.thread-draft-item__info { flex: 1; min-width: 0; }
.thread-draft-item__info strong { display: block; font-size: 0.8rem; color: var(--rs-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-draft-item__info span { font-size: 0.7rem; color: var(--rs-text-muted); }
.thread-draft-item__delete {
	background: none; border: none; color: var(--rs-text-muted); font-size: 1.2rem; cursor: pointer;
	padding: 0 4px; line-height: 1; flex-shrink: 0;
}
.thread-draft-item__delete:hover { color: var(--rs-error); }
.thread-image-section { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.thread-image-preview { border-radius: 8px; overflow: hidden; border: 1px solid var(--rs-input-border); }
.thread-image-preview[hidden] { display: none; }
.thread-image-preview img { display: block; max-width: 200px; height: auto; }
#share-link-area { grid-column: 1 / -1; }
.thread-share-link {
	display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem;
	background: rgba(99,102,241,0.1); border: 1px solid var(--rs-primary); border-radius: 8px;
	font-size: 0.8rem; color: var(--rs-primary-hover, #c4b5fd);
}
.thread-share-link code { font-size: 0.75rem; color: var(--rs-accent, #7dd3fc); }
.thread-share-link button {
	background: none; border: none; color: var(--rs-text-secondary); cursor: pointer; font-size: 0.75rem; padding: 2px 6px;
}
.thread-share-link button:hover { color: var(--rs-text-primary); }
.thread-preview { display: flex; flex-direction: column; gap: 0; }
.thread-preview__empty { color: var(--rs-text-muted); text-align: center; padding: 3rem 1rem; font-size: 0.9rem; }
.tweet-card {
	position: relative; background: var(--rs-bg-surface); border: 1px solid var(--rs-input-border); border-radius: 0.75rem;
	padding: 1rem; margin-bottom: 0;
}
.tweet-card + .tweet-card { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: -1px; }
.tweet-card:has(+ .tweet-card) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tweet-card__connector {
	position: absolute; left: 29px; top: -1px; width: 2px; height: 1rem;
	background: var(--rs-input-border); z-index: 1;
}
.tweet-card__header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.tweet-card__avatar {
	width: 40px; height: 40px; border-radius: 50%; background: var(--rs-primary);
	display: flex; align-items: center; justify-content: center; color: white;
	font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.tweet-card__name { font-weight: 700; color: var(--rs-text-primary); font-size: 0.9rem; }
.tweet-card__handle { color: var(--rs-text-muted); font-size: 0.85rem; }
.tweet-card__dot { color: var(--rs-text-muted); font-size: 0.85rem; }
.tweet-card__time { color: var(--rs-text-muted); font-size: 0.85rem; }
.tweet-card__content { color: var(--rs-text-primary); font-size: 0.95rem; line-height: 1.6; margin: 0 0 0.75rem; white-space: pre-wrap; word-break: break-word; }
.tweet-card__footer { display: flex; align-items: center; justify-content: space-between; }
.tweet-card__actions { display: flex; gap: 1.25rem; }
.tweet-card__action { display: flex; align-items: center; gap: 0.3rem; color: var(--rs-text-muted); font-size: 0.8rem; cursor: default; }
.tweet-card__action svg { width: 16px; height: 16px; }
.tweet-card__meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; color: var(--rs-text-muted); }
.tweet-card__chars { font-variant-numeric: tabular-nums; }
.tweet-card__chars--over { color: var(--rs-error); font-weight: 600; }
.tweet-card__thread-num { color: var(--rs-primary); font-weight: 600; }
@media (max-width: 700px) {
	.thread-page { grid-template-columns: 1fr; }
	.thread-compose { position: static; }
}
.thread-export-dropdown { position: relative; }
.thread-export-menu {
	position: absolute; top: calc(100% + 4px); right: 0; z-index: 100;
	background: var(--rs-bg-surface); border: 1px solid var(--rs-input-border); border-radius: 8px;
	min-width: 180px; overflow: hidden;
	box-shadow: 0 8px 24px var(--rs-shadow-lg);
}
.thread-export-menu[hidden] { display: none; }
.thread-export-menu button {
	display: block; width: 100%; padding: 0.6rem 0.75rem; border: none;
	background: transparent; color: var(--rs-text-primary); font-size: 0.85rem;
	text-align: left; cursor: pointer; transition: background 0.1s;
}
.thread-export-menu button:hover { background: var(--rs-bg-hover); }
.thread-export-menu button + button { border-top: 1px solid var(--rs-bg-hover); }
.tweet-card__photo-btn {
	position: absolute; top: 8px; right: 8px; z-index: 5;
	width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rs-input-border);
	background: var(--rs-bg-surface); color: var(--rs-text-muted); cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	opacity: 0; transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}
.tweet-card:hover .tweet-card__photo-btn { opacity: 1; }
.tweet-card__photo-btn:hover { border-color: var(--rs-primary); color: var(--rs-primary-hover, #c4b5fd); }
.tweet-card__photo-btn svg { width: 14px; height: 14px; }
.tweet-card__photo-btn .photo-btn-plus {
	position: absolute; bottom: -1px; right: -3px; font-size: 10px; font-weight: 700;
	color: var(--rs-primary); line-height: 1;
}
.tweet-card__photo-menu {
	position: absolute; top: 38px; right: 8px; z-index: 10;
	background: var(--rs-bg-surface); border: 1px solid var(--rs-input-border); border-radius: 8px;
	min-width: 160px; overflow: hidden; box-shadow: 0 8px 24px var(--rs-shadow-lg);
}
.tweet-card__photo-menu[hidden] { display: none; }
.tweet-card__photo-menu button {
	display: flex; align-items: center; gap: 0.4rem; width: 100%;
	padding: 0.5rem 0.7rem; border: none; background: transparent;
	color: var(--rs-text-primary); font-size: 0.8rem; cursor: pointer; transition: background 0.1s;
}
.tweet-card__photo-menu button:hover { background: var(--rs-bg-hover); }
.tweet-card__photo-menu button + button { border-top: 1px solid var(--rs-bg-hover); }
.tweet-card__photo-menu button svg { width: 14px; height: 14px; }
.tweet-card__attached-image { position: relative; margin-top: 0.5rem; border-radius: 8px; overflow: hidden; border: 1px solid var(--rs-input-border); }
.tweet-card__attached-image img { display: block; width: 100%; height: auto; }
.tweet-card__image-remove {
	position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
	border-radius: 50%; background: rgba(0,0,0,0.7); color: white; border: none;
	font-size: 0.8rem; cursor: pointer; display: flex; align-items: center;
	justify-content: center; line-height: 1; transition: background 0.15s;
}
.tweet-card__image-remove:hover { background: var(--rs-error); }

/* ── Thread read-only ── */

.thread-ro { max-width: 640px; margin: 0 auto; padding: 2rem 1rem; }
.thread-ro__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.thread-ro__author { display: flex; align-items: center; gap: 0.75rem; }
.thread-ro__name { font-weight: 700; color: var(--rs-text-primary); font-size: 1.1rem; }
.thread-ro__handle { color: var(--rs-text-muted); font-size: 0.9rem; }
.thread-ro__meta { display: flex; align-items: center; gap: 0.5rem; color: var(--rs-text-muted); font-size: 0.85rem; }
.thread-ro__title { font-size: 1.4rem; color: var(--rs-text-primary); margin: 0 0 1.5rem; line-height: 1.3; }
.thread-ro__image { margin-bottom: 1.5rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--rs-input-border); }
.thread-ro__image img { display: block; width: 100%; height: auto; }
.thread-ro__cards { margin-bottom: 1.5rem; }
.thread-ro__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--rs-input-border); }
.thread-ro__cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.thread-export-toast {
	position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
	background: var(--rs-bg-surface); border: 1px solid var(--rs-primary); color: var(--rs-primary-hover, #c4b5fd);
	padding: 0.6rem 1.25rem; border-radius: 8px; font-size: 0.85rem;
	box-shadow: 0 4px 16px var(--rs-shadow-lg); z-index: 1000;
	transition: opacity 0.2s;
}
.thread-export-toast[hidden] { display: none; }

/* ── Thread gallery ── */

.threads-gallery { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.threads-gallery__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.threads-gallery__header h1 {
	margin: 0; font-size: 1.5rem;
	background: linear-gradient(135deg, #7dd3fc, #c4b5fd);
	-webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.threads-gallery__grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem;
}
.threads-gallery__empty { color: var(--rs-text-muted); text-align: center; padding: 3rem 1rem; font-size: 0.9rem; }
.thread-card {
	background: var(--rs-bg-surface); border: 1px solid var(--rs-input-border); border-radius: 0.75rem;
	padding: 1.25rem; transition: border-color 0.15s, transform 0.15s;
	display: flex; flex-direction: column; gap: 0.75rem;
	text-decoration: none; color: inherit;
}
.thread-card:hover { border-color: var(--rs-primary); transform: translateY(-2px); }
.thread-card__title { font-size: 1rem; font-weight: 700; color: var(--rs-text-primary); margin: 0; line-height: 1.3; }
.thread-card__preview {
	font-size: 0.85rem; color: var(--rs-text-secondary); line-height: 1.5;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.thread-card__meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; color: var(--rs-text-muted); margin-top: auto; }
.thread-card__author { display: flex; align-items: center; gap: 0.4rem; }
.thread-card__avatar-sm {
	width: 20px; height: 20px; border-radius: 50%; background: var(--rs-primary);
	display: flex; align-items: center; justify-content: center;
	color: white; font-weight: 700; font-size: 0.55rem; flex-shrink: 0;
}
.thread-card__image { border-radius: 8px; overflow: hidden; border: 1px solid var(--rs-input-border); margin-bottom: 0.25rem; }
.thread-card__image img { display: block; width: 100%; height: 120px; object-fit: cover; }

/* ── Demo feed ── */

.rsocials-app { max-width: 640px; margin: 0 auto; padding: 2rem 1rem; }
.rsocials-header { margin-bottom: 1.5rem; }
.rsocials-header h2 {
	font-size: 1.5rem; margin: 0 0 0.25rem; display: flex; align-items: center; gap: 0.75rem;
	background: linear-gradient(135deg, #7dd3fc, #c4b5fd);
	-webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.rsocials-demo-badge {
	font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em;
	background: var(--rs-primary); color: white;
	-webkit-text-fill-color: white;
	padding: 2px 8px; border-radius: 4px;
	text-transform: uppercase; line-height: 1.6;
}
.rsocials-subtitle { color: var(--rs-text-muted); font-size: 0.85rem; margin: 0; }
.rsocials-feed { display: flex; flex-direction: column; gap: 1px; }
.rsocials-loading { color: var(--rs-text-muted); padding: 2rem 0; text-align: center; }
.rsocials-empty { color: var(--rs-text-muted); padding: 2rem 0; text-align: center; }
.rsocials-item {
	padding: 1rem; border-radius: 8px;
	background: var(--rs-bg-surface); border: 1px solid var(--rs-border-subtle);
	margin-bottom: 0.5rem;
	transition: border-color 0.2s;
}
.rsocials-item:hover { border-color: rgba(99,102,241,0.3); }
.rsocials-item-header {
	display: flex; align-items: center; gap: 0.75rem;
	font-size: 0.85rem; color: var(--rs-text-secondary); margin-bottom: 0.5rem;
}
.rsocials-avatar {
	width: 36px; height: 36px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	color: white; font-weight: 700; font-size: 0.85rem;
	flex-shrink: 0;
}
.rsocials-meta {
	display: flex; flex-direction: column; gap: 1px;
}
.rsocials-meta strong { color: var(--rs-text-primary); font-size: 0.9rem; }
.rsocials-meta time { font-size: 0.75rem; color: var(--rs-text-muted); }
.rsocials-item-header strong { color: var(--rs-text-primary); }
.rsocials-item-header time { margin-left: auto; font-size: 0.75rem; }
.rsocials-source {
	font-size: 0.65rem; padding: 1px 6px; border-radius: 4px;
	background: rgba(124,58,237,0.15); color: #c4b5fd;
	text-transform: uppercase; letter-spacing: 0.05em;
}
.rsocials-item-content { margin: 0 0 0.75rem; color: var(--rs-text-primary); line-height: 1.6; font-size: 0.9rem; }
.rsocials-item-link {
	display: block; font-size: 0.8rem; color: var(--rs-accent, #7dd3fc);
	text-decoration: none; margin-bottom: 0.5rem; word-break: break-all;
}
.rsocials-item-link:hover { text-decoration: underline; }
.rsocials-item-actions {
	display: flex; gap: 1rem; font-size: 0.8rem; color: var(--rs-text-muted);
}
.rsocials-action {
	display: flex; align-items: center; gap: 0.35rem;
	cursor: default;
}
.rsocials-action svg { opacity: 0.7; }
.rsocials-demo-notice {
	text-align: center; font-size: 0.75rem; color: var(--rs-text-muted);
	padding: 1rem 0; border-top: 1px solid var(--rs-border-subtle); margin-top: 0.5rem;
}
