/* =================================================================
   พร้อมลิงค์ (PromptLink) — Design System
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap');

:root {
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', 'Inter', 'Noto Sans Thai', system-ui, sans-serif;
    color-scheme: light;

    /* สไตล์ Apple — ขาว/เทา สะอาด แบนสนิท + แอ็กเซนต์เทียล */
    --bg: #f1ecef;
    /* พื้นหลังมุก (mother-of-pearl) เหลือบหลายสี — ส่องผ่าน Liquid Glass ให้ดูมีมิติ */
    --app-bg:
        radial-gradient(1100px 760px at 6% -8%, rgba(255, 209, 224, 0.62), transparent 58%),
        radial-gradient(1000px 720px at 102% 2%, rgba(206, 227, 255, 0.58), transparent 55%),
        radial-gradient(1000px 820px at 50% 116%, rgba(205, 251, 233, 0.52), transparent 60%),
        radial-gradient(880px 700px at 96% 104%, rgba(233, 216, 255, 0.54), transparent 56%),
        radial-gradient(760px 620px at 26% 58%, rgba(255, 242, 214, 0.42), transparent 62%),
        linear-gradient(135deg, #f8f2f4 0%, #eef1f7 46%, #f1f7f4 100%);
    --surface: #ffffff;
    --surface-2: #f0f0f2;
    --border: #e2e2e7;
    --text: #1d1d1f;
    --text-muted: #6e6e73;

    --primary: #0d9488;
    --primary-600: #0b7268;
    --primary-glow: rgba(13, 148, 136, 0);
    --accent: #0d9488;

    /* สีแอ็กเซนต์ของเมนูข้าง (active + ไอคอน) */
    --nav-accent: #0d9488;
    --nav-accent-soft: rgba(13, 148, 136, .12);

    --success: #16a34a;
    --danger: #e5484d;

    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .03);
    --shadow-glow: none;

    --maxw: 1140px;

    /* Glass System Variables (Light Mode defaults) */
    --card-bg: rgba(255, 255, 255, 0.45);
    --card-border: rgba(255, 255, 255, 0.5);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 1px 0 rgba(255, 255, 255, 0.3) inset;
    --card-hover-bg: rgba(255, 255, 255, 0.6);
    --card-hover-border: rgba(255, 255, 255, 0.65);
    --card-hover-shadow: 0 12px 35px -8px rgba(0, 0, 0, 0.06), 0 1px 1px 0 rgba(255, 255, 255, 0.3) inset;

    --sidebar-bg: rgba(255, 255, 255, 0.45);
    --sidebar-border: rgba(255, 255, 255, 0.5);
    --sidebar-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.45), 0 8px 32px 0 rgba(0, 0, 0, 0.03);

    --modal-bg: rgba(255, 255, 255, 0.75);
    --modal-border: rgba(255, 255, 255, 0.65);
    --modal-shadow: 0 30px 70px rgba(0, 0, 0, 0.15);

    --input-bg: rgba(255, 255, 255, 0.35);
    --input-border: rgba(0, 0, 0, 0.08);
    --input-focus-bg: rgba(255, 255, 255, 0.6);

    --btn-bg: rgba(255, 255, 255, 0.45);
    --btn-border: rgba(255, 255, 255, 0.4);
    --btn-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 1px 0 rgba(255, 255, 255, 0.3) inset;
    --btn-hover-bg: rgba(255, 255, 255, 0.65);
    --btn-hover-border: rgba(255, 255, 255, 0.6);
    --btn-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.08), 0 1px 1px 0 rgba(255, 255, 255, 0.4) inset;

    --btn-primary-bg: rgba(13, 148, 136, 0.7);
    --btn-primary-border: rgba(255, 255, 255, 0.2);
    --btn-primary-shadow: 0 4px 15px rgba(13, 148, 136, 0.25), 0 1px 1px 0 rgba(255, 255, 255, 0.2) inset;
    --btn-primary-hover-bg: rgba(13, 148, 136, 0.85);
    --btn-primary-hover-border: rgba(255, 255, 255, 0.4);
    --btn-primary-hover-shadow: 0 6px 20px rgba(13, 148, 136, 0.35), 0 1px 1px 0 rgba(255, 255, 255, 0.3) inset;

    --skeleton-bg: rgba(255, 255, 255, 0.25);
    
    /* White sales glow flare in light mode */
    --sales-glow: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent 70%);
    --sales-num-grad: linear-gradient(180deg, #1c1c1e 0%, #48484a 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
/* พื้นหลังมุกแบบตรึงจอบน pseudo-element — เป็น layer แยก ลื่นกว่า background-attachment: fixed */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--app-bg);
    background-size: cover;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* หน้าเพจสาธารณะตั้งพื้นหลัง "ธีมของเพจ" ไว้ที่ body เอง (profile.php + includes/blocks_render.php)
   ถ้าปล่อย ::before ไว้ มันจะพ่น --app-bg ของธีมแอปทับจนพื้นหลังธีมหายหมด —
   ผลคือทุกเพจซีดเป็นพาสเทลเหมือนกันหมดไม่ว่าเจ้าของเลือกธีมไหน (ธีม 13 แบบใช้ไม่ได้เลย) */
body.bio-page::before { content: none; }

/* ---- Liquid Glass scrollbars (ทั้งแอป) — teal โปร่งแสง + ขอบขาววาว ทรงแคปซูล ---- */
html { scrollbar-width: thin; scrollbar-color: rgba(13, 148, 136, .4) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(13, 148, 136, .5), rgba(13, 148, 136, .28));
    background-clip: padding-box;
    border: 3px solid transparent;
    border-radius: 100px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(13, 148, 136, .72), rgba(13, 148, 136, .5));
    background-clip: padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { letter-spacing: -.022em; }

.muted { color: var(--text-muted); }
.center { text-align: center; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 980px;
    border: 1px solid var(--btn-border);
    font-weight: 600;
    font-size: 15px;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--btn-bg);
    color: var(--text);
    white-space: nowrap;
    box-shadow: var(--btn-shadow);
}
.btn:hover {
    background: var(--btn-hover-bg);
    border-color: var(--btn-hover-border);
    box-shadow: var(--btn-hover-shadow);
    transform: translateY(-1px);
    opacity: 1;
}
.btn:active {
    transform: scale(0.97) translateY(0);
    opacity: 0.9;
}
.btn-primary {
    background: var(--btn-primary-bg);
    color: #fff;
    border: 1px solid var(--btn-primary-border);
    box-shadow: var(--btn-primary-shadow);
}
.btn-primary:hover {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    box-shadow: var(--btn-primary-hover-shadow);
    opacity: 1;
}
.btn-ghost {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}
.btn-danger {
    background: rgba(229, 72, 77, 0.15);
    border-color: rgba(229, 72, 77, 0.3);
    color: var(--danger);
}
.btn-danger:hover {
    background: rgba(229, 72, 77, 0.25);
    border-color: rgba(229, 72, 77, 0.5);
    opacity: 1;
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.input, .textarea, select.input {
    width: 100%;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, select.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .18);
}
/* คู่สีพื้น/ตัวอักษรของรายการตัวเลือกต้องมาจากธีมเดียวกันเสมอ ไม่ปล่อยให้ระบบเลือกเอง */
select.input option { color: var(--text); background: var(--surface); }
.textarea { resize: vertical; min-height: 90px; }
.input-group { display: flex; align-items: center; }
.input-group .prefix {
    padding: 13px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-muted);
    font-size: 15px;
    white-space: nowrap;
}
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------------- Alerts ---------------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.alert-error { background: rgba(229,72,77,.10); color: #b42318; border: 1px solid rgba(229,72,77,.28); }
.alert-success { background: rgba(22,163,74,.10); color: #15803d; border: 1px solid rgba(22,163,74,.28); }

/* ---------------- Cards ---------------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    box-shadow: var(--card-hover-shadow);
}

/* glass-card-level-1: standard depth card */
.glass-card-level-1 {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

/* glass-card-level-2: modal / dropdown / popup layer depth card */
.glass-card-level-2 {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    box-shadow: var(--modal-shadow);
}

/* ---------------- Skeleton Loading ---------------- */
@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}
.skeleton {
    background: var(--skeleton-bg);
    animation: skeleton-pulse 1.5s infinite ease-in-out;
    border-radius: var(--radius-sm);
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

/* ---------------- Order Feed Item Slide-in ---------------- */
@keyframes orderSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        box-shadow: 0 0 20px rgba(13, 148, 136, 0.4);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }
}
.new-order-feed-item {
    animation: orderSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =================================================================
   Marketing landing page
   ================================================================= */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: #0d0d12;
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; }
.logo .dot { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--accent)); }
/* โลโก้รูปภาพที่อัปโหลด (แทนอิโมจิ) */
.dot.dot-img { background: none !important; width: auto; height: auto; padding: 0; border-radius: 0; }
.dot.dot-img img { display: block; width: auto; }
.brand-logo-img { display: block; margin: 0 auto 12px; width: auto; max-width: 180px; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 10px; }

