:root {
    --bg: hsl(210 17% 98%);
    --fg: hsl(0 0% 20%);
    --card: #ffffff;
    --card-fg: #000000;
    --muted: hsl(0 0% 96%);
    --accent: hsl(0 0% 96%);
    --muted-fg: hsl(220 9% 46%);
    --border: hsl(0 0% 90%);
    --input: hsl(0 0% 90%);
    --primary: #000000;
    --primary-fg: #ffffff;
    --success: #16a34a;
    --warning: #d97706;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-md: 0 10px 26px -14px rgba(0, 0, 0, .28);
    --sidebar-w: 240px;
    --font: 'Inter', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { font-family: inherit; }
svg { display: block; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    width: var(--sidebar-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.sidebar-brand {
    padding: 10px 16px 8px;
    flex: 0 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--fg);
    min-width: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--primary);
    color: var(--primary-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -.05em;
    flex: 0 0 auto;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    object-fit: cover;
    background: #fff;
    flex: 0 0 auto;
}

.brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: none;
}

.side-nav::-webkit-scrollbar { display: none; }

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
    transition: background .18s, color .18s;
}

.side-link svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    transition: transform .2s;
}

.side-link:hover {
    background: var(--accent);
}

.side-link:hover svg { transform: scale(1.1); }

.side-link.active {
    background: var(--accent);
    font-weight: 600;
}

.side-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.side-toggle .nav-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    opacity: .55;
    transition: transform .2s, opacity .2s;
}

.side-toggle:hover .nav-chevron { opacity: .9; }

.side-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }

.side-subnav {
    display: none;
    flex-direction: column;
    gap: 1px;
    margin: 1px 0 6px 20px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}

.side-subnav.open { display: flex; }

.side-sublink {
    display: block;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted-fg);
    transition: background .18s, color .18s;
}

.side-sublink:hover {
    background: var(--accent);
    color: var(--fg);
}

.side-sublink.active {
    background: var(--accent);
    color: var(--fg);
    font-weight: 600;
}

.side-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
    flex: 0 0 auto;
}

.sidebar-foot {
    flex: 0 0 auto;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg);
    padding: 0 2px 2px;
    min-width: 0;
}

.side-user .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    flex: 0 0 auto;
}

.side-user span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Mobile bar ---------- */
.mobile-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.mobile-bar .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 1rem;
}

.mobile-bar .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.mobile-bar .brand-text { font-size: 1rem; }

/* ---------- Main ---------- */
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 8px 32px 32px;
    width: calc(100% - var(--sidebar-w));
}

.content {
    flex: 1 1 auto;
    width: 100%;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: .875rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .18s, border-color .18s, filter .18s;
    white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
    background: var(--primary);
    color: var(--primary-fg);
}

.btn-primary:hover { filter: brightness(.9); }

.btn-ghost {
    background: var(--card);
    border-color: var(--input);
    color: var(--fg);
}

.btn-ghost:hover { background: var(--accent); }

.btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: .8125rem;
}

.w-full { width: 100%; }

/* ---------- Profile ---------- */
.cover {
    position: relative;
    width: 100%;
    height: 128px;
    border-radius: 8px;
    overflow: hidden;
    background: #0a0a0b;
    isolation: isolate;
}

.cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 1;
}

.cover::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(520px 200px at 18% 10%, rgba(14, 165, 233, .16), transparent 70%),
        radial-gradient(480px 220px at 85% 90%, rgba(168, 85, 247, .12), transparent 72%),
        linear-gradient(135deg, rgba(17, 19, 24, .16), rgba(5, 5, 6, .42));
}

.cover::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    box-shadow: inset 0 0 40px 0 rgba(0, 0, 0, .55), inset 0 0 8px 0 rgba(0, 0, 0, .35);
    pointer-events: none;
}

.cover-grain {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: .08;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.cover-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .45);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

.profile {
    position: relative;
    z-index: 2;
    margin-top: -56px;
    padding: 0 8px;
}

