/* ==========================================================================
   Protoola Tools — plugin styles
   Only what the theme's component library does not already provide.
   Tokens come from the theme; every value below degrades sensibly if the
   plugin is used with a different theme.
   ========================================================================== */

.tool-block-body {
	margin-top: 4px;
}

.tool-emoji {
	font-size: 2rem;
	line-height: 1;
}

.card-emoji {
	font-size: 1.6rem;
	line-height: 1;
}

/* --------------------------------------------------------------------------
   Previews and downloads
   -------------------------------------------------------------------------- */
.protoola-preview {
	margin-top: 12px;
	padding: 16px;
	background: var(--bg-surface-alt, #f1f5f9);
	border-radius: var(--radius-md, 16px);
	text-align: center;
}

.protoola-preview img {
	display: inline-block;
	max-width: 100%;
	max-height: 300px;
	border-radius: var(--radius-sm, 12px);
}

.protoola-download {
	margin-top: 12px;
	text-decoration: none;
}

.protoola-download.is-small {
	padding: 4px 12px;
	font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Colour swatches
   -------------------------------------------------------------------------- */
.protoola-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.protoola-swatch {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	font: inherit;
}

.swatch-chip {
	display: block;
	width: 58px;
	height: 58px;
	border: 1px solid var(--card-border, rgba(0, 0, 0, 0.1));
	border-radius: var(--radius-sm, 12px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s;
}

.protoola-swatch:hover .swatch-chip {
	transform: scale(1.06);
}

.swatch-hex {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.76rem;
	font-weight: 600;
}

.swatch-share {
	font-size: 0.68rem;
	color: var(--text-secondary, #666);
}

/* --------------------------------------------------------------------------
   Tables and lists inside results
   -------------------------------------------------------------------------- */
.protoola-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.protoola-table th,
.protoola-table td {
	padding: 9px 12px;
	border-bottom: 1px solid var(--card-border, rgba(0, 0, 0, 0.08));
	text-align: left;
	vertical-align: top;
}

.protoola-table th {
	width: 40%;
	font-weight: 600;
	color: var(--text-secondary, #666);
}

.protoola-table tr:last-child th,
.protoola-table tr:last-child td {
	border-bottom: none;
}

.protoola-list {
	margin: 0;
	padding-left: 20px;
}

.protoola-list li {
	margin-bottom: 5px;
	list-style: disc;
	font-size: 0.9rem;
}

.protoola-list code {
	padding: 1px 5px;
	border-radius: 5px;
	background: var(--bg-surface-alt, #f1f5f9);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.85em;
}

/* --------------------------------------------------------------------------
   SVG preview sandbox
   -------------------------------------------------------------------------- */
.svg-preview-frame {
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--card-border, rgba(0, 0, 0, 0.1));
	border-radius: var(--radius-md, 16px);
}

.svg-preview-frame iframe {
	display: block;
	width: 100%;
	height: 280px;
	border: 0;
}

/* --------------------------------------------------------------------------
   Favicon grid
   -------------------------------------------------------------------------- */
.favicon-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 18px;
}

.favicon-preview {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	color: var(--text-secondary, #666);
}

.favicon-preview img {
	border: 1px solid var(--card-border, rgba(0, 0, 0, 0.1));
	border-radius: 8px;
	background: #fff;
	padding: 4px;
}

/* --------------------------------------------------------------------------
   Page speed results
   -------------------------------------------------------------------------- */
.psi-score {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 18px;
}

.psi-score-value {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	font-size: 1.9rem;
	font-weight: 700;
	color: #fff;
}

.psi-good {
	background: #0cce6b;
}

.psi-average {
	background: #ffa400;
}

.psi-poor {
	background: #ff4e42;
}

/* --------------------------------------------------------------------------
   Result box sizing on small screens
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
	.protoola-table th {
		width: 45%;
	}

	.swatch-chip {
		width: 46px;
		height: 46px;
	}

	.svg-preview-frame iframe {
		height: 220px;
	}
}
