/**
 * Dashboard styles
 * Design tokens and base styles are in base.css.
 */

.followup-context.compact {
	padding: 10px 12px;
	margin-bottom: 8px;
}

.followup-input-section.compact {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Shared workspace container — all three tabs use the same shell */
.evaluation-workspace,
.conversation-workspace,
.image-workspace {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 150px;
	border: 1px solid var(--sage-border-subtle);
	border-top: none;
	border-radius: 0 0 8px 8px;
	background: white;
	padding: 16px;
}

.evaluation-inline {
	background: white;
	border: none;
	border-radius: 0;
	padding: 0;
	margin: 0;
}

/* Score pills row - compact inline badges */
.score-pills-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--sage-gray-200);
}

.score-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	background: var(--sage-gray-100);
	border-radius: 12px;
	font-size: 12px;
}

.score-pill-label {
	color: var(--sage-text-secondary);
}

.score-pill-value {
	font-weight: 700;
	color: var(--sage-ink);
}

/* Evaluation section cards — stacked full-width */
.eval-section-card {
	background: var(--sage-gray-50);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	padding: 12px 14px;
}

.eval-section-card.muted {
	background: white;
	border-color: var(--sage-gray-200);
}

.eval-section-card.muted .insight-header {
	color: var(--sage-gray-500);
	font-size: 11px;
}

.eval-section-card.muted .insight-list li {
	color: var(--sage-text-secondary);
	font-size: 12px;
}

.evaluation-inline .insight-header {
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--sage-gray-700);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.evaluation-inline .insight-list {
	margin: 0;
	padding-left: 16px;
}

.evaluation-inline .insight-list li {
	margin-bottom: 4px;
	font-size: 13px;
	line-height: 1.4;
}

/* algorithm-text removed — algorithmInsights no longer rendered */

/* Structural guidance: template match + recommendations */
.structural-guidance {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--sage-gray-200);
}

.structure-match-name {
	font-weight: 600;
	font-size: 13px;
	color: var(--sage-gray-800);
	margin-bottom: 2px;
}

.structure-match-pattern {
	font-size: 12px;
	color: var(--sage-gray-600);
	margin-bottom: 8px;
}

.structure-recommendations {
	margin-top: 10px;
}

.structure-rec-card {
	background: var(--sage-gray-50);
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 10px 12px;
	margin-top: 8px;
}

.structure-rec-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}

.structure-rec-name {
	font-weight: 600;
	font-size: 13px;
	color: var(--sage-gray-800);
}

.structure-apply-btn {
	background: var(--sage-info);
	color: white;
	border: none;
	padding: 4px 12px;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
	white-space: nowrap;
}

.structure-apply-btn:hover {
	background: var(--sage-info-hover);
}

.structure-rec-pattern {
	font-size: 12px;
	color: var(--sage-gray-600);
	margin-bottom: 4px;
}

.structure-rec-rationale {
	font-size: 12px;
	color: var(--sage-gray-600);
	font-style: italic;
}

body {
	padding: 20px;
	overflow-x: hidden;
}

.add-idea-section {
	background: white;
	padding: 12px;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	margin-bottom: 16px;
}

.add-idea-form {
	display: flex;
	flex-direction: column;
}

.add-idea-form textarea {
	padding: 12px;
	border: 1px solid var(--sage-border);
	border-radius: var(--sage-radius-md);
	font-size: 14px;
	font-family: inherit;
	resize: vertical;
	width: 100%;
	min-height: 80px;
}

/* Inline input pattern — buttons embedded in textarea */
.idea-input-wrapper {
	position: relative;
}

.idea-input-wrapper textarea {
	padding-bottom: 48px;
	min-height: 100px;
}

.idea-input-bar {
	position: absolute;
	bottom: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.platform-dropdown-container {
	position: relative;
}

.platform-dropdown-trigger {
	font-size: 12px;
	color: var(--sage-text-secondary);
	display: flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	padding: 6px 10px;
	border: 1px solid var(--sage-border);
	border-radius: var(--sage-radius-sm);
	background: white;
	font-family: inherit;
	transition: all 0.15s;
}

.platform-dropdown-trigger:hover {
	border-color: #cbd5e1;
	background: var(--sage-gray-50);
}

.add-idea-btn {
	padding: 6px 16px;
	font-size: 13px;
	font-weight: 500;
	border-radius: var(--sage-radius-sm);
}

.platform-dropdown-menu {
	position: absolute;
	top: 100%;
	right: 0;
	background: white;
	border: 2px solid var(--sage-gray-200);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	min-width: 180px;
	margin-top: 4px;
}

.platform-option {
	padding: 10px 12px;
	cursor: pointer;
	transition: background-color 0.2s;
	display: flex;
	align-items: center;
	font-size: 14px;
	color: var(--sage-gray-700);
}

.platform-option:hover {
	background-color: var(--sage-canvas);
}

.platform-option:first-child {
	border-top-left-radius: 6px;
	border-top-right-radius: 6px;
}

.platform-option:last-child {
	border-bottom-left-radius: 6px;
	border-bottom-right-radius: 6px;
}

.platform-selection {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 12px 0;
}

.platform-selection label {
	font-size: 14px;
	font-weight: 500;
	color: var(--sage-gray-700);
	white-space: nowrap;
}

.platform-dropdown {
	padding: 8px 12px;
	border: 2px solid var(--sage-gray-200);
	border-radius: 8px;
	background: white;
	color: var(--sage-gray-700);
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s;
	min-width: 140px;
}

.platform-dropdown:hover {
	border-color: var(--sage-accent);
}

.platform-dropdown:focus {
	outline: none;
	border-color: var(--sage-accent);
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.platform-buttons {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 8px;
	/* Keep buttons at their natural height. Without this, the grid's default
	   align-items:stretch + .btn-content height:100% form a circular height
	   constraint that the post-optimize re-render resolves by ballooning every
	   button to ~100px tall (#537). */
	align-items: center;
}

.platform-btn {
	padding: 8px 14px;
	border: 1px solid var(--sage-gray-200);
	border-radius: 20px;
	background: white;
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.platform-btn:hover {
	border-color: var(--sage-accent);
	background: var(--sage-botanical-light);
}

.platform-btn.selected {
	border-color: var(--sage-accent);
	background: var(--sage-accent);
	color: white;
}

/* Platform Button Loading States */
.platform-btn {
	height: auto;
	width: auto;
	min-width: 0;
	box-sizing: border-box;
}

.platform-btn .btn-content {
	display: flex;
	align-items: center;
	gap: 6px;
	justify-content: center;
}

.platform-btn .btn-icon,
.platform-btn .btn-spinner {
	width: 16px; /* Fixed width for consistent spacing */
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.platform-btn .btn-icon svg,
.platform-btn .btn-icon img {
	width: 16px;
	height: 16px;
	display: block;
}

.platform-btn .btn-spinner {
	display: none;
	font-size: 8px;
	color: var(--sage-text-muted);
	animation: pulse 1.5s ease-in-out infinite;
}

.platform-btn.loading {
	background: var(--sage-canvas);
	border-color: var(--sage-gray-300);
	color: var(--sage-text-secondary);
	cursor: not-allowed;
}

.platform-btn.loading .btn-icon {
	display: none;
}

.platform-btn.loading .btn-spinner {
	display: flex;
}

.platform-btn.loading:hover {
	background: var(--sage-canvas);
	border-color: var(--sage-gray-300);
}

/* Simple pulse animation for circular dot */
@keyframes pulse {
	0%,
	100% {
		opacity: 0.4;
		transform: scale(1);
	}
	50% {
		opacity: 1;
		transform: scale(1.2);
	}
}

/* ─── State badge base (hidden by default) ─── */
.platform-btn {
	position: relative;
}

.state-badge {
	display: none;
}

.platform-btn.optimized .state-badge,
.platform-btn.posted .state-badge {
	display: flex;
}

/* ─── STATE: Optimized (saved content, not yet posted) ─── */
.platform-btn.optimized {
	border: 2px solid #60a5fa;
	background: #eff6ff;
}

.platform-btn.optimized:hover {
	border-color: #3b82f6;
	background: #dbeafe;
}

.platform-btn.optimized .state-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #3b82f6;
	border: 2px solid white;
}

/* ─── STATE: Posted (published, click to view) ─── */
.platform-btn.posted {
	border: 2px solid var(--sage-gray-300);
	background: var(--sage-canvas);
	color: var(--sage-text-muted);
	cursor: pointer;
	opacity: 0.55;
	transition:
		opacity 0.15s,
		background 0.15s;
}

.platform-btn.posted:hover {
	opacity: 1;
	background: var(--sage-info-bg);
}

.platform-btn.posted img {
	opacity: 0.4;
}

.platform-btn.posted .state-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: var(--sage-success);
	color: white;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid white;
	font-size: 7px;
	font-weight: 700;
}

/* ─── Outbound arrow on posted pills (#480) ─── */
.platform-outbound {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 2px;
	padding: 0 2px;
	color: var(--sage-text-muted, #64748b);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	border-radius: 3px;
	user-select: none;
}

.platform-outbound:hover {
	color: var(--sage-text-primary, #0f172a);
}

.platform-outbound:focus {
	outline: 2px solid var(--sage-accent, #4a7c59);
	outline-offset: 1px;
}

/* ─── Posted-content modal (#394) ─── */
.posted-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	background: var(--sage-success-bg);
	color: var(--sage-success-fg);
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
}

.view-live-link {
	color: var(--sage-platform-substack);
	font-size: 12px;
	text-decoration: none;
	border: 1px solid var(--sage-platform-substack);
	padding: 4px 10px;
	border-radius: 4px;
	font-weight: 500;
}

.view-live-link:hover {
	background: var(--sage-platform-substack);
	color: white;
}

/* Posted-modal layout — class-based replacement for inline styles (#410) */
.posted-modal .modal-header {
	position: sticky;
	top: 0;
	background: white;
	z-index: 10;
	padding: 12px 20px;
}

.posted-modal .modal-header h3 {
	font-size: 16px;
}

.posted-modal .header-actions {
	gap: 8px;
}

/* Right-aligned navigation link rendered inside a tab row (e.g. Calendar) */
.tab-btn--nav {
	margin-left: auto;
	text-decoration: none;
}

.posted-preview-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--sage-border-subtle);
}

.posted-preview-tabs .tab-btn {
	padding: 8px 16px;
	cursor: default;
}

.posted-preview-tabs .tab-btn.active,
.posted-preview-tabs .tab-btn.active:hover {
	color: var(--sage-info);
	border-bottom-color: var(--sage-info);
	font-weight: 500;
}

.posted-tabs-meta {
	margin-left: auto;
	color: var(--sage-text-secondary);
	font-size: 14px;
	display: flex;
	align-items: center;
	padding: 8px 0;
}

.posted-modal .preview-content {
	padding: 8px 16px;
	background: white;
	margin-bottom: 16px;
}

.posted-modal .modal-actions.actions-row {
	gap: 6px;
	justify-content: center;
}

/* ─── Platform button layout (follow-up context inherits grid) ─── */

/* image-workspace overrides handled by shared workspace rule at top */

/* Visual workspace - clean top controls + bottom preview */
.visual-controls {
	background: white;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 12px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.visual-ai-section {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.visual-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--sage-ink);
	display: flex;
	align-items: center;
	gap: 8px;
}

.visual-limit {
	font-size: 12px;
	font-weight: 400;
	color: var(--sage-text-secondary);
}

.visual-prompt-input {
	width: 100%;
	border: 1px solid var(--sage-gray-300);
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	resize: vertical;
	transition: border-color 0.2s ease;
}

.visual-prompt-input:focus {
	outline: none;
	border-color: var(--sage-accent);
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.visual-prompt-input:disabled {
	background: var(--sage-gray-100);
	color: var(--sage-text-muted);
	cursor: not-allowed;
}

.visual-button-row {
	display: flex;
	gap: 12px;
	margin-top: 4px;
}

/* Visual tab buttons - use new unified system */
.visual-prompt-btn,
.visual-generate-btn,
.visual-upload-btn {
	flex: 1;
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	color: white;
}

.visual-prompt-btn {
	background: var(--sage-accent);
	position: relative;
}

.visual-prompt-btn:hover:not(:disabled) {
	background: var(--sage-accent-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

/* Connector arrow: signals AI-flow dependency from Choose-a-format → Generate visual.
   Sits outside the button on its right edge; not rendered before .visual-upload-btn. */
.visual-prompt-btn::after {
	content: "→";
	position: absolute;
	left: calc(100% + 4px);
	top: 50%;
	transform: translateY(-50%);
	color: var(--sage-text-muted);
	font-size: 16px;
	font-weight: 600;
	pointer-events: none;
}

.visual-generate-btn {
	background: var(--sage-text-secondary);
}

.visual-generate-btn:hover:not(:disabled) {
	background: var(--sage-gray-600);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.visual-upload-btn {
	background: var(--sage-accent);
}

.visual-upload-btn:hover:not(:disabled) {
	background: var(--sage-accent-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.visual-preview-panel {
	background: white;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	justify-content: center;
}

.visual-preview-image {
	width: 100%;
	max-height: 400px;
	border: none;
	background: none;
	padding: 20px;
	cursor: pointer;
	border-radius: 8px;
	overflow: hidden;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.visual-preview-image:hover {
	transform: scale(1.02);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.visual-preview-image img {
	display: block;
	max-width: 100%;
	max-height: 400px;
	width: 100%;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
}

.visual-preview-empty {
	text-align: center;
	padding: 12px;
	color: var(--sage-text-secondary);
	width: 100%;
}

.visual-empty-icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

.visual-empty-text {
	font-size: 15px;
	font-weight: 500;
	color: var(--sage-gray-600);
	margin-bottom: 8px;
}

.visual-empty-hint {
	font-size: 13px;
	color: var(--sage-text-muted);
}

.visual-preview-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
}

.visual-action-btn {
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
	background: var(--sage-gray-100);
	color: var(--sage-gray-600);
}

.visual-action-btn:hover:not(:disabled) {
	background: var(--sage-border-subtle);
	transform: translateY(-1px);
}

.visual-action-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Status messages for visual tab */
.idea-image-status {
	font-size: 13px;
	color: var(--sage-text-secondary);
	text-align: center;
	padding: 8px 12px;
	background: var(--sage-gray-50);
	border-radius: 6px;
}

.idea-image-status.generating {
	color: var(--sage-accent);
	background: var(--sage-botanical-light);
}

.idea-image-status.uploading {
	color: var(--sage-accent);
	background: var(--sage-botanical-light);
}

/* ─── Proposal cards (Attach tab) ─── */
.proposal-cards-container {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.proposal-cards-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 2px;
}

.proposal-cards-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--sage-ink);
}

.proposal-refresh-btn {
	font-size: 12px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	background: none;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	padding: 4px 10px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.proposal-refresh-btn:hover:not(:disabled) {
	background: var(--sage-gray-50);
	border-color: var(--sage-gray-300);
}

.proposal-refresh-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.proposal-card {
	background: white;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	padding: 12px 14px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.proposal-card:hover {
	border-color: var(--sage-gray-300);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.proposal-card-selected {
	border-color: var(--sage-accent);
	background: var(--sage-botanical-light);
}

.proposal-card-top {
	border-color: var(--sage-accent);
	border-width: 2px;
}

.proposal-card-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.proposal-rank {
	font-size: 12px;
	font-weight: 700;
	color: var(--sage-text-secondary);
	min-width: 20px;
}

.proposal-format-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
	background: var(--sage-gray-100);
	color: var(--sage-gray-600);
}

.proposal-format-badge[data-tier="T1"] {
	background: #dbeafe;
	color: #1e40af;
}

.proposal-format-badge[data-tier="T2"] {
	background: #fef3c7;
	color: #92400e;
}

.proposal-format-badge[data-tier="T3"] {
	background: #f3f4f6;
	color: #6b7280;
}

.proposal-pending-chip {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.3px;
	padding: 2px 8px;
	border-radius: 10px;
	background: var(--sage-gray-100);
	color: var(--sage-gray-600);
	margin-left: auto;
}

.proposal-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--sage-ink);
	margin-bottom: 4px;
}

.proposal-rationale {
	font-size: 13px;
	color: var(--sage-text-secondary);
	line-height: 1.4;
	margin-bottom: 8px;
	white-space: pre-wrap;
}

.proposal-actions {
	display: flex;
	gap: 8px;
}

.proposal-generate-btn,
.proposal-edit-btn {
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: all 0.15s ease;
}

.proposal-generate-btn {
	background: var(--sage-accent);
	color: white;
}

.proposal-generate-btn:hover:not(:disabled) {
	background: var(--sage-accent-hover);
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(74, 124, 89, 0.3);
}

.proposal-generate-btn:disabled,
.proposal-edit-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.proposal-edit-btn {
	background: var(--sage-gray-100);
	color: var(--sage-gray-600);
}

.proposal-edit-btn:hover {
	background: var(--sage-border-subtle);
}

.proposal-card-editing {
	border-color: var(--sage-accent);
	background: var(--sage-botanical-light);
}

.proposal-edit-textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
	line-height: 1.4;
	color: var(--sage-ink);
	background: white;
	resize: vertical;
	margin-bottom: 4px;
	box-sizing: border-box;
}

.proposal-edit-textarea:focus {
	outline: none;
	border-color: var(--sage-accent);
	box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.15);
}

/* Upload strip at bottom of Attach tab */
.attach-upload-strip {
	border-top: 1px solid var(--sage-border-subtle);
	padding-top: 12px;
	text-align: center;
}

.attach-upload-btn {
	width: 100%;
	padding: 10px;
	border: 1px dashed var(--sage-gray-300);
	border-radius: 8px;
	background: var(--sage-gray-50);
	color: var(--sage-text-secondary);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
}

.attach-upload-btn:hover:not(:disabled) {
	border-color: var(--sage-accent);
	color: var(--sage-accent);
	background: var(--sage-botanical-light);
}

.attach-upload-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ─── Two-action layout (Attach tab) ─── */
.image-action-buttons {
	display: flex;
	gap: 20px; /* extra space accommodates the .visual-prompt-btn::after arrow */
}

.image-action-buttons .visual-prompt-btn,
.image-action-buttons .visual-upload-btn {
	flex: 1;
}

/* ─── Prompt disclosure (Attach tab) ─── */
.prompt-disclosure {
	border-top: 1px solid var(--sage-border-subtle);
	padding-top: 8px;
}

.prompt-disclosure-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	padding: 6px 2px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	cursor: pointer;
	transition: color 0.15s ease;
	width: 100%;
	text-align: left;
}

.prompt-disclosure-toggle:hover {
	color: var(--sage-ink);
}

.prompt-disclosure-arrow {
	font-size: 10px;
	line-height: 1;
}

.prompt-disclosure-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-top: 8px;
}

.prompt-disclosure-body .visual-prompt-input {
	min-height: 5.5em;
}

.prompt-disclosure-body .visual-button-row {
	justify-content: flex-end;
}

@media (max-width: 640px) {
	.image-action-buttons {
		flex-direction: column;
		gap: 8px;
	}
}

.image-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	padding: 24px;
}

.image-modal-content {
	background: var(--sage-surface);
	border-radius: 12px;
	padding: 16px;
	max-width: 80vw;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	gap: 12px;
	position: relative;
}

.image-modal-content img {
	max-width: 70vw;
	max-height: 65vh;
	object-fit: contain;
	border-radius: 8px;
}

.image-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	font-size: 28px;
	color: var(--sage-gray-600);
	cursor: pointer;
	line-height: 1;
}

.image-modal-close:hover {
	color: #1f2937;
}

.image-modal-footer {
	display: flex;
	justify-content: flex-end;
}

.add-idea-btn {
	background: var(--sage-accent);
	color: white;
	border: none;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s;
}

.add-idea-btn:hover {
	background: var(--sage-accent-hover);
}

.add-idea-btn:disabled {
	background: var(--sage-text-muted);
	cursor: not-allowed;
}

/* View Selection Tabs */
.view-tabs {
	display: flex;
	gap: 0;
	margin-top: 8px;
	margin-bottom: 12px;
	padding: 0;
	background: none;
	border-bottom: 1px solid var(--sage-border);
	overflow-x: auto;
	overflow-y: hidden;
	max-width: 100%;
	/* Smooth scrolling */
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	/* Better scrollbar styling */
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 var(--sage-gray-100);
}

/* Webkit scrollbar styling (Chrome, Safari, Edge) */
.view-tabs::-webkit-scrollbar {
	height: 6px;
}

.view-tabs::-webkit-scrollbar-track {
	background: var(--sage-gray-100);
	border-radius: 3px;
}

.view-tabs::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}