.profile-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-fg);
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.04em;
    border: 4px solid var(--bg);
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .35);
    flex: 0 0 auto;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-id {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 2px;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.profile-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verified {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #18181b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.verified svg { width: 11px; height: 11px; }

.profile-handle {
    font-size: .875rem;
    color: var(--muted-fg);
    margin-top: 2px;
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    row-gap: 6px;
    flex: 0 0 auto;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-pill.ok {
    background: rgba(22, 163, 74, .10);
    border-color: rgba(22, 163, 74, .25);
    color: #15803d;
}

.status-pill.warn {
    background: rgba(217, 119, 6, .10);
    border-color: rgba(217, 119, 6, .25);
    color: #b45309;
}

.profile-stats {
    display: flex;
    justify-content: flex-end;
    gap: 26px;
    margin-top: 18px;
}

.stat {
    text-align: center;
    min-width: 64px;
}

.stat b {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--fg);
}

.stat span {
    display: block;
    font-size: .75rem;
    color: var(--muted-fg);
    margin-top: 1px;
}

/* ---------- Tabs row ---------- */
.tabs-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}

.segmented {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.segmented::-webkit-scrollbar { display: none; }

.tab {
    border: 0;
    background: transparent;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted-fg);
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, background .15s, box-shadow .15s;
}

.tab:hover { color: var(--fg); }

.tab.active {
    background: var(--card);
    color: var(--fg);
    box-shadow: var(--shadow-sm);
}

.tab .count {
    font-weight: 400;
    opacity: .8;
    margin-left: 2px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    min-width: 200px;
    max-width: 320px;
    padding: 0 10px;
    border: 1px solid var(--input);
    border-radius: 6px;
    background: var(--card);
    color: var(--fg);
    font-size: .875rem;
    cursor: default;
}

.filter-btn .filter-ico {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffedd5, #fef3c7);
    color: #c2410c;
    flex: 0 0 auto;
}

.filter-btn .filter-ico svg { width: 12px; height: 12px; }

.filter-btn .label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.filter-btn .sep { color: var(--muted-fg); margin: 0 6px; }
.filter-btn .sub { color: var(--muted-fg); }

.filter-btn > svg {
    width: 16px;
    height: 16px;
    color: var(--muted-fg);
    flex: 0 0 auto;
}

/* ---------- Panels ---------- */
.panel { display: none; padding-top: 16px; }
.panel.active { display: block; animation: fade .22s ease; }

@keyframes fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 10px;
}

/* ---------- Cards ---------- */
.item {
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease;
    min-width: 0;
}

.item:hover { box-shadow: var(--shadow-md); }

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    flex: 0 0 auto;
}

.style-chip {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.card-top-right {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--muted-fg);
}

.format-ico {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.format-ico svg { width: 15px; height: 15px; }

.card-media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    margin: 0 -8px 12px;
    background: #fff;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    display: block;
}

.media-ph {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #d1d5db;
}

.media-ph svg { width: 42px; height: 42px; }

.media-ph b {
    font-size: 1.9rem;
    font-weight: 800;
    color: #e5e7eb;
    letter-spacing: -.03em;
    line-height: 1;
}

.media-hover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    transition: opacity .25s, background .25s;
}

.item:hover .media-hover {
    opacity: 1;
    background: rgba(0, 0, 0, .05);
}

.media-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4);
    display: grid;
    place-items: center;
    color: var(--fg);
}

.media-btn svg { width: 16px; height: 16px; }

.card-info { flex: 0 0 auto; min-width: 0; }

.card-name {
    display: block;
    margin: 0 0 3px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .75rem;
    color: var(--muted-fg);
    flex-wrap: wrap;
    row-gap: 4px;
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    max-width: 100%;
}

