/*
 * SG Group WebP Converter — front-end styles.
 * Light-first, clean and readable on a normal white WordPress page.
 * All rules are scoped under .sgwc so the host theme is never affected.
 * Dark theme applies ONLY when theme="dark" (data-theme-active="dark").
 * Responsive, reduced-motion and iOS safe-area aware. License: GPL-2.0-or-later.
 */

/* ===== Root + palette (light is the default) ============================ */
.sgwc {
	--sgwc-bg: transparent;
	--sgwc-surface: #ffffff;
	--sgwc-surface-soft: #f8fafc;
	--sgwc-surface-blue: #eff6ff;
	--sgwc-text: #0f172a;
	--sgwc-muted: #475569;
	--sgwc-subtle: #64748b;
	--sgwc-border: #dbe4f0;
	--sgwc-border-strong: #bfdbfe;
	--sgwc-primary: #2563eb;
	--sgwc-primary-strong: #1d4ed8;
	--sgwc-primary-soft: #dbeafe;
	--sgwc-accent: #06b6d4;
	--sgwc-success: #047857;
	--sgwc-warning: #b45309;
	--sgwc-danger: #dc2626;
	--sgwc-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
	--sgwc-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
	--sgwc-radius: 16px;
	--sgwc-radius-sm: 12px;
	--sgwc-hero: linear-gradient(135deg, #ffffff 0%, #eff6ff 55%, #ecfeff 100%);

	box-sizing: border-box;
	max-width: 1040px;
	margin: 0 auto;
	padding: 8px;
	background: var(--sgwc-bg);
	color: var(--sgwc-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Meiryo, Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
	-webkit-text-size-adjust: 100%;
}
.sgwc *,
.sgwc *::before,
.sgwc *::after { box-sizing: border-box; }

/* Neutralise host-theme list markers that can leak into our lists. */
.sgwc ul,
.sgwc ol { list-style: none; margin: 0; padding: 0; }
.sgwc li { list-style: none; }
.sgwc li::marker { content: ""; }

/* ===== Hero ============================================================= */
.sgwc-hero {
	background: var(--sgwc-hero);
	color: var(--sgwc-text);
	border: 1px solid var(--sgwc-border);
	border-radius: var(--sgwc-radius);
	padding: 34px 28px;
	text-align: center;
	box-shadow: var(--sgwc-shadow-soft);
	position: relative;
	overflow: hidden;
}
.sgwc-hero::after {
	content: "";
	position: absolute;
	inset: -40% -20% auto auto;
	width: 280px; height: 280px;
	background: radial-gradient(circle, rgba(37, 99, 235, 0.10), transparent 62%);
	pointer-events: none;
}
.sgwc-brand {
	display: inline-block;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-size: 12px;
	color: var(--sgwc-primary-strong);
	background: var(--sgwc-primary-soft);
	padding: 5px 14px;
	border-radius: 999px;
}
.sgwc-title {
	margin: 16px 0 8px;
	font-size: clamp(26px, 4.4vw, 36px);
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--sgwc-text);
}
.sgwc-subtitle {
	margin: 0 auto;
	max-width: 620px;
	color: var(--sgwc-muted);
	font-size: 16px;
}
.sgwc-badges {
	margin: 22px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}
.sgwc-badge {
	background: var(--sgwc-surface);
	border: 1px solid var(--sgwc-border-strong);
	color: var(--sgwc-primary-strong);
	border-radius: 999px;
	padding: 7px 14px 7px 30px;
	font-size: 13px;
	font-weight: 600;
	position: relative;
	box-shadow: var(--sgwc-shadow-soft);
}
.sgwc-badge::before {
	content: "✓";
	position: absolute;
	left: 12px; top: 50%;
	transform: translateY(-50%);
	color: var(--sgwc-primary);
	font-weight: 800;
}

/* ===== Dropzone ======================================================== */
.sgwc-dropzone {
	margin-top: 22px;
	background: var(--sgwc-surface);
	border: 2px dashed var(--sgwc-border-strong);
	border-radius: var(--sgwc-radius);
	padding: 40px 24px;
	text-align: center;
	cursor: pointer;
	transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
	box-shadow: var(--sgwc-shadow-soft);
}
.sgwc-dropzone:hover { border-color: var(--sgwc-primary); background: var(--sgwc-surface-blue); }
.sgwc-dropzone.is-dragover {
	border-color: var(--sgwc-primary);
	background: var(--sgwc-surface-blue);
	transform: scale(1.01);
	box-shadow: var(--sgwc-shadow);
}
.sgwc-dropzone__icon {
	width: 60px; height: 60px;
	margin: 0 auto 14px;
	background: linear-gradient(135deg, var(--sgwc-primary) 0%, var(--sgwc-accent) 100%);
	border-radius: 50%;
	position: relative;
	box-shadow: 0 8px 20px rgba(37, 99, 235, 0.30);
}
.sgwc-dropzone__icon::before,
.sgwc-dropzone__icon::after { content: ""; position: absolute; }
.sgwc-dropzone__icon::before {
	width: 4px; height: 24px;
	left: 50%; top: 17px;
	transform: translateX(-50%);
	background: #fff;
	border-radius: 2px;
}
.sgwc-dropzone__icon::after {
	width: 16px; height: 16px;
	left: 50%; top: 19px;
	transform: translateX(-50%) rotate(45deg);
	border-width: 4px 0 0 4px;
	border-style: solid;
	border-color: #fff;
}
.sgwc-dropzone__title { font-weight: 700; font-size: 18px; margin: 6px 0; color: var(--sgwc-text); }
.sgwc-dropzone__hint { color: var(--sgwc-muted); font-size: 14px; margin: 4px auto 18px; max-width: 540px; }

/* ===== Buttons ========================================================= */
.sgwc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font: inherit;
	font-weight: 700;
	font-size: 15px;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 12px 24px;
	min-height: 46px;
	cursor: pointer;
	text-decoration: none;
	transition: transform .12s, box-shadow .2s, background .2s, border-color .2s, opacity .2s, color .2s;
	line-height: 1.2;
}
.sgwc-btn:active { transform: translateY(1px); }
.sgwc-btn--primary { background: var(--sgwc-primary); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25); }
.sgwc-btn--primary:hover { background: var(--sgwc-primary-strong); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32); }
.sgwc-btn--secondary { background: var(--sgwc-surface); color: var(--sgwc-text); border-color: var(--sgwc-border); }
.sgwc-btn--secondary:hover { background: var(--sgwc-surface-soft); border-color: var(--sgwc-border-strong); }
.sgwc-btn--ghost { background: var(--sgwc-surface); color: var(--sgwc-primary-strong); border-color: var(--sgwc-border-strong); }
.sgwc-btn--ghost:hover { background: var(--sgwc-surface-blue); }
.sgwc-btn--small { padding: 9px 16px; min-height: 38px; font-size: 13px; }
.sgwc-btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ===== Section titles ================================================== */
.sgwc-section-title {
	font-size: 17px;
	font-weight: 800;
	margin: 28px 0 12px;
	padding: 0;
	color: var(--sgwc-text);
}