.view-tabs::-webkit-scrollbar-thumb:hover {
	background: var(--sage-text-muted);
}

.view-tabs .tab-btn {
	flex: 0 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	white-space: nowrap;
	min-width: 0;
}

.tab-btn {
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.tab-btn:hover {
	color: var(--sage-text-primary);
	border-bottom-color: #cbd5e1;
	background: transparent;
}

.tab-btn.active {
	color: var(--sage-accent);
	border-bottom-color: var(--sage-accent);
	font-weight: 600;
	background: transparent;
	box-shadow: none;
}

.tab-btn.active:hover {
	color: var(--sage-accent-hover);
	border-bottom-color: var(--sage-accent-hover);
	background: transparent;
}

/* Up Next */
.up-next-container {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.up-next-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.up-next-title-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.up-next-label {
	font-size: 18px;
	font-weight: 700;
	color: var(--sage-ink);
}

.up-next-counter {
	font-size: 13px;
	color: var(--sage-text-muted);
}

.up-next-toggle-btn {
	background: none;
	border: 1px solid var(--sage-border);
	border-radius: var(--sage-radius-sm);
	padding: 6px 12px;
	font-size: 13px;
	color: var(--sage-text-secondary);
	cursor: pointer;
	transition: all 0.15s ease;
}

.up-next-toggle-btn:hover {
	background: var(--sage-canvas);
	color: var(--sage-ink);
	border-color: #cbd5e1;
}

.up-next-card-wrapper {
	border-radius: var(--sage-radius-md);
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.up-next-card-wrapper > .idea-card {
	border-top-left-radius: 0;
	border-top-right-radius: 0;
	box-shadow: none;
}

.up-next-recommendation {
	background: var(--sage-botanical-light);
	border: 1px solid var(--sage-botanical);
	border-bottom: none;
	border-radius: var(--sage-radius-md) var(--sage-radius-md) 0 0;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.up-next-rec-text {
	font-size: 14px;
	font-weight: 500;
	color: var(--sage-botanical-dark);
	line-height: 1.4;
	flex: 1;
	min-width: 0;
}

.up-next-rec-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.up-next-action-btn {
	background: var(--sage-botanical);
	color: white;
	border: none;
	border-radius: var(--sage-radius-sm);
	padding: 8px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
	white-space: nowrap;
}

.up-next-action-btn:hover {
	background: var(--sage-botanical-dark);
}

.up-next-skip-btn {
	background: none;
	border: 1px solid var(--sage-border);
	border-radius: var(--sage-radius-sm);
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
}

.up-next-skip-btn:hover {
	background: var(--sage-canvas);
	color: var(--sage-ink);
	border-color: #cbd5e1;
}

/* Up Next mobile */
@media (max-width: 640px) {
	.up-next-recommendation {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.up-next-rec-actions {
		justify-content: stretch;
	}

	.up-next-action-btn,
	.up-next-skip-btn {
		flex: 1;
		text-align: center;
	}
}

/* Sort Controls */
.sort-controls {
	background: white;
	padding: 14px 20px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	margin: 0 0 20px 0;
	display: flex;
	align-items: center;
	gap: 16px;
	border: 1px solid var(--sage-gray-200);
}

.sort-label {
	font-weight: 600;
	color: var(--sage-text-secondary);
	font-size: 14px;
	margin: 0;
	white-space: nowrap;
}

.sort-buttons {
	display: flex;
	gap: 2px;
	flex-wrap: wrap;
	background: var(--sage-gray-100);
	border-radius: 8px;
	padding: 3px;
}

.sort-btn {
	padding: 6px 14px;
	border: none;
	background: transparent;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	transition: all 0.15s ease;
	white-space: nowrap;
}

.sort-btn:hover {
	background: var(--sage-border-subtle);
	color: var(--sage-text-primary);
}

.sort-btn:active {
	transform: none;
}

.sort-btn.active {
	background: white;
	color: var(--sage-text-primary);
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.sort-btn.active:hover {
	background: white;
}

/* Search Input */
.search-input {
	padding: 8px 12px;
	border: 1px solid var(--sage-border-subtle);
	background: var(--sage-gray-50);
	border-radius: 6px;
	font-size: 14px;
	color: var(--sage-gray-600);
	width: 180px;
	transition: all 0.15s ease;
}

.search-input:focus {
	outline: none;
	border-color: var(--sage-accent);
	background: white;
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.search-input::placeholder {
	color: var(--sage-text-muted);
}

.search-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.search-result-count {
	font-size: 13px;
	color: var(--sage-text-secondary);
	white-space: nowrap;
}

.search-result-count:empty {
	display: none;
}

/* Batch Evaluate Button */
.batch-evaluate-btn {
	padding: 6px 14px;
	border: 1px solid var(--sage-gray-200);
	background: white;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	transition: all 0.15s ease;
	white-space: nowrap;
	margin-left: auto;
}

.batch-evaluate-btn:hover {
	background: var(--sage-accent);
	color: white;
	border-color: var(--sage-accent);
}

.batch-evaluate-btn.batch-evaluating {
	background: var(--sage-accent);
	color: white;
	border-color: var(--sage-accent);
	cursor: pointer;
}

.batch-evaluate-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Responsive: Stack on mobile */
@media (max-width: 640px) {
	.sort-controls {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		padding: 10px 12px;
	}

	.sort-buttons {
		width: 100%;
	}

	.sort-btn {
		flex: 1;
		min-width: 0;
		padding: 6px 8px;
		font-size: 12px;
	}

	.search-wrapper {
		width: 100%;
		margin-left: 0;
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.search-input {
		width: 100%;
	}

	.view-tabs {
		gap: 0;
	}

	.tab-btn {
		padding: 6px 10px;
		font-size: 13px;
	}
}

.ideas-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.idea-card {
	background: white;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.idea-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Deep-link arrival highlight (#406). Applied for 2s when the dashboard
   is opened with ?idea=<id>; JS removes the class on animation end. */
.idea-card.card-deep-linked {
	animation: deep-link-pulse 2s ease-out;
}

@keyframes deep-link-pulse {
	0% {
		outline: 0 solid rgba(0, 0, 0, 0);
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	}
	20% {
		outline: 3px solid var(--sage-accent);
		box-shadow:
			0 0 0 6px rgba(0, 0, 0, 0.04),
			0 4px 12px rgba(0, 0, 0, 0.15);
	}
	100% {
		outline: 0 solid rgba(0, 0, 0, 0);
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	}
}

.idea-header {
	position: relative;
	padding: 20px;
	border-bottom: 1px solid var(--sage-gray-100);
}

.idea-actions {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	gap: 12px;
}

.idea-actions-inline {
	display: flex;
	align-items: center;
	gap: 8px;
}

.idea-actions-inline button {
	background: none;
	border: none;
	font-size: 16px;
	cursor: pointer;
	padding: 6px;
	border-radius: 4px;
	opacity: 0.7;
	transition: all 0.2s;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.idea-card:hover .idea-actions-inline button {
	opacity: 0.6;
}

.idea-actions-inline button:hover {
	opacity: 1;
	background-color: #f0f0f0;
	transform: scale(1.1);
}

/* Focus-mode pill (#348, regrouped in #575). Primary CTA at the head of the
   right-hand action cluster -- always full opacity, not the dimmed icon row. */
.focus-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	width: auto;
	height: auto;
	font-size: 11px;
	font-weight: 600;
	border-radius: 999px;
	background: var(--sage-botanical);
	color: white;
	border: none;
	cursor: pointer;
	font-family: inherit;
	opacity: 1;
}

.focus-pill:hover {
	opacity: 1;
	background: var(--sage-botanical-dark);
	transform: none;
}

.focus-pill .arrow {
	font-size: 11px;
	line-height: 1;
}

/* Single-row status phrase (#575). Step, readiness %, and the idea-merit
   verdict render as hairline-separated inline segments -- replaces the
   .readiness-step-chip (#466) and .verdict-chip (#550) pills. Grows to fill
   the header so the action cluster stays hard-right. */
.card-status-line {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	flex-wrap: wrap;
	font-size: 12.5px;
	color: var(--sage-text-secondary);
}

.card-status-line .status-seg {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 10px;
	white-space: nowrap;
}

.card-status-line .status-seg:first-child {
	padding-left: 0;
}

.card-status-line .status-seg + .status-seg {
	border-left: 1px solid var(--sage-border);
}

.card-status-line .status-seg strong {
	color: var(--sage-ink);
	font-weight: 600;
}

.card-status-line .step-num {
	font-variant-numeric: tabular-nums;
}

.card-status-line .status-seg--score {
	color: var(--sage-ink);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* #550 verdict, reflowed inline (#575). Full label, no truncation; the craft
   flag is the leading ✓/✗ and the text color carries the merit signal -- only
   "Yours and useful" reads green; the other four read amber/red "needs work". */
.card-status-line .status-seg--verdict {
	font-weight: 600;
}

.card-status-line .craft-mark {
	font-weight: 700;
}

.card-status-line .craft-mark--ready {
	color: #1f6f3a;
}

.card-status-line .craft-mark--not-ready {
	color: #a3392f;
}

.card-status-line .status-seg--verdict[data-verdict="Yours and useful"] {
	color: #1f6f3a;
}

.card-status-line .status-seg--verdict[data-verdict="True but not new"],
.card-status-line .status-seg--verdict[data-verdict="New but not yours"],
.card-status-line .status-seg--verdict[data-verdict="Yours but not useful"] {
	color: #8a6300;
}

.card-status-line .status-seg--verdict[data-verdict="Spiky but not true"] {
	color: #9b2c2c;
}

/* Right-hand action cluster (#575): Focus CTA + the 6 action icons, grouped
   hard-right so the status phrase owns the left. */
.column-header-actions {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

/* Hairline separator between mark-completed and archive in the icon cluster. */
.icon-sep {
	display: inline-block;
	width: 1px;
	height: 18px;
	background: var(--sage-border);
	margin: 0 6px;
}

.posted-btn {
	margin-right: 4px;
}

/* Card-level image upload button (in action icons row) */
.card-image-upload-btn.has-image {
	opacity: 0.8;
	color: var(--sage-accent, #2563eb);
}

.idea-card:hover .card-image-upload-btn.has-image {
	opacity: 1;
	color: var(--sage-accent, #2563eb);
}

/* Card-level image thumbnail preview */
.card-image-preview {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	margin-top: 4px;
	border-top: 1px solid var(--sage-border-subtle, #e5e7eb);
}

.card-image-thumbnail {
	width: 72px;
	height: 72px;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	flex-shrink: 0;
	border: 1px solid var(--sage-border-subtle, #e5e7eb);
	transition: border-color 0.2s;
}

.card-image-thumbnail:hover {
	border-color: var(--sage-accent, #2563eb);
}

.card-image-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.card-image-actions {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.card-image-action-btn {
	background: none;
	border: 1px solid var(--sage-border-subtle, #e5e7eb);
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
	color: var(--sage-text-muted, #6b7280);
	transition: all 0.2s;
}

.card-image-action-btn:hover {
	background: var(--sage-bg-hover, #f3f4f6);
	color: var(--sage-text, #111827);
}

.card-image-remove-btn:hover {
	color: #dc2626;
	border-color: #dc2626;
	background: #fef2f2;
}

/* Mobile: card image preview */
@media (max-width: 768px) {
	.card-image-thumbnail {
		width: 56px;
		height: 56px;
	}

	.card-image-action-btn {
		padding: 3px 8px;
		font-size: 11px;
	}
}

.platform-selection {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.platform-select-btn {
	padding: 12px 16px;
	border: 2px solid var(--sage-border-subtle);
	border-radius: 8px;
	background: white;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	gap: 8px;
}

.platform-select-btn:hover {
	border-color: var(--sage-accent);
	background-color: var(--sage-botanical-light);
	transform: translateY(-1px);
}

.idea-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.platform-tag {
	background: var(--sage-canvas);
	color: var(--sage-gray-700);
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 500;
}

.idea-text {
	margin: 12px 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sage-gray-700);
}

/* Side-by-side content comparison layout */
/* New layout: Enhanced content primary, original collapsed, insights sidebar */
.new-layout {
	margin-top: 4px;
	margin-bottom: 8px;
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

.main-content {
	flex: 1 1 420px;
	max-width: 580px;
	min-width: 300px;
	align-self: flex-start;
}

.idea-sidebar {
	flex: 1 1 500px;
	min-width: 400px;
	max-width: none;
	padding-top: 0;
}

.original-layout .main-content {
	flex: 1 1 auto;
	max-width: 100%;
}

.original-only-section {
	background: var(--sage-surface);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 12px;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.original-only-box {
	border: 1px dashed var(--sage-border-subtle);
	border-radius: 10px;
	padding: 16px;
	background: linear-gradient(
		0deg,
		var(--sage-surface) 0%,
		var(--sage-gray-50) 100%
	);
}

.original-only-box .idea-text {
	margin: 0;
}

.conversation-workspace.no-tabs .workspace-inline-tabs {
	display: none;
}

.enhanced-section {
	margin-bottom: 0;
}

/* Collapsible original reference */
.original-reference {
	margin-top: 12px;
}

.collapsible-original {
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	background: var(--sage-gray-50);
}

.original-toggle {
	padding: 12px 16px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	cursor: pointer;
	user-select: none;
	list-style: none;
	transition: all 0.2s ease;
}

.original-toggle:hover {
	background: var(--sage-gray-100);
	color: var(--sage-gray-600);
}

.original-toggle::-webkit-details-marker {
	display: none;
}

.collapsible-original[open] .original-toggle {
	border-bottom: 1px solid var(--sage-border-subtle);
	background: var(--sage-gray-100);
}

.collapsible-original .original-content {
	padding: 16px;
	background: white;
	border-radius: 0 0 6px 6px;
}

/* Workspace panels container - reduced padding */
.workspace-panels {
	padding: 0;
}

.platform-optimization-section {
	margin-bottom: 8px;
}

.conversation-section {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Bookends (Hooks & Closers) */
.bookends-section {
	padding: 10px;
	border-bottom: 1px solid var(--sage-border-subtle);
}

.bookends-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.bookends-header .section-label {
	margin-bottom: 0;
}

.bookends-generate-btn,
.bookends-regenerate-btn {
	font-size: 12px;
	padding: 6px 12px;
	border-radius: 6px;
	border: 1px solid var(--sage-border-subtle);
	background: var(--sage-gray-50);
	color: var(--sage-text-primary);
	cursor: pointer;
	transition: background 0.15s;
}

.bookends-generate-btn:hover,
.bookends-regenerate-btn:hover {
	background: var(--sage-gray-100);
}

.bookends-loading {
	font-size: 12px;
	color: var(--sage-text-secondary);
	padding: 8px 0;
}

.bookends-group {
	margin-bottom: 8px;
}

.bookends-group-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--sage-text-secondary);
	margin-bottom: 4px;
}

.bookend-card {
	background: var(--sage-gray-50);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	padding: 8px 10px;
	margin-bottom: 4px;
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.bookend-type {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--sage-text-secondary);
	background: var(--sage-gray-100);
	padding: 2px 6px;
	border-radius: 4px;
	white-space: nowrap;
	flex-shrink: 0;
	margin-top: 2px;
}

.bookend-text {
	font-size: 13px;
	line-height: 1.4;
	color: var(--sage-text-primary);
	margin: 0;
	flex: 1;
}

.bookend-use-btn {
	font-size: 11px;
	padding: 3px 10px;
	border-radius: 4px;
	border: 1px solid var(--sage-primary);
	background: transparent;
	color: var(--sage-primary);
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
	transition:
		background 0.15s,
		color 0.15s;
}

.bookend-use-btn:hover {
	background: var(--sage-primary);
	color: white;
}

.workspace-inline-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: -1px;
	align-items: flex-start;
	border: none;
	padding: 0;
	background: transparent;
}

.workspace-inline-tab {
	background: var(--sage-gray-100);
	border: 1px solid var(--sage-border-subtle);
	border-bottom: 1px solid var(--sage-border-subtle);
	border-radius: 8px 8px 0 0;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	cursor: pointer;
	transition:
		background 0.15s ease,
		color 0.15s ease,
		border-color 0.15s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	position: relative;
	height: 38px;
	box-sizing: border-box;
	flex: 1 1 0;
	min-width: 0;
}

.workspace-inline-tab:hover:not(.active) {
	background: var(--sage-border-subtle);
	color: var(--sage-gray-600);
}

.workspace-inline-tab.active {
	background: white;
	color: var(--sage-accent);
	font-weight: 600;
	border-bottom-color: white;
	z-index: 1;
}

/* Follow-up context styling */
.followup-context {
	background: var(--sage-gray-50);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	padding: 12px;
	margin-bottom: 12px;
}

.followup-context.inline {
	display: flex;
	gap: 6px;
	align-items: baseline;
}

.context-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--sage-accent);
	margin-bottom: 6px;
}

.followup-context.inline .context-label {
	margin-bottom: 0;
	flex-shrink: 0;
}

.followup-input-section,
.answer-form {
	margin-top: 12px;
}

.input-label,
.input-guidance {
	font-size: 13px;
	color: var(--sage-text-secondary);
	margin-bottom: 8px;
	line-height: 1.4;
}

.submit-followup-btn {
	background: transparent;
	color: var(--sage-accent);
	border: 1px solid var(--sage-accent);
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.submit-followup-btn:hover {
	background: var(--sage-botanical-light);
}

.conversation-header {
	font-size: 14px;
	font-weight: 600;
	color: var(--sage-ink);
	margin-bottom: 12px;
}

.current-question {
	margin-bottom: 16px;
}

/* Evaluation prompts - visual distinction from regular questions */
.current-question.eval-prompt {
	background: linear-gradient(
		135deg,
		#fef9c3 0%,
		var(--sage-warning-light) 100%
	);
	border: 1px solid #fcd34d;
	border-radius: 8px;
	padding: 12px;
	border-left: 4px solid var(--sage-warning);
}

.current-question.eval-prompt .context-label {
	color: #d97706;
	font-weight: 600;
}

.question-text {
	font-size: 14px;
	color: var(--sage-gray-700);
	margin-bottom: 8px;
	line-height: 1.5;
}

.followup-context.inline .question-text {
	margin-bottom: 0;
}

.answer-input-section {
	margin-top: 8px;
}

.answer-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--sage-gray-300);
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
	line-height: 1.4;
	resize: vertical;
	margin-bottom: 8px;
}

.answer-input:focus {
	outline: none;
	border-color: var(--sage-accent);
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.submit-answer-btn {
	background: var(--sage-accent);
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.submit-answer-btn:hover {
	background: var(--sage-accent-hover);
}

.conversation-history {
	border-top: 1px solid var(--sage-gray-100);
	padding-top: 12px;
	margin-top: 12px;
}

.history-header {
	font-size: 12px;
	font-weight: 600;
	color: var(--sage-text-secondary);
	margin-bottom: 8px;
}

.history-item {
	margin-bottom: 4px;
}

.question-history {
	font-size: 12px;
	color: var(--sage-text-secondary);
	line-height: 1.4;
}

.history-item.current .question-history {
	color: var(--sage-accent);
	font-weight: 500;
}

.column-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
	padding-bottom: 2px;
	gap: 8px;
}

/* Base focus-warning styles (moved from inline styles in evaluationRenderer.ts) */
.focus-warning {
	border: 2px solid #ff9500;
	padding: 10px;
	margin: 8px 0;
	border-radius: 6px;
	background: #fff8f0;
	font-size: 13px;
}

.focus-warning__title {
	font-weight: 600;
	color: #b8660a;
	margin-bottom: 6px;
}

.focus-warning__themes {
	margin-bottom: 6px;
}

.focus-warning__recommendation {
	margin-bottom: 8px;
	color: #666;
}

.focus-warning .focus-selection-btn {
	background: #ff9500;
	color: white;
	border: none;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 11px;
	cursor: pointer;
}

.focus-warning__quote {
	margin-top: 4px;
	font-size: 11px;
	color: #888;
	font-style: italic;
}

/* Compact override when focus-warning appears in column headers */
.column-header .focus-warning {
	border: 1px solid #e5e7eb;
	padding: 3px 8px;
	margin: 0;
	background: #f1f5f9;
	font-size: 11px;
	color: #64748b;
}

.column-header .focus-warning__title {
	color: #64748b;
	font-size: 11px;
	margin-bottom: 0;
}

.column-header .focus-warning > *:not(.focus-warning__title) {
	display: none;
}

.column-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--sage-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.original-content {
	background: var(--sage-gray-50);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	padding: 16px;
	min-height: 240px;
}

.content-display {
	font-size: 14px;
	line-height: 1.6;
	color: var(--sage-ink);
	white-space: pre-wrap;
	word-wrap: break-word;
}

.enhanced-content-wrapper {
	background: var(--sage-botanical-light);
	border: 1px solid var(--sage-accent);
	border-radius: 6px;
	padding: 10px;
}

/* Fallback for ideas without enhanced content */
.original-only .idea-text {
	margin: 12px 0 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--sage-ink);
}

/* Mobile responsiveness - stack on smaller screens */
@media (max-width: 768px) {
	body {
		padding: 4px;
		font-size: 14px;
		overflow-x: hidden;
		max-width: 100vw;
	}

	.header {
		padding: 4px 4px 0;
		margin-bottom: 4px;
	}

	.header-right {
		font-size: 12px;
	}

	.add-idea-section {
		padding: 6px;
		border-radius: 4px;
		margin-bottom: 6px;
	}

	.add-idea-form textarea {
		min-height: 60px;
		font-size: 16px; /* Prevents zoom on iOS */
	}

	.platform-buttons {
		grid-template-columns: 1fr 1fr;
	}

	.platform-btn {
		padding: 8px 10px;
		font-size: 12px;
		min-width: auto;
	}

	.platform-btn .btn-text {
		font-size: 11px;
	}

	.idea-input-wrapper textarea {
		font-size: 16px; /* Prevents zoom on iOS */
	}

	.new-layout {
		flex-direction: column;
		gap: 12px;
	}

	.main-content {
		max-width: none;
		min-width: 0;
		flex: 1 1 auto;
		width: 100%;
	}

	.idea-sidebar {
		min-width: 0;
		flex: 1 1 auto;
	}

	.sidebar {
		flex: 1;
		min-width: 0;
	}

	/* Legacy layout for backwards compatibility */
	.content-comparison {
		flex-direction: column;
		gap: 16px;
	}

	.enhanced-column {
		max-width: none;
		flex: 1;
	}

	.idea-card {
		margin-bottom: 8px;
		border-radius: 4px;
	}

	.idea-header {
		padding: 12px;
	}

	.idea-meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.enhanced-section {
		padding: 12px;
	}

	.enhanced-text-editor {
		min-height: 200px;
		font-size: 16px; /* Prevents zoom on iOS */
	}

	.conversation-section {
		padding: 8px;
	}

	.answer-input {
		font-size: 16px; /* Prevents zoom on iOS */
	}

	.ideas-container {
		gap: 12px;
	}

	/* LinkedIn Evaluator mobile improvements */
	.linkedin-evaluator-section {
		padding: 16px;
	}

	#linkedin-post-text {
		font-size: 16px; /* Prevents zoom on iOS */
		min-height: 100px;
	}

	.linkedin-evaluator-section .evaluate-btn {
		width: 100%;
		padding: 14px 20px;
		font-size: 16px;
	}

	.evaluation-results {
		padding: 16px;
	}

	.category-scores {
		grid-template-columns: 1fr;
	}

	.modal-content {
		width: 95vw;
		max-width: none;
		margin: 10px;
	}

	.modal-actions {
		flex-direction: column;
		gap: 8px;
		padding: 16px;
	}

	.modal-actions button {
		width: 100%;
		min-width: auto;
	}

	.workspace-inline-tab {
		padding: 6px 10px;
		font-size: 12px;
		height: 34px;
	}

	.workspace-panels {
		padding: 0;
	}

	.section-label {
		font-size: 11px;
		margin-bottom: 6px;
	}

	.platform-optimization-section {
		padding: 0;
	}

	.enhanced-actions {
		gap: 6px;
	}

	.original-only-section {
		padding: 12px;
	}

	.column-header {
		flex-wrap: wrap;
		gap: 6px;
	}

	/* The action row (focus-pill + icon buttons) is wider than a phone viewport
	   once #348 added the Focus-mode pill. .column-header wraps it as a unit,
	   but the row itself must also wrap or it overflows .idea-card and clips
	   under overflow:hidden. Mirrors the .column-header pattern above. */
	.idea-actions-inline {
		flex-wrap: wrap;
	}
}

/* Enhanced content editor styles for side-by-side layout */
.enhanced-text-editor {
	width: 100%;
	min-height: 280px;
	padding: 12px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.6;
	color: var(--sage-ink);
	background: white;
	resize: vertical;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.enhanced-text-editor:focus {
	outline: none;
	box-shadow:
		0 0 0 2px rgba(59, 130, 246, 0.2),
		0 1px 3px rgba(0, 0, 0, 0.1);
}

.enhanced-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	justify-content: flex-start;
}

.enhanced-actions button {
	flex: 1 1 0;
	min-width: 0;
	font-size: 12px;
	padding: 6px 12px;
	font-weight: 500;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Button size variants */
.btn-sm {
	padding: 6px 12px;
	font-size: 12px;
}

.btn-md {
	padding: 10px 20px;
	font-size: 13px;
}

/* Button color variants */
.btn-success {
	background: var(--sage-success);
	color: white;
}

.btn-success:hover:not(:disabled) {
	background: #059669;
	transform: translateY(-1px);
}

.btn-primary {
	background: var(--sage-accent);
	color: white;
}

.btn-primary:hover:not(:disabled) {
	background: var(--sage-accent-hover);
	transform: translateY(-1px);
}

/* Disabled state for all buttons */
.save-btn:disabled,
.save-evaluate-btn:disabled,
.evaluate-btn:disabled,
.visual-prompt-btn:disabled,
.visual-generate-btn:disabled,
.visual-upload-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* Legacy button classes - map to new system */
.save-btn {
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 500;
	border: 1px solid var(--sage-border);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 4px;
	background: transparent;
	color: var(--sage-text-secondary);
}

.save-btn:hover:not(:disabled) {
	background: var(--sage-gray-100);
	border-color: #cbd5e1;
	color: var(--sage-text-primary);
}

.save-evaluate-btn {
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 500;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 4px;
	background: var(--sage-accent);
	color: white;
}

.save-evaluate-btn:hover:not(:disabled) {
	background: var(--sage-accent-hover);
	transform: translateY(-1px);
}

.next-action {
	padding: 12px 20px;
	margin-top: 8px;
}

.platform-section,
.refinement-section {
	margin-bottom: 16px;
}

.platform-section:last-child,
.refinement-section:last-child {
	margin-bottom: 0;
}

.section-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--sage-gray-700);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 6px;
}

/* LinkedIn Evaluator Styles */
.linkedin-evaluator-section {
	background: white;
	padding: 20px;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	margin-bottom: 24px;
}

.linkedin-evaluator-section h2 {
	margin: 0 0 8px 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--sage-ink);
}

.evaluator-description {
	color: var(--sage-text-secondary);
	margin: 0 0 16px 0;
	font-size: 14px;
}

.evaluator-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

#linkedin-post-text {
	width: 100%;
	padding: 12px;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	resize: vertical;
	min-height: 120px;
}

#linkedin-post-text:focus {
	outline: none;
	border-color: var(--sage-accent);
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.evaluate-btn {
	background: var(--sage-accent);
	color: white;
	border: none;
	padding: 12px 20px;
	border-radius: 8px;
	font-weight: 500;
	cursor: pointer;
	font-size: 14px;
	align-self: flex-start;
	transition: background-color 0.2s;
}

.evaluate-btn:hover {
	background: var(--sage-accent-hover);
}

.evaluate-btn:disabled {
	background: var(--sage-text-muted);
	cursor: not-allowed;
}

.evaluation-results {
	margin-top: 20px;
	padding: 20px;
	background: var(--sage-gray-50);
	border-radius: 8px;
	border: 1px solid var(--sage-border-subtle);
}

.score-summary {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
	padding: 16px;
	background: white;
	border-radius: 8px;
	border: 1px solid var(--sage-border-subtle);
}

.overall-score {
	font-size: 32px;
	font-weight: 700;
	color: var(--sage-ink);
}

.performance-tier {
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.tier-excellent {
	background: #dcfce7;
	color: #166534;
}
.tier-good {
	background: #dbeafe;
	color: #1e40af;
}
.tier-average {
	background: var(--sage-warning-light);
	color: #92400e;
}
.tier-needs-improvement {
	background: #fee2e2;
	color: #991b1b;
}

.category-scores {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.category-card {
	background: white;
	padding: 16px;
	border-radius: 8px;
	border: 1px solid var(--sage-border-subtle);
}

.category-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.category-name {
	font-weight: 600;
	color: var(--sage-ink);
	font-size: 14px;
}

.category-score {
	font-weight: 700;
	color: var(--sage-accent);
}

.category-feedback {
	font-size: 13px;
	color: var(--sage-text-secondary);
	line-height: 1.4;
}

.improvements-section,
.strengths-section {
	margin-bottom: 16px;
}

.improvements-section h4,
.strengths-section h4 {
	margin: 0 0 8px 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--sage-ink);
}

.improvements-list,
.strengths-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.improvements-list li {
	padding: 8px 0;
	border-bottom: 1px solid var(--sage-gray-100);
	font-size: 13px;
	color: var(--sage-text-secondary);
}

.improvements-list li:before {
	content: "🔧 ";
	margin-right: 8px;
}

.strengths-list li {
	padding: 8px 0;
	border-bottom: 1px solid var(--sage-gray-100);
	font-size: 13px;
	color: var(--sage-text-secondary);
}

.strengths-list li:before {
	content: "✅ ";
	margin-right: 8px;
}

.next-action-label {
	font-size: 14px;
	font-weight: 500;
	color: var(--sage-text-secondary);
	margin-bottom: 12px;
}

.answer-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.answer-form textarea {
	padding: 12px;
	border: 1px solid var(--sage-gray-300);
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	resize: vertical;
}

.buttons {
	display: flex;
	gap: 8px;
}

.submit-btn,
.skip-btn {
	padding: 8px 16px;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	font-weight: 500;
}

.submit-btn {
	background: var(--sage-success);
	color: white;
}

.submit-btn:hover {
	background: #059669;
}

.skip-btn {
	background: var(--sage-canvas);
	color: var(--sage-text-secondary);
}

.skip-btn:hover {
	background: var(--sage-gray-200);
}

/* Recommendations Section Styles */
.recommendations-section {
	background: var(--sage-gray-50);
	border-radius: 8px;
	padding: 16px;
	margin-top: 12px;
}

.recommendations-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--sage-border-subtle);
}

.recommendations-header .context-label {
	font-size: 20px;
	line-height: 1;
}

.recommendations-count {
	font-size: 13px;
	color: var(--sage-text-secondary);
	background: white;
	padding: 4px 12px;
	border-radius: 12px;
	font-weight: 500;
}

.recommendations-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.recommendation-item {
	display: flex;
	gap: 12px;
	background: white;
	padding: 12px;
	border-radius: 8px;
	border: 1px solid var(--sage-border-subtle);
}

/* Evaluation suggestions - amber/yellow theme to distinguish from regular questions */
.recommendation-item.eval-suggestion {
	background: linear-gradient(
		135deg,
		#fffbeb 0%,
		var(--sage-warning-light) 100%
	);
	border-color: #fcd34d;
	border-left: 4px solid var(--sage-warning);
}

.recommendation-item.eval-suggestion .recommendation-number {
	color: #d97706;
}

.eval-freshness {
	font-size: 11px;
	color: var(--sage-text-muted);
	font-weight: 400;
	margin-left: 4px;
}

.recommendation-number {
	font-weight: 700;
	color: var(--sage-accent);
	font-size: 16px;
	min-width: 24px;
	flex-shrink: 0;
}

.recommendation-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.recommendation-text {
	font-size: 14px;
	color: var(--sage-ink);
	line-height: 1.5;
	font-weight: 500;
}

.recommendation-reasoning {
	font-size: 13px;
	color: var(--sage-text-secondary);
	font-style: italic;
	padding: 8px 12px;
	background: var(--sage-gray-100);
	border-radius: 6px;
	border-left: 3px solid var(--sage-accent);
}

.recommendation-actions {
	display: flex;
	gap: 8px;
	margin-top: 4px;
}

.recommendation-actions .submit-btn,
.recommendation-actions .skip-btn {
	padding: 6px 12px;
	font-size: 12px;
}

.recommendations-footer {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--sage-border-subtle);
}

.recommendations-footer .input-guidance {
	font-size: 12px;
	color: var(--sage-text-secondary);
	text-align: center;
	font-style: italic;
}

.conversation-history {
	margin-top: 16px;
}

.conversation-toggle {
	background: var(--sage-canvas);
	border: 1px solid var(--sage-gray-300);
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	width: 100%;
	text-align: left;
}

.conversation-items {
	display: none;
	margin-top: 12px;
	padding: 12px;
	background: var(--sage-canvas);
	border-radius: 8px;
}

.conversation-item {
	margin-bottom: 12px;
}

.conversation-item:last-child {
	margin-bottom: 0;
}

.conversation-item .label {
	font-weight: 600;
	color: var(--sage-text-secondary);
	font-size: 11px;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.conversation-item .content {
	font-size: 14px;
	color: var(--sage-gray-700);
	line-height: 1.4;
}

.loading,
.empty-state {
	text-align: center;
	padding: 40px 20px;
	color: var(--sage-text-secondary);
	font-size: 16px;
}

.optimization-modal,
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.modal-content {
	background: white;
	border-radius: 12px;
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	border-bottom: 1px solid var(--sage-gray-200);
}

.modal-header h3 {
	margin: 0;
	font-size: 18px;
	color: #1f2937;
}

.close-btn {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: var(--sage-text-secondary);
}

.modal-body {
	padding: 16px 20px 12px;
}

.optimized-content {
	background: var(--sage-canvas);
	padding: 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
}

.constraints h4 {
	margin: 0 0 8px 0;
	font-size: 14px;
	color: var(--sage-gray-700);
}

.constraints ul {
	margin: 0;
	padding-left: 20px;
	color: var(--sage-text-secondary);
	font-size: 13px;
}

.modal-footer {
	padding: 16px 20px;
	border-top: 1px solid var(--sage-gray-200);
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

.modal-footer button {
	padding: 8px 16px;
	border: 1px solid var(--sage-gray-300);
	border-radius: 6px;
	background: white;
	cursor: pointer;
	font-size: 13px;
}

.modal-footer button:first-child {
	background: var(--sage-text-secondary);
	color: white;
}

/* "Also optimize for" section */
.also-optimize-section {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--sage-border-subtle);
}

.also-optimize-label {
	font-size: 12px;
	color: var(--sage-text-muted);
	margin-bottom: 6px;
	text-align: center;
}

/* Platform selection styling for mark as posted modal */
.platform-selection {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.platform-select-btn {
	background: var(--sage-gray-50);
	border: 2px solid var(--sage-border-subtle);
	border-radius: 8px;
	padding: 12px 16px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: #334155;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 8px;
}

.platform-select-btn:hover {
	background: var(--sage-accent);
	border-color: var(--sage-accent);
	color: white;
	transform: translateY(-1px);
}

/* Simplified LinkedIn Composer Styles */
.linkedin-composer {
	background: white;
	border-radius: 12px;
	border: 1px solid #e1e5e9;
	overflow: hidden;
}

.composer-header {
	padding: 16px 20px;
	border-bottom: 1px solid #e1e5e9;
	background: #fafbfc;
}

.composer-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #000;
}

.composer-content {
	padding: 12px 16px;
}

.content-editor {
	width: 100%;
	min-height: 300px;
	border: none;
	outline: none;
	font-size: 14px;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.5;
	resize: vertical;
	overflow: auto;
	background: transparent;
	color: #000;
}

.content-editor::placeholder {
	color: #666;
	font-size: 18px;
	font-weight: 400;
}

.linkedin-meta-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 4px 20px 8px;
	font-size: 12px;
	color: var(--sage-text-secondary);
}

.linkedin-meta-row.over-limit {
	color: var(--sage-error);
	font-weight: 600;
}

.linkedin-word-count {
	flex: 0 0 auto;
	white-space: nowrap;
}

.linkedin-proximity-bar {
	flex: 1 1 auto;
	height: 4px;
	background: #e5e7eb;
	border-radius: 2px;
	overflow: hidden;
}

.linkedin-proximity-fill {
	height: 100%;
	background: var(--sage-platform-linkedin);
	border-radius: 2px;
	transition:
		width 0.15s ease,
		background 0.15s ease;
}

.linkedin-meta-row.over-limit .linkedin-proximity-fill {
	background: var(--sage-error);
}

.linkedin-score-chip {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 600;
	color: var(--sage-platform-linkedin);
	background: #e7f3ff;
	padding: 4px 10px;
	border-radius: 12px;
	white-space: nowrap;
}

.engagement-preview {
	padding: 16px 20px;
	background: var(--sage-canvas);
	border-top: 1px solid #e1e5e9;
}

.engagement-stats {
	font-size: 14px;
	color: #666;
	font-weight: 500;
	margin-bottom: 4px;
}

.engagement-note {
	font-size: 12px;
	color: #999;
	font-style: italic;
}

/* LinkedIn Integration Styles */
.linkedin-status {
	margin: 16px 0;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
}

.linkedin-status.not-configured {
	background: var(--sage-warning-light);
	border: 1px solid var(--sage-warning);
	color: #92400e;
}

.linkedin-status.disconnected {
	background: #fef2f2;
	border: 1px solid #f87171;
	color: #991b1b;
}

.linkedin-status.connected {
	background: #d1fae5;
	border: 1px solid var(--sage-success);
	color: #065f46;
}

.status-subtitle {
	font-size: 12px;
	opacity: 0.8;
	margin-top: 4px;
}

.linkedin-connect-btn {
	background: var(--sage-platform-linkedin);
	color: white;
	border: none;
	padding: 10px 16px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.linkedin-connect-btn:hover {
	background: #005885;
	transform: translateY(-1px);
}

.linkedin-post-btn {
	background: var(--sage-platform-linkedin);
	color: white;
	border: none;
	padding: 10px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.linkedin-post-btn:hover:not(:disabled) {
	background: #005885;
	transform: translateY(-1px);
}

.linkedin-post-btn:disabled,
.linkedin-schedule-btn-inline:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.linkedin-post-btn.success {
	background: var(--sage-success);
	color: white;
}

.linkedin-post-btn.error {
	background: #ef4444;
	color: white;
}

.twitter-connect-btn {
	background: #1da1f2;
	color: white;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
	font-weight: 500;
}

.twitter-connect-btn:hover {
	background: #1a91da;
}

.view-post-btn {
	background: #6366f1;
	color: white;
	border: none;
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 500;
	transition: all 0.2s ease;
	margin-left: 8px;
}

.view-post-btn:hover {
	background: #4f46e5;
	transform: translateY(-1px);
}

/* Modal actions with LinkedIn integration */
.modal-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 20px;
	padding: 0 24px 24px 24px;
}

.modal-actions.actions-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.dashboard-card .actions-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--sage-ink);
}

.header-actions {
	display: flex;
	align-items: center;
}

.modal-actions button {
	flex: 1;
	min-width: 130px;
	padding: 12px 18px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	justify-content: center;
}

.copy-btn {
	background: var(--sage-gray-50);
	border: 1px solid var(--sage-border-subtle);
	color: var(--sage-gray-700);
}

.copy-btn:hover {
	background: var(--sage-gray-100);
	transform: translateY(-1px);
}

.copy-post-btn {
	background: #059669;
	border: 1px solid #059669;
	color: white;
}

.copy-post-btn:hover {
	background: #047857;
	transform: translateY(-1px);
}

/* LinkedIn action row: Post to LinkedIn primary, "Copy & mark as posted" outlined secondary. */
.modal-actions.linkedin-action-row .linkedin-post-btn {
	flex: 2 1 auto;
}

.modal-actions.linkedin-action-row .copy-post-btn {
	flex: 1 1 auto;
	background: white;
	border: 1px solid var(--sage-border-subtle);
	color: var(--sage-gray-700);
}

.modal-actions.linkedin-action-row .copy-post-btn:hover {
	background: var(--sage-gray-50);
	border-color: var(--sage-gray-300);
	color: var(--sage-ink);
}

/* LinkedIn Post Preview Styles */
.linkedin-post-preview {
	background: white;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	padding: 16px;
	margin: 16px 0;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
		Arial, sans-serif;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.linkedin-post-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 12px;
}

.profile-info {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.profile-avatar {
	width: 48px;
	height: 48px;
	background: var(--sage-platform-linkedin);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 20px;
	flex-shrink: 0;
}

.profile-details {
	flex: 1;
}

.profile-name {
	font-weight: 600;
	font-size: 14px;
	color: #000;
	margin-bottom: 2px;
}

.profile-subtitle {
	font-size: 12px;
	color: #666;
	margin-bottom: 2px;
}

.post-time {
	font-size: 12px;
	color: #666;
	display: flex;
	align-items: center;
	gap: 4px;
}

.post-options {
	background: none;
	border: none;
	color: #666;
	font-size: 16px;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
}

.post-options:hover {
	background: #f3f2ef;
}

.linkedin-post-content {
	font-size: 14px;
	line-height: 1.6;
	color: #000;
	margin-bottom: 16px;
	white-space: pre-line;
}

.linkedin-post-content .hashtag {
	color: var(--sage-platform-linkedin);
	font-weight: 500;
}

.linkedin-post-actions {
	border-top: 1px solid #e6e6e6;
	padding-top: 8px;
}

.engagement-stats {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: #666;
	margin-bottom: 8px;
	padding: 0 4px;
}

.reactions {
	display: flex;
	align-items: center;
	gap: 2px;
}

.action-buttons {
	display: flex;
	justify-content: space-around;
}

.action-btn {
	background: none;
	border: none;
	color: #666;
	font-size: 14px;
	font-weight: 500;
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 6px;
}

.action-btn:hover {
	background: #f3f2ef;
	color: var(--sage-platform-linkedin);
}

.tweet-content {
	padding: 16px 20px;
}

.profile-section {
	display: flex;
	gap: 12px;
}

.profile-avatar {
	width: 48px;
	height: 48px;
	background: #1d9bf0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 20px;
	flex-shrink: 0;
}

.tweet-input-section {
	flex: 1;
}

.tweet-editor {
	width: 100%;
	border: none;
	outline: none;
	font-size: 20px;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.25;
	resize: none;
	background: transparent;
	color: #0f1419;
	min-height: 120px;
	padding: 8px 0;
}

.tweet-editor::placeholder {
	color: #536471;
	font-size: 20px;
	font-weight: 400;
}

.tweet-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid #eff3f4;
}

.tweet-actions {
	display: flex;
	gap: 16px;
}

.tweet-action {
	font-size: 18px;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s;
}

.tweet-action:hover {
	opacity: 1;
}

.tweet-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.char-count {
	font-size: 14px;
	color: #536471;
	font-weight: 400;
}

.tweet-btn {
	background: #1d9bf0;
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.2s;
}

.tweet-btn:hover:not(:disabled) {
	background: #1a8cd8;
}

.tweet-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Space-Efficient Twitter UI */
.twitter-composer-efficient {
	background: white;
	border-radius: 12px;
	border: 1px solid var(--sage-platform-twitter);
	overflow: hidden;
	max-width: 600px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	height: 400px; /* Fixed height for consistent layout */
}

.tweet-content-area {
	flex: 1;
	padding: 16px;
}

.tweet-editor-large {
	width: 100%;
	height: 100%;
	border: none;
	outline: none;
	resize: none;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		sans-serif;
	font-size: 20px;
	line-height: 24px;
	color: #0f1419;
	background: transparent;
	padding: 0;
	margin: 0;
}

.tweet-editor-large::placeholder {
	color: #536471;
	font-size: 20px;
}

.tweet-bottom-bar {
	padding: 12px 16px;
	border-top: 1px solid #eff3f4;
	background: var(--sage-surface);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
}

.char-count {
	font-size: 15px;
	color: #536471;
	font-weight: 400;
}

.char-count.over-limit {
	color: var(--sage-error);
	font-weight: 600;
}

/* Twitter Composer with Analysis Sidebar */
.twitter-composer-with-analysis {
	display: flex;
	gap: 20px;
	background: white;
	border-radius: 12px;
	border: 1px solid var(--sage-platform-twitter);
	overflow: hidden;
	min-height: 400px;
}

.tweet-editor-section {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 400px;
}

.tweet-editor-header {
	padding: 16px 16px 8px 16px;
	border-bottom: 1px solid var(--sage-platform-twitter);
}

.tweet-editor-header h4 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #0f1419;
}

.tweet-editor-main {
	flex: 1;
	width: 100%;
	border: none;
	outline: none;
	padding: 16px;
	font-size: 20px;
	font-family:
		system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 24px;
	resize: none;
	background: transparent;
	color: #0f1419;
}

.tweet-editor-main::placeholder {
	color: #657786;
}

.tweet-editor-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	border-top: 1px solid var(--sage-platform-twitter);
	background: var(--sage-canvas);
}

.tweet-actions {
	display: flex;
	gap: 12px;
}

.tweet-analysis-sidebar {
	width: 300px;
	background: var(--sage-gray-50);
	border-left: 1px solid var(--sage-platform-twitter);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}

.analysis-header {
	padding: 16px 16px 8px 16px;
}

.analysis-header h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--sage-ink);
}

.analysis-content {
	flex: 1;
	padding: 8px 16px 16px 16px;
	overflow-y: auto;
}

.analysis-section {
	margin-bottom: 20px;
}

.analysis-section h5 {
	margin: 0 0 8px 0;
	font-size: 14px;
	font-weight: 600;
	color: #059669;
}

.analysis-points {
	list-style: none;
	padding: 0;
	margin: 0;
}

.analysis-points li {
	padding: 4px 0;
	font-size: 13px;
	line-height: 18px;
	color: var(--sage-gray-600);
	position: relative;
	padding-left: 16px;
}

.analysis-points li::before {
	content: "•";
	position: absolute;
	left: 0;
	color: #059669;
	font-weight: bold;
}

.visual-section h5 {
	color: var(--sage-accent);
}

.visual-suggestion {
	font-size: 13px;
	line-height: 18px;
	color: var(--sage-gray-600);
	background: white;
	padding: 12px;
	border-radius: 8px;
	border: 1px solid var(--sage-border-subtle);
	font-style: italic;
}

.stats-section h5 {
	color: #0ea5e9;
}

.tweet-stats {
	background: white;
	padding: 12px;
	border-radius: 8px;
	border: 1px solid var(--sage-border-subtle);
}

.stat-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.stat-label {
	font-size: 13px;
	color: var(--sage-text-secondary);
	font-weight: 500;
}

.stat-value {
	font-size: 14px;
	color: var(--sage-ink);
	font-weight: 600;
}

.stat-value.over-limit {
	color: var(--sage-error);
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.twitter-composer-with-analysis {
		flex-direction: column;
	}

	.tweet-analysis-sidebar {
		width: 100%;
		border-left: none;
		border-top: 1px solid var(--sage-platform-twitter);
	}

	.tweet-editor-section {
		min-width: unset;
	}
}

/* Focus-mode step editor — two-pane shell shared by all 5 steps (Shape, Edit,
   Visualize, Format, Post). Desktop pins .editor-left to 534px so the WYSIWYG
   width is stable; mobile collapses to a single column. The left pane width
   lives here (not inline in editorShell.ts) so the @media override below wins
   without needing !important. .editor-left is unique to the editor shell —
   no other consumers exist in this codebase. */
.editor-left {
	width: 534px;
	flex: 0 0 534px;
}

@media (max-width: 768px) {
	.editor-modal {
		width: 100vw;
		max-height: 100vh;
		border-radius: 0;
	}

	.editor-body {
		flex-direction: column;
		overflow-y: auto;
	}

	.editor-left {
		width: 100%;
		flex: 0 0 auto;
	}

	.editor-right {
		width: 100%;
	}
}

/* Twitter Composer Styles - DEPRECATED: Use twitter-composer-efficient instead */
.twitter-composer {
	background: white;
	border-radius: 16px;
	border: 1px solid var(--sage-platform-twitter);
	overflow: hidden;
	max-width: 598px;
	margin: 0 auto;
}

.twitter-composer .composer-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--sage-platform-twitter);
	background: var(--sage-surface);
}

.twitter-composer .composer-header h3 {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	color: #0f1419;
}

/* New Twitter Composer - Simple Layout (Option D) */
.twitter-composer {
	background: white;
	border-radius: 8px;
	border: 1px solid var(--sage-platform-twitter);
}

.twitter-composer .composer-header {
	padding: 16px 20px 8px 20px;
	border-bottom: 1px solid var(--sage-platform-twitter);
}

.twitter-composer .composer-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #0f1419;
}

.twitter-composer .composer-content {
	padding: 16px 20px;
}

.twitter-composer .content-editor {
	width: 100%;
	border: none;
	outline: none;
	font-size: 18px;
	font-family:
		system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 24px;
	resize: none;
	background: transparent;
	color: #0f1419;
}

.twitter-composer .content-editor::placeholder {
	color: #657786;
}

.twitter-composer .composer-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 20px;
	border-top: 1px solid var(--sage-platform-twitter);
	background: var(--sage-canvas);
}

.twitter-composer .toolbar-left {
	display: flex;
	gap: 12px;
}

.twitter-composer .toolbar-btn {
	background: none;
	border: 1px solid #ccd6dd;
	padding: 6px 12px;
	border-radius: 16px;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.twitter-composer .toolbar-btn:hover {
	background: #f7f9fa;
	border-color: #657786;
}

.twitter-composer .char-count {
	font-size: 14px;
	font-weight: 500;
	color: #657786;
}

.twitter-composer .char-count.over-limit {
	color: var(--sage-error);
	font-weight: 600;
}

.twitter-composer .analysis-panel {
	padding: 16px 20px;
	border-top: 1px solid var(--sage-platform-twitter);
	background: var(--sage-gray-50);
}

.twitter-composer .analysis-summary {
	font-size: 14px;
	line-height: 20px;
	color: var(--sage-gray-700);
	margin-bottom: 8px;
}

.twitter-composer .visual-suggestion {
	font-size: 14px;
	line-height: 20px;
	color: var(--sage-gray-700);
	font-style: italic;
}

.action-buttons {
	display: flex;
	gap: 12px;
}

.tweet-btn-primary {
	background: #1d9bf0;
	color: white;
	border: none;
	border-radius: 20px;
	padding: 8px 16px;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.tweet-btn-primary:hover {
	background: #1a8cd8;
}

.copy-btn-secondary,
.posted-btn-secondary {
	background: transparent;
	color: #1d9bf0;
	border: 1px solid #cfd9de;
	border-radius: 20px;
	padding: 8px 16px;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.copy-btn-secondary:hover,
.posted-btn-secondary:hover {
	background: #f7f9fa;
	border-color: #1d9bf0;
}

/* Ensure modal is wide enough for LinkedIn preview */
.modal-content {
	max-width: 600px;
	width: 90vw;
}

/* Template and Dual Evaluation Styles */
.enhanced-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

/* Template-swap popover (#168). The column-header chip is now a button
   that opens a popover to swap the active content template. Replaces the
   former static .template-tag / .template-info / .template-reasoning. */
.template-chip-container {
	position: relative;
	display: inline-flex;
}

.template-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #f1f5f9;
	color: #64748b;
	padding: 3px 8px;
	border: 1px solid transparent;
	border-radius: 12px;
	font-size: 10px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s;
}

.template-chip:hover {
	background: #e2e8f0;
	border-color: #cbd5e1;
}

.template-chip--empty {
	background: transparent;
	color: var(--sage-text-muted);
	border-color: var(--sage-border);
}

.template-chip-caret {
	font-size: 8px;
	line-height: 1;
}

.template-popover {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 1000;
	min-width: 260px;
	max-width: 320px;
	padding: 4px;
	background: white;
	border: 1px solid var(--sage-gray-200);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.template-popover--loading {
	padding: 14px 12px;
	font-size: 12px;
	color: var(--sage-text-secondary);
}

.template-popover-title {
	padding: 6px 10px 4px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--sage-text-muted);
}

.template-popover-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	padding: 8px 10px;
	border: none;
	border-radius: 6px;
	background: transparent;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.15s;
}

button.template-popover-item:hover {
	background: var(--sage-gray-50);
}

.template-popover-item.is-active {
	cursor: default;
	background: rgba(74, 124, 89, 0.08);
}

.template-popover-check {
	flex-shrink: 0;
	width: 14px;
	color: var(--sage-accent);
	font-size: 12px;
	font-weight: 700;
}

.template-popover-rank {
	flex-shrink: 0;
	width: 14px;
	color: var(--sage-text-muted);
	font-size: 11px;
	font-weight: 600;
}

.template-popover-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.template-popover-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--sage-gray-700);
}

.template-popover-structure {
	font-size: 11px;
	line-height: 1.4;
	color: var(--sage-text-secondary);
}

.template-popover-divider {
	height: 1px;
	margin: 4px 6px;
	background: var(--sage-gray-200);
}

.template-popover-keep .template-popover-name {
	color: var(--sage-text-secondary);
}

/* Editor dim + lock while a template regenerate is in flight (#168 AC#7),
   mirroring the edit_session lock pattern. */
.enhanced-content-wrapper.template-regenerating {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s;
}

/* Info popover (#435) — a passive ⓘ affordance that reveals a small panel
   on hover, keyboard focus, or click/tap. Hover + focus-within drive the
   pointer/keyboard paths; the JS-toggled `.is-open` class drives touch,
   where hover does not exist. First used by the Format step's per-platform
   guarantees; reuse for any "details on demand" microcopy. */
.info-popover {
	position: relative;
	display: inline-flex;
}

.info-popover-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	background: transparent;
	color: #94a3b8;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	font-family: inherit;
}

.info-popover-trigger:hover,
.info-popover-trigger:focus-visible {
	color: #475569;
}

.info-popover-panel {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 1000;
	min-width: 240px;
	max-width: 300px;
	padding: 10px 12px;
	background: white;
	border: 1px solid var(--sage-gray-200);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.info-popover:hover .info-popover-panel,
.info-popover:focus-within .info-popover-panel,
.info-popover.is-open .info-popover-panel {
	display: block;
}

/* Template Picker Modal - Optimization Flow */
.template-picker-modal .modal-content {
	animation: modalSlideIn 0.2s ease;
}

.template-picker-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.template-picker-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 10px 12px;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	background: var(--sage-surface);
	cursor: pointer;
	text-align: left;
	transition: all 0.15s ease;
}

.template-picker-card:hover {
	border-color: var(--sage-platform-linkedin);
	background: #f0f9ff;
	box-shadow: 0 1px 3px rgba(2, 119, 189, 0.1);
}

.template-picker-card-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--sage-ink);
}

