/* Lynq — visual language aligned with luckyleft615.com
   Dark surfaces, green accent (#39B54A), Barlow / Barlow Condensed / JetBrains Mono
*/

:root {
    --accent: #39B54A;
    --accent-hover: #4fd463;
    --tech: #B8BFC6;
    --tech-dim: rgba(184, 191, 198, 0.1);
    --tech-border: rgba(184, 191, 198, 0.22);
    --bg: #0a0a0a;
    --surface: #141414;
    --surface2: #1a1a1a;
    --border: #262626;
    --text: #f0f0f0;
    --muted: #7a7a7a;
    --danger: #ef4444;
    --font-base: 17px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: var(--font-base);
    scroll-behavior: smooth;
}

body {
    font-family: 'Barlow', sans-serif;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(57, 181, 74, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(184, 191, 198, 0.06), transparent 45%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 64px;
    padding: 0 1.5rem;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--text);
    text-decoration: none;
}

.brand-home {
    color: inherit;
    text-decoration: none;
    line-height: 1;
}

.brand-wordmark {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: 1.7rem;
    letter-spacing: -0.02em;
    line-height: 1;
}

.brand-wordmark .accent { color: var(--accent); }

.brand-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tech);
    user-select: none;
    -webkit-user-select: none;
    padding: 0.15rem 0;
}

.brand-tagline.easter-armed {
    color: var(--accent);
    letter-spacing: 0.26em;
    transition: color 0.2s, letter-spacing 0.2s;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.45rem 0.7rem;
    border-radius: 4px;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.nav-cta,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.7rem 1.35rem;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
}

.nav-cta,
.btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.nav-cta:hover,
.btn-primary:hover {
    background: var(--accent-hover);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(57, 181, 74, 0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--tech-border);
    color: var(--text);
    background: var(--surface);
}

/* Main */
.site-main {
    flex: 1;
    width: min(960px, 100%);
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.hero {
    padding: 2.5rem 0 3rem;
}

.hero-brand {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tech);
    margin-bottom: 0.85rem;
}

.hero-title {
    font-size: clamp(2.8rem, 10vw, 5.2rem);
    max-width: 12ch;
}

.hero-sub {
    margin-top: 1rem;
    max-width: 36rem;
    color: #888;
    font-size: 1.05rem;
    font-weight: 500;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.home-note,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem 1.6rem;
}

.panel-narrow { max-width: 520px; }

.section-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.45rem;
}

.home-note h2,
.panel h1 {
    font-size: 1.85rem;
    margin-bottom: 0.55rem;
}

.panel-lead,
.home-note p {
    color: #bbb;
    margin-bottom: 0.75rem;
}

.health-link { font-size: 0.78rem; color: var(--tech); }

.health-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 1.25rem 0;
}

