/* AI Toolbox — living page styles. Scoped to .toolbox-page. Accent: #34d399 */

.toolbox-page {
	--toolbox-accent: #34d399;
}

.toolbox-page [data-anchor] {
	scroll-margin-top: 80px;
}

/* Hero */
.toolbox-hero {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.toolbox-hero-icon {
	display: inline-flex;
	height: 4rem;
	width: 4rem;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	border-radius: 1rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
}

.toolbox-hero-content {
	flex: 1;
	min-width: 0;
}

.toolbox-hero-title {
	font-size: 1.9rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--color-text);
	line-height: 1.2;
}

.toolbox-hero-description {
	margin-top: 0.35rem;
	color: var(--color-text-muted);
	max-width: 60ch;
}

.toolbox-updated-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.75rem;
	border-radius: 999px;
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	padding: 0.25rem 0.7rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--color-text-muted);
}

/* Method disclosure */
.toolbox-method {
	margin-bottom: 2rem;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background: var(--color-surface);
	padding: 0.85rem 1.1rem;
}

.toolbox-method summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--toolbox-accent);
}

.toolbox-method p {
	margin-top: 0.6rem;
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--color-text-muted);
}

/* Shared section shell */
.toolbox-section {
	margin-bottom: 2.5rem;
}

.toolbox-section-head {
	margin-bottom: 1rem;
	border-left: 3px solid var(--toolbox-accent);
	padding-left: 0.75rem;
}

.toolbox-section-head h2 {
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--color-text);
	margin: 0;
}

.toolbox-section-subtitle {
	margin-top: 0.15rem;
	font-size: 0.85rem;
	color: var(--color-text-muted);
}

/* Stack ranking table */
.stack-ranking-group-title {
	margin: 1.5rem 0 0.6rem;
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-text-muted);
}

.stack-ranking-group-title:first-of-type {
	margin-top: 0;
}

.stack-ranking-closed-note {
	margin: 0 0 0.6rem;
	font-size: 0.78rem;
	color: var(--color-text-muted);
}

.stack-ranking-table-wrapper {
	overflow-x: auto;
	border: 1px solid var(--color-border);
	border-radius: 16px;
	background: var(--color-surface);
	margin-bottom: 0.5rem;
}

.stack-ranking-table-wrapper:last-of-type {
	margin-bottom: 0;
}

.evidence-cell {
	min-width: 180px;
}

.evidence-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.evidence-chip {
	display: inline-block;
	border-radius: 999px;
	border: 1px solid var(--color-border);
	background: var(--color-surface-2, var(--color-border));
	padding: 0.15rem 0.55rem;
	font-size: 0.68rem;
	line-height: 1.4;
	color: var(--color-text-muted);
}

.stack-ranking-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 640px;
}

.stack-ranking-row {
	border-bottom: 1px solid var(--color-border);
}

.stack-ranking-row:last-child {
	border-bottom: none;
}

.stack-ranking-table td {
	padding: 0.85rem 1rem;
	vertical-align: top;
	font-size: 0.85rem;
}

.rank-cell {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.rank-number {
	font-weight: 700;
	color: var(--color-text);
}

.rank-delta {
	margin-left: 0.35rem;
	font-size: 0.7rem;
}

.rank-up {
	color: #34d399;
}

.rank-down {
	color: #f87171;
}

.rank-flat {
	color: var(--color-text-muted);
}

.tool-cell {
	min-width: 180px;
}

.tool-cell-inner {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
}

.tool-cell-text {
	min-width: 0;
}

/* Icon chip — fixed square so monochrome (mask) and raster (image) logos
   line up identically across every row. */
.tool-icon-chip {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--color-surface-2, var(--color-border));
	border: 1px solid var(--color-border);
}

.tool-icon-mask {
	background-color: var(--color-surface-2, var(--color-border));
	position: relative;
}

.tool-icon-mask::before {
	content: '';
	display: block;
	width: 16px;
	height: 16px;
	background-color: var(--brand, var(--color-text-muted));
	mask-image: var(--tool-icon-src);
	-webkit-mask-image: var(--tool-icon-src);
	mask-size: contain;
	-webkit-mask-size: contain;
	mask-repeat: no-repeat;
	-webkit-mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-position: center;
}

.tool-icon-image img {
	width: 20px;
	height: 20px;
	object-fit: contain;
	border-radius: 4px;
}

.tool-icon-placeholder {
	background: var(--color-surface-2, var(--color-border));
	opacity: 0.5;
}

.tool-name {
	display: block;
	font-weight: 600;
	color: var(--color-text);
	text-decoration: none;
}

.tool-name:hover {
	color: var(--toolbox-accent);
}