.template-picker-card-structure {
	font-size: 11px;
	color: var(--sage-text-secondary);
	line-height: 1.3;
}

@media (max-width: 600px) {
	.template-picker-grid {
		grid-template-columns: 1fr;
	}
}

.dual-evaluation {
	margin-top: 12px;
	padding: 12px;
	background: var(--sage-canvas);
	border-radius: 8px;
	border: 1px solid var(--sage-border-subtle);
}

.evaluation-header {
	margin-bottom: 8px;
}

.eval-title {
	font-size: 13px;
	font-weight: 500;
	color: var(--sage-gray-600);
}

.evaluation-scores {
	display: flex;
	gap: 12px;
	margin-bottom: 8px;
}

.eval-score {
	flex: 1;
	text-align: center;
	padding: 8px;
	background: white;
	border-radius: 6px;
	border: 1px solid var(--sage-border-subtle);
}

.eval-label {
	font-size: 11px;
	color: var(--sage-text-secondary);
	margin-bottom: 4px;
}

.eval-value {
	font-size: 16px;
	font-weight: 600;
	color: var(--sage-ink);
	margin-bottom: 4px;
}

.eval-tier {
	font-size: 10px;
	font-weight: 500;
	padding: 2px 6px;
	border-radius: 10px;
}

.eval-tier.excellent {
	background: #dcfce7;
	color: #166534;
}