.card-meta span .txt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-meta svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* ---------- Activities ---------- */
.activity-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.activity-card { overflow: hidden; }
.activity-media {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    margin: -8px -8px 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0,0,0,.02), rgba(0,0,0,.01));
}
.activity-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}
.activity-media:hover img { transform: scale(1.03); }
.activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.activity-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: .72rem;
    color: var(--muted-fg);
}
.activity-head .page-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.activity-cover {
    margin: 4px 0 18px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.activity-cover img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
}
.activity-article {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.activity-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: clamp(16px, 3vw, 34px);
    font-size: clamp(.98rem, .9vw + .4rem, 1.02rem);
    line-height: 1.9;
}
.activity-content h2 {
    margin: 10px 0 4px;
    font-size: clamp(1.25rem, 1vw + 1rem, 1.6rem);
    font-weight: 700;
    letter-spacing: -.02em;
}
.activity-content h3 {
    margin: 8px 0 2px;
    font-size: clamp(1.08rem, .8vw + .9rem, 1.25rem);
    font-weight: 700;
}
.activity-content p { margin: 0; color: var(--fg); }
.activity-content ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0;
    padding-left: 22px;
}
.activity-content li { line-height: 1.9; }
.policy-content { gap: 16px; }
.activity-gallery,
.activity-videos {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 10px;
}
.gallery-item {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}
.gallery-item:hover img { transform: scale(1.02); }
.video-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
}
.video-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    background: #000;
}
.video-card video,
.video-card iframe {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    display: block;
}
.video-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg);
    font-weight: 500;
}
.activity-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.link-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--fg);
}
.link-more svg { transition: transform .2s ease; }
.link-more:hover svg { transform: translateX(2px); }
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .88rem;
    color: var(--muted-fg);
    margin-bottom: 6px;
}
.breadcrumbs a { color: var(--muted-fg); }
.breadcrumbs a:hover { color: var(--fg); }
.news-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
}

.news-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s;
    display: flex;
    flex-direction: column;
}

.news-card:hover { box-shadow: var(--shadow-md); }

.news-title {
    margin: 0 0 6px;
    font-size: 1.22rem;   /* หัวข้อข่าว — ตัวใหญ่กว่าเนื้อหา (.85rem) ชัดเจน */
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
    color: var(--fg);
}

.news-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: var(--muted-fg);
    margin-bottom: 10px;
}

.news-date svg { width: 13px; height: 13px; }

.news-body {
    color: var(--muted-fg);
    font-size: .85rem;
    line-height: 1.62;
    flex: 1 1 auto;
    white-space: pre-line;
}

.news-link {
    margin-top: 12px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--fg);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.news-link:hover { text-decoration: underline; }

/* ---------- รูปแนบประกาศ (หลายรูป) ---------- */
.news-media {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 10px 0 2px;
}

.news-media.multi {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.news-img {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted);
    line-height: 0;
}

.news-img img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform .2s ease, opacity .2s ease;
}

.news-media:not(.multi) .news-img img { aspect-ratio: 16 / 10; object-fit: contain; background: var(--muted); }
.news-img:hover img { transform: scale(1.03); opacity: .92; }

/* ---------- Empty ---------- */
.empty {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 52px 24px;
    text-align: center;
    color: var(--muted-fg);
    background: var(--card);
}

.empty svg {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    opacity: .5;
}

.empty-title {
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 2px;
}

.empty-sub { font-size: .85rem; }

/* ---------- Page / Cards ---------- */
.page-head {
    margin: 8px 0 20px;
}

.page-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.page-sub {
    margin-top: 3px;
    font-size: .85rem;
    color: var(--muted-fg);
}

.card-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    min-width: 0;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: .95rem;
    font-weight: 600;
    color: var(--fg);
}

.card-head svg {
    width: 18px;
    height: 18px;
    color: var(--muted-fg);
    flex: 0 0 auto;
}

.narrow { max-width: 560px; }

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.muted { color: var(--muted-fg); }
.small { font-size: .8rem; }

.pay-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.account-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .85rem;
    line-height: 1.5;
    background: var(--card);
}

.alert svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin-top: 2px;
}

.alert-ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-err {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }

.label {
    display: block;
    margin-bottom: 6px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--muted-fg);
}

.input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--input);
    border-radius: 6px;
    background: var(--card);
    color: var(--fg);
    font-family: inherit;
    font-size: .875rem;
    transition: border-color .15s, box-shadow .15s;
}

.input:focus {
    outline: none;
    border-color: #a1a1aa;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .06);
}