.hero { position: relative; padding: 90px 0 70px; overflow: hidden; }
.hero::before {
    content: ''; position: absolute; inset: -30% 0 auto; height: 600px;
    background: radial-gradient(circle at 50% 0, rgba(13, 148, 136,.32), transparent 60%);
    pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; position: relative; }
.badge-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 100px; font-size: 13px; font-weight: 600;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
    margin-bottom: 22px;
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.hero h1 .grad {
    background: linear-gradient(120deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 18px; color: var(--text-muted); margin: 20px 0 30px; max-width: 480px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 30px; margin-top: 40px; }
.hero-stats .num { font-size: 26px; font-weight: 800; }
.hero-stats .lbl { font-size: 13px; color: var(--text-muted); }

/* Floating phone mockup */
.phone {
    width: 290px; margin: 0 auto;
    background: linear-gradient(135deg,#667eea,#764ba2);
    border-radius: 34px; padding: 22px 18px;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
    border: 8px solid #16161f;
    animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.phone .pf-avatar { width: 76px; height: 76px; border-radius: 50%; margin: 6px auto 12px;
    background: rgba(255,255,255,.25); border: 3px solid rgba(255,255,255,.6);
    display: grid; place-items: center; font-size: 30px; }
.phone .pf-name { text-align: center; color: #fff; font-weight: 700; font-size: 17px; }
.phone .pf-bio { text-align: center; color: rgba(255,255,255,.85); font-size: 13px; margin-bottom: 16px; }
.phone .pf-link {
    background: rgba(255,255,255,.18); color: #fff; text-align: center;
    padding: 12px; border-radius: 12px; margin-bottom: 10px; font-size: 14px; font-weight: 600;
}

.section { padding: 80px 0; }
.section h2 { font-size: clamp(28px,4vw,40px); font-weight: 800; text-align: center; letter-spacing: -.02em; }
.section .sub { text-align: center; color: var(--text-muted); max-width: 560px; margin: 14px auto 50px; font-size: 17px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { padding: 28px; }
.feature .ic { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; font-size: 24px;
    background: var(--surface-2); margin-bottom: 16px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: 15px; }

.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; counter-reset: step; }
.step { padding: 28px; position: relative; }
.step .n { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; margin-bottom: 14px; }

.pricing { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; align-items: stretch; }
.plan { padding: 32px 26px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--primary); box-shadow: var(--shadow-glow); position: relative; }
.plan.featured::after { content: 'แนะนำ'; position: absolute; top: -12px; right: 22px;
    background: linear-gradient(135deg,var(--primary),var(--accent)); color: #fff;
    font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 100px; }
.plan h3 { font-size: 20px; }
.plan .price { font-size: 40px; font-weight: 800; margin: 12px 0 4px; }
.plan .price small { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.plan ul { list-style: none; margin: 22px 0; flex: 1; }
.plan ul li { padding: 8px 0; color: var(--text-muted); display: flex; gap: 10px; }
.plan ul li::before { content: '✓'; color: var(--success); font-weight: 800; }

.cta-band { text-align: center; padding: 70px 24px; border-radius: 26px;
    background: linear-gradient(135deg, var(--primary), var(--accent)); margin: 40px 0; }
.cta-band h2 { font-size: clamp(28px,4vw,40px); font-weight: 800; }
.cta-band p { color: rgba(255,255,255,.9); margin: 12px 0 26px; font-size: 18px; }

.footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--text-muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }

/* ===== Public marketing/legal/support — shared header & footer ===== */
.pub-nav { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--border); }
.pub-nav-in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 22px; }
.pub-logo { font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.pub-links { display: flex; gap: 22px; margin-left: 14px; flex: 1; }
.pub-links a { color: var(--text-muted); text-decoration: none; font-size: 14.5px; font-weight: 600; transition: color .15s; }
.pub-links a:hover { color: var(--primary); }
.pub-auth { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.pub-footer { border-top: 1px solid var(--border); background: var(--surface-2, #f6f6f8); margin-top: 48px; }
.pub-footer-in { max-width: 1100px; margin: 0 auto; padding: 44px 22px 26px; }
.pub-foot-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.pub-foot-brand .b { font-weight: 800; font-size: 18px; color: var(--text); display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.pub-foot-brand p { color: var(--text-muted); font-size: 13.5px; line-height: 1.75; max-width: 300px; margin: 0; }
.pub-foot-col h4 { font-size: 13px; color: var(--text); margin: 0 0 12px; font-weight: 700; }
.pub-foot-col a { display: block; color: var(--text-muted); text-decoration: none; font-size: 13.5px; padding: 4px 0; transition: color .15s; }
.pub-foot-col a:hover { color: var(--primary); }
.pub-foot-bottom { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 18px; color: var(--text-muted); font-size: 13px; }
.pub-social { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.pub-social a { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all .15s; }
.pub-social a:hover { color: #fff; background: var(--primary); border-color: var(--primary); transform: translateY(-2px); }
.pub-social a svg { width: 18px; height: 18px; display: block; }
@media (max-width: 760px) {
    .pub-links { display: none; }
    .pub-foot-cols { grid-template-columns: 1fr 1fr; gap: 22px; }
    .pub-foot-brand { grid-column: 1 / -1; }
}

/* Trust / Partner / Security Badges in Footer */
.pub-foot-trust {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.pub-trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    padding: 14px 16px;
    border-radius: var(--radius-sm, 12px);
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.pub-trust-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.06);
}
.pub-trust-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface-2, #f0f0f2);
    color: var(--text-muted, #6e6e73);
}
.pub-trust-item:hover .pub-trust-icon {
    background: var(--border, #e2e2e7);
    color: var(--primary, #0d9488);
}

.pub-trust-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}
.pub-trust-text h5 {
    margin: 0 0 2px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}
.pub-trust-text p {
    margin: 0;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}


/* =================================================================
   Auth pages
   ================================================================= */
.auth-page { min-height: 100vh; display: grid; place-items: center;
    padding: calc(40px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 15% 15%, rgba(13, 148, 136,.10), transparent 42%),
      radial-gradient(circle at 85% 85%, rgba(13, 148, 136,.06), transparent 42%),
      var(--bg);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 36px 32px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand-logo { font-size: 34px; margin-bottom: 8px; }
.auth-head h1 { font-size: 24px; }
.auth-head p { color: var(--text-muted); font-size: 15px; margin-top: 4px; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 14px; }
.auth-foot a { color: var(--primary); font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Install page reuses auth styling */
.install-page { min-height: 100vh; display: grid; place-items: center;
    padding: calc(40px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); background: var(--bg); }
.install-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 36px; text-align: center; }
.install-card .brand-logo { font-size: 40px; margin-bottom: 10px; }
.install-card h1 { margin-bottom: 8px; }
.install-card code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }
.install-card .btn { margin-top: 16px; }

/* =================================================================
   Dashboard
   ================================================================= */
.dash {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    position: relative;
    transition: grid-template-columns .2s ease;
}
/* iOS-style Liquid Glass background blobs */
.glass-blob {
    position: fixed;
    border-radius: 50%;
    /* ห้ามใส่ filter: blur() ตรงนี้ — วัดแล้ว blur(90px) บน element fixed 3 ตัวที่ต้องผสม
       ทับเนื้อหาที่เลื่อนอยู่ ทำให้ทุกหน้าแอดมิน/dashboard ตกจาก 16.7ms เป็น 116.7ms ต่อเฟรม (~8fps)
       ใช้ radial-gradient ที่จางไปหาโปร่งใสแทน = ได้แสงนุ่มเหมือนกันโดยไม่ต้องเบลอตอนรัน */
    opacity: 0.22;
    z-index: 0;
    pointer-events: none;
    animation: blobDrift 24s ease-in-out infinite alternate;
    will-change: transform;
}
.blob-2 { animation-duration: 30s; animation-delay: -6s; }
.blob-3 { animation-duration: 27s; animation-delay: -12s; }
@keyframes blobDrift {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(4%, -5%, 0); }
    100% { transform: translate3d(-4%, 5%, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .glass-blob { animation: none; }
}

.blob-1 {
    top: -10%;
    right: -10%;
    width: 680px;
    height: 680px;
    background: radial-gradient(circle, #ff9a9e 0%, #fecfef 38%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #a1c4fd 0%, #c2e9fb 38%, transparent 70%);
}

.blob-3 {
    top: 40%;
    right: 15%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #d4fc79 0%, #96e6a1 38%, transparent 70%);
}

.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: var(--sidebar-shadow);
}
.sidebar .logo { padding: 0 8px 22px; }
/* โปรไฟล์ผู้ใช้บนสุด (แทนที่โลโก้ระบบ) */
.side-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.015);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.side-profile:hover {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(13, 148, 136, 0.25);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.06);
}
.side-profile:hover .meta b { color: var(--nav-accent); }
.side-profile .av { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2);
    display: grid; place-items: center; font-size: 18px; overflow: hidden; flex-shrink: 0;
    border: 1px solid var(--border); }
.side-profile .av img { width: 100%; height: 100%; object-fit: cover; }
.side-profile .meta { overflow: hidden; min-width: 0; }
.side-profile .meta b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s; }
.side-profile .meta span { display: block; font-size: 12px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ตัวสลับเพจ (multi-page) */
.page-switch { padding: 0 2px 14px; }
.page-switch select {
    font-size: 13px;
    padding: 9px 10px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
    transition: all 0.2s ease;
}
.page-switch select:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(13, 148, 136, 0.25);
}
html.side-collapsed .page-switch { display: none; }
/* เมนูยาวกว่าจอ: ให้โซนเมนูเลื่อนเอง — โลโก้/ตัวสลับเพจ/ปุ่มล่างตรึงไว้เห็นตลอด */
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0;
    overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(13, 148, 136, 0.2); border-radius: 100px; }
.side-nav::-webkit-scrollbar-thumb:hover { background: rgba(13, 148, 136, 0.4); }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15.5px;
    letter-spacing: -.01em;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.side-nav a:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.015);
}
.side-nav a.active {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.14), rgba(13, 148, 136, 0.03));
    color: var(--nav-accent);
    border: 1px solid rgba(13, 148, 136, 0.18);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--nav-accent), 0 4px 12px rgba(13, 148, 136, 0.04);
}
.side-nav a.active:hover {
    transform: translateX(2px);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.18), rgba(13, 148, 136, 0.05));
    border-color: rgba(13, 148, 136, 0.25);
}
.side-nav a .ic { width: 26px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 18px; }
.side-nav a .ic svg { width: 24px; height: 24px; }
.side-nav a.active .ic { color: var(--nav-accent); }
.side-nav a.nav-top .ic { color: var(--nav-accent); } /* แชท = เมนูหลัก ไอคอนสีเด่นเสมอ */
@media (min-width: 761px) { .side-nav a.nav-top { margin-bottom: 6px; font-weight: 600; } }
.nav-group-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    background: none; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.45); cursor: pointer; text-align: left; font-family: inherit;
    font-size: 12px; font-weight: 700; letter-spacing: .01em;
    color: var(--text-muted); padding: 12px 8px 6px; margin-top: 7px; opacity: 1; transition: color .15s; }