.eval-tier.good {
	background: var(--sage-botanical-light);
	color: var(--sage-accent-hover);
}

.eval-tier.average {
	background: var(--sage-warning-light);
	color: #b45309;
}

.eval-tier.needs-improvement {
	background: #fee2e2;
	color: var(--sage-error);
}

.comparison-insights {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	padding: 8px;
	background: var(--sage-gray-50);
	border-radius: 6px;
	border-left: 3px solid var(--sage-accent);
}

.insights-icon {
	font-size: 12px;
	margin-top: 2px;
}

.insights-text {
	font-size: 12px;
	color: var(--sage-gray-600);
	line-height: 1.4;
}

/* Substack Composer Styles - Tabbed Interface */
.substack-composer {
	background: white;
	border-radius: 12px;
	border: 1px solid var(--sage-gray-200);
	overflow: hidden;
	max-width: 800px;
	margin: 0 auto;
}

/* Compact Header for Option 1 - More comfortable spacing */
.composer-header-compact {
	padding: 10px 24px;
	border-bottom: 1px solid var(--sage-gray-200);
	background: var(--sage-surface);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.header-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.substack-logo-svg {
	width: 20px;
	height: 20px;
	border-radius: 3px;
}

.platform-name {
	font-size: 16px;
	font-weight: 600;
	color: var(--sage-ink);
}

/* Tab Navigation */
.composer-tabs {
	display: flex;
	border-bottom: 1px solid var(--sage-gray-200);
	background: var(--sage-canvas);
}

.composer-tabs .tab-btn {
	flex: 1;
	padding: 10px 16px;
	border: none;
	background: transparent;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	color: var(--sage-text-secondary);
	border-bottom: 2px solid transparent;
	transition: all 0.2s;
	border-radius: 6px;
}

.composer-tabs .tab-btn:hover {
	color: var(--sage-ink);
	background: var(--sage-canvas);
}

.composer-tabs .tab-btn.active {
	color: var(--sage-accent);
	border-bottom-color: var(--sage-accent);
	background: white;
}

/* Tab Content */
.tab-content {
	display: none;
}

.tab-content.active {
	display: block;
}

.substack-note-modal .tab-content {
	min-height: 400px;
}

.word-count {
	font-size: 12px;
	color: var(--sage-text-secondary);
	font-weight: 500;
}

/* Preview Tab Styles - More comfortable spacing */
.preview-content {
	padding: 24px;
	font-family: Georgia, serif;
	line-height: 1.6;
	min-height: 400px;
}

.newsletter-modal {
	display: flex;
	flex-direction: column;
	width: min(95vw, 740px);
	max-width: 740px;
	max-height: 88vh;
	overflow: hidden;
}

.newsletter-modal .modal-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
	overflow: hidden;
}