input[type="file"].input {
    height: auto;
    padding: 9px 10px;
    font-size: .8rem;
}

input[type="file"].input::file-selector-button {
    margin-right: 10px;
    padding: 5px 11px;
    border: 1px solid var(--input);
    border-radius: 5px;
    background: var(--muted);
    color: var(--fg);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
}

input[type="file"].input::file-selector-button:hover {
    background: #ececec;
}

/* ---------- Payment ---------- */
.price-box {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted);
}

.price-label {
    font-size: .75rem;
    color: var(--muted-fg);
}

.price-value {
    margin-top: 2px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.qr-wrap {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.qr-img {
    width: 220px;
    max-width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.pp-number {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .01em;
    word-break: break-all;
}

.pp-name {
    margin-top: 2px;
    margin-bottom: 14px;
    font-size: .8rem;
    color: var(--muted-fg);
}

.divider {
    height: 1px;
    margin: 16px 0;
    background: var(--border);
}

/* ---------- License ---------- */
.license-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--muted);
    margin-top: 12px;
}

.license-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .05em;
    word-break: break-all;
}

/* ---------- Badges / info rows ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.ok {
    background: rgba(22, 163, 74, .10);
    border-color: rgba(22, 163, 74, .25);
    color: #15803d;
}

.badge.warn {
    background: rgba(217, 119, 6, .10);
    border-color: rgba(217, 119, 6, .25);
    color: #b45309;
}

.info-list {
    display: flex;
    flex-direction: column;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
}

.info-row:last-child { border-bottom: 0; }

.info-label {
    color: var(--muted-fg);
    flex: 0 0 auto;
}

.info-value {
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 20px 0 4px;
    color: var(--muted-fg);
    font-size: .8rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--fg);
}

.footer-brand .brand-mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: .72rem;
}

.footer-brand .brand-logo {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    height: 58px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    color: var(--muted-fg);
}

.bottom-link svg { width: 18px; height: 18px; }

.bottom-link.active { color: var(--fg); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
    .cover { height: 192px; }
    .profile { margin-top: -64px; padding: 0 24px; }
    .avatar { width: 144px; height: 144px; font-size: 2.5rem; }
    .profile-name { font-size: 1.5rem; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .style-chip { font-size: 10px; }
    .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .cover { height: 256px; }
}

@media (min-width: 1024px) {
    .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .activity-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .account-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

@media (min-width: 1280px) {
    .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
    .activity-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
    .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    .pay-grid { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
}

@media (min-width: 1280px) {
    .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 1536px) {
    .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .activity-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .mobile-bar { display: flex; }
    .main {
        margin-left: 0;
        width: 100%;
        padding: 8px 16px calc(78px + env(safe-area-inset-bottom));
    }
    .bottom-nav { display: grid; }
    .profile { padding: 0 4px; }
    .profile-row { gap: 12px; }
    .profile-id {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .profile-actions { justify-content: flex-start; }
    .profile-stats {
        justify-content: stretch;
        gap: 8px;
        margin-top: 16px;
    }
    .stat {
        flex: 1 1 0;
        min-width: 0;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 9px 2px;
        background: var(--card);
    }
    .tabs-row { flex-direction: column; align-items: stretch; }
    .segmented { width: 100%; }
    .tab { flex: 1 1 0; padding: 7px 8px; text-align: center; }
    .filter-btn { width: 100%; max-width: none; }
}

@media (max-width: 480px) {
    .brand-text { font-size: .95rem; }
    .avatar { width: 92px; height: 92px; font-size: 1.7rem; }
    .profile { margin-top: -46px; }
    .cover { height: 116px; }
    .stat b { font-size: 1.15rem; }
    .stat span { font-size: .68rem; }
    .profile-actions .btn {
        height: 34px;
        padding: 0 10px;
    }
    .activity-content { padding: 16px; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        font-size: .8rem;
    }
}

/* ---------- Footer links ---------- */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.footer-links a {
    color: var(--muted-fg);
    text-decoration: none;
}

.footer-links a:hover { color: var(--fg); }