/* ===== Quality cards =================================================== */
.sgwc-quality { border: 0; margin: 0; padding: 0; }
.sgwc-quality__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}
.sgwc-qcard {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: var(--sgwc-surface);
	border: 1.5px solid var(--sgwc-border);
	border-radius: var(--sgwc-radius-sm);
	padding: 16px 14px;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
	position: relative;
}
.sgwc-qcard:hover { transform: translateY(-2px); border-color: var(--sgwc-border-strong); background: var(--sgwc-surface-soft); box-shadow: var(--sgwc-shadow-soft); }
.sgwc-qcard.is-active {
	border-color: var(--sgwc-primary);
	background: var(--sgwc-surface-blue);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}
.sgwc-qcard input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sgwc-qcard__title { font-weight: 800; font-size: 15px; color: var(--sgwc-text); }
.sgwc-qcard__desc { color: var(--sgwc-muted); font-size: 12.5px; }
.sgwc-qcard.is-active .sgwc-qcard__title { color: var(--sgwc-primary-strong); }
.sgwc-qcard.is-active .sgwc-qcard__desc { color: var(--sgwc-primary-strong); }

/* ===== Advanced options =============================================== */
.sgwc-options {
	margin-top: 18px;
	background: var(--sgwc-surface);
	border: 1px solid var(--sgwc-border);
	border-radius: var(--sgwc-radius-sm);
	padding: 6px 18px;
	box-shadow: var(--sgwc-shadow-soft);
}
.sgwc-options > summary {
	cursor: pointer;
	padding: 12px 0;
	color: var(--sgwc-text);
	font-weight: 700;
	list-style: none;
}
.sgwc-options > summary::-webkit-details-marker { display: none; }
.sgwc-options > summary::before {
	content: "▸";
	color: var(--sgwc-primary);
	margin-right: 8px;
	display: inline-block;
	transition: transform .15s;
}
.sgwc-options[open] > summary::before { transform: rotate(90deg); }
.sgwc-options__body { padding: 6px 0 16px; display: flex; flex-direction: column; gap: 14px; }
.sgwc-check, .sgwc-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--sgwc-text); }
.sgwc-check input, .sgwc-radio input { accent-color: var(--sgwc-primary); }
.sgwc-resize { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.sgwc-resize__input { display: inline-flex; align-items: center; gap: 6px; }
.sgwc-resize__input input {
	width: 100px; padding: 9px 10px;
	border: 1px solid var(--sgwc-border); border-radius: 8px;
	background: var(--sgwc-surface); color: var(--sgwc-text);
}
.sgwc-resize__input input:disabled { background: var(--sgwc-surface-soft); color: var(--sgwc-subtle); }
.sgwc-resize__unit { color: var(--sgwc-muted); font-size: 13px; }

/* ===== Notice ========================================================== */
.sgwc-notice {
	margin-top: 16px;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	color: #92400e;
	border-radius: var(--sgwc-radius-sm);
	padding: 13px 16px;
	font-weight: 600;
	font-size: 14px;
}

/* ===== Progress ======================================================== */
.sgwc-progress { margin-top: 20px; }
.sgwc-progress__bar {
	height: 10px;
	background: var(--sgwc-surface-blue);
	border: 1px solid var(--sgwc-border);
	border-radius: 999px;
	overflow: hidden;
}
.sgwc-progress__fill {
	display: block;
	height: 100%;
	width: 0%;
	background: linear-gradient(135deg, var(--sgwc-primary) 0%, var(--sgwc-accent) 100%);
	transition: width .25s ease;
}
.sgwc-progress__label { margin: 10px 0; color: var(--sgwc-muted); font-size: 14px; font-weight: 600; }

/* ===== Summary ========================================================= */
.sgwc-summary {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 22px 0;
}
.sgwc-summary__item {
	background: var(--sgwc-surface);
	border: 1px solid var(--sgwc-border);
	border-radius: var(--sgwc-radius);
	padding: 20px;
	text-align: center;
	box-shadow: var(--sgwc-shadow-soft);
}
.sgwc-summary__value {
	display: block;
	font-size: clamp(24px, 5vw, 34px);
	font-weight: 800;
	color: var(--sgwc-primary-strong);
}
.sgwc-summary__label { color: var(--sgwc-muted); font-size: 13px; font-weight: 600; }

/* ===== Results list ==================================================== */
.sgwc-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	gap: 16px;
}
.sgwc-card {
	background: var(--sgwc-surface);
	border: 1px solid var(--sgwc-border);
	border-radius: var(--sgwc-radius);
	overflow: hidden;
	box-shadow: var(--sgwc-shadow-soft);
	display: flex;
	flex-direction: column;
}
.sgwc-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	background: var(--sgwc-surface-soft);
	display: flex; align-items: center; justify-content: center;
	overflow: hidden;
}
.sgwc-card__thumb { width: 100%; height: 100%; object-fit: contain; display: block; }
.sgwc-card__thumb--ph {
	font-weight: 800; color: var(--sgwc-subtle); font-size: 18px; letter-spacing: .05em;
}
.sgwc-card__info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 9px; }
.sgwc-card__name {
	font-weight: 700; font-size: 14px; color: var(--sgwc-text);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sgwc-card__meta { display: grid; gap: 5px; }
.sgwc-card__row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.sgwc-card__row dt { color: var(--sgwc-muted); margin: 0; }
.sgwc-card__row dd { margin: 0; font-weight: 600; text-align: right; color: var(--sgwc-text); }
.sgwc-card__note { font-size: 12px; color: var(--sgwc-subtle); min-height: 1px; }
.sgwc-card__note.is-error { color: var(--sgwc-danger); font-weight: 600; }
.sgwc-card__actions { margin-top: 4px; }

.sgwc-reduction { font-weight: 800; }
.sgwc-reduction.is-good { color: var(--sgwc-success); }
.sgwc-reduction.is-warn { color: var(--sgwc-warning); }

/* ===== Status badges =================================================== */
.sgwc-status {
	display: inline-flex; align-items: center; gap: 6px;
	align-self: flex-start;
	font-size: 12px; font-weight: 700;
	padding: 3px 11px 3px 22px;
	border-radius: 999px;
	position: relative;
	border: 1px solid var(--sgwc-border);
	background: var(--sgwc-surface-soft);
}
.sgwc-status::before {
	content: ""; position: absolute; left: 9px; top: 50%;
	width: 7px; height: 7px; border-radius: 50%;
	transform: translateY(-50%);
	background: currentColor;
}
.sgwc-status.is-waiting { color: var(--sgwc-subtle); }
.sgwc-status.is-converting { color: var(--sgwc-primary); }
.sgwc-status.is-converting::before { animation: sgwc-pulse 1s infinite; }
.sgwc-status.is-done { color: var(--sgwc-success); }
.sgwc-status.is-failed { color: var(--sgwc-danger); }
@keyframes sgwc-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ===== Before / after slider ========================================== */
.sgwc-ba { position: relative; width: 100%; height: 100%; }
.sgwc-ba__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sgwc-ba__before {
	position: absolute; inset: 0;
	overflow: hidden;
	border-right: 2px solid rgba(37, 99, 235, 0.9);
	box-shadow: 1px 0 4px rgba(15, 23, 42, .2);
}
.sgwc-ba__before .sgwc-ba__img { width: auto; }
.sgwc-ba__range {
	position: absolute; left: 0; bottom: 8px;
	width: 90%; margin: 0 5%;
	accent-color: var(--sgwc-primary);
}

/* ===== Actions ========================================================= */
.sgwc-actions {
	margin: 22px 0;
	display: flex; flex-wrap: wrap; gap: 12px;
}

/* ===== CTA ============================================================= */
.sgwc-cta {
	margin: 26px 0;
	background: var(--sgwc-surface-blue);
	border: 1px solid var(--sgwc-border-strong);
	border-radius: var(--sgwc-radius);
	padding: 26px;
}
.sgwc-cta__heading { margin: 0 0 8px; font-size: 19px; font-weight: 800; color: var(--sgwc-text); }
.sgwc-cta__body { margin: 0 0 16px; color: var(--sgwc-muted); }
.sgwc-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ===== Share =========================================================== */
.sgwc-share { margin: 26px 0; }
.sgwc-share__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.sgwc-share__btn {
	border: 1px solid var(--sgwc-border);
	background: var(--sgwc-surface);
	color: var(--sgwc-text);
	border-radius: 999px;
	padding: 9px 18px;
	font-size: 13px; font-weight: 700;
	cursor: pointer; text-decoration: none;
	transition: transform .12s, box-shadow .2s, border-color .2s, background .2s;
}
.sgwc-share__btn:hover { transform: translateY(-2px); box-shadow: var(--sgwc-shadow-soft); }
.sgwc-share__btn.is-native,
.sgwc-share__btn.is-copy { background: var(--sgwc-primary); color: #fff; border-color: transparent; }
.sgwc-share__btn.is-native:hover,
.sgwc-share__btn.is-copy:hover { background: var(--sgwc-primary-strong); }
.sgwc-share__btn.is-x:hover { border-color: #0f172a; background: var(--sgwc-surface-soft); }
.sgwc-share__btn.is-fb:hover { border-color: #1877f2; background: var(--sgwc-surface-soft); }
.sgwc-share__btn.is-line:hover { border-color: #06c755; background: var(--sgwc-surface-soft); }
.sgwc-share__btn.is-in:hover { border-color: #0a66c2; background: var(--sgwc-surface-soft); }
.sgwc-share__btn.is-wa:hover { border-color: #25d366; background: var(--sgwc-surface-soft); }

/* ===== PWA card ======================================================== */
.sgwc-pwa {
	position: relative;
	margin: 26px 0;
	background: var(--sgwc-surface);
	border: 1px solid var(--sgwc-border);
	border-left: 4px solid var(--sgwc-primary);
	border-radius: var(--sgwc-radius);
	padding: 22px;
	box-shadow: var(--sgwc-shadow-soft);
}
.sgwc-pwa__close {
	position: absolute; top: 10px; right: 12px;
	background: transparent; border: 0; cursor: pointer;
	font-size: 22px; line-height: 1; color: var(--sgwc-subtle);
}
.sgwc-pwa__close:hover { color: var(--sgwc-text); }
.sgwc-pwa__title { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--sgwc-text); }
.sgwc-pwa__body { margin: 0 0 14px; color: var(--sgwc-muted); }
.sgwc-pwa__ios { margin: 12px 0 0; font-size: 13px; color: var(--sgwc-muted); }

/* ===== FAQ ============================================================= */
.sgwc-faq { margin: 26px 0; }
.sgwc-faq__item {
	border: 1px solid var(--sgwc-border);
	border-radius: var(--sgwc-radius-sm);
	background: var(--sgwc-surface);
	margin-bottom: 10px;
	overflow: hidden;
	box-shadow: var(--sgwc-shadow-soft);
	transition: border-color .15s, background .15s;
}
.sgwc-faq__item[open] { border-color: var(--sgwc-border-strong); background: var(--sgwc-surface-soft); }
.sgwc-faq__q {
	cursor: pointer; padding: 16px 18px; font-weight: 700;
	color: var(--sgwc-text); list-style: none;
}
.sgwc-faq__q::-webkit-details-marker { display: none; }
.sgwc-faq__q::after { content: "+"; float: right; color: var(--sgwc-primary); font-weight: 800; font-size: 18px; line-height: 1; }
.sgwc-faq__item[open] .sgwc-faq__q::after { content: "−"; }
.sgwc-faq__a { padding: 0 18px 16px; color: var(--sgwc-muted); }

/* ===== Support ========================================================= */
.sgwc-support {
	margin: 26px 0;
	background: var(--sgwc-surface-soft);
	border: 1px solid var(--sgwc-border);
	border-left: 4px solid var(--sgwc-primary);
	border-radius: var(--sgwc-radius);
	padding: 22px;
}
.sgwc-support .sgwc-section-title { margin-top: 0; }
.sgwc-support__body { color: var(--sgwc-muted); margin: 0 0 14px; font-size: 14px; }
.sgwc-support__actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* In the support card, the first action reads as primary, the second as secondary. */
.sgwc-support__actions .sgwc-btn--ghost[data-sgwc-report] { background: var(--sgwc-primary); color: #fff; border-color: transparent; }
.sgwc-support__actions .sgwc-btn--ghost[data-sgwc-report]:hover { background: var(--sgwc-primary-strong); }

/* ===== Footer ========================================================= */
.sgwc-footer {
	margin: 30px 0 8px;
	padding-top: 18px;
	border-top: 1px solid var(--sgwc-border);
	display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
	font-size: 13px;
}
.sgwc-footer__link { color: var(--sgwc-muted); text-decoration: none; }
.sgwc-footer__link:hover { color: var(--sgwc-primary); text-decoration: underline; }
.sgwc-footer__brand { margin-left: auto; color: var(--sgwc-subtle); }

/* ===== Mobile sticky action bar ======================================= */
.sgwc-actionbar {
	position: sticky;
	bottom: 0;
	z-index: 30;
	display: none;
	gap: 12px;
	padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
	margin: 12px -8px -8px;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--sgwc-border);
}
.sgwc-actionbar .sgwc-btn { flex: 1; }

/* ===== noscript ======================================================== */
.sgwc-noscript {
	background: var(--sgwc-surface);
	border: 1px solid var(--sgwc-border);
	border-radius: var(--sgwc-radius-sm);
	padding: 16px;
	color: var(--sgwc-text);
}

/* ===== Accessibility =================================================== */
.sgwc :focus-visible {
	outline: 3px solid var(--sgwc-primary);
	outline-offset: 2px;
	border-radius: 8px;
}

/* ===== Compact hero variant =========================================== */
.sgwc-hero--compact { padding: 24px 24px 18px; }
.sgwc-hero--compact .sgwc-title { margin: 6px 0 4px; font-size: clamp(23px, 4vw, 30px); }
.sgwc-hero--compact .sgwc-subtitle { font-size: 14.5px; }

/* ===== Compact trust strip ============================================ */
.sgwc-trust-strip {
	display: flex; flex-wrap: wrap; justify-content: center;
	gap: 6px; margin: 14px 0 0;
}
.sgwc-trust-chip {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: 12px; font-weight: 700;
	color: var(--sgwc-primary-strong);
	background: var(--sgwc-surface);
	border: 1px solid var(--sgwc-border-strong);
	border-radius: 999px; padding: 4px 10px; line-height: 1.2;
}
.sgwc-trust-icon { display: inline-flex; color: var(--sgwc-primary); }
.sgwc-trust-icon svg { display: block; }

/* ===== Share icons / variants ========================================= */
.sgwc-share__btn { display: inline-flex; align-items: center; gap: 7px; }
.sgwc-share-icon { display: block; flex: none; }
.sgwc-share__label { color: inherit; }
/* brand-minimal (default): coloured icon, dark label, light pill. */
.sgwc-share--brand-minimal .sgwc-share__btn.is-x { color: #0f172a; }
.sgwc-share--brand-minimal .sgwc-share__btn.is-fb { color: #1877f2; }
.sgwc-share--brand-minimal .sgwc-share__btn.is-line { color: #06c755; }
.sgwc-share--brand-minimal .sgwc-share__btn.is-in { color: #0a66c2; }
.sgwc-share--brand-minimal .sgwc-share__btn.is-wa { color: #25d366; }
.sgwc-share--brand-minimal .sgwc-share__btn .sgwc-share__label { color: var(--sgwc-text); }
.sgwc-share--brand-minimal .sgwc-share__btn.is-native,
.sgwc-share--brand-minimal .sgwc-share__btn.is-copy { color: #fff; }
.sgwc-share--brand-minimal .sgwc-share__btn.is-native .sgwc-share__label,
.sgwc-share--brand-minimal .sgwc-share__btn.is-copy .sgwc-share__label { color: #fff; }
/* outline: monochrome icon + label. */
.sgwc-share--outline .sgwc-share__btn { color: var(--sgwc-muted); }
.sgwc-share--outline .sgwc-share__btn .sgwc-share__label { color: var(--sgwc-text); }
.sgwc-share--outline .sgwc-share__btn.is-native,
.sgwc-share--outline .sgwc-share__btn.is-copy { color: #fff; }
/* filled: brand background, white icon + label. */
.sgwc-share--filled .sgwc-share__btn { color: #fff; border-color: transparent; }
.sgwc-share--filled .sgwc-share__btn .sgwc-share__label { color: #fff; }
.sgwc-share--filled .sgwc-share__btn.is-x { background: #0f172a; }
.sgwc-share--filled .sgwc-share__btn.is-fb { background: #1877f2; }
.sgwc-share--filled .sgwc-share__btn.is-line { background: #06c755; }
.sgwc-share--filled .sgwc-share__btn.is-in { background: #0a66c2; }
.sgwc-share--filled .sgwc-share__btn.is-wa { background: #25d366; }

/* ===== Conversion limits mini-bar ===================================== */
.sgwc-limit-strip {
	display: flex; flex-wrap: wrap; align-items: center;
	gap: 6px; margin: 12px 0 0;
}
.sgwc-limit-chip {
	display: inline-flex; align-items: center;
	font-size: 11.5px; font-weight: 600;
	color: var(--sgwc-muted);
	background: var(--sgwc-surface-soft);
	border: 1px solid var(--sgwc-border);
	border-radius: 999px; padding: 3px 9px; line-height: 1.3;
}
.sgwc-limit-chip--label {
	color: var(--sgwc-primary-strong);
	background: var(--sgwc-primary-soft);
	border-color: var(--sgwc-border-strong);
	font-weight: 800;
}
.sgwc-limit-note { margin: 6px 0 0; font-size: 11px; color: var(--sgwc-subtle); }

/* ===== Optional support link (free tool — not a paid funnel) ========== */
.sgwc-support-link {
	margin: 22px 0; padding: 12px 16px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
	background: var(--sgwc-surface-soft);
	border: 1px solid var(--sgwc-border);
	border-radius: var(--sgwc-radius-sm);
	font-size: 14px;
}
.sgwc-support-link__lead { color: var(--sgwc-muted); }
.sgwc-support-link__link {
	font-weight: 700; color: var(--sgwc-primary-strong); text-decoration: none;
	border-bottom: 1px solid currentColor;
}
.sgwc-support-link__link:hover { color: var(--sgwc-primary); }

/* ===== Dark theme (only when theme="dark") ============================ */
.sgwc[data-theme-active="dark"] {
	--sgwc-bg: transparent;
	--sgwc-surface: #131c2e;
	--sgwc-surface-soft: #1b2740;
	--sgwc-surface-blue: #1c2c4a;
	--sgwc-text: #e8eefb;
	--sgwc-muted: #aab8d4;
	--sgwc-subtle: #8597b6;
	--sgwc-border: #2a3852;
	--sgwc-border-strong: #355084;
	--sgwc-primary: #3b82f6;
	--sgwc-primary-strong: #60a5fa;
	--sgwc-primary-soft: #1e3a8a;
	--sgwc-success: #34d399;
	--sgwc-warning: #fbbf24;
	--sgwc-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
	--sgwc-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
	--sgwc-hero: linear-gradient(135deg, #16213a 0%, #122038 55%, #0e2233 100%);
}
.sgwc[data-theme-active="dark"] .sgwc-brand { color: #dbeafe; background: rgba(59, 130, 246, 0.22); }
.sgwc[data-theme-active="dark"] .sgwc-badge { color: #dbeafe; }
.sgwc[data-theme-active="dark"] .sgwc-notice { background: rgba(217, 119, 6, 0.16); border-color: rgba(217, 119, 6, 0.5); color: #fbbf24; }
.sgwc[data-theme-active="dark"] .sgwc-actionbar { background: rgba(19, 28, 46, 0.92); }

/* ===== Responsive ===================================================== */
@media (max-width: 640px) {
	.sgwc { font-size: 15px; }
	.sgwc-quality__grid { grid-template-columns: repeat(2, 1fr); }
	.sgwc-list { grid-template-columns: 1fr; }
	.sgwc-hero { padding: 26px 18px; }
	.sgwc-hero--compact { padding: 22px 16px 16px; }
	.sgwc-dropzone { padding: 30px 16px; }
	.sgwc-actions { display: none; } /* replaced by the sticky bar on mobile */
	.sgwc-actionbar[hidden] { display: none; }
	.sgwc-actionbar:not([hidden]) { display: flex; }
}

/* ===== Reduced motion ================================================= */
@media (prefers-reduced-motion: reduce) {
	.sgwc *,
	.sgwc *::before,
	.sgwc *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
}

/* Generic hidden attribute safety. */
.sgwc [hidden] { display: none !important; }