.newsletter-modal .tab-content {
	flex: 1;
	display: none;
	padding: 16px;
	background: white;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	overflow-y: auto;
	min-height: 0;
}

.newsletter-modal .tab-content.active {
	display: block;
}

.newsletter-modal .preview-content {
	min-height: 0;
	height: 100%;
	overflow-y: auto;
}

.newsletter-modal #newsletter-edit-tab {
	margin-bottom: 0;
	flex: 1;
}

.newsletter-modal #newsletter-content-editor {
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 16px;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	font-family: inherit;
	resize: vertical;
	box-sizing: border-box;
}

.newsletter-modal .modal-actions {
	margin-top: auto;
	padding: 0 24px 24px 24px;
}

@media (max-width: 640px) {
	.modal-actions.actions-row,
	.dashboard-card .actions-row {
		flex-wrap: wrap;
		justify-content: center;
		gap: 10px;
	}

	.modal-actions.actions-row button,
	.dashboard-card .actions-row button {
		flex: 1 1 0;
		min-width: 0;
		padding: 10px 12px;
	}
}

.substack-paragraph {
	margin: 0 0 16px 0;
	font-size: 15px;
	color: var(--sage-ink);
}

.substack-paragraph:last-child {
	margin-bottom: 0;
}

.substack-hashtag {
	color: #ff6719;
	font-weight: 500;
}