/* ---------- Auth pages ---------- */
.auth-wrap {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 980px;
    margin: 16px auto 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.auth-aside {
    display: none;
    position: relative;
    align-items: flex-end;
    padding: 36px 34px;
    background: #0a0a0b;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.auth-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(520px 260px at 12% 8%, rgba(14, 165, 233, .22), transparent 70%),
        radial-gradient(460px 260px at 92% 92%, rgba(168, 85, 247, .18), transparent 72%),
        linear-gradient(150deg, #12141a, #050506);
}

.auth-aside::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    box-shadow: inset 0 0 100px 0 #000;
    pointer-events: none;
}

.auth-aside-grain {
    position: absolute;
    inset: 0;
    opacity: .16;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.auth-aside-inner {
    position: relative;
    z-index: 2;
    width: 100%;
}

.auth-aside-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: #fff;
    color: #000;
    font-size: 1.05rem;
    font-weight: 800;
}

.auth-aside h2 {
    margin: 0 0 6px;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-aside p {
    margin: 0;
    max-width: 340px;
    font-size: .86rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .68);
}

.auth-points {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    font-size: .8rem;
    color: rgba(255, 255, 255, .82);
}

.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.auth-points svg {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex: 0 0 auto;
    color: #7dd3fc;
}

.auth-card {
    padding: 30px 20px;
    min-width: 0;
}

.auth-head { margin-bottom: 22px; }

.auth-title {
    margin: 0 0 4px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-sub {
    margin: 0;
    font-size: .85rem;
    line-height: 1.5;
    color: var(--muted-fg);
}

.auth-form .input { height: 44px; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.auth-row .label { margin-bottom: 0; }

.auth-link {
    font-size: .8rem;
    font-weight: 600;
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-link:hover { opacity: .7; }

.auth-foot {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: .82rem;
    color: var(--muted-fg);
}

.auth-foot a {
    font-weight: 600;
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-note {
    margin: 0;
    font-size: .8rem;
    line-height: 1.6;
    color: var(--muted-fg);
}

/* ---------- Google Sign-In ---------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    font-size: .78rem;
    color: var(--muted-fg);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--border);
}

.auth-sub-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 20px 0 14px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--fg);
}

.auth-sub-title svg {
    width: 15px;
    height: 15px;
    color: var(--muted-fg);
    flex: 0 0 auto;
}

.google-intro {
    display: block;
    margin: 0 0 12px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted);
    font-size: .84rem;
    line-height: 1.5;
    color: var(--fg);
}

.google-intro b { font-weight: 700; }

.google-intro span {
    display: block;
    margin-top: 3px;
    font-size: .75rem;
    color: var(--muted-fg);
}

/* ปุ่ม Google — แสดงตลอด แม้ยังไม่ได้ใส่ Client ID (กดแล้วขึ้นข้อความแจ้งสถานะ) */
.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow .15s ease, background .15s ease;
}

.google-btn:hover {
    background: var(--muted);
    box-shadow: var(--shadow-sm);
}

.google-btn svg { flex: 0 0 auto; }

.google-msg {
    margin: 8px 0 0;
    font-size: .76rem;
    line-height: 1.5;
    color: #b45309;
}

.google-signin {
    display: flex;
    justify-content: center;
    min-height: 44px;
}

.google-hidden-form { display: none; }

/* ---------- Turnstile: ยืนยันตัวตนแบบมาตรฐาน ---------- */
.human-check--turnstile {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
}

.human-check--turnstile .human-static { gap: 8px; }
.human-check--turnstile .cf-turnstile { display: flex; justify-content: center; }

/* ---------- Human verification ---------- */
.human-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 56px;
    margin: 4px 0 16px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted);
}

.human-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: .85rem;
    font-weight: 500;
    color: var(--fg);
    cursor: pointer;
}

.human-label input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.human-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border: 1.5px solid #a1a1aa;
    border-radius: 5px;
    background: #fff;
    transition: background .15s, border-color .15s;
}

.human-box svg {
    width: 13px;
    height: 13px;
    color: #fff;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .15s, transform .15s;
}

.human-label input:checked + .human-box {
    background: var(--primary);
    border-color: var(--primary);
}

