/* SPARK-LINKS (registry #45): the public /links/<user>/ page and the "My Links" editor.
   Phone-first: one column, full-width cards, 56px+ tap targets. */
:root {
	--spk-links-bg: #fff7ee;
	--spk-links-ink: #1d1a17;
	--spk-links-muted: #6b625a;
	--spk-links-card: #ffffff;
	--spk-links-line: #f1dcc4;
	--spk-links-accent: #ff8a00;
	--spk-links-radius: 18px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--spk-links-bg: #17130f;
		--spk-links-ink: #f6efe7;
		--spk-links-muted: #b5a99c;
		--spk-links-card: #241e18;
		--spk-links-line: #3a2f25;
	}
}

/* ---- public page ---- */
body.spk-links-body { margin: 0; background: var(--spk-links-bg); color: var(--spk-links-ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.spk-links-page { box-sizing: border-box; max-width: 560px; min-height: 100vh; margin: 0 auto; padding: 40px 16px 32px; display: flex; flex-direction: column; gap: 24px; }
.spk-links-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.spk-links-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--spk-links-accent); margin-bottom: 8px; }
.spk-links-name { margin: 0; font-size: 1.4rem; font-weight: 800; text-wrap: balance; }
.spk-links-handle { margin: 0; color: var(--spk-links-muted); font-size: .95rem; }
.spk-links-bio { margin: 6px 0 0; max-width: 40ch; }
.spk-links-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.spk-link-card { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px 8px 8px; background: var(--spk-links-card); color: var(--spk-links-ink); border: 1px solid var(--spk-links-line); border-radius: var(--spk-links-radius); text-decoration: none; font-weight: 650; box-shadow: 0 1px 0 var(--spk-links-line); transition: transform 150ms ease, box-shadow 150ms ease; }
.spk-link-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255, 138, 0, .18); }
.spk-link-card:active { transform: translateY(0); }
.spk-link-card:focus-visible { outline: 3px solid var(--spk-links-accent); outline-offset: 2px; }
.spk-link-thumb { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--spk-links-bg); font-size: 1.4rem; }
.spk-link-thumb > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spk-link-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.spk-link-card--spark { background: var(--spk-links-accent); border-color: var(--spk-links-accent); color: #1d1a17; }
.spk-links-foot { margin-top: auto; display: flex; justify-content: center; gap: 8px; font-size: .85rem; color: var(--spk-links-muted); }
.spk-links-foot a { color: inherit; }
@media (prefers-reduced-motion: reduce) { .spk-link-card { transition: none; } .spk-link-card:hover { transform: none; } }

/* ---- editor (/my-account/my-links/) ---- */
.spk-links-editor { display: flex; flex-direction: column; gap: 16px; }
.spk-links-notice { margin: 0; padding: 10px 14px; border-radius: 10px; }
.spk-links-notice.is-ok { background: #e8f7ec; color: #145a2a; }
.spk-links-notice.is-error { background: #fdecea; color: #8a1c12; }
.spk-links-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.spk-links-share label { width: 100%; font-weight: 700; }
.spk-links-share input { flex: 1 1 200px; min-width: 0; }
.spk-links-view { padding: 10px 16px; border-radius: 999px; background: var(--spk-links-accent); color: #1d1a17; font-weight: 700; text-decoration: none; }
.spk-links-form textarea, .spk-links-form input[type="text"] { width: 100%; box-sizing: border-box; min-height: 44px; }
.spk-links-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.spk-links-row { border: 1px solid var(--spk-links-line); border-radius: 14px; padding: 12px; }
.spk-links-row.is-new { border-style: dashed; border-color: var(--spk-links-accent); }
.spk-links-row-head { margin: 0 0 8px; font-weight: 700; }
.spk-links-row-main { display: flex; gap: 12px; align-items: flex-start; }
.spk-links-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #fff7ee; font-size: 1.4rem; }
.spk-links-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.spk-links-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.spk-links-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
.spk-links-fields input[type="file"] { max-width: 100%; }
.spk-links-row-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.spk-links-row-actions button { min-height: 40px; padding: 6px 12px; }
.spk-links-check { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
.spk-links-save { align-self: stretch; min-height: 48px; margin-top: 12px; font-weight: 700; }
.spk-links-page .spk-link-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-weight: 400; display: inline-block !important; font-size: 1.5rem; line-height: 1; opacity: 1; visibility: visible; color: inherit; }
.spk-links-editor .spk-links-view { color: #1d1a17 !important; }
.spk-link-emoji img.emoji, .spk-links-thumb img.emoji { width: 1.5rem !important; height: 1.5rem !important; margin: 0 !important; }
.spk-links-page a.spk-link-card--spark, .spk-links-page a.spk-link-card--spark:visited, .spk-links-page a.spk-link-card--spark:hover { color: #1d1a17 !important; opacity: 1; }

/* Platform badge for links without a picture (spark-links.php). */
.spk-links-page .spk-link-badge { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-size: 1.35rem; font-weight: 800; line-height: 1; }
.spk-link-badge--youtube { background: #ff0033; }
.spk-link-badge--tiktok { background: #111; text-shadow: -1px -1px 0 #25f4ee, 1px 1px 0 #fe2c55; }
.spk-link-badge--instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.spk-link-badge--x { background: #000; }
.spk-link-badge--facebook { background: #1877f2; font-family: Arial, sans-serif; }
.spk-link-badge--spotify { background: #1db954; }