/* Newsletter Preview Styles */
.newsletter-preview .preview-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--sage-gray-200);
}

.newsletter-preview .preview-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--sage-ink);
}

.newsletter-preview .word-count {
	font-size: 12px;
	color: var(--sage-text-secondary);
	font-weight: 500;
}

.newsletter-preview .preview-content {
	font-family: Georgia, serif;
	line-height: 1.6;
	color: var(--sage-ink);
	font-size: 15px;
}

/* Version History Accordion Styles */
.version-accordion {
	margin-top: 8px;
}

.version-item {
	margin-bottom: 8px;
	border: 1px solid var(--sage-gray-200);
	border-radius: 6px;
	background: var(--sage-canvas);
}

.version-summary {
	padding: 8px 12px;
	font-weight: 500;
	font-size: 14px;
	cursor: pointer;
	background: var(--sage-canvas);
	border-radius: 6px;
}

.version-summary:hover {
	background: var(--sage-gray-200);
}

.version-content {
	padding: 12px;
	border-top: 1px solid var(--sage-gray-200);
}

.content-preview {
	font-size: 13px;
	line-height: 1.4;
	color: var(--sage-gray-700);
	margin-bottom: 8px;
}

.show-full-btn {
	background: var(--sage-accent);
	color: white;
	border: none;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 11px;
	cursor: pointer;
	margin-left: 4px;
}