.health-list li {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    gap: 0.25rem 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.health-list li .health-detail {
    grid-column: 2;
    color: var(--muted);
    font-size: 0.72rem;
    word-break: break-word;
}

.health-status {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.health-list li.ok .health-status { color: var(--accent); }
.health-list li.bad .health-status { color: var(--danger); }

.health-label { font-weight: 600; }

.meta-line {
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem 2rem;
    text-align: center;
}

.footer-meta {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tech);
}

.footer-note {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.footer-note a { color: var(--muted); }
.footer-note a:hover { color: var(--accent); }

/* Flash */
.flash-wrap { margin-bottom: 1rem; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.92rem;
    border: 1px solid var(--border);
}
.flash-error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fecaca; }
.flash-success { background: rgba(57, 181, 74, 0.12); border-color: rgba(57, 181, 74, 0.35); color: #bbf7d0; }
.flash-info { background: var(--tech-dim); border-color: var(--tech-border); color: var(--tech); }

/* Forms */
.stack-form { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1rem; }
.stack-form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 500; }
.stack-form label > span:first-child,
.hint { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; }
.hint { text-transform: none; font-family: 'JetBrains Mono', monospace; letter-spacing: 0; margin-top: 0.25rem; display: block; }
.stack-form input[type="text"],
.stack-form input[type="email"],
.stack-form input[type="password"],
.stack-form input[type="url"],
.stack-form textarea,
.stack-form select,
.inline-add-form input {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    padding: 0.7rem 0.85rem;
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    outline: none;
}
.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus,
.inline-add-form input:focus {
    border-color: var(--accent);
}
.check-label {
    flex-direction: row !important;
    align-items: center;
    gap: 0.6rem !important;
    cursor: pointer;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.35rem; }
.form-foot { margin-top: 1.25rem; color: var(--muted); font-size: 0.92rem; }
.inline-form { display: inline; }
.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.nav-email {
    font-size: 0.62rem;
    color: var(--tech);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-danger {
    background: transparent;
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fff;
    border-color: var(--danger);
}
.muted { color: var(--muted); }
.h-compact {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

/* Dashboard */
.site-main-wide { width: min(1100px, 100%); }
.dash-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.banner-warn {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 8px;
}
.profile-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.profile-row,
.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.profile-row-main h2 { font-size: 1.45rem; margin-bottom: 0.2rem; }
.profile-slug { margin: 0.15rem 0 0.35rem; }
.profile-row-actions,
.link-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.inline-add-form {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 0.5rem;
}
.link-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.link-row { cursor: grab; }
.link-row.dragging { opacity: 0.55; }
.link-row.is-inactive { opacity: 0.55; }
.drag-handle {
    font-size: 1rem;
    color: var(--muted);
    padding: 0.25rem 0.35rem;
    user-select: none;
    letter-spacing: -0.15em;
}
.link-row-main {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.link-url {
    font-size: 0.72rem;
    word-break: break-all;
}

/* Admin tables */
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.data-table th,
.data-table td {
    text-align: left;
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table th {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: var(--tech);
}
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Public profile */
.page-public {
    background: var(--bg);
    min-height: 100vh;
}
.page-public.theme-light {
    --bg: #f3f3f3;
    --text: #121212;
    --muted: #666;
    --surface: #fff;
    --border: #ddd;
    --accent: #2f9e3f;
    background:
        radial-gradient(ellipse 70% 40% at 50% -10%, rgba(57, 181, 74, 0.15), transparent 50%),
        var(--bg);
    color: var(--text);
}
.page-public.theme-midnight {
    --bg: #070b14;
    --text: #e8eefc;
    --muted: #7a8aaa;
    --surface: #121826;
    --border: #243049;
    --accent: #5b8cff;
    background:
        radial-gradient(ellipse 70% 45% at 50% -15%, rgba(91, 140, 255, 0.22), transparent 55%),
        var(--bg);
    color: var(--text);
}
.page-public.theme-ember {
    --bg: #140c0a;
    --text: #fff4ec;
    --muted: #a8897a;
    --surface: #1f1410;
    --border: #3a241c;
    --accent: #ff7a39;
    background:
        radial-gradient(ellipse 70% 45% at 50% -15%, rgba(255, 122, 57, 0.2), transparent 55%),
        var(--bg);
    color: var(--text);
}
.page-public.theme-forest {
    --bg: #0a120e;
    --text: #e7f5ea;
    --muted: #7d9a86;
    --surface: #121c16;
    --border: #24362b;
    --accent: #3dcf7a;
    background:
        radial-gradient(ellipse 70% 45% at 50% -15%, rgba(61, 207, 122, 0.18), transparent 55%),
        var(--bg);
    color: var(--text);
}
.page-public.theme-mono {
    --bg: #050505;
    --text: #d6d6d6;
    --muted: #6e6e6e;
    --surface: #101010;
    --border: #2a2a2a;
    --accent: #c8c8c8;
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}
.page-public.theme-mono .public-name,
.page-public.theme-mono .public-link {
    font-family: 'JetBrains Mono', monospace;
    font-style: normal;
    letter-spacing: 0.02em;
}
.public-wrap {
    width: min(480px, 100%);
    margin: 0 auto;
    padding: 3rem 1.25rem 2.5rem;
    text-align: center;
}
.public-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 1rem;
    border: 2px solid var(--border);
    background: var(--surface);
}
.public-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 2.4rem;
    color: var(--accent);
    line-height: 1;
}
.public-header {
    margin-bottom: 0.25rem;
}
.public-name {
    font-size: clamp(2rem, 8vw, 2.75rem);
    margin-bottom: 0.5rem;
}
.public-bio {
    color: var(--muted);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}
.public-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.public-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-align: center;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.public-link:hover {
    color: var(--text);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.public-empty { color: var(--muted); }
.public-brand {
    margin-top: 2.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
}
.public-brand a { color: var(--muted); }
.public-brand a:hover { color: var(--accent); }

.embed-frame {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}
.embed-youtube {
    aspect-ratio: 16 / 9;
}
.embed-spotify {
    height: 152px;
}
.embed-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.embed-spotify iframe {
    position: static;
    height: 152px;
}
.embed-caption {
    margin-top: 0.45rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.email-capture {
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: left;
}
.email-capture-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.65rem;
}
.email-capture-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.email-capture-form input[type="email"] {
    flex: 1;
    min-width: 160px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    padding: 0.7rem 0.85rem;
    font-family: inherit;
    font-size: 1rem;
}
.public-subscribe-msg {
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 0.95rem;
}
.public-links > li { list-style: none; }
.code-area {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.78rem !important;
    line-height: 1.45;
}

/* Analytics */
.analytics-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.analytics-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 160px;
}
.analytics-filters select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    padding: 0.55rem 0.7rem;
    font-family: 'Barlow', sans-serif;
}
.clicks-chart {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
}
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.stat-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.stat-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}
.stat-label-row { font-size: 0.92rem; }
.stat-val-sm { color: var(--accent); font-size: 0.85rem; }
.form-fieldset {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.form-fieldset legend {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tech);
    padding: 0 0.35rem;
}

@media (max-width: 600px) {
    .site-header { padding: 0 1rem; }
    .site-main { padding: 2rem 1rem 3rem; }
    .health-list li { grid-template-columns: 3rem 1fr; }
    .inline-add-form { grid-template-columns: 1fr; }
    .nav-email { display: none; }
}

/* —— Link editor (Linktree-inspired, Lynq theme) —— */
.site-main-editor {
    width: min(1180px, 100%);
}
.editor-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    align-items: start;
}
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.editor-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.editor-profile {
    display: flex;
    gap: 1.15rem;
    align-items: center;
    margin-bottom: 1.25rem;
}
.avatar-form { flex-shrink: 0; }
.avatar-wrap {
    position: relative;
    display: block;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--surface2);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.avatar-wrap:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(57, 181, 74, 0.2);
}
.avatar-img,
.avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
}
.avatar-fallback {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 2.2rem;
    color: var(--accent);
    background: var(--surface);
}
.avatar-edit-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: var(--accent);
    color: #0a0a0a;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}