.human-label input:checked + .human-box svg {
    opacity: 1;
    transform: scale(1);
}

.human-label input:focus-visible + .human-box {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .12);
}

.human-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 9px;
    line-height: 1.2;
    text-align: center;
    color: var(--muted-fg);
}

.human-brand svg {
    width: 18px;
    height: 18px;
}

.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.shop-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.shop-logo {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
}

.shop-logo-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--primary);
    color: var(--primary-fg);
    font-size: 1.5rem;
    font-weight: 800;
}

.shop-name {
    margin: 0 0 3px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.shop-tag {
    font-size: .78rem;
    color: var(--muted-fg);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .875rem;
    line-height: 1.55;
}

.contact-item svg {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    flex: 0 0 auto;
    color: var(--muted-fg);
}

.contact-item .lbl {
    display: block;
    margin-bottom: 1px;
    font-size: .72rem;
    color: var(--muted-fg);
}

.contact-item a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.bank-box {
    margin-top: 4px;
    padding: 12px 14px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--muted);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.6;
    white-space: pre-line;
    word-break: break-word;
}

.bank-box .lbl {
    display: block;
    margin-bottom: 2px;
    font-size: .72rem;
    font-weight: 400;
    color: var(--muted-fg);
}

.qr-mini-wrap {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.qr-mini {
    width: 176px;
    max-width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

@media (min-width: 900px) {
    .auth-wrap {
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
        margin-top: 24px;
    }
    .auth-aside { display: flex; }
    .auth-card { padding: 40px 38px; }
}

@media (min-width: 1024px) {
    .contact-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

@media (max-width: 899px) {
    .auth-wrap { margin-top: 8px; box-shadow: var(--shadow-sm); }
}

@media (max-width: 480px) {
    .auth-card { padding: 24px 16px; }
    .human-check { padding: 9px 10px; }
    .shop-card { flex-direction: column; gap: 12px; }
}

/* ---------- Real human challenge ---------- */
.human-static {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    font-weight: 500;
}
.human-static .human-box {
    background: var(--primary);
    border-color: var(--primary);
}
.human-static .human-box svg {
    opacity: 1;
    transform: scale(1);
    color: var(--primary-fg);
}
.human-q {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted);
    font-size: .85rem;
}
.human-answer {
    width: 96px !important;
    height: 36px !important;
    text-align: center;
    font-weight: 700;
    padding: 6px 10px !important;
}

/* ---------- Product gallery ---------- */
.gallery {
    display: grid;
    gap: 10px;
}
.gallery-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumb {
    width: 64px;
    height: 64px;
    padding: 4px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumb.active { border-color: var(--primary); }

/* ---------- Cart / orders ---------- */
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.cart-item-media {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cart-item-media img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cart-item-body { flex: 1 1 auto; min-width: 0; }
.cart-item-title { font-weight: 700; }
.cart-item-price { color: var(--muted-fg); font-size: .85rem; }
.cart-item-side { flex: 0 0 auto; text-align: right; }
.cart-qty { width: 80px; height: 38px; text-align: center; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.summary-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; }
.table-wrap { overflow-x: auto; }
.simple-table { width: 100%; border-collapse: collapse; }
.simple-table th, .simple-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.simple-table th { font-size: .8rem; color: var(--muted-fg); text-transform: uppercase; letter-spacing: .03em; }
.simple-table tr:last-child td { border-bottom: 0; }
.badge.err { background: #fef2f2; color: #b91c1c; }
.order-thumb { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.order-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.order-form-grid .span-2 { grid-column: 1 / -1; }
.checkout-note { white-space: pre-line; }
@media (max-width: 640px) {
    .order-form-grid { grid-template-columns: 1fr; }
    .cart-item { flex-wrap: wrap; }
    .cart-item-side { width: 100%; display: flex; justify-content: space-between; align-items: center; }
}

/* ---------- Print receipt ---------- */
@media print {
    .sidebar, .mobile-bar, .bottom-nav, .site-footer, .no-print { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; }
    body { background: #fff; }
    .receipt { box-shadow: none !important; border: 0 !important; }
}