.show-full-btn:hover {
	background: var(--sage-accent-hover);
}

.prompt-guidance {
	font-size: 12px;
	color: var(--sage-text-secondary);
	background: var(--sage-canvas);
	padding: 8px;
	border-radius: 4px;
	line-height: 1.4;
}

.prompt-guidance strong {
	color: var(--sage-gray-700);
}

/* Version editing styles */
.v0-edit-wrapper,
.version-edit-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.v0-text-editor,
.version-text-editor {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--sage-gray-300);
	border-radius: 6px;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	line-height: 1.5;
	resize: vertical;
	min-height: 100px;
}

.v0-text-editor:focus,
.version-text-editor:focus {
	outline: none;
	border-color: var(--sage-accent);
	box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.save-v0-btn,
.save-version-btn {
	align-self: flex-start;
	background: var(--sage-success);
	color: white;
	border: none;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}

.save-v0-btn:hover,
.save-version-btn:hover {
	background: #059669;
}

.save-v0-btn:active,
.save-version-btn:active {
	transform: scale(0.98);
}

/* Collapsible Evaluation Styles */
/* Compact evaluation with rightward overlay */
.dual-evaluation-compact {
	margin-top: 12px;
	position: relative;
}

.evaluation-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	background: #f0f9ff;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 13px;
}

.evaluation-summary:hover {
	background: var(--sage-botanical-light);
	border-color: var(--sage-accent);
}

.eval-summary-text {
	color: #1e40af;
	font-weight: 500;
}

.toggle-icon {
	color: var(--sage-text-secondary);
	font-size: 12px;
	font-weight: bold;
	transition: transform 0.2s ease;
}

/* Inline evaluation card */
.evaluation-overlay {
	position: static;
	display: block;
	margin-top: 12px;
	border: 1px solid var(--sage-gray-200);
	border-radius: 8px;
	background: var(--sage-canvas);
	box-shadow: none;
}

.evaluation-overlay.collapsed {
	display: none;
}

.overlay-content {
	padding: 16px;
	max-height: 360px;
	overflow-y: auto;
}

.quick-insights {
	display: inline-block;
	margin-left: 8px;
	font-size: 12px;
	color: var(--sage-gray-600);
}

/* Standardized section header — used across all workspace tabs */
.insight-header {
	font-size: 12px;
	font-weight: 600;
	color: var(--sage-gray-700);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 6px;
}

.insight-list {
	margin: 0;
	padding-left: 20px;
	list-style-type: disc;
}

.insight-list li {
	font-size: 13px;
	line-height: 1.5;
	color: #4b5563;
	margin-bottom: 4px;
}

.algorithm-text {
	font-size: 13px;
	line-height: 1.5;
	color: #4b5563;
	margin: 0;
}

/* Posted Content View */
.posted-content-view {
	display: none;
}

.posted-content-view.active {
	display: block;
}

/* Revamped Posted Content Card */
.posted-item-card {
	background: white;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	padding: 16px 20px;
	margin-bottom: 12px;
	border: 1px solid var(--sage-border-subtle);
}

.posted-item-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.posted-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
	cursor: pointer;
}

.platform-info {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background: var(--sage-gray-100);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 999px;
	font-size: 13px;
	color: #334155;
}

.platform-icon img {
	width: 14px;
	height: 14px;
	display: inline-block;
}

.posted-date {
	font-size: 13px;
	color: var(--sage-text-secondary);
	white-space: nowrap;
}

.link-chips {
	margin-left: auto;
	display: inline-flex;
	gap: 8px;
	align-items: center;
}

.link-chip,
.add-link-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: var(--sage-gray-50);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	font-size: 12px;
	color: var(--sage-gray-600);
	text-decoration: none;
	transition: all 0.2s ease;
}

.link-chip:hover,
.add-link-chip:hover {
	background: #eef2f7;
	border-color: #cbd5e1;
	color: var(--sage-ink);
}

.posted-platforms {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--sage-gray-200);
}
.posted-platforms-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--sage-text-secondary);
	margin-bottom: 8px;
}

.posted-content {
	margin-top: 6px;
}
.content-excerpt {
	font-size: 14px;
	color: var(--sage-ink);
}
.content-full {
	background: var(--sage-canvas);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 8px;
	padding: 12px;
	margin: 8px 0;
}
.content-toggle {
	background: var(--sage-canvas);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 12px;
	color: var(--sage-gray-600);
	cursor: pointer;
}
.content-toggle:hover {
	background: var(--sage-border-subtle);
}

.posted-link.linkedin {
	background: var(--sage-botanical-light);
	border-color: var(--sage-border);
	color: var(--sage-accent-hover);
}

.posted-link.linkedin:hover {
	background: var(--sage-botanical-light);
	border-color: var(--sage-accent);
}

.posted-link.twitter {
	background: #f0f9ff;
	border-color: #e0f2fe;
	color: var(--sage-platform-linkedin);
}

.posted-link.twitter:hover {
	background: #e0f2fe;
	border-color: #0284c7;
}

.posted-link.substack {
	background: #fffbeb;
	border-color: #fed7aa;
	color: #c2410c;
}

.posted-link.substack:hover {
	background: #fed7aa;
	border-color: #fb923c;
}

.posted-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	padding-top: 12px;
	border-top: 1px solid var(--sage-gray-100);
}

.posted-action-btn {
	padding: 6px 12px;
	font-size: 12px;
	border: 1px solid var(--sage-border-subtle);
	background: var(--sage-gray-50);
	color: var(--sage-text-secondary);
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.posted-action-btn:hover {
	background: var(--sage-border-subtle);
	color: var(--sage-gray-600);
}

.empty-posted-state {
	text-align: center;
	padding: 60px 20px;
	color: var(--sage-text-secondary);
}

.empty-posted-state h3 {
	font-size: 18px;
	font-weight: 600;
	color: var(--sage-gray-700);
	margin: 0 0 8px 0;
}

.empty-posted-state p {
	font-size: 14px;
	margin: 0;
	line-height: 1.5;
}

/* Completed card styles */
.completed-header {
	margin-bottom: 8px;
}
.completed-date {
	font-size: 13px;
	font-weight: 600;
	color: var(--sage-text-secondary);
}
.completed-platforms {
	margin-top: 10px;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.completed-platforms-label {
	font-size: 12px;
	color: var(--sage-text-secondary);
	font-weight: 500;
}

/* Per-platform link chip on the Completed card. Three states: --add (empty),
   --saved (link + edit/remove controls), --editing (inline input). #188 */
.link-chip--saved {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0 4px 0 10px;
}
.link-chip__link {
	color: inherit;
	text-decoration: none;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.link-chip__btn {
	background: transparent;
	border: none;
	color: var(--sage-text-secondary);
	cursor: pointer;
	padding: 2px 4px;
	font-size: 12px;
	line-height: 1;
	border-radius: 4px;
	opacity: 0.7;
	transition:
		opacity 0.15s ease,
		background 0.15s ease,
		color 0.15s ease;
}
.link-chip__btn:hover {
	opacity: 1;
	background: var(--sage-gray-100);
	color: var(--sage-ink);
}
.link-chip__remove:hover {
	color: #b91c1c;
}
.link-chip--add {
	cursor: pointer;
	font-style: italic;
	color: var(--sage-text-secondary);
}
.link-chip--editing {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
}
.link-chip__editor-label {
	font-size: 12px;
	color: var(--sage-text-secondary);
}
.link-chip__input {
	min-width: 240px;
	padding: 4px 8px;
	font-size: 12px;
	border: 1px solid var(--sage-border-subtle);
	border-radius: 4px;
	background: #fff;
}
.link-chip__input[aria-invalid="true"] {
	border-color: #b91c1c;
}
.link-chip__save,
.link-chip__cancel {
	background: var(--sage-gray-50);
	border: 1px solid var(--sage-border-subtle);
	padding: 3px 10px;
	font-weight: 500;
}
.link-chip__save:hover {
	background: var(--sage-ink);
	color: #fff;
}
.link-chip__error {
	flex-basis: 100%;
	color: #b91c1c;
	font-size: 11px;
	min-height: 0;
}
.link-chip__error:empty {
	display: none;
}

.completed-actions {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--sage-gray-100);
}
.move-back-btn {
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 500;
	border: 1px solid var(--sage-border-subtle);
	background: var(--sage-gray-50);
	color: var(--sage-text-secondary);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s ease;
}
.move-back-btn:hover {
	background: var(--sage-border-subtle);
	color: var(--sage-ink);
}

/* Mark Completed button in active card actions */
.mark-completed-btn {
	background: none;
	border: none;
	color: var(--sage-text-secondary);
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	display: inline-flex;
	align-items: center;
	transition: color 0.15s ease;
}
.mark-completed-btn:hover {
	color: #16a34a;
}

/* Bulk Import Styles */
.bulk-import-modal .modal-content {
	max-width: 600px;
}

.bulk-import-modal .preview-section {
	margin: 16px 0;
	padding: 12px;
	background: var(--sage-gray-50);
	border-radius: 6px;
	border: 1px solid var(--sage-border-subtle);
}

.bulk-import-modal .preview-section ol {
	margin: 8px 0;
	padding-left: 24px;
}

.bulk-import-modal .preview-section li {
	margin: 6px 0;
	color: #334155;
	line-height: 1.5;
}

.bulk-import-modal .skipped-section {
	margin-top: 12px;
	padding: 8px;
	background: var(--sage-warning-light);
	border-radius: 4px;
}

.bulk-import-modal .import-estimate {
	margin-top: 16px;
	padding: 12px;
	background: #eff6ff;
	border-radius: 6px;
	border: 1px solid #bfdbfe;
}

.bulk-import-modal .cancel-btn {
	padding: 10px 20px;
	background: white;
	color: var(--sage-text-secondary);
	border: 1px solid var(--sage-border-subtle);
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
}

.bulk-import-modal .cancel-btn:hover {
	background: var(--sage-gray-50);
	border-color: #cbd5e1;
}

.bulk-import-modal .results-summary {
	padding: 16px 0;
}

.bulk-import-modal .results-summary ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.bulk-import-modal .results-summary li {
	padding: 8px 0;
	border-bottom: 1px solid var(--sage-border-subtle);
}

.bulk-import-modal .errors-section {
	margin-top: 16px;
	padding: 12px;
	background: #fef2f2;
	border-radius: 6px;
	max-height: 200px;
	overflow-y: auto;
}

.bulk-import-modal .errors-section ul {
	margin: 0;
	padding-left: 20px;
	font-size: 14px;
}

.bulk-import-modal .errors-section li {
	margin: 4px 0;
	color: #7f1d1d;
}

.bulk-import-progress-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
}

.bulk-import-progress-overlay .progress-content {
	background: white;
	border-radius: 12px;
	padding: 32px;
	max-width: 500px;
	width: 90%;
	text-align: center;
}

.bulk-import-progress-overlay h3 {
	margin: 0 0 24px 0;
	font-size: 20px;
	font-weight: 600;
	color: var(--sage-ink);
}

.bulk-import-progress-overlay .progress-bar-container {
	width: 100%;
	height: 8px;
	background: var(--sage-border-subtle);
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 16px;
}

.bulk-import-progress-overlay .progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #0ea5e9, #06b6d4);
	transition: width 0.3s ease;
	border-radius: 4px;
}