.nav-group-label:hover { color: var(--nav-accent); }
.nav-group-label:hover .ngl-chevron { background: var(--nav-accent); color: #fff; }
.nav-group-label .ngl-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* สามเหลี่ยมยุบ-ขยาย: เดิม 9px สีจางมองแทบไม่เห็น → ทำเป็นปุ่มกลมสีเด่น (accent) ให้รู้ว่ายุบ-ขยายได้ */
.nav-group-label .ngl-chevron { font-size: 11px; line-height: 1; flex-shrink: 0;
    width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--nav-accent); background: var(--nav-accent-soft); border-radius: 7px;
    transition: transform .2s ease, background .15s, color .15s; }
.nav-group-label[aria-expanded="false"] .ngl-chevron { transform: rotate(-90deg); }
.side-nav a.group-hidden { display: none; }
.sidebar .side-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}
.sidebar .side-foot-icon {
    flex: 1;
    min-width: 36px;
    height: 36px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 16px;
    margin-bottom: 0 !important;
}
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.user-chip .av { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2);
    display: grid; place-items: center; font-size: 16px; overflow: hidden; flex-shrink: 0; }
.user-chip .meta { overflow: hidden; }
.user-chip .meta b { display: block; font-size: 14px; }
.user-chip .meta span { font-size: 12px; color: var(--text-muted); }

/* ---- Collapsible sidebar ---- */
.side-collapse {
    position: absolute;
    top: 26px;
    right: -13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(13, 148, 136, 0.2);
    background: rgba(255, 255, 255, 0.85);
    color: var(--nav-accent);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 11px;
    line-height: 1;
    z-index: 20;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.side-collapse:hover {
    color: #fff;
    background: var(--nav-accent);
    border-color: var(--nav-accent);
    transform: scale(1.15);
    box-shadow: 0 6px 14px rgba(13, 148, 136, 0.3);
}
html.side-collapsed .dash { grid-template-columns: 78px 1fr; }
html.side-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
html.side-collapsed .sidebar .logo { font-size: 0; gap: 0; justify-content: center; padding-left: 0; padding-right: 0; }
html.side-collapsed .sidebar .logo .dot { font-size: 16px; }
html.side-collapsed .side-profile { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; padding: 10px 0; width: 44px; margin: 0 auto 14px; }
html.side-collapsed .side-profile .meta { display: none; }
html.side-collapsed .side-nav a { justify-content: center; padding: 11px 6px; }
html.side-collapsed .side-nav a:hover { transform: none; }
html.side-collapsed .side-nav a .lbl { display: none; }
/* ย่อแล้ว: หัวข้อหมวดกลายเป็นเส้นคั่นบาง ๆ (ซ่อนตัวอักษร + กดไม่ได้) และโชว์ทุกไอคอน */
html.side-collapsed .nav-group-label { display: block; font-size: 0; padding: 0; height: 1px; overflow: hidden;
    pointer-events: none; opacity: .5; background: var(--border); border: 0; margin: 8px 8px; }
html.side-collapsed .nav-group-label:first-child { margin-top: 2px; }
@media (min-width: 761px) {
    html.side-collapsed .side-nav a.group-hidden { display: flex; }
}
html.side-collapsed .side-foot > a, html.side-collapsed .side-foot > .btn { display: none; }
html.side-collapsed .user-chip { justify-content: center; padding: 8px 0; }
html.side-collapsed .user-chip .meta { display: none; }

/* overflow-x: clip (not hidden) — hidden would create a scroll context that
   breaks position:sticky for children (e.g. the live preview on the Design page) */
/* min-width: 0 — grid item จะหดได้ ไม่ถูกตาราง/เนื้อหากว้างดันให้ล้นจอ (สำคัญบนมือถือ) */
.dash-main { padding: 30px 36px; max-width: 100%; min-width: 0; overflow-x: hidden; overflow-x: clip; position: relative; z-index: 1; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--text-muted); font-size: 15px; }

