/* Skin picker cards, header preview and two-device preview dialog (shared/skin-preview.js). Page chrome uses site
   tokens; everything inside a `[data-skin]` node paints with that skin's --skin-* variables from skins.css, which
   pages must load alongside this file. */

.sp-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--skin-accent); }
.sp-dot:is([data-skin="vault"], [data-skin="midnight"], [data-skin="obsidian"]) { background: var(--skin-bg); box-shadow: inset 0 0 0 2px var(--skin-accent); }
.sp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Filter segmented control: labels never wrap; on narrow screens the row scrolls instead of squeezing. */
.sp-filters { display: flex; gap: 2px; width: max-content; max-width: 100%; margin-bottom: 16px; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface-2); scrollbar-width: none; }
.sp-filter { flex: none; min-height: 32px; padding: 6px 12px; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--ink-2); font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; transition: color .14s, background-color .14s; }
.sp-filter:hover { color: var(--ink); }
.sp-filter[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }

/* Radio cards: 1 / 2 / 5 columns. */
.sp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
@media (min-width: 640px) { .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .sp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.sp-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-l); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); transition: border-color .14s, background-color .14s, box-shadow .14s; }
.sp-card:hover { border-color: color-mix(in srgb, var(--action) 35%, var(--line)); background: var(--surface); }
.sp-card[data-selected] { border-color: var(--action); background: color-mix(in srgb, var(--action) 3%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 15%, transparent); }
.sp-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.sp-card-pick { display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: pointer; }
.sp-card-name { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 10px; font-size: 14px; }
.sp-card-name strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sp-badge { flex: none; margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.sp-card-desc { color: var(--muted); font-size: 12px; line-height: 1.6; }
.sp-preview { align-self: flex-start; min-height: 32px; margin-top: 8px; padding: 4px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.sp-preview:hover { color: var(--action); }

/* Thumbnail wireframe painted by its own skin. */
.sp-thumb { position: relative; display: flex; flex-direction: column; gap: 8px; height: 128px; padding: 10px; overflow: hidden; border: 1px solid var(--skin-border); border-radius: var(--radius-m); background: var(--skin-bg); transition: transform .18s; }
.sp-card:hover .sp-thumb { transform: scale(1.01); }
.sp-thumb i { display: block; border-radius: 999px; }
.sp-t-top { display: flex; align-items: center; gap: 6px; }
.sp-thumb .sp-t-logo { width: 14px; height: 14px; border-radius: 4px; background: var(--skin-accent); }
.sp-t-line { width: 44px; height: 6px; background: var(--skin-text); opacity: .7; }
.sp-t-pill { width: 24px; height: 10px; margin-left: auto; background: var(--skin-accent); }
.sp-t-hero { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--skin-border); border-radius: 8px; background: linear-gradient(135deg, var(--skin-hero-a), var(--skin-hero-b)); }
.sp-t-hero small { position: absolute; top: 6px; right: 8px; color: var(--skin-muted); font-size: 8px; line-height: 1; }
.sp-t-bar { width: 56px; height: 8px; background: var(--skin-accent); }
.sp-t-sub { width: 96px; max-width: 80%; height: 6px; background: var(--skin-muted); opacity: .4; }
.sp-t-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sp-t-card { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--skin-border); border-radius: 6px; background: var(--skin-card); }
.sp-t-text { width: 32px; height: 6px; background: var(--skin-text); opacity: .7; }
.sp-t-accent { width: 20px; height: 6px; background: var(--skin-accent); }
.sp-thumb .sp-t-soft { width: 16px; height: 8px; border-radius: 3px; background: var(--skin-accent-soft); }
.sp-check { position: absolute; top: 8px; right: 8px; display: none; width: 20px; height: 20px; border-radius: 50%; background: var(--action); box-shadow: 0 0 0 2px var(--surface); }
.sp-check::after { content: ""; position: absolute; top: 5px; left: 7px; width: 5px; height: 9px; border: solid var(--action-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sp-card[data-selected] .sp-check { display: block; }

/* Shared preview pieces (header preview and dialog frames); only used inside [data-skin] nodes. */
.sp-avatar { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-m); background: var(--skin-accent); color: var(--skin-accent-ink); font-size: 14px; font-weight: 900; line-height: 1; }
.sp-name { min-width: 0; overflow: hidden; color: var(--skin-text); white-space: nowrap; text-overflow: ellipsis; }
.sp-muted { color: var(--skin-muted); }
.sp-chip { align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: var(--skin-accent-soft); color: var(--skin-accent); font-size: 10px; font-weight: 700; white-space: nowrap; }
.sp-button { flex: none; padding: 4px 12px; border-radius: 999px; background: var(--skin-accent); color: var(--skin-accent-ink); font-size: 11px; font-weight: 600; white-space: nowrap; }
.sp-announce { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 6px 14px; border-top: 1px solid var(--skin-border); background: var(--skin-accent-soft); color: var(--skin-text); font-size: 11px; }
.sp-announce-tag { flex: none; color: var(--skin-accent); font-weight: 700; }
.sp-announce-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Setup page header preview ([data-header-preview]). */
.sp-hp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sp-hp-label { color: var(--muted); font-size: 11px; }
.sp-hp-skin { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 11px; }
.sp-hp-frame { min-width: 0; overflow: hidden; border: 1px solid var(--skin-border); border-radius: var(--radius-m); background: var(--skin-card); color: var(--skin-text); box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.sp-hp-bar { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; }
.sp-hp-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.sp-hp-text .sp-name { font-size: 14px; }
.sp-hp-text .sp-mono { overflow: hidden; color: var(--skin-muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }

/* Two-device preview dialog. */
.sp-dialog { width: min(96vw, 1060px); max-width: none; max-height: 90vh; margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 4px #17191d0d, 0 24px 60px -12px #17191d40; }
.sp-dialog[open] { display: flex; flex-direction: column; }
.sp-dialog::backdrop { background: rgba(15, 23, 42, .56); backdrop-filter: blur(6px); }
.sp-dialog-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.sp-dialog-head > .sp-dot { width: 14px; height: 14px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .05); }
.sp-dialog-head > .sp-dot:is([data-skin="vault"], [data-skin="midnight"], [data-skin="obsidian"]) { box-shadow: inset 0 0 0 3px var(--skin-accent), 0 0 0 4px rgba(0, 0, 0, .05); }
.sp-dialog-heading { flex: 1; min-width: 0; }
.sp-dialog-title { margin: 0; font-size: 16px; font-weight: 700; }
.sp-dialog-desc { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.sp-close { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer; }
.sp-close:hover { color: var(--ink); background: var(--surface-2); }
.sp-strip { display: flex; flex: none; gap: 8px; padding: 10px 24px; overflow-x: auto; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 80%, var(--surface)); scrollbar-width: thin; }
.sp-strip-chip { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.sp-strip-chip .sp-dot { width: 10px; height: 10px; }
.sp-strip-chip[aria-pressed="true"] { border-color: var(--action); background: color-mix(in srgb, var(--action) 6%, var(--surface)); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.sp-dialog-body { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr); gap: 24px; min-height: 0; padding: 24px; overflow-y: auto; background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
@media (min-width: 1024px) { .sp-dialog-body { grid-template-columns: 290px minmax(0, 1fr); } }
.sp-dialog-foot { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); }
.sp-choose:disabled { opacity: .6; }
.sp-pane { min-width: 0; }
.sp-pane-title { margin: 0 0 10px; color: var(--muted); font-size: 12px; text-align: center; }

.sp-phone { width: 260px; max-width: 100%; margin: 0 auto; overflow: hidden; border: 6px solid rgba(24, 24, 27, .9); border-radius: 28px; background: var(--skin-bg); color: var(--skin-text); box-shadow: 0 20px 40px -18px rgba(15, 23, 42, .35); }
.sp-phone-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--skin-border); background: var(--skin-card); }
.sp-phone-head .sp-avatar { width: 20px; height: 20px; border-radius: 50%; font-size: 10px; }
.sp-phone-head .sp-name { flex: 1; font-size: 10px; }
.sp-phone-head .sp-chip { font-size: 9px; }
.sp-phone .sp-announce { border-top: 0; font-size: 10px; }
.sp-hero { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 12px; padding: 14px; border: 1px solid var(--skin-border); border-radius: var(--radius-l); background: linear-gradient(135deg, var(--skin-hero-a), var(--skin-hero-b)); }
.sp-hero-title { color: var(--skin-text); font-size: 14px; font-weight: 900; }
.sp-hero .sp-mono { overflow: hidden; color: var(--skin-muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.sp-phone-list { display: grid; gap: 8px; margin: 0; padding: 0 12px 14px; list-style: none; }
.sp-phone-list li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--skin-border); border-radius: var(--radius-m); background: var(--skin-card); }
.sp-item { display: flex; flex: 1; flex-direction: column; min-width: 0; font-size: 12px; }
.sp-item strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sp-item .sp-muted { font-size: 10px; }
.sp-price-tag { flex: none; padding: 4px 8px; border-radius: var(--radius-s); background: var(--skin-accent); color: var(--skin-accent-ink); font-size: 10px; font-weight: 700; }

.sp-browser { overflow: hidden; border: 1px solid var(--skin-border); border-radius: var(--radius-l); background: var(--skin-bg); color: var(--skin-text); box-shadow: 0 20px 40px -18px rgba(15, 23, 42, .3); }
.sp-browser-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--skin-border); background: var(--skin-card); }
.sp-lights { display: flex; flex: none; gap: 6px; }
.sp-lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--skin-text); opacity: .25; }
.sp-url { min-width: 0; margin: 0 auto; padding: 4px 14px; overflow: hidden; border: 1px solid var(--skin-border); border-radius: 999px; color: var(--skin-muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.sp-site-head { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 14px 24px; border-bottom: 1px solid var(--skin-border); background: var(--skin-card); }
.sp-site-head .sp-avatar { width: 32px; height: 32px; }
.sp-site-head .sp-name { font-size: 14px; font-weight: 800; }
.sp-site-nav { display: flex; flex: none; align-items: center; gap: 16px; margin-left: auto; font-size: 12px; }
.sp-browser > .sp-announce { padding: 8px 24px; border-top: 0; font-size: 12px; }
.sp-site-body { display: grid; gap: 20px; padding: 24px; }
.sp-site-hero { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 20px; }
.sp-site-copy { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sp-site-copy .sp-hero-title { font-size: 20px; }
.sp-site-copy .sp-muted { font-size: 12px; }
.sp-site-hero > .sp-button { padding: 8px 16px; font-size: 12px; }
.sp-site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.sp-site-grid li { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px; border: 1px solid var(--skin-border); border-radius: var(--radius-l); background: var(--skin-card); }
.sp-site-grid strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.sp-site-grid .sp-muted { font-size: 11px; }
.sp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--skin-border); }
.sp-price { color: var(--skin-accent); font-size: 14px; font-weight: 900; }

/* Narrow screens: the desktop mock keeps readable cards (one column) instead of squeezing three. */
@media (max-width: 720px) {
  .sp-dialog { width: 96vw; max-height: 92vh; border-radius: 20px; }
  .sp-dialog-head, .sp-strip, .sp-dialog-foot { padding-inline: 16px; }
  .sp-dialog-body { gap: 20px; padding: 16px; }
  .sp-site-head { flex-wrap: wrap; padding: 12px 16px; }
  .sp-site-nav { gap: 10px; margin-left: 0; }
  .sp-site-body { padding: 16px; }
  .sp-site-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .sp-card, .sp-thumb, .sp-filter { transition: none; }
  .sp-card:hover .sp-thumb { transform: none; }
}