.avatar-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}
.editor-profile-text { min-width: 0; }
.editor-profile-name {
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    margin-bottom: 0.2rem;
}
.editor-profile-bio {
    color: var(--muted);
    margin-bottom: 0.35rem;
    line-height: 1.45;
}
.editor-profile-slug { font-size: 0.78rem; margin-bottom: 0.45rem; }
.editor-profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    font-size: 0.88rem;
}
.editor-profile-links a,
.editor-profile-links .linkish {
    color: var(--accent);
}
.btn-add-block {
    width: 100%;
    text-align: center;
    padding: 0.9rem 1.25rem;
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    border-radius: 999px;
}
.add-panel { margin-bottom: 1.25rem; }
.editor-blocks .hint { margin-bottom: 0.75rem; }
.empty-blocks {
    padding: 2rem 1.25rem;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
}
.link-card {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: grab;
    transition: border-color 0.15s, opacity 0.15s;
}
.link-card:hover { border-color: #3a3a3a; }
.link-card.dragging { opacity: 0.55; }
.link-card.is-inactive { opacity: 0.55; }
.link-card .drag-handle { margin-top: 0.15rem; }
.link-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.link-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}
.link-card-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}
.link-meta { font-size: 0.72rem; }
.link-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
    font-size: 0.85rem;
}
.link-card-actions a { color: var(--accent); }
.toggle-form { flex-shrink: 0; margin: 0; }
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    cursor: pointer;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.switch-slider {
    position: absolute;
    inset: 0;
    background: #3a3a3a;
    border-radius: 999px;
    transition: background 0.2s;
}
.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.switch input:checked + .switch-slider {
    background: var(--accent);
}
.switch input:checked + .switch-slider::before {
    transform: translateX(18px);
}
.switch input:focus-visible + .switch-slider {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Phone preview pane */
.editor-preview {
    position: sticky;
    top: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.preview-label {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tech);
    margin: 0;
}
.phone-frame {
    width: 280px;
    padding: 12px;
    border-radius: 28px;
    background: #1a1a1a;
    border: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.phone-screen {
    border-radius: 20px;
    overflow: hidden;
    min-height: 480px;
    max-height: 620px;
    background: var(--bg);
}
.phone-scroll {
    padding: 1.5rem 1rem 1.25rem;
    text-align: center;
    overflow-y: auto;
    max-height: 620px;
    min-height: 480px;
}
.phone-screen .public-avatar {
    width: 72px;
    height: 72px;
    margin-bottom: 0.75rem;
}
.phone-screen .public-name {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}
.phone-screen .public-bio {
    font-size: 0.82rem;
    margin-bottom: 1.1rem;
}
.phone-screen .public-links { gap: 0.55rem; }
.phone-screen .public-link {
    padding: 0.75rem 0.85rem;
    font-size: 0.92rem;
    border-radius: 999px;
    pointer-events: none;
}
.phone-screen .public-brand {
    margin-top: 1.5rem;
    font-size: 0.65rem;
}
.phone-screen .email-capture {
    text-align: left;
    padding: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.phone-screen .email-capture-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.phone-screen .email-capture-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.phone-screen .email-capture-form input {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2, #141414);
    color: var(--text);
}
.phone-screen iframe {
    width: 100%;
    max-width: 100%;
    border: 0;
    border-radius: 8px;
    pointer-events: none;
}
.preview-note {
    font-size: 0.78rem;
    text-align: center;
    max-width: 260px;
    line-height: 1.4;
}

@media (max-width: 960px) {
    .editor-shell {
        grid-template-columns: 1fr;
    }
    .editor-preview {
        position: static;
        order: -1;
    }
    .phone-frame { width: min(280px, 100%); }
    .phone-screen,
    .phone-scroll {
        min-height: 360px;
        max-height: 420px;
    }
}

@media (max-width: 600px) {
    .editor-profile {
        flex-direction: column;
        text-align: center;
    }
    .editor-profile-links { justify-content: center; }
    .avatar-wrap { margin: 0 auto; }
}

/* Collections + thumbnails */
.editor-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.editor-add-row .btn-add-block {
    flex: 1;
    margin-bottom: 0;
    min-width: 140px;
}
.collection-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.85rem;
}
.collection-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem;
}
.collection-box.dragging { opacity: 0.55; }
.collection-box.is-inactive { opacity: 0.6; }
.collection-box-loose {
    margin-bottom: 0.85rem;
}
.collection-box-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.collection-box-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--tech);
}
.collection-rename-form {
    flex: 1;
    min-width: 120px;
    margin: 0;
}
.collection-title-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.95rem;
    padding: 0.35rem 0.45rem;
}
.collection-title-input:hover,
.collection-title-input:focus {
    border-color: var(--border);
    outline: none;
    background: var(--surface);
}
.empty-blocks-sm {
    padding: 1.15rem;
    margin: 0;
    font-size: 0.88rem;
}
.link-card-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.thumb-editor {
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}
.thumb-editor-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 0.65rem;
}
.thumb-preview {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
}
.thumb-preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2, #141414);
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}
.thumb-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.btn-file {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.btn-file input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

/* Public collections + link thumbnails */
.public-collection {
    margin-top: 1.5rem;
    text-align: center;
}
.public-collection-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.85rem;
}
.public-link-thumb {
    justify-content: flex-start;
    text-align: left;
    padding-left: 0.65rem;
}
.public-link-thumb-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.public-link-label {
    flex: 1;
}
.phone-screen .public-collection {
    margin-top: 1rem;
}
.phone-screen .public-collection-title {
    font-size: 0.7rem;
    margin-bottom: 0.55rem;
}
.phone-screen .public-link-thumb-img {
    width: 36px;
    height: 36px;
}
.phone-screen .public-link {
    border-radius: 12px;
}