.share-bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
    padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 24px; flex-wrap: wrap; }
.share-bar .url { font-weight: 600; color: var(--primary); word-break: break-all; }

.dash-grid { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }

/* Dashboard Glassmorphism Theme (Liquid Glass) */
.dash-main .card,
.dash-main .ofilter,
.dash-main .readiness-widget,
.dash-main .share-bar,
.dash-main .link-item,
.dash-main .todo-new {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: var(--card-shadow) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dash-main .card:hover,
.dash-main .ofilter:hover,
.dash-main .readiness-widget:hover,
.dash-main .share-bar:hover,
.dash-main .link-item:hover {
    background: var(--card-hover-bg) !important;
    border-color: var(--card-hover-border) !important;
    box-shadow: var(--card-hover-shadow) !important;
}

/* Translucent inputs & selects in dashboard main */
.dash-main .input, 
.dash-main .textarea, 
.dash-main select.input,
.dash-main .input-group .prefix {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--text) !important;
}

.dash-main .input:focus, 
.dash-main .textarea:focus, 
.dash-main select.input:focus {
    border-color: var(--primary) !important;
    background: var(--input-focus-bg) !important;
}

/* Modals glassmorphism */
.dash-main .modal,
#orderDetailModal > div,
.modal-overlay .modal {
    background: var(--modal-bg) !important;
    border: 1px solid var(--modal-border) !important;
    box-shadow: var(--modal-shadow) !important;
}

/* Table borders transparency */
.dash-main .tbl th, 
.dash-main .tbl td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Link editor cards */
.link-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; margin-bottom: 14px; display: flex; gap: 14px; align-items: center; transition: border-color .2s; }
.link-item:hover { border-color: var(--primary); }
.link-item.dragging { opacity: .5; }
.link-item .drag { cursor: grab; color: var(--text-muted); font-size: 20px; user-select: none; }
.link-item .li-body { flex: 1; min-width: 0; }
.link-item .li-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-item .li-url { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-item .li-actions { display: flex; gap: 6px; align-items: center; }
.link-item .clicks { font-size: 12px; color: var(--text-muted); background: var(--surface-2);
    padding: 4px 9px; border-radius: 100px; white-space: nowrap; }

.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-muted); display: grid; place-items: center; font-size: 15px; transition: all .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--primary); }
.icon-btn.on { color: var(--success); }