.tool-publisher {
	display: block;
	font-size: 0.72rem;
	color: var(--color-text-muted);
	margin-top: 0.1rem;
}

.kind-pill {
	display: inline-block;
	margin-top: 0.3rem;
	border-radius: 999px;
	border: 1px solid var(--color-border);
	padding: 0.05rem 0.5rem;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--color-text-muted);
}

.stars-cell,
.mentions-cell {
	white-space: nowrap;
	color: var(--color-text);
}

.stat-label {
	display: block;
	font-size: 0.65rem;
	color: var(--color-text-muted);
}

.score-cell {
	min-width: 120px;
}

.score-bar-track {
	height: 6px;
	width: 100%;
	border-radius: 999px;
	background: var(--color-surface-2, var(--color-border));
	overflow: hidden;
}

.score-bar-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--toolbox-accent);
}

.score-value {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.72rem;
	color: var(--color-text-muted);
}

.why-cell {
	min-width: 220px;
	max-width: 320px;
	color: var(--color-text-muted);
	line-height: 1.45;
}

/* Ecosystem news */
.ecosystem-group {
	margin-bottom: 1.25rem;
}

.ecosystem-group-title {
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-text-muted);
	margin-bottom: 0.6rem;
}

/* Three columns is the intended desktop rhythm. Explicit tracks rather than
   auto-fill so the count is predictable at every width instead of drifting
   with the container: auto-fill silently dropped to two columns on narrower
   windows. */
.ecosystem-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.75rem;
}

@media (max-width: 819px) {
	.ecosystem-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 559px) {
	.ecosystem-cards {
		grid-template-columns: minmax(0, 1fr);
	}
}

.ecosystem-card {
	display: block;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background: var(--color-surface);
	padding: 0.9rem 1rem;
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.ecosystem-card:hover {
	border-color: var(--toolbox-accent);
	background: var(--color-surface-2, var(--color-surface));
}

.ecosystem-card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
}

.ecosystem-card-name {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--color-text);
}

.ecosystem-card-date {
	font-size: 0.68rem;
	color: var(--color-text-muted);
	white-space: nowrap;
}

.ecosystem-card-summary {
	margin-top: 0.4rem;
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--color-text-muted);
}

.ecosystem-card-source {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 0.72rem;
	color: var(--toolbox-accent);
}

/* Community talk */
.community-list {
	display: grid;
	gap: 0.75rem;
}

.community-item {
	display: block;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background: var(--color-surface);
	padding: 0.9rem 1.1rem;
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.community-item:hover {
	border-color: var(--toolbox-accent);
	background: var(--color-surface-2, var(--color-surface));
}

.community-item-meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.7rem;
	color: var(--color-text-muted);
}

.platform-badge {
	border-radius: 999px;
	padding: 0.05rem 0.5rem;
	font-weight: 700;
	font-size: 0.65rem;
	text-transform: uppercase;
}

.platform-hn {
	background: color-mix(in srgb, #ff6600 20%, transparent);
	color: #ff6600;
}

.platform-reddit {
	background: color-mix(in srgb, #ff4500 20%, transparent);
	color: #ff4500;
}

.community-title {
	margin-top: 0.4rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--color-text);
}

.community-takeaway {
	margin-top: 0.3rem;
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--color-text-muted);
}

.community-stats {
	margin-top: 0.5rem;
	display: flex;
	gap: 0.9rem;
	font-size: 0.72rem;
	color: var(--color-text-muted);
}

/* Changelog */
.changelog-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background: var(--color-surface);
	overflow: hidden;
}

.changelog-item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.6rem;
	padding: 0.65rem 1rem;
	border-bottom: 1px solid var(--color-border);
	font-size: 0.82rem;
}

.changelog-item:last-child {
	border-bottom: none;
}

.changelog-date {
	font-variant-numeric: tabular-nums;
	color: var(--color-text-muted);
	font-size: 0.72rem;
	white-space: nowrap;
}

.changelog-kind {
	border-radius: 999px;
	padding: 0.05rem 0.55rem;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	white-space: nowrap;
}

.changelog-kind-rank {
	background: color-mix(in srgb, var(--toolbox-accent) 20%, transparent);
	color: var(--toolbox-accent);
}

.changelog-kind-add {
	background: color-mix(in srgb, #60a5fa 20%, transparent);
	color: #60a5fa;
}

.changelog-kind-remove {
	background: color-mix(in srgb, #f87171 20%, transparent);
	color: #f87171;
}

.changelog-kind-note {
	background: color-mix(in srgb, var(--color-text-muted) 20%, transparent);
	color: var(--color-text-muted);
}

.changelog-text {
	color: var(--color-text);
	flex: 1;
	min-width: 200px;
}
