/* (10/11/2026) Pages de liens : éditeur façon Linktree / link.me (blocs, carrés, thème, aperçu du téléphone en direct) */
html body .app .pg-form { gap: 0; }
html body .app .pg-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
html body .app .pg-edit { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
html body .app .pg-edit .co-sub { margin: 6px 0 0; display: flex; align-items: baseline; gap: 8px; }
html body .app .pg-help { margin: -6px 0 0; }

/* couverture */
html body .app .pg-cv { flex: none; width: 86px; height: 48px; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--fg) 6%, transparent); border: 1px dashed var(--line); }
html body .app .pg-cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
html body .app .pg-cv:has(img) { border-style: solid; }

/* style */
html body .app .pg-theme { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
html body .app .pg-th { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
html body .app .pg-th > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
html body .app .pg-th .seg-mini { align-self: flex-start; }

/* blocs */
html body .app .pg-blocks { display: flex; flex-direction: column; gap: 8px; }
html body .app .pg-blk { display: grid; grid-template-columns: auto 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2, transparent); transition: border-color .15s, opacity .15s; }
html body .app .pg-blk.drag { opacity: .45; }
html body .app .pg-blk.over { border-color: var(--accent); }
html body .app .pg-grip { cursor: grab; color: var(--muted); font-size: 14px; letter-spacing: -2px; padding: 4px 2px; user-select: none; touch-action: none; }
html body .app .pg-kind { display: flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; }
html body .app .pg-kind .i, html body .app .pg-add-b .i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body .app .pg-kind small { font-size: 12px; font-weight: 600; white-space: nowrap; }
html body .app .pg-k-tile .pg-kind { color: var(--accent); }
html body .app .pg-f { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
html body .app .pg-k-title .pg-f, html body .app .pg-k-social .pg-f { grid-template-columns: minmax(0, 1fr); }
html body .app .pg-k-tile .pg-f { grid-template-columns: 64px minmax(0, 1fr); }
html body .app .pg-f input, html body .app .pg-f select { width: 100%; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--glass-line, var(--line)); background: color-mix(in srgb, var(--fg) 4%, transparent); font: inherit; font-size: 13.5px; color: inherit; }
html body .app .pg-k-title .pg-f input { font-weight: 700; }
html body .app .pg-tile-f { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; min-width: 0; }
html body .app .pg-tile-f select { grid-column: 1 / -1; }
html body .app .pg-tile-img { width: 64px; height: 64px; padding: 0; border-radius: 12px; overflow: hidden; border: 1px dashed var(--line); background: color-mix(in srgb, var(--fg) 5%, transparent); color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; display: grid; place-items: center; }
html body .app .pg-tile-img:hover { border-color: var(--accent); color: var(--fg); }
html body .app .pg-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
html body .app .pg-tile-img:has(img) { border-style: solid; }

/* ajouter */
html body .app .pg-add { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
html body .app .pg-add-b { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 10px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: transparent; color: var(--fg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
html body .app .pg-add-b:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
html body .app .pg-add-b:disabled { opacity: .4; cursor: default; }

/* aperçu : un téléphone, collé en haut pendant qu'on défile */
html body .app .pg-prev { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; }
html body .app .pg-prev-top { display: flex; align-items: center; gap: 10px; }
html body .app .pg-prev-top b { font-size: 13px; }
html body .app .pg-prev-top .seg-mini { margin-left: auto; }
html body .app .pg-prev-x, html body .app .pg-prev-btn { display: none; }
html body .app .pg-phone { position: relative; width: 100%; aspect-ratio: 9 / 18.5; max-height: 700px; border-radius: 38px; padding: 10px; background: #0b0a0e; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .04); }
html body .app .pg-phone::before { content: ""; position: absolute; top: 18px; left: 50%; width: 82px; height: 22px; transform: translateX(-50%); border-radius: 999px; background: #000; z-index: 2; }
html body .app .pg-phone iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 29px; background: #09080b; }

@media (max-width: 1100px) {
  html body .app .pg-wrap { grid-template-columns: minmax(0, 1fr) 300px; }
}
/* téléphone et tablette : l'aperçu s'ouvre en plein écran avec le bouton « Aperçu » (déplacé sous <body>, voir app.js) */
@media (max-width: 900px) {
  html body .app .pg-wrap { grid-template-columns: minmax(0, 1fr); }
  html body .app .pg-prev { display: none; }
  html body .app .pg-prev-btn { display: inline-flex; }
}
body > .pg-prev.pg-prev-full { position: fixed; inset: 0; z-index: 1300; display: flex; flex-direction: column; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); background: #09080b; color: #f4f4f6; font-family: inherit; animation: pgfull .22s ease-out; }
body > .pg-prev.pg-prev-full .pg-prev-top { display: flex; align-items: center; gap: 10px; }
body > .pg-prev.pg-prev-full .pg-prev-top b { font-size: 15px; }
body > .pg-prev.pg-prev-full .seg-mini { margin-left: auto; display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); }
body > .pg-prev.pg-prev-full .seg-mini button { height: 34px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: rgba(255, 255, 255, .6); font: inherit; font-size: 13.5px; font-weight: 600; }
body > .pg-prev.pg-prev-full .seg-mini button[aria-pressed="true"] { background: rgba(255, 255, 255, .14); color: #fff; }
body > .pg-prev.pg-prev-full .pg-prev-x { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16); background: transparent; color: #fff; font-size: 16px; cursor: pointer; }
body > .pg-prev.pg-prev-full .pg-phone { position: relative; flex: 1; min-height: 0; width: min(100%, 420px); margin: 0 auto; border-radius: 30px; padding: 8px; background: #000; border: 1px solid rgba(255, 255, 255, .1); }
body > .pg-prev.pg-prev-full .pg-phone iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 23px; background: #09080b; }
html.pg-prev-lock, html.pg-prev-lock body { overflow: hidden; }
@keyframes pgfull { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { body > .pg-prev.pg-prev-full { animation: none; } }
@media (max-width: 760px) {
  html body .app .pg-theme { grid-template-columns: minmax(0, 1fr); }
  html body .app .pg-blk { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "grip kind move" "f f f"; row-gap: 8px; }
  html body .app .pg-grip { grid-area: grip; } html body .app .pg-kind { grid-area: kind; } html body .app .pg-move { grid-area: move; } html body .app .pg-f { grid-area: f; }
  html body .app .pg-f { grid-template-columns: minmax(0, 1fr); }
  html body .app .pg-k-tile .pg-f { grid-template-columns: 72px minmax(0, 1fr); }
  html body .app .pg-tile-img { width: 72px; height: 72px; }
  html body .app .pg-tile-f { grid-template-columns: minmax(0, 1fr); }
  html body .app .pg-add { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body .app .pg-f input, html body .app .pg-f select { font-size: 16px; }
  html body .app .pg-move button { width: 40px; height: 40px; }
  html body .app .pg-accents { gap: 10px; }
  html body .app .pg-accents button { width: 38px !important; height: 38px !important; min-width: 38px !important; min-height: 38px !important; padding: 0 !important; border-radius: 50% !important; flex: none; }
}
@media (prefers-reduced-motion: reduce) { html body .app .pg-blk { transition: none; } }