/* Color Badge Utilities matching system branding */
.icon-indigo, .icon-purple { background: rgba(13, 148, 136, 0.08) !important; color: #0d9488 !important; border: 1px solid rgba(13, 148, 136, 0.15) !important; }
.icon-teal { background: rgba(13, 148, 136, 0.08) !important; color: #0d9488 !important; border: 1px solid rgba(13, 148, 136, 0.15) !important; }

/* Toggle switch */
.switch { position: relative; width: 44px; height: 25px; flex-shrink: 0; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 100px; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; width: 17px; height: 17px; left: 4px; top: 3px;
    background: var(--text-muted); border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: linear-gradient(135deg,var(--primary),var(--accent)); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(18px); background: #fff; }

/* Live preview phone */
.preview-wrap { position: sticky; top: 30px; }
.preview-phone { width: 300px; margin: 0 auto; border-radius: 34px; border: 9px solid #16161f;
    box-shadow: var(--shadow); overflow: hidden; background: #000; }
.preview-phone iframe { width: 100%; height: 600px; border: 0; display: block; background: #fff; }

/* Theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.theme-swatch { aspect-ratio: 9/14; border-radius: 14px; cursor: pointer; border: 3px solid transparent;
    position: relative; overflow: hidden; transition: transform .15s; }
.theme-swatch:hover { transform: translateY(-3px); }
.theme-swatch.active { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.theme-swatch .label { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.4);
    color: #fff; font-size: 11px; font-weight: 600; text-align: center; padding: 4px; }
.theme-swatch .mini { position: absolute; inset: 14px 18px auto; height: 8px; border-radius: 100px; }

/* Stats cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: 18px; margin-bottom: 26px; }
.stat { padding: 22px; }
.stat .v { font-size: 32px; font-weight: 800; }
.stat .l { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.stat .ic { font-size: 22px; margin-bottom: 10px; }

/* Bar chart */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; background: linear-gradient(180deg,var(--primary),var(--accent)); border-radius: 6px 6px 0 0;
    min-height: 4px; position: relative; transition: height .4s ease; }
.bars .bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-muted); }

/* Table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.tbl th { color: var(--text-muted); font-weight: 600; font-size: 13px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
    display: none; place-items: center; z-index: 100; padding: 20px; }
.modal-overlay.open { display: grid; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px; animation: pop .2s ease;
    max-height: calc(100dvh - 40px); overflow-y: auto; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty .big { font-size: 44px; margin-bottom: 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    padding: 12px 20px; border-radius: 100px; box-shadow: var(--shadow); z-index: 200;
    opacity: 0; transition: all .3s ease; font-size: 14px; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* =================================================================
   Public profile (bio) page
   ================================================================= */
.bio-page { min-height: 100vh; padding: calc(56px + env(safe-area-inset-top)) 20px 40px; }
.bio-wrap { max-width: 580px; margin: 0 auto; text-align: center; }
.bio-avatar { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 16px;
    border: 3px solid rgba(255,255,255,.6); overflow: hidden; display: grid; place-items: center;
    font-size: 40px; background: rgba(255,255,255,.18); box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.bio-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bio-name { font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px; }
.bio-name .verified { color: #4eaaff; font-size: 18px; }
.bio-handle { font-size: 14px; opacity: .7; margin-top: 2px; }
.bio-desc { margin: 14px auto 8px; max-width: 420px; font-size: 15px; opacity: .92; }
.bio-socials { display: flex; justify-content: center; gap: 14px; margin: 18px 0 8px; }
.bio-socials a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255,255,255,.15); transition: transform .15s; }
.bio-socials a:hover { transform: translateY(-3px) scale(1.08); }
.bio-socials svg { width: 20px; height: 20px; }
.bio-links { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.bio-link { display: flex; align-items: center; gap: 12px; padding: 16px 18px; font-weight: 600; font-size: 16px;
    transition: transform .15s, box-shadow .2s; position: relative; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.bio-link:hover { transform: scale(1.025); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.bio-link .l-ic { width: 24px; flex-shrink: 0; display: grid; place-items: center; }
.bio-link .l-ic svg { width: 22px; height: 22px; }
.bio-link .l-title { flex: 1; text-align: center; }
.bio-link.style-rounded { border-radius: 14px; }
.bio-link.style-pill { border-radius: 100px; }
.bio-link.style-sharp { border-radius: 4px; }
.bio-link.style-outline { background: transparent !important; border: 2px solid currentColor; box-shadow: none; }
.bio-link.highlight { animation: hl-pulse 2s ease-in-out infinite; }
.bio-link.highlight::after {
    content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2px;
    background: linear-gradient(120deg, #ffd86b, #ff8a5c, #22d3ee, #ffd86b);
    background-size: 300% 100%; -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; animation: hl-border 3s linear infinite; pointer-events: none;
}
@keyframes hl-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes hl-border { to { background-position: 300% 0; } }
.bio-foot { margin-top: 38px; font-size: 13px; opacity: .75; }
.bio-foot a { font-weight: 700; }
.bio-empty { margin-top: 30px; opacity: .8; font-size: 15px; }

/* ================= Content blocks ================= */
.bio-blocks { margin-top: 24px; display: flex; flex-direction: column; gap: 18px; text-align: left; }
.bio-blocks .bio-links { margin-top: 0; }
.blk { animation: blk-in .4s ease both; }
@keyframes blk-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Placeholder image tile */
.blk-ph { display: grid; place-items: center; font-size: 30px;
    background: rgba(255,255,255,.16); width: 100%; aspect-ratio: 1; }

/* Featured banner */
.blk-featured { border-radius: 18px; overflow: hidden; position: relative;
    box-shadow: 0 8px 26px rgba(0,0,0,.22); background: rgba(255,255,255,.1); }
.blk-featured-img { width: 100%; height: 190px; object-fit: cover; aspect-ratio: auto; }
.blk-featured .blk-ph { height: 190px; aspect-ratio: auto; font-size: 52px; }
.blk-featured-body { position: absolute; inset: auto 0 0 0; padding: 18px 18px 16px;
    background: linear-gradient(to top, rgba(0,0,0,.6), transparent); color: #fff; }
.blk-featured-body h3 { font-size: 19px; margin-bottom: 2px; }
.blk-featured-body p { font-size: 13px; opacity: .92; margin-bottom: 10px; }
.blk-cta { display: inline-block; background: #fff; color: #111; font-weight: 700; font-size: 13px;
    padding: 8px 18px; border-radius: 100px; transition: transform .15s; }
.blk-cta:hover { transform: scale(1.05); }

/* Gallery grid */
.blk-gallery { display: grid; gap: 8px; }
.blk-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.blk-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.blk-gallery-cell { border-radius: 12px; overflow: hidden; }
.blk-gallery-img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .25s; }
.blk-gallery-cell:hover .blk-gallery-img { transform: scale(1.06); }

/* Products */
.blk-products { display: flex; flex-direction: column; gap: 10px; }
.blk-product { display: flex; align-items: center; gap: 12px; padding: 10px;
    background: rgba(255,255,255,.22); border-radius: 14px; }
.blk-product-img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; aspect-ratio: 1; flex-shrink: 0; }
.blk-product .blk-ph { width: 56px; height: 56px; border-radius: 10px; font-size: 26px; }
.blk-product-info { flex: 1; min-width: 0; }
.blk-product-title { font-weight: 600; font-size: 15px; }
.blk-product-price { font-size: 14px; opacity: .85; }
.blk-buy { background: #ff4d4f; color: #fff; font-weight: 700; font-size: 13px;
    padding: 8px 18px; border-radius: 100px; transition: transform .15s; white-space: nowrap; }
.blk-buy:hover { transform: scale(1.06); }
.blk-buy.blk-out { background: #b9b9c2; color: #fff; cursor: not-allowed; }
.blk-buy.blk-out:hover { transform: none; }
.blk-vsel { margin-top: 6px; width: 100%; max-width: 260px; padding: 6px 9px; border-radius: 9px;
    border: 1px solid rgba(0,0,0,.18); background: rgba(255,255,255,.95); color: #1a1a1a;
    font-size: 13px; font-family: inherit; cursor: pointer; }

/* Text */
.blk-text { padding: 4px 2px; }
.blk-text h3 { font-size: 18px; margin-bottom: 6px; }
.blk-text p { font-size: 14px; opacity: .9; line-height: 1.7; }

/* Video (lite: thumbnail + play button, loads iframe on click) */
.blk-video { border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; box-shadow: 0 8px 26px rgba(0,0,0,.22); position: relative; }
.blk-video iframe { width: 100%; height: 100%; display: block; border: 0; }
.blk-video-thumb { width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center;
    background-size: cover; background-position: center; background-color: #000; position: relative; }
.blk-video-thumb::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.18); transition: background .2s; }
.blk-video-thumb:hover::after { background: rgba(0,0,0,.05); }
.blk-play { position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255,0,40,.92); box-shadow: 0 6px 22px rgba(0,0,0,.4); transition: transform .2s; }
.blk-video-thumb:hover .blk-play { transform: scale(1.1); }
.blk-play::before { content: ''; width: 0; height: 0; margin-left: 4px;
    border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }

/* TikTok embed + feed */
.blk-tiktok { border-radius: 16px; overflow: hidden; }
.blk-tiktok .tiktok-embed { margin: 0 auto !important; max-width: 100% !important; border-radius: 16px; overflow: hidden; }
.blk-tiktok-cap { font-size: 13px; opacity: .85; margin: 8px 2px 0; text-align: center; }
.blk-tiktok-fallback { display: grid; place-items: center; aspect-ratio: 9/16; max-height: 460px; border-radius: 16px;
    background: #000 center/cover no-repeat; position: relative; box-shadow: 0 8px 26px rgba(0,0,0,.22); }
.blk-tiktok-fallback::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.25); border-radius: 16px; }
.blk-tiktok-cta { position: absolute; z-index: 1; bottom: 14px; font-size: 13px; font-weight: 700; color: #fff;
    background: rgba(0,0,0,.55); padding: 6px 12px; border-radius: 100px; }
.blk-ttfeed-h { font-size: 16px; font-weight: 700; margin: 0 0 10px; text-align: center; }
.blk-ttfeed-grid { display: grid; gap: 8px; }
.blk-ttfeed-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.blk-ttfeed-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.blk-ttfeed-cell { aspect-ratio: 9/16; border-radius: 12px; background: #000 center/cover no-repeat; position: relative;
    display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.18); transition: transform .15s; }
.blk-ttfeed-cell:hover { transform: translateY(-2px); }
.blk-ttfeed-cell::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.12); border-radius: 12px; }
.blk-ttfeed-cell .blk-play { width: 38px; height: 38px; background: rgba(0,0,0,.5); }
.blk-ttfeed-cell .blk-play::before { border-left-width: 12px; border-top-width: 7px; border-bottom-width: 7px; }
.blk-ttfeed-more { display: block; text-align: center; font-size: 13px; font-weight: 600; margin-top: 10px; opacity: .9; }

/* Contact card */
.blk-contact { background: rgba(255,255,255,.22); border-radius: 16px; padding: 16px; text-align: center; }
.blk-contact-name { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.blk-contact-actions { display: flex; gap: 10px; justify-content: center; }
.blk-contact-actions a { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18);
    padding: 9px 18px; border-radius: 100px; font-weight: 600; font-size: 14px; transition: transform .15s; }
.blk-contact-actions a:hover { transform: translateY(-2px); }
.blk-contact-actions .ci { width: 16px; height: 16px; display: inline-grid; place-items: center; }
.blk-contact-actions .ci svg { width: 16px; height: 16px; }