.bulk-import-progress-overlay .progress-text {
	margin: 8px 0;
	font-size: 16px;
	font-weight: 500;
	color: #334155;
}

.bulk-import-progress-overlay .progress-estimate {
	margin: 4px 0;
	font-size: 14px;
	color: var(--sage-text-secondary);
}

.bulk-import-progress-overlay .current-idea {
	margin-top: 12px;
	color: var(--sage-text-secondary);
	font-size: 14px;
	font-style: italic;
	min-height: 20px;
}

.bulk-import-progress-overlay .progress-warning {
	margin-top: 20px;
	color: #b45309;
	font-size: 14px;
	font-weight: 500;
}

.bulk-import-progress-overlay .cancel-import-btn {
	margin-top: 16px;
	padding: 8px 16px;
	background: #ef4444;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: background 0.2s;
}

.bulk-import-progress-overlay .cancel-import-btn:hover {
	background: var(--sage-error);
}

/* Spinner animation for processing status */
@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Mention hint */
.mention-hint {
	color: var(--sage-text-muted);
	font-size: 0.8em;
	margin: 4px 0 0;
}

.mention-hint code {
	background: var(--sage-canvas);
	padding: 1px 4px;
	border-radius: 3px;
	font-size: 0.95em;
}

/* Mentions dropdown */
.mentions-dropdown {
	position: absolute;
	bottom: 100%;
	left: 0;
	right: 0;
	max-height: 200px;
	overflow-y: auto;
	background: white;
	border: 1px solid var(--sage-gray-300);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	margin-bottom: 4px;
}

/* Portal variant (#508): rendered into document.body with position:fixed
   and viewport-relative coordinates so modal `overflow: hidden` and
   un-positioned ancestors can't clip or mis-anchor the menu. */
.mentions-dropdown.mentions-dropdown--portal {
	position: fixed;
	right: auto;
	z-index: 10001;
}

.mention-option {
	padding: 8px 12px;
	cursor: pointer;
	border-bottom: 1px solid var(--sage-canvas);
}

.mention-option:last-child {
	border-bottom: none;
}

.mention-option:hover {
	background: #f0f9ff;
}

/* ============================================
   CONFIDENCE TIER CARD
   Botanical palette: leaf (green), stem (blue), bark (amber)
   ============================================ */
.confidence-card {
	border-radius: var(--sage-radius-md);
	padding: 14px 16px;
	margin-bottom: 12px;
	border: 1px solid var(--sage-border);
}

.confidence-card.confidence-strong {
	background: #ecfdf5;
	border-color: #a7f3d0;
}

.confidence-card.confidence-good {
	background: #eff6ff;
	border-color: #bfdbfe;
}

.confidence-card.confidence-needs-work {
	background: #fffbeb;
	border-color: #fde68a;
}

.confidence-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.confidence-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 10px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.confidence-card.confidence-strong .confidence-badge {
	background: #059669;
	color: #fff;
}

.confidence-card.confidence-good .confidence-badge {
	background: #2563eb;
	color: #fff;
}

.confidence-card.confidence-needs-work .confidence-badge {
	background: #d97706;
	color: #fff;
}

.confidence-score {
	font-size: 20px;
	font-weight: 700;
	color: var(--sage-text-primary);
}

@media (max-width: 640px) {
	.confidence-card {
		padding: 12px;
	}

	.confidence-score {
		font-size: 18px;
	}
}

/* ── Evaluation Failure / Retry ──────────────────── */

.eval-failure-card {
	border-radius: var(--sage-radius-md);
	padding: 14px 16px;
	margin: 0 0 12px 0;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.eval-failure-card--full {
	background: #fef2f2;
	border-color: #fecaca;
}

.eval-failure-title {
	font-weight: 600;
	color: var(--sage-text-primary);
	font-size: 14px;
}

.eval-failure-body {
	font-size: 13px;
	color: var(--sage-text-secondary);
}

.eval-retry-btn {
	align-self: flex-start;
	background: var(--sage-accent);
	color: #fff;
	border: 0;
	border-radius: var(--sage-radius-sm, 6px);
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.eval-retry-btn:hover:not(:disabled) {
	background: var(--sage-accent-hover);
	transform: translateY(-1px);
}

.eval-retry-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.eval-side-summary {
	border-radius: var(--sage-radius-md);
	padding: 12px 16px;
	border: 1px solid var(--sage-border);
	background: var(--sage-surface, #fff);
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.eval-side-summary-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--sage-text-secondary);
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.eval-side-summary-score {
	font-size: 18px;
	font-weight: 700;
	color: var(--sage-text-primary);
}

.eval-side-summary-tier {
	font-size: 13px;
	color: var(--sage-text-secondary);
}

/* ── Diff Renderer ─────────────────────────────────── */

.diff-view {
	margin-top: 4px;
}

.diff-legend {
	display: flex;
	gap: 16px;
	margin-bottom: 8px;
	font-size: 12px;
	color: var(--sage-text-secondary, #64748b);
}

.diff-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.diff-legend-swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 2px;
}

.diff-legend-add {
	background: #dcfce7;
	border: 1px solid #86efac;
}

.diff-legend-delete {
	background: #fee2e2;
	border: 1px solid #fca5a5;
}

.diff-content {
	white-space: pre-wrap;
	word-break: break-word;
}

.diff-add {
	background: #dcfce7;
	color: #166534;
	text-decoration: none;
	border-radius: 2px;
	padding: 1px 0;
}

.diff-delete {
	background: #fee2e2;
	color: #991b1b;
	text-decoration: line-through;
	border-radius: 2px;
	padding: 1px 0;
}

.diff-no-changes {
	text-align: center;
	color: var(--sage-text-secondary, #64748b);
	font-style: italic;
	padding: 8px 0;
	font-size: 13px;
}

.diff-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
}

.diff-accept-btn {
	padding: 8px 20px;
	background: #16a34a;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
}

.diff-accept-btn:hover:not(:disabled) {
	background: #15803d;
}

.diff-accept-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.diff-reject-btn {
	padding: 8px 20px;
	background: #f1f5f9;
	color: var(--sage-text-primary, #1e293b);
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
}

.diff-reject-btn:hover {
	background: #e2e8f0;
}

/* ── Edit Mode (#223) — inline track-changes ────────────────────── */

.edit-mode-modal-content {
	max-width: 580px;
}

.edit-top-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
	padding: 10px 14px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

.edit-counter {
	font-size: 12px;
	color: #64748b;
	flex: 1;
	font-weight: 500;
}

.edit-accept-all-btn {
	background: white;
	color: #374151;
	padding: 6px 12px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 12px;
	border: 1px solid #d1d5db;
	cursor: pointer;
	font-family: inherit;
}

.edit-accept-all-btn:hover {
	background: #f8fafc;
}

.edit-save-btn,
.edit-copy-btn {
	background: white;
	color: #374151;
	padding: 6px 12px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 12px;
	border: 1px solid #d1d5db;
	cursor: pointer;
	font-family: inherit;
}

.edit-save-btn:hover:not(:disabled),
.edit-copy-btn:hover:not(:disabled) {
	background: #f8fafc;
}

.edit-save-btn:disabled,
.edit-copy-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.edit-finalize-btn {
	background: #2563eb;
	color: white;
	padding: 6px 12px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 12px;
	border: none;
	cursor: pointer;
	font-family: inherit;
}

.edit-finalize-btn:hover:not(:disabled) {
	background: #1d4ed8;
}

.edit-finalize-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Inline track-changes tokens */
.inline-current {
	color: #94a3b8;
	text-decoration: line-through;
	text-decoration-thickness: 1.5px;
	margin-right: 4px;
	cursor: pointer;
	padding: 0 2px;
	border-radius: 3px;
	transition: background 0.12s;
}

.inline-current:hover {
	background: rgba(239, 68, 68, 0.1);
	color: #b91c1c;
}

.inline-suggestion {
	color: #4f46e5;
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
	font-weight: 500;
	cursor: pointer;
	padding: 0 2px;
	border-radius: 3px;
	transition: background 0.12s;
}

.inline-suggestion:hover {
	background: rgba(79, 70, 229, 0.14);
}

/* Tooltip anchored to change — shows reason on hover */
.change-anchor {
	position: relative;
	display: inline;
}

.change-anchor::after {
	content: attr(data-reason);
	position: absolute;
	left: 50%;
	bottom: calc(100% + 10px);
	transform: translateX(-50%);
	background: #0f172a;
	color: white;
	font-size: 11px;
	padding: 8px 12px;
	border-radius: 6px;
	white-space: normal;
	width: max-content;
	max-width: 280px;
	line-height: 1.5;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s;
	z-index: 20;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
	font-weight: 400;
	text-align: left;
}

.change-anchor:hover::after {
	opacity: 1;
}

.draft-prose {
	font-size: 14px;
	line-height: 1.7;
	color: #0f172a;
	cursor: text;
	min-height: 1.7em;
}

.draft-prose:focus {
	outline: none;
}

.edit-draft-container:focus-within {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Edit button on idea card */
.edit-idea-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	background: white;
	border: 1px solid transparent;
	border-radius: 6px;
	color: #64748b;
	cursor: pointer;
	transition: all 0.12s;
}

.edit-idea-btn:hover {
	background: #f8fafc;
	color: #0f172a;
	border-color: #e2e8f0;
}

/* AI in-flight lock (#234, epic #155). Per-step UI lives in the step's
 * ticket; these are just the cross-step primitives (disabled-textarea look
 * and a spinner each step can drop in beside its Cancel button). */
textarea[data-ai-lock-target]:disabled {
	background: var(--sage-canvas, #f8fafc);
	color: var(--sage-text-muted, #64748b);
	cursor: not-allowed;
	opacity: 0.7;
}

.ai-lock-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -2px;
	animation: spin 0.7s linear infinite;
}

/* ── Credit-pool usage pill (#522) ───────────────────────────────────────────
   Header-only ambient meter, rendered into .usage-pill-slot left of the
   connection dots. The slot stays empty under 50% of the pool; at >=50% the
   pill shows "{used}/{limit} credits" neutral, goes amber (warning token) at
   >=80%, and flips to a red (error token) "Upgrade →" nudge linking /pricing at
   the cap. Mobile compact form (label dropped, cap shows ↑) is the media query
   below. Visual contract: specs/522-upgrade-nudges/prototype.html. */
.usage-pill-slot {
	display: flex;
	align-items: center;
}

.usage-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 10px;
	margin-right: 8px;
	font:
		500 13px / 1 Inter,
		sans-serif;
	border-radius: 8px;
	border: 1px solid #e5e5e0;
	background: #fff;
	color: #6b7280;
	white-space: nowrap;
	cursor: default;
	user-select: none;
	transition:
		background 0.18s,
		border-color 0.18s,
		color 0.18s;
}

.usage-pill .up-count {
	color: #1a1a24;
	font-weight: 600;
}

.usage-pill .up-label {
	color: #9ca3af;
	font-weight: 500;
}

.usage-pill.is-amber {
	background: #fef6e7;
	border-color: #f5d9a3;
	color: #92610a;
}

.usage-pill.is-amber .up-count {
	color: #b4730b;
}

.usage-pill.is-cap {
	background: #fdecec;
	border-color: #f3b4b4;
	color: #b91c1c;
	cursor: pointer;
}

.usage-pill.is-cap .up-count {
	color: #dc2626;
}

.usage-pill .up-cta {
	margin-left: 2px;
	font-weight: 600;
	color: #dc2626;
}

.usage-pill.is-cap .up-cta-full {
	border-bottom: 1px solid currentColor;
	padding-bottom: 1px;
}

.usage-pill .up-cta-compact {
	display: none;
}

.usage-pill.is-cap:focus-visible {
	outline: 2px solid #dc2626;
	outline-offset: 2px;
}

@media (max-width: 768px) {
	.usage-pill {
		padding: 0 8px;
		gap: 3px;
		height: 30px;
		margin-right: 6px;
	}

	.usage-pill .up-label {
		display: none;
	}

	.usage-pill .up-cta-full {
		display: none;
	}

	.usage-pill .up-cta-compact {
		display: inline;
	}
}
