:root {
    --accent: #B7FF3C;
    --page-bg: #0B0D10;
    --page-text: #F5F7FA;
    --ink: #101216;
    --muted: #6C727F;
    --line: #E4E7EC;
    --surface: #FFFFFF;
    --soft: #F4F6F8;
    --danger: #D92D20;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow: 0 18px 60px rgba(16, 24, 40, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #F0F2F5;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.eyebrow {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    border-radius: 18px;
    background: #111418;
    color: var(--accent);
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    letter-spacing: -.05em;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; }

/* Public page */
.public-page {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--page-text);
    background: var(--page-bg);
    position: relative;
}
.public-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(to bottom, black 0%, transparent 72%);
    pointer-events: none;
}
.ambient {
    position: fixed;
    border-radius: 999px;
    filter: blur(95px);
    pointer-events: none;
    opacity: .22;
}
.ambient-one { width: 420px; height: 420px; background: var(--accent); top: -170px; left: -180px; }
.ambient-two { width: 360px; height: 360px; background: #6A5CFF; right: -170px; top: 28%; }
.link-page-shell {
    width: min(100% - 32px, 720px);
    margin: 0 auto;
    padding: 70px 0 34px;
    position: relative;
    z-index: 1;
}
.profile-header { text-align: center; margin-bottom: 34px; }
.profile-avatar {
    width: 92px;
    height: 92px;
    border-radius: 29px;
    object-fit: cover;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.profile-monogram {
    display: inline-grid;
    place-items: center;
    background: var(--accent);
    color: #0B0D10;
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    font-size: 25px;
    letter-spacing: -.06em;
}
.profile-header .eyebrow { color: var(--accent); }
.profile-header h1 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(34px, 7vw, 56px);
    line-height: 1;
    letter-spacing: -.055em;
}
.profile-bio {
    width: min(100%, 520px);
    margin: 15px auto 0;
    color: color-mix(in srgb, var(--page-text) 72%, transparent);
    font-size: 16px;
    line-height: 1.55;
}
.public-card-list { display: grid; gap: 16px; }
.public-link-card {
    display: grid;
    grid-template-columns: 168px 1fr;
    min-height: 168px;
    color: var(--page-text);
    text-decoration: none;
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    position: relative;
}
.style-glass .public-link-card {
    background: rgba(255,255,255,.075);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 24px;
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 48px rgba(0,0,0,.20);
}
.style-solid .public-link-card {
    background: color-mix(in srgb, var(--page-text) 8%, var(--page-bg));
    border: 1px solid color-mix(in srgb, var(--page-text) 18%, transparent);
    border-radius: 20px;
}
.style-minimal .public-link-card {
    border-bottom: 1px solid color-mix(in srgb, var(--page-text) 18%, transparent);
    padding: 14px 0;
}
.public-link-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 65%, transparent);
    box-shadow: 0 22px 60px rgba(0,0,0,.32);
}
.card-cover-wrap { min-height: 168px; overflow: hidden; background: rgba(255,255,255,.05); }
.card-cover { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.public-link-card:hover .card-cover { transform: scale(1.04); }
.card-copy { padding: 23px 24px 22px; display: flex; flex-direction: column; align-items: flex-start; }
.card-domain-row { display: flex; align-items: center; gap: 8px; min-height: 20px; margin-bottom: 11px; color: color-mix(in srgb, var(--page-text) 58%, transparent); font-size: 12px; font-weight: 600; }
.card-favicon { width: 18px; height: 18px; object-fit: contain; border-radius: 5px; background: white; }
.card-copy h2 { margin: 0 0 8px; font-family: "Manrope", sans-serif; font-size: 21px; line-height: 1.18; letter-spacing: -.03em; }
.card-copy p { margin: 0 0 18px; color: color-mix(in srgb, var(--page-text) 67%, transparent); line-height: 1.45; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-button-label { margin-top: auto; color: var(--accent); font-size: 13px; font-weight: 800; }
.empty-public-state { text-align: center; padding: 56px 24px; border: 1px dashed rgba(255,255,255,.18); border-radius: 24px; background: rgba(255,255,255,.04); }
.empty-public-state span { color: var(--accent); font-size: 28px; }
.empty-public-state h2 { margin: 12px 0 6px; font-family: "Manrope", sans-serif; }
.empty-public-state p { margin: 0; opacity: .65; }
.public-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; padding: 0 4px; color: color-mix(in srgb, var(--page-text) 45%, transparent); font-size: 12px; }
.public-footer a { text-decoration: none; }
.public-footer a:hover { color: var(--accent); }

/* Login */
.admin-login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #0B0D10; color: #F7F8FA; }
.login-panel { width: min(100%, 460px); padding: 42px; border-radius: 28px; background: rgba(255,255,255,.065); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 28px 90px rgba(0,0,0,.35); }
.login-panel .eyebrow { color: var(--accent); margin-top: 24px; }
.login-panel h1 { font-family: "Manrope", sans-serif; font-size: 34px; letter-spacing: -.045em; margin: 0 0 10px; }
.login-panel > p { color: rgba(255,255,255,.64); line-height: 1.55; }
.login-form { display: grid; gap: 10px; margin: 28px 0 18px; }
.login-form label { font-size: 13px; font-weight: 700; }
.login-form input { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.14); }
.login-form .primary-button { margin-top: 8px; }
.text-link { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 700; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.alert.error { background: rgba(217,45,32,.14); border: 1px solid rgba(217,45,32,.4); color: #FFB4AE; }

/* Builder */
.builder-page { min-height: 100vh; background: #EDF0F3; }
.builder-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(16,24,40,.08);
    backdrop-filter: blur(18px);
}
.builder-topbar > div { display: flex; align-items: center; gap: 12px; }
.builder-topbar > div > div { display: grid; gap: 2px; }
.builder-topbar strong { font-family: "Manrope", sans-serif; font-size: 15px; }
.builder-topbar span:not(.brand-mark) { font-size: 12px; color: var(--muted); }
.builder-topbar nav { display: flex; align-items: center; gap: 18px; }
.builder-topbar nav a { font-size: 13px; font-weight: 700; text-decoration: none; color: #344054; }
.builder-topbar nav a:hover { color: #101828; }
.builder-layout {
    width: min(100% - 32px, 1480px);
    margin: 0 auto;
    padding: 28px 0 60px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 520px);
    gap: 24px;
    align-items: start;
}
.builder-controls { display: grid; gap: 18px; }
.builder-preview-column { display: grid; gap: 18px; position: sticky; top: 94px; }
.panel { background: var(--surface); border: 1px solid rgba(16,24,40,.07); border-radius: var(--radius-lg); padding: 24px; box-shadow: 0 10px 30px rgba(16,24,40,.045); }
.intro-panel { background: #101216; color: white; overflow: hidden; position: relative; padding: 34px; }
.intro-panel::after { content: ""; width: 220px; height: 220px; position: absolute; right: -70px; top: -80px; border-radius: 999px; background: var(--accent); filter: blur(72px); opacity: .32; }
.intro-panel .eyebrow { color: var(--accent); position: relative; z-index: 1; }
.intro-panel h1 { position: relative; z-index: 1; margin: 0 0 12px; max-width: 670px; font-family: "Manrope", sans-serif; font-size: clamp(30px, 4vw, 50px); line-height: 1.06; letter-spacing: -.05em; }
.intro-panel p:last-child { position: relative; z-index: 1; margin: 0; max-width: 660px; color: rgba(255,255,255,.62); line-height: 1.6; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.panel-heading > div { display: flex; align-items: center; gap: 12px; }
.panel-heading h2 { margin: 0; font-family: "Manrope", sans-serif; font-size: 18px; letter-spacing: -.025em; }
.panel-heading.compact { margin-bottom: 14px; }
.panel-heading.compact > div { width: 100%; justify-content: space-between; }
.panel-heading.compact span { color: var(--muted); font-size: 12px; }
.step-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #101216; color: var(--accent); font-size: 10px; font-weight: 800; }
.url-fetch-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.field-help { margin: 9px 0 0; font-size: 12px; color: var(--muted); }
.field-help.success { color: #067647; }
.field-help.error { color: var(--danger); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.field-grid label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: #344054; }
.full-field { grid-column: 1 / -1; }
input, textarea, select {
    width: 100%;
    border: 1px solid #D9DEE7;
    border-radius: 12px;
    background: white;
    padding: 12px 13px;
    color: #101828;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, textarea:focus, select:focus { border-color: #98A2B3; box-shadow: 0 0 0 4px rgba(16,24,40,.055); }
.color-control { display: grid; grid-template-columns: 46px 1fr; gap: 8px; }
.color-control input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }
.toggle-field { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px !important; cursor: pointer; }
.toggle-field input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 42px; height: 24px; background: #D0D5DD; border-radius: 999px; position: relative; transition: background .2s ease; }
.toggle-ui::after { content: ""; width: 18px; height: 18px; position: absolute; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .2s ease; }
.toggle-field input:checked + .toggle-ui { background: #101216; }
.toggle-field input:checked + .toggle-ui::after { transform: translateX(18px); background: var(--accent); }
.form-actions { display: flex; gap: 10px; }
.primary-button, .secondary-button, .ghost-button, .icon-button {
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    transition: transform .16s ease, opacity .16s ease, background .16s ease;
}
.primary-button { padding: 12px 17px; color: #0B0D10; background: var(--accent); box-shadow: 0 7px 18px rgba(183,255,60,.20); }
.primary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-button { padding: 12px 17px; background: #EEF1F4; color: #344054; }
.ghost-button { padding: 8px 10px; color: #667085; background: transparent; }
.ghost-button:hover { background: #F2F4F7; }
.hidden { display: none !important; }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; font-size: 13px; font-weight: 700; }
.preview-toolbar > div { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #12B76A; box-shadow: 0 0 0 4px rgba(18,183,106,.13); }
.phone-frame { height: 610px; border: 8px solid #101216; border-radius: 38px; overflow: hidden; background: #101216; box-shadow: 0 26px 70px rgba(16,24,40,.23); }
.phone-frame iframe { width: 100%; height: 100%; border: 0; background: #0B0D10; }
.cards-panel { max-height: 420px; overflow: auto; }
.admin-card-list { display: grid; gap: 10px; }
.admin-card-item { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 10px; background: #F7F8FA; border: 1px solid #EAECF0; border-radius: 14px; }
.admin-card-thumb { width: 48px; height: 48px; border-radius: 11px; object-fit: cover; background: #E4E7EC; }
.admin-card-placeholder { display: grid; place-items: center; font-weight: 800; color: #667085; }
.admin-card-copy { min-width: 0; }
.admin-card-copy strong, .admin-card-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-card-copy strong { font-size: 13px; color: #101828; }
.admin-card-copy span { margin-top: 3px; font-size: 11px; color: #667085; }
.admin-card-actions { display: flex; gap: 3px; }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; background: white; color: #475467; border: 1px solid #E4E7EC; }
.icon-button:hover { background: #F2F4F7; }
.icon-button.danger:hover { color: var(--danger); background: #FEF3F2; border-color: #FECDCA; }
.empty-admin-state { text-align: center; padding: 28px 14px; color: #98A2B3; font-size: 13px; border: 1px dashed #D0D5DD; border-radius: 14px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 360px; padding: 13px 16px; border-radius: 13px; background: #101216; color: white; font-size: 13px; font-weight: 700; box-shadow: 0 18px 45px rgba(0,0,0,.25); transform: translateY(20px); opacity: 0; pointer-events: none; transition: all .2s ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { background: #B42318; }

@media (max-width: 1040px) {
    .builder-layout { grid-template-columns: 1fr; }
    .builder-preview-column { position: static; grid-row: auto; }
    .phone-frame { height: 680px; }
}
@media (max-width: 680px) {
    .link-page-shell { padding-top: 42px; }
    .public-link-card { grid-template-columns: 112px 1fr; min-height: 148px; }
    .card-cover-wrap { min-height: 148px; }
    .card-copy { padding: 18px 17px; }
    .card-copy h2 { font-size: 17px; }
    .card-copy p { font-size: 13px; -webkit-line-clamp: 2; }
    .builder-topbar { padding: 10px 14px; }
    .builder-topbar nav a:first-child { display: none; }
    .builder-layout { width: min(100% - 20px, 1480px); padding-top: 14px; }
    .panel { padding: 18px; border-radius: 16px; }
    .intro-panel { padding: 24px; }
    .field-grid { grid-template-columns: 1fr; }
    .full-field { grid-column: auto; }
    .url-fetch-row { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; }
    .phone-frame { height: 620px; border-width: 5px; border-radius: 26px; }
}
@media (max-width: 480px) {
    .public-link-card { grid-template-columns: 1fr; }
    .card-cover-wrap { height: 180px; min-height: 0; }
    .public-footer { flex-direction: column; gap: 8px; }
}