/* ตัวเลขข้อความยังไม่อ่าน (CRM/แชท) — เกาะมุมรูปโปรไฟล์ */
.unread-badge { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 100px; background: #ff3b5c; color: #fff;
    font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
    box-shadow: 0 0 0 2px var(--surface); z-index: 2; }

/* 🛒 ตะกร้าสินค้า (หน้าเพจสาธารณะ — โทนกลางอ่านชัดทุกธีม) */
.cart-fab { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; align-items: center; gap: 8px;
    background: #14141c; color: #fff; border: 0; border-radius: 100px; padding: 13px 18px;
    font-size: 17px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 28px rgba(0,0,0,.35); transition: transform .15s; }
.cart-fab-count { background: #ff3b5c; border-radius: 100px; min-width: 22px; height: 22px;
    font-size: 12px; line-height: 22px; text-align: center; padding: 0 6px; }
.cart-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
    display: none; align-items: flex-end; justify-content: center; }
.cart-overlay.open { display: flex; }
.cart-sheet { width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; background: #16161f; color: #fff;
    border-radius: 22px 22px 0 0; padding: 18px 18px 22px; }
@media (min-width: 600px) { .cart-overlay { align-items: center; } .cart-sheet { border-radius: 22px; } }
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 17px; }
.cart-x { background: rgba(255,255,255,.1); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.cart-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.cart-row-info { flex: 1; min-width: 0; }
.cart-row-title { font-size: 14px; font-weight: 600; }
.cart-row-price { font-size: 13px; opacity: .75; }
.cart-qty { display: flex; align-items: center; gap: 10px; }
.cart-qty button { width: 30px; height: 30px; border-radius: 9px; border: 0; background: rgba(255,255,255,.12);
    color: #fff; font-size: 17px; cursor: pointer; line-height: 1; }
.cart-qty span { min-width: 18px; text-align: center; font-weight: 700; }
.cart-total { display: flex; justify-content: space-between; padding: 13px 0; font-size: 16px; }
.cart-shipnote { background: rgba(46,193,110,.14); border: 1px solid rgba(46,193,110,.35); border-radius: 12px;
    padding: 9px 13px; font-size: 13px; margin-bottom: 12px; }
.cart-input { display: block; width: 100%; border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
    background: rgba(255,255,255,.07); color: #fff; font-family: inherit; font-size: 16px;
    padding: 12px 14px; margin-bottom: 10px; outline: none; resize: vertical; }
.cart-input::placeholder { color: rgba(255,255,255,.45); }
.cart-input:focus { border-color: rgba(255,255,255,.5); }
.cart-checkout { display: block; width: 100%; border: 0; border-radius: 14px; cursor: pointer;
    background: linear-gradient(135deg, #0d9488, #22d3ee); color: #fff; font-weight: 800;
    font-size: 16px; font-family: inherit; padding: 14px; margin-top: 4px; }
.cart-checkout:disabled { opacity: .6; }

/* Lead form block */
.blk-form { background: rgba(255,255,255,.22); border-radius: 16px; padding: 18px; text-align: left; }
.blk-form h3 { font-size: 17px; margin-bottom: 4px; }
.blk-form-sub { font-size: 13px; opacity: .85; margin-bottom: 12px; }
.blk-form-input { display: block; width: 100%; border: 1px solid rgba(255,255,255,.25); border-radius: 12px;
    background: rgba(255,255,255,.14); color: inherit; font-family: inherit; font-size: 14px;
    padding: 11px 14px; margin-bottom: 10px; outline: none; resize: vertical; }
.blk-form-input::placeholder { color: inherit; opacity: .55; }
.blk-form-input:focus { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.2); }
/* รายการตัวเลือกของ dropdown เป็นป๊อปอัปของระบบ (พื้นขาว) — ธีมตัวอักษรขาวจะมองไม่เห็น ต้องบังคับสีเข้ม */
select.blk-form-input option { color: #1a1a2a; background: #ffffff; }
.blk-form-ok { background: rgba(46,193,110,.2); border: 1px solid rgba(46,193,110,.45);
    border-radius: 12px; padding: 13px 16px; font-weight: 600; font-size: 14px; }

/* Card layout: blocks left-aligned inside the card already; keep centered header */
.bio-layout-card .bio-blocks { text-align: left; }

/* ---- Template layouts ---- */
/* Hero: large gradient cover with avatar overlapping */
.bio-page.bio-layout-hero, .bio-page.has-cover { padding-top: 0; }
/* Full-bleed cover: spans edge-to-edge (ignores body padding) and fades into the page bg. */
.bio-cover { height: 230px; position: relative; background-size: cover; background-position: center;
    width: 100vw; left: 50%; margin-left: -50vw; margin-right: -50vw;
    -webkit-mask: linear-gradient(180deg, #000 70%, transparent 100%); mask: linear-gradient(180deg, #000 70%, transparent 100%); }
.bio-layout-hero .bio-wrap, .has-cover .bio-wrap { margin-top: -70px; position: relative; }
/* When a cover is present, every layout gets a consistent centered, overlapping avatar. */
.has-cover .bio-avatar { width: 116px; height: 116px; margin: 0 auto 14px; border-width: 4px; box-shadow: 0 12px 40px rgba(0,0,0,.32); }
.has-cover .bio-name { justify-content: center; }
.has-cover.bio-layout-minimal .bio-wrap { text-align: center; }
.has-cover.bio-layout-minimal .bio-desc { margin-left: auto; margin-right: auto; }
.has-cover.bio-layout-minimal .bio-socials { justify-content: center; }
/* Subtle cohesion for mock gallery/featured imagery (keeps products natural). */
.mock-page .blk-gallery-img, .mock-page .blk-featured-img { filter: saturate(.92) contrast(1.02); }
.bio-layout-hero .bio-avatar { width: 120px; height: 120px; border-width: 4px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.bio-layout-hero .bio-name { font-size: 27px; }

/* Card: wrap content in a translucent frosted card */
.bio-layout-card .bio-wrap {
    background: rgba(255,255,255,.22); 
    border: 1px solid rgba(255,255,255,.18); border-radius: 26px;
    padding: 34px 26px 30px; box-shadow: 0 18px 50px rgba(0,0,0,.22); margin-top: 24px;
}
.bio-layout-card .bio-avatar { margin-top: -4px; }

/* Minimal: smaller avatar, left aligned, business-card feel */
.bio-layout-minimal .bio-wrap { text-align: left; max-width: 480px; }
.bio-layout-minimal .bio-avatar { width: 68px; height: 68px; margin: 0 0 14px; font-size: 28px; }
.bio-layout-minimal .bio-name { font-size: 22px; justify-content: flex-start; }
.bio-layout-minimal .bio-desc { margin-left: 0; margin-right: auto; }
.bio-layout-minimal .bio-socials { justify-content: flex-start; }
.bio-layout-minimal .bio-link { box-shadow: none; border: 1px solid rgba(125,125,125,.18); }

/* Spotlight: big name, emphasized first link */
.bio-layout-spotlight .bio-name { font-size: 30px; letter-spacing: -.01em; }
.bio-layout-spotlight .bio-avatar { width: 110px; height: 110px; }
.bio-layout-spotlight .bio-link:first-child { transform: scale(1.04); font-size: 17px; font-weight: 700; }
.bio-layout-spotlight .bio-link:first-child:hover { transform: scale(1.07); }

/* Font weights tuned per family */
.bio-font-serif .bio-name { font-weight: 800; letter-spacing: 0; }
.bio-font-mono .bio-name, .bio-font-mono .bio-handle { letter-spacing: -.02em; }
.bio-font-rounded .bio-link { font-weight: 700; }

/* =================================================================
   เมนูมือถือ (แท็บล่าง + แผ่นเมนู "เพิ่มเติม")
   ================================================================= */
.mob-more { display: none; }
.mob-sheet { position: fixed; inset: 0; z-index: 80; }
.mob-sheet[hidden] { display: none; }
.mob-sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
    opacity: 0; transition: opacity .2s ease; }
.mob-sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface);
    border: 1px solid var(--border); border-bottom: none; border-radius: 22px 22px 0 0;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
    max-height: 82dvh; overflow-y: auto;
    transform: translateY(100%); transition: transform .22s ease; }
.mob-sheet.open .mob-sheet-bg { opacity: 1; }
.mob-sheet.open .mob-sheet-panel { transform: translateY(0); }
.mob-sheet-grab { width: 42px; height: 4px; border-radius: 100px; background: var(--border); margin: 2px auto 12px; }
.mob-sheet-user { display: flex; align-items: center; gap: 11px; padding: 4px 4px 14px; }
.mob-sheet-user .av { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2);
    display: grid; place-items: center; font-size: 18px; overflow: hidden; flex-shrink: 0; }
.mob-sheet-user .av img { width: 100%; height: 100%; object-fit: cover; }
.mob-sheet-user .meta b { display: block; font-size: 15px; }
.mob-sheet-user .meta span { font-size: 13px; color: var(--text-muted); }
.mob-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.mob-sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 13px 6px 11px; border-radius: var(--radius-sm); background: var(--surface-2);
    border: 1px solid transparent; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.mob-sheet-grid a .ic { font-size: 22px; display: inline-flex; }
.mob-sheet-grid a .ic svg { width: 26px; height: 26px; }
.mob-sheet-grid a.active { border-color: transparent; color: var(--nav-accent);
    background: var(--nav-accent-soft); }
.mob-group-label { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-muted); padding: 10px 2px 1px; opacity: .8; }
.mob-group-label:first-child { padding-top: 0; }
.mob-sheet-actions { display: flex; flex-direction: column; gap: 8px; }

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { display: none; }
    .features, .steps, .pricing { grid-template-columns: 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
    .preview-wrap { display: none; }
}
@media (max-width: 760px) {
    .dash, html.side-collapsed .dash { grid-template-columns: 1fr; }

    /* แถบแท็บล่าง */
    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        height: auto;
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.45);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.45);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        z-index: 60;
    }
    .sidebar .logo, .sidebar .side-profile, .sidebar .side-foot, .side-collapse, .sidebar .page-switch { display: none; }
    .side-nav { flex-direction: row; width: 100%; gap: 2px; overflow: visible; min-height: auto; flex: none; }
    /* โชว์เฉพาะเมนูหลัก 4 อัน + ปุ่ม "เมนู" — ที่เหลืออยู่ในแผ่นเมนู */
    .side-nav a:not(.mob-keep) { display: none; }
    .side-nav .nav-group-label { display: none; } /* หัวข้อหมวดไม่โชว์ในแถบแท็บล่าง */
    .side-nav a.mob-keep, .side-nav .mob-more { display: flex; flex-direction: column; align-items: center;
        justify-content: center; gap: 3px; flex: 1; min-width: 0; padding: 7px 2px 5px;
        border: 0; background: none; border-radius: var(--radius-sm);
        color: var(--text-muted); font-weight: 500; }
    .side-nav a.mob-keep .ic, .side-nav .mob-more .ic { font-size: 21px; width: auto; height: auto; }
    .side-nav a.mob-keep .ic svg { width: 25px; height: 25px; }
    .side-nav a.mob-keep .lbl, .side-nav .mob-more .lbl { display: block; font-size: 10.5px; line-height: 1.2;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
    .side-nav a.mob-keep.active, .side-nav .mob-more.active { color: var(--nav-accent);
        background: var(--nav-accent-soft); border: 0; }

    .dash-main { padding: calc(18px + env(safe-area-inset-top)) 14px calc(86px + env(safe-area-inset-bottom)); }
    .page-head h1 { font-size: 22px; }
    .toast { bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }

    /* ตาราง: เลื่อนแนวนอนแทนการบีบจนอ่านไม่ได้ */
    .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tbl th, .tbl td { white-space: nowrap; }

    /* กัน iOS ซูมอัตโนมัติเมื่อแตะช่องกรอก (ต้อง >= 16px) */
    .input, .textarea, select.input, .blk-form-input { font-size: 16px; }

    .card { padding: 18px 16px; }
    .section { padding: 52px 0; }
    .theme-grid { grid-template-columns: repeat(3,1fr); }
    .nav-links .hide-sm { display: none; }
    .modal { padding: 20px 18px; }
    .link-item { flex-wrap: wrap; }
    .link-item .li-body { flex-basis: 60%; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat { padding: 16px; }
    .stat .v { font-size: 26px; }
}
@media (max-width: 480px) {
    .theme-grid { grid-template-columns: repeat(2,1fr); }
    .hero-stats { gap: 18px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .page-head > .btn, .page-head > div > .btn { width: 100%; }
}

/* safe area สำหรับปุ่มตะกร้าลอยบนหน้าเพจสาธารณะ */
@supports (padding: env(safe-area-inset-bottom)) {
    .cart-fab { bottom: calc(18px + env(safe-area-inset-bottom)); }
    .cart-sheet { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
    .bio-page { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}

/* ---------------- แผ่นแนะนำติดตั้งเป็นแอปบน iPhone/iPad ---------------- */
#ios-ins { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end;
    opacity: 0; transition: opacity .22s ease; }
#ios-ins.show { opacity: 1; }
.ios-ins-bg { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.ios-ins-card { position: relative; width: 100%; max-width: 460px; margin: 0 auto;
    background: var(--surface); border: 1px solid var(--border); border-bottom: none;
    border-radius: 22px 22px 0 0; padding: 12px 22px calc(20px + env(safe-area-inset-bottom));
    text-align: center; transform: translateY(100%); transition: transform .24s ease; }
#ios-ins.show .ios-ins-card { transform: translateY(0); }
.ios-ins-grab { width: 40px; height: 4px; border-radius: 99px; background: var(--border); margin: 2px auto 14px; }
.ios-ins-icon { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.ios-ins-card h3 { font-size: 18px; margin-bottom: 16px; }
.ios-ins-steps { counter-reset: s; list-style: none; text-align: left; margin: 0 0 16px; padding: 0;
    display: grid; gap: 12px; color: var(--text); font-size: 15px; line-height: 1.5; }
.ios-ins-steps li { position: relative; padding-left: 38px; }
.ios-ins-steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: -1px;
    width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
    font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.ios-share { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
    background: rgba(13,148,136,.14); font-size: 13px; vertical-align: -6px; }
.ios-ins-warn { background: rgba(255,159,10,.12); border: 1px solid rgba(255,159,10,.32);
    color: #b26a00; border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; text-align: left; }
@media (min-width: 560px) {
    #ios-ins { align-items: center; padding: 20px; }
    .ios-ins-card { border: 1px solid var(--border); border-radius: 20px; transform: translateY(16px); }
}

/* =================================================================
   Dark Mode Support (Glassmorphism Variables & Overrides)
   ================================================================= */
@media (prefers-color-scheme: dark) {
    html:not(.light-theme) {
        color-scheme: dark;
        --bg: #0a0a0c;
        --app-bg:
            radial-gradient(1100px 760px at 6% -8%, rgba(244, 63, 94, 0.12), transparent 58%),
            radial-gradient(1000px 720px at 102% 2%, rgba(59, 130, 246, 0.12), transparent 55%),
            radial-gradient(1000px 820px at 50% 116%, rgba(16, 185, 129, 0.10), transparent 60%),
            radial-gradient(880px 700px at 96% 104%, rgba(168, 85, 247, 0.12), transparent 56%),
            linear-gradient(135deg, #0a0a0c 0%, #0c0d12 50%, #0a0c0b 100%);
        --surface: #1c1c1e;
        --surface-2: #2c2c2e;
        --border: #2c2c2e;
        --text: #f5f5f7;
        --text-muted: #8e8e93;
        --primary: #0d9488;
        --primary-600: #0b7268;
        --accent: #0d9488;
        --nav-accent: #0d9488;
        --nav-accent-soft: rgba(13, 148, 136, .15);
        --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .2);

        /* Dark Glass values */
        --card-bg: rgba(20, 20, 25, 0.65);
        --card-border: rgba(255, 255, 255, 0.08);
        --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
        --card-hover-bg: rgba(255, 255, 255, 0.05);
        --card-hover-border: rgba(255, 255, 255, 0.12);
        --card-hover-shadow: 0 12px 35px -8px rgba(0, 0, 0, 0.4), 0 1px 1px 0 rgba(255, 255, 255, 0.08) inset;

        --sidebar-bg: rgba(15, 15, 20, 0.7);
        --sidebar-border: rgba(255, 255, 255, 0.08);
        --sidebar-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05), 0 8px 32px 0 rgba(0, 0, 0, 0.3);

        --modal-bg: rgba(20, 20, 25, 0.85);
        --modal-border: rgba(255, 255, 255, 0.1);
        --modal-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);

        --input-bg: rgba(255, 255, 255, 0.05);
        --input-border: rgba(255, 255, 255, 0.08);
        --input-focus-bg: rgba(255, 255, 255, 0.08);

        --btn-bg: rgba(255, 255, 255, 0.08);
        --btn-border: rgba(255, 255, 255, 0.1);
        --btn-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
        --btn-hover-bg: rgba(255, 255, 255, 0.15);
        --btn-hover-border: rgba(255, 255, 255, 0.2);
        --btn-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 0 1px 1px 0 rgba(255, 255, 255, 0.08) inset;

        --btn-primary-bg: rgba(13, 148, 136, 0.85);
        --btn-primary-border: rgba(255, 255, 255, 0.15);
        --btn-primary-shadow: 0 4px 15px rgba(13, 148, 136, 0.3), 0 1px 1px 0 rgba(255, 255, 255, 0.15) inset;
        --btn-primary-hover-bg: rgba(13, 148, 136, 0.95);
        --btn-primary-hover-border: rgba(255, 255, 255, 0.25);
        --btn-primary-hover-shadow: 0 6px 20px rgba(13, 148, 136, 0.45), 0 1px 1px 0 rgba(255, 255, 255, 0.2) inset;

        --skeleton-bg: rgba(255, 255, 255, 0.08);
        --sales-glow: radial-gradient(circle, rgba(13, 148, 136, 0.15), transparent 70%);
        --sales-num-grad: linear-gradient(180deg, #f5f5f7 0%, #a1a1a6 100%);
    }

    /* Glass Blobs adjustment for dark mode to look extra deep and premium */
    html:not(.light-theme) .glass-blob {
        opacity: 0.12;
        /* ไม่ใส่ blur — เหตุผลเดียวกับธีมสว่าง (ดูคอมเมนต์ที่ .glass-blob) */
    }
    html:not(.light-theme) .blob-1 {
        background: radial-gradient(circle, rgba(239,68,68,.4) 0%, rgba(244,63,94,.4) 38%, transparent 70%);
    }
    html:not(.light-theme) .blob-2 {
        background: radial-gradient(circle, rgba(59,130,246,.4) 0%, rgba(6,182,212,.4) 38%, transparent 70%);
    }
    html:not(.light-theme) .blob-3 {
        background: radial-gradient(circle, rgba(16,185,129,.3) 0%, rgba(52,211,153,.3) 38%, transparent 70%);
    }
}

html.dark-theme {
    color-scheme: dark;
    --bg: #0a0a0c;
    --app-bg:
        radial-gradient(1100px 760px at 6% -8%, rgba(244, 63, 94, 0.12), transparent 58%),
        radial-gradient(1000px 720px at 102% 2%, rgba(59, 130, 246, 0.12), transparent 55%),
        radial-gradient(1000px 820px at 50% 116%, rgba(16, 185, 129, 0.10), transparent 60%),
        radial-gradient(880px 700px at 96% 104%, rgba(168, 85, 247, 0.12), transparent 56%),
        linear-gradient(135deg, #0a0a0c 0%, #0c0d12 50%, #0a0c0b 100%);
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --border: #2c2c2e;
    --text: #f5f5f7;
    --text-muted: #8e8e93;
    --primary: #0d9488;
    --primary-600: #0b7268;
    --accent: #0d9488;
    --nav-accent: #0d9488;
    --nav-accent-soft: rgba(13, 148, 136, .15);
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .2);

    /* Dark Glass values */
    --card-bg: rgba(20, 20, 25, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
    --card-hover-bg: rgba(255, 255, 255, 0.05);
    --card-hover-border: rgba(255, 255, 255, 0.12);
    --card-hover-shadow: 0 12px 35px -8px rgba(0, 0, 0, 0.4), 0 1px 1px 0 rgba(255, 255, 255, 0.08) inset;

    --sidebar-bg: rgba(15, 15, 20, 0.7);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05), 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --modal-bg: rgba(20, 20, 25, 0.85);
    --modal-border: rgba(255, 255, 255, 0.1);
    --modal-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);

    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.08);
    --input-focus-bg: rgba(255, 255, 255, 0.08);

    --btn-bg: rgba(255, 255, 255, 0.08);
    --btn-border: rgba(255, 255, 255, 0.1);
    --btn-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
    --btn-hover-bg: rgba(255, 255, 255, 0.15);
    --btn-hover-border: rgba(255, 255, 255, 0.2);
    --btn-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 0 1px 1px 0 rgba(255, 255, 255, 0.08) inset;

    --btn-primary-bg: rgba(13, 148, 136, 0.85);
    --btn-primary-border: rgba(255, 255, 255, 0.15);
    --btn-primary-shadow: 0 4px 15px rgba(13, 148, 136, 0.3), 0 1px 1px 0 rgba(255, 255, 255, 0.15) inset;
    --btn-primary-hover-bg: rgba(13, 148, 136, 0.95);
    --btn-primary-hover-border: rgba(255, 255, 255, 0.25);
    --btn-primary-hover-shadow: 0 6px 20px rgba(13, 148, 136, 0.45), 0 1px 1px 0 rgba(255, 255, 255, 0.2) inset;

    --skeleton-bg: rgba(255, 255, 255, 0.08);
    --sales-glow: radial-gradient(circle, rgba(13, 148, 136, 0.15), transparent 70%);
    --sales-num-grad: linear-gradient(180deg, #f5f5f7 0%, #a1a1a6 100%);
}

html.dark-theme .glass-blob {
    opacity: 0.12;
    /* ไม่ใส่ blur — เหตุผลเดียวกับธีมสว่าง (ดูคอมเมนต์ที่ .glass-blob) */
}
html.dark-theme .blob-1 {
    background: radial-gradient(circle, rgba(239,68,68,.4) 0%, rgba(244,63,94,.4) 38%, transparent 70%);
}
html.dark-theme .blob-2 {
    background: radial-gradient(circle, rgba(59,130,246,.4) 0%, rgba(6,182,212,.4) 38%, transparent 70%);
}
html.dark-theme .blob-3 {
    background: radial-gradient(circle, rgba(16,185,129,.3) 0%, rgba(52,211,153,.3) 38%, transparent 70%);
}
