/* ═══════════════════════════════════════════════════════════════
   Teacher Portfolio — Premium Dark Navy Theme
   Fonts: Kanit (display) + Sarabun (body)
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Brand scale (navy) — เปลี่ยนได้ผ่าน theme_style_tag() */
  --brand-50:#eff6ff;  --brand-100:#dbeafe; --brand-200:#bfdbfe; --brand-300:#93c5fd;
  --brand-400:#60a5fa; --brand-500:#3b82f6; --brand-600:#2563eb; --brand-700:#1d4ed8;
  --brand-800:#1e40af; --brand-900:#1e3a8a; --brand-950:#172554;

  --gold-300:#fde68a; --gold-400:#fbbf24; --gold-500:#f59e0b; --gold-600:#d97706;

  /* Dark surfaces (default) */
  --bg:#08101f;
  --bg-grad: radial-gradient(1200px 600px at 85% -5%, rgba(37,99,235,.20), transparent 60%),
             radial-gradient(900px 500px at 0% 0%, rgba(30,58,138,.25), transparent 55%),
             linear-gradient(180deg,#0a1428 0%, #08101f 100%);
  --surface: rgba(19,33,61,.72);
  --surface-solid:#11203f;
  --surface-2: rgba(13,24,47,.6);
  --line: rgba(148,163,184,.16);
  --line-strong: rgba(148,163,184,.32);
  --ink:#eaf1fb;
  --ink-soft:#c6d3e6;
  --ink-muted:#8ea3c0;
  --shadow-sm: 0 2px 8px rgba(3,8,20,.4);
  --shadow: 0 12px 32px rgba(3,8,20,.5);
  --shadow-lg: 0 28px 70px rgba(3,8,20,.6);
  --radius:18px;
  --ease: cubic-bezier(.4,0,.2,1);
  --nav-h:76px;

  --c-green:#22c55e; --c-amber:#f59e0b; --c-red:#ef4444; --c-violet:#8b5cf6;
  --c-cyan:#06b6d4; --c-teal:#14b8a6;
}

[data-theme="light"] {
  --bg:#f1f5fb;
  --bg-grad: radial-gradient(1000px 500px at 90% -10%, rgba(37,99,235,.12), transparent 60%),
             linear-gradient(180deg,#f5f8fd 0%,#eef3fb 100%);
  --surface: rgba(255,255,255,.9);
  --surface-solid:#ffffff;
  --surface-2: rgba(241,245,251,.8);
  --line: rgba(15,23,42,.1);
  --line-strong: rgba(15,23,42,.18);
  --ink:#0f1e3a;
  --ink-soft:#334155;
  --ink-muted:#64748b;
  --shadow-sm: 0 2px 8px rgba(15,23,42,.06);
  --shadow: 0 12px 32px rgba(15,23,42,.1);
  --shadow-lg: 0 28px 70px rgba(15,23,42,.14);
}

*,*::before,*::after { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  margin:0; min-height:100dvh;
  font-family:'Sarabun','Kanit',system-ui,sans-serif;
  background:var(--bg); background-image:var(--bg-grad); background-attachment:fixed;
  color:var(--ink); font-size:15px; line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,h5,.font-display { font-family:'Kanit','Sarabun',system-ui,sans-serif; font-weight:600; line-height:1.3; }
a { color:inherit; text-decoration:none; }
img { max-width:100%; display:block; }
button { font-family:inherit; cursor:pointer; }
::selection { background:var(--brand-500); color:#fff; }

.container { width:min(1440px, 92vw); margin-inline:auto; }
.muted { color:var(--ink-muted); }
.text-brand { color:var(--brand-400); }

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; }
}

/* ═══════════ Topbar / Navbar ═══════════ */
.topbar {
  position:sticky; top:0; z-index:60;
  background:linear-gradient(180deg, rgba(8,16,31,.92), rgba(8,16,31,.72));
  backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
  border-bottom:1px solid var(--line);
}
[data-theme="light"] .topbar { background:linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.8)); }
.nav {
  display:flex; align-items:center; gap:18px; height:var(--nav-h);
}
.nav-brand { display:flex; align-items:center; gap:12px; flex-shrink:0; }
.nav-logo {
  width:52px; height:52px; border-radius:14px; flex-shrink:0;
  display:grid; place-items:center; overflow:hidden;
  background:radial-gradient(circle at 30% 25%, var(--brand-500), var(--brand-900));
  box-shadow:0 8px 22px rgba(37,99,235,.4), inset 0 1px 0 rgba(255,255,255,.2);
}
.nav-logo img { width:100%; height:100%; object-fit:cover; }
.nav-logo i { font-size:26px; color:#fff; }
.nav-brand-text strong { display:block; font-family:'Kanit'; font-weight:600; font-size:18px; letter-spacing:.2px; }
.nav-brand-text span { display:block; font-size:11px; letter-spacing:3px; color:var(--ink-muted); font-weight:500; }

.main-nav { display:flex; align-items:center; gap:2px; margin-inline:auto; }
.nav-link {
  position:relative; display:inline-flex; align-items:center; gap:5px;
  padding:9px 13px; border-radius:10px; font-size:14.5px; font-weight:500;
  color:var(--ink-soft); white-space:nowrap; flex-shrink:0;
  transition:color .2s var(--ease), background .2s var(--ease);
}
.nav-link:hover { color:var(--ink); background:rgba(148,163,184,.08); }
.nav-link.is-active { color:var(--brand-400); }
.nav-link.is-active::after {
  content:""; position:absolute; left:13px; right:13px; bottom:2px; height:2px;
  background:linear-gradient(90deg,var(--brand-500),var(--brand-300)); border-radius:2px;
}
.nav-link .bi-chevron-down { font-size:11px; opacity:.6; }

.nav-actions { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.btn-download {
  display:inline-flex; align-items:center; gap:8px; padding:11px 20px; border-radius:999px;
  font-family:'Kanit'; font-weight:500; font-size:14px; border:1.5px solid var(--brand-500);
  color:var(--brand-300); background:rgba(37,99,235,.08); white-space:nowrap;
  transition:all .25s var(--ease);
}
.btn-download:hover { background:var(--brand-600); color:#fff; transform:translateY(-1px); box-shadow:0 8px 20px rgba(37,99,235,.4); }
.icon-btn {
  width:44px; height:44px; border-radius:12px; border:1px solid var(--line);
  background:var(--surface-2); color:var(--ink-soft); display:grid; place-items:center;
  font-size:18px; transition:all .2s var(--ease);
}
.icon-btn:hover { color:var(--brand-400); border-color:var(--brand-500); }
.nav-toggle { display:none; }

/* dropdown */
.nav-dd { position:relative; }
.nav-dd-menu {
  position:absolute; top:calc(100% + 8px); left:0; min-width:230px;
  background:var(--surface-solid); border:1px solid var(--line); border-radius:14px;
  padding:8px; box-shadow:var(--shadow-lg); opacity:0; visibility:hidden;
  transform:translateY(-8px); transition:all .22s var(--ease); z-index:70;
}
.nav-dd:hover .nav-dd-menu, .nav-dd:focus-within .nav-dd-menu { opacity:1; visibility:visible; transform:translateY(0); }
.nav-dd-menu a {
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  font-size:14px; color:var(--ink-soft); transition:all .18s var(--ease);
}
.nav-dd-menu a:hover { background:rgba(37,99,235,.12); color:var(--brand-300); }
.nav-dd-menu a i { color:var(--brand-400); font-size:16px; width:20px; }

/* ═══════════ Breadcrumb ═══════════ */
.breadcrumb {
  display:flex; align-items:center; gap:8px; padding:16px 0; font-size:13.5px; color:var(--ink-muted);
  border-bottom:1px solid var(--line);
}
.breadcrumb a:hover { color:var(--brand-400); }
.breadcrumb .sep { opacity:.5; }
.breadcrumb .cur { color:var(--ink-soft); }

/* ═══════════ Page Hero ═══════════ */
.page-hero {
  position:relative; overflow:hidden; border-radius:22px; margin-top:22px;
  padding:38px 40px; min-height:150px;
  background:linear-gradient(120deg, var(--brand-950) 0%, var(--brand-800) 55%, var(--brand-700) 100%);
  border:1px solid var(--line-strong);
  box-shadow:var(--shadow);
}
.page-hero::before {
  content:""; position:absolute; inset:0;
  background:radial-gradient(600px 300px at 78% 10%, rgba(96,165,250,.35), transparent 60%),
             radial-gradient(400px 240px at 100% 100%, rgba(59,130,246,.25), transparent 55%);
}
.page-hero::after {
  content:""; position:absolute; top:-40%; left:-10%; width:60%; height:180%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transform:rotate(18deg); pointer-events:none;
}
.page-hero-inner { position:relative; z-index:2; display:flex; align-items:center; gap:20px; }
.page-hero-icon {
  width:74px; height:74px; border-radius:18px; flex-shrink:0; display:grid; place-items:center;
  font-size:34px; color:#fff;
  background:linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.22); box-shadow:inset 0 1px 0 rgba(255,255,255,.3);
}
.page-hero h1 { margin:0; font-size:30px; color:#fff; }
.page-hero p { margin:6px 0 0; color:rgba(255,255,255,.82); font-size:15px; max-width:640px; }
.page-hero-deco {
  position:absolute; right:38px; top:50%; transform:translateY(-50%); z-index:1;
  display:flex; gap:20px; opacity:.9;
}
.page-hero-deco i {
  font-size:38px; color:rgba(147,197,253,.9);
  filter:drop-shadow(0 0 14px rgba(96,165,250,.7));
}
.page-hero-deco i:nth-child(2){ font-size:48px; }
@media (max-width:900px){ .page-hero-deco { display:none; } .page-hero{ padding:28px 24px; } .page-hero h1{ font-size:24px; } }

/* KPI cards inside hero */
.hero-kpis { position:relative; z-index:2; display:flex; flex-wrap:wrap; gap:26px; margin-top:22px; }
.hero-kpi { display:flex; align-items:center; gap:11px; }
.hero-kpi i { font-size:22px; color:var(--gold-400); }
.hero-kpi b { font-family:'Kanit'; font-size:24px; color:#fff; display:block; line-height:1; }
.hero-kpi span { font-size:12.5px; color:rgba(255,255,255,.72); }

/* ═══════════ Cards / Surface ═══════════ */
.card {
  background:var(--surface); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
  border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm);
}
.panel { background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:24px; box-shadow:var(--shadow-sm); }
.panel-title { display:flex; align-items:center; gap:10px; font-family:'Kanit'; font-size:18px; font-weight:600; margin:0 0 18px; }
.panel-title i { color:var(--brand-400); }

/* ═══════════ Badges ═══════════ */
.badge {
  display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:8px;
  font-size:12px; font-weight:600; font-family:'Kanit'; letter-spacing:.2px;
}
.badge-cat { color:#fff; }
.badge-soft { background:rgba(148,163,184,.14); color:var(--ink-soft); }

/* ═══════════ Buttons ═══════════ */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 22px; border-radius:12px; border:none; font-family:'Kanit'; font-weight:500;
  font-size:14.5px; transition:all .25s var(--ease); position:relative; overflow:hidden;
}
.btn-primary { background:linear-gradient(135deg,var(--brand-500),var(--brand-700)); color:#fff; box-shadow:0 8px 22px rgba(37,99,235,.35); }
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 14px 30px rgba(37,99,235,.5); }
.btn-ghost { background:transparent; color:var(--ink); border:1.5px solid var(--line-strong); }
.btn-ghost:hover { border-color:var(--brand-500); color:var(--brand-300); }
.btn-block { width:100%; }
.btn-lg { padding:15px 28px; font-size:16px; }

/* ═══════════ Work / Activity Card ═══════════ */
.grid-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:22px; }
.work-card {
  display:flex; flex-direction:column; overflow:hidden; border-radius:var(--radius);
  background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-sm);
  transition:transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.work-card:hover { transform:translateY(-5px); box-shadow:var(--shadow-lg); border-color:var(--brand-500); }
.work-cover {
  position:relative; aspect-ratio:16/10; overflow:hidden;
  background:linear-gradient(135deg,var(--brand-800),var(--brand-950));
  display:grid; place-items:center;
}
.work-cover img { width:100%; height:100%; object-fit:cover; transition:transform .5s var(--ease); }
.work-card:hover .work-cover img { transform:scale(1.06); }
.work-cover-icon { font-size:52px; color:rgba(255,255,255,.28); }
.work-cover-badge { position:absolute; top:12px; left:12px; z-index:2; }
.work-cover-crown {
  position:absolute; top:12px; right:12px; z-index:2; width:34px; height:34px; border-radius:50%;
  display:grid; place-items:center; font-size:16px; color:#78350f;
  background:linear-gradient(135deg,var(--gold-300),var(--gold-500));
  box-shadow:0 4px 12px rgba(251,191,36,.5);
}
.work-cover-count {
  position:absolute; bottom:12px; right:12px; z-index:2; display:flex; align-items:center; gap:5px;
  padding:4px 10px; border-radius:8px; font-size:12px; color:#fff;
  background:rgba(8,16,31,.7); backdrop-filter:blur(6px);
}
.work-body { padding:16px 18px; display:flex; flex-direction:column; gap:9px; flex:1; }
.work-title { font-family:'Kanit'; font-weight:600; font-size:16px; line-height:1.4; color:var(--ink);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.work-card:hover .work-title { color:var(--brand-300); }
.work-meta { display:flex; flex-wrap:wrap; gap:12px; font-size:12.5px; color:var(--ink-muted); margin-top:auto; }
.work-meta span { display:inline-flex; align-items:center; gap:5px; }
.work-meta i { color:var(--brand-400); }

/* list variant (works page rows) */
.work-row {
  display:flex; gap:18px; padding:16px; border-radius:16px; align-items:center;
  background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-sm);
  transition:all .25s var(--ease);
}
.work-row:hover { border-color:var(--brand-500); transform:translateX(3px); }
.work-row-cover {
  width:190px; height:118px; border-radius:12px; flex-shrink:0; overflow:hidden; position:relative;
  background:linear-gradient(135deg,var(--brand-800),var(--brand-950)); display:grid; place-items:center;
}
.work-row-cover img { width:100%; height:100%; object-fit:cover; }
.work-row-icon-badge {
  position:absolute; left:-10px; top:-10px; width:36px; height:36px; border-radius:50%;
  display:grid; place-items:center; color:#fff; font-size:16px; box-shadow:var(--shadow);
}
.work-row-body { flex:1; min-width:0; }
.work-row-body h3 { margin:8px 0 6px; font-size:18px; font-family:'Kanit'; }
.work-row-body h3 a:hover { color:var(--brand-300); }
.work-row-desc { color:var(--ink-muted); font-size:13.5px; margin:0 0 10px;
  display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
.work-row-foot { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.work-row-foot .meta { display:flex; gap:16px; font-size:12.5px; color:var(--ink-muted); }
.work-row-foot .meta i { color:var(--brand-400); }
@media (max-width:640px){
  .work-row { flex-direction:column; align-items:stretch; }
  .work-row-cover { width:100%; height:170px; }
}

/* ═══════════ Toolbar / Filters ═══════════ */
.toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip {
  display:inline-flex; align-items:center; gap:7px; padding:9px 16px; border-radius:999px;
  font-size:13.5px; font-weight:500; font-family:'Kanit'; color:var(--ink-soft);
  background:var(--surface-2); border:1px solid var(--line); transition:all .2s var(--ease); white-space:nowrap;
}
.chip:hover { border-color:var(--brand-500); color:var(--ink); }
.chip.is-active { background:var(--brand-600); border-color:var(--brand-600); color:#fff; box-shadow:0 6px 16px rgba(37,99,235,.35); }
.chip i { font-size:15px; }
.chip-dot { width:9px; height:9px; border-radius:50%; }

.field, .search-input, select.field {
  width:100%; padding:12px 15px; border-radius:12px; font-family:'Sarabun'; font-size:14px;
  background:var(--surface-2); border:1px solid var(--line); color:var(--ink); transition:all .2s var(--ease);
}
.field:focus, .search-input:focus { outline:none; border-color:var(--brand-500); box-shadow:0 0 0 3px rgba(37,99,235,.18); }
.field::placeholder { color:var(--ink-muted); }
select.field { appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238ea3c0' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; padding-right:38px; }
.search-wrap { position:relative; flex:1; min-width:220px; }
.search-wrap i { position:absolute; right:15px; top:50%; transform:translateY(-50%); color:var(--ink-muted); pointer-events:none; }
.search-wrap .search-input { padding-right:42px; }

.view-toggle { display:flex; gap:4px; padding:4px; border-radius:12px; background:var(--surface-2); border:1px solid var(--line); }
.view-toggle button { width:38px; height:34px; border-radius:9px; border:none; background:transparent; color:var(--ink-muted); font-size:16px; display:grid; place-items:center; transition:all .2s; }
.view-toggle button.is-active { background:var(--brand-600); color:#fff; }

/* ═══════════ Pagination ═══════════ */
.pagination { display:flex; justify-content:center; align-items:center; gap:6px; margin-top:34px; }
.pagination a, .pagination span {
  min-width:42px; height:42px; padding:0 12px; border-radius:11px; display:inline-flex; align-items:center; justify-content:center;
  font-family:'Kanit'; font-size:14px; background:var(--surface-2); border:1px solid var(--line); color:var(--ink-soft);
  transition:all .2s var(--ease);
}
.pagination a:hover { border-color:var(--brand-500); color:var(--brand-300); }
.pagination .is-active { background:var(--brand-600); border-color:var(--brand-600); color:#fff; }
.pagination .disabled { opacity:.4; pointer-events:none; }

/* ═══════════ Layout with sidebar ═══════════ */
.layout-sidebar { display:grid; grid-template-columns:1fr 320px; gap:26px; margin-top:26px; align-items:start; }
.sidebar-sticky { position:sticky; top:calc(var(--nav-h) + 16px); display:flex; flex-direction:column; gap:20px; }
@media (max-width:1040px){ .layout-sidebar { grid-template-columns:1fr; } .sidebar-sticky{ position:static; } }

/* summary list */
.summary-item { display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px dashed var(--line); }
.summary-item:last-child { border-bottom:none; }
.summary-ic { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; font-size:17px; color:#fff; flex-shrink:0; }
.summary-item .lbl { flex:1; font-size:14px; color:var(--ink-soft); }
.summary-item .cnt { font-family:'Kanit'; font-weight:600; font-size:18px; color:var(--ink); }
.summary-item .cnt small { font-size:12px; color:var(--ink-muted); font-weight:400; margin-left:3px; }

/* stat rows (gallery info) */
.stat-row { display:flex; align-items:center; gap:13px; padding:13px 0; border-bottom:1px dashed var(--line); }
.stat-row:last-child { border-bottom:none; }
.stat-row .ic { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; font-size:18px;
  color:var(--brand-300); background:rgba(37,99,235,.14); }
.stat-row .lbl { flex:1; font-size:14px; color:var(--ink-soft); }
.stat-row .val { font-family:'Kanit'; font-weight:700; font-size:22px; color:var(--ink); }
.stat-row .val small { font-size:12px; font-weight:400; color:var(--ink-muted); margin-left:4px; }

/* tag cloud */
.tag-cloud { display:flex; flex-wrap:wrap; gap:8px; }
.tag {
  padding:6px 13px; border-radius:999px; font-size:13px; color:var(--ink-soft);
  background:var(--surface-2); border:1px solid var(--line); transition:all .2s var(--ease);
}
.tag:hover { border-color:var(--brand-500); color:var(--brand-300); background:rgba(37,99,235,.1); }

/* profile mini card */
.profile-card { text-align:center; }
.profile-card .avatar {
  width:110px; height:110px; border-radius:50%; margin:0 auto 14px; overflow:hidden;
  background:linear-gradient(135deg,var(--brand-600),var(--brand-900)); display:grid; place-items:center;
  border:3px solid var(--line-strong); box-shadow:0 10px 26px rgba(37,99,235,.35); font-size:44px; color:#fff;
}
.profile-card .avatar img { width:100%; height:100%; object-fit:cover; }
.profile-card h3 { margin:0 0 4px; font-size:19px; }
.profile-card .pos { color:var(--ink-muted); font-size:13.5px; margin-bottom:16px; }

/* ═══════════ Empty / Error states ═══════════ */
.empty-state { text-align:center; padding:60px 20px; }
.empty-state .ic { width:88px; height:88px; border-radius:24px; margin:0 auto 18px; display:grid; place-items:center;
  font-size:40px; color:var(--brand-300); background:rgba(37,99,235,.12); }
.empty-state h3 { margin:0 0 6px; font-size:20px; }
.empty-state p { color:var(--ink-muted); margin:0 0 18px; }

/* ═══════════ Footer ═══════════ */
.site-footer { margin-top:60px; border-top:1px solid var(--line);
  background:linear-gradient(180deg, transparent, rgba(8,16,31,.5)); }
.footer-main { display:grid; grid-template-columns:1.4fr 1fr 1.2fr auto; gap:40px; padding:46px 0; }
.footer-quote { position:relative; }
.footer-quote .qmark { font-size:56px; color:var(--brand-700); font-family:Georgia,serif; line-height:.5; opacity:.6; }
.footer-quote p { font-family:'Kanit'; font-size:16px; line-height:1.7; color:var(--ink-soft); margin:14px 0; }
.footer-col h4 { font-family:'Kanit'; font-size:15px; margin:0 0 14px; color:var(--ink); }
.footer-col ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px; }
.footer-col ul a { color:var(--ink-muted); font-size:14px; transition:color .2s; }
.footer-col ul a:hover { color:var(--brand-400); }
.footer-contact div { display:flex; align-items:center; gap:10px; margin-bottom:11px; font-size:14px; color:var(--ink-soft); }
.footer-contact i { color:var(--brand-400); width:18px; }
.footer-qr { text-align:center; }
.footer-qr img, .footer-qr .qr-box { width:110px; height:110px; border-radius:12px; background:#fff; padding:8px; margin:0 auto 8px; }
.footer-qr small { color:var(--ink-muted); font-size:12px; display:block; max-width:130px; margin:0 auto; }
.footer-bottom { border-top:1px solid var(--line); padding:16px 0; display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px;
  font-size:13px; color:var(--ink-muted); }
.footer-bottom .dev a { color:var(--brand-400); }
@media (max-width:900px){ .footer-main { grid-template-columns:1fr 1fr; gap:28px; } .footer-qr{ grid-column:1/-1; } }
@media (max-width:540px){ .footer-main { grid-template-columns:1fr; } }

/* social icon buttons */
.social-icons { display:flex; gap:10px; }
.social-ic {
  width:44px; height:44px; border-radius:12px; display:grid; place-items:center; font-size:19px; color:#fff;
  transition:transform .2s var(--ease), box-shadow .2s var(--ease); position:relative;
}
.social-ic:hover { transform:translateY(-3px); }
.social-ic.fb { background:linear-gradient(135deg,#1877f2,#0d5fc4); }
.social-ic.yt { background:linear-gradient(135deg,#ff0000,#cc0000); }
.social-ic.line { background:linear-gradient(135deg,#06c755,#04a544); }
.social-ic.mail { background:linear-gradient(135deg,var(--brand-500),var(--brand-700)); }
.social-ic.web { background:linear-gradient(135deg,#0ea5e9,#0369a1); }
.social-ic .dot { position:absolute; top:-3px; right:-3px; min-width:16px; height:16px; padding:0 4px; border-radius:8px;
  background:var(--c-red); color:#fff; font-size:10px; display:grid; place-items:center; }

/* ═══════════ Contact FAB (side rail on desktop) ═══════════ */
.side-social { position:fixed; right:18px; top:50%; transform:translateY(-50%); z-index:55;
  display:flex; flex-direction:column; gap:10px; }
@media (max-width:1100px){ .side-social { display:none; } }

/* ═══════════ Scroll-reveal ═══════════ */
[data-reveal] { opacity:0; transform:translateY(26px); transition:opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].is-in { opacity:1; transform:none; }

/* ═══════════ Back-to-top ═══════════ */
.to-top { position:fixed; right:22px; bottom:22px; z-index:54; width:48px; height:48px; border-radius:50%;
  background:var(--surface-solid); border:1px solid var(--line-strong); color:var(--brand-300); font-size:20px;
  display:grid; place-items:center; box-shadow:var(--shadow); opacity:0; visibility:hidden; transform:translateY(10px);
  transition:all .3s var(--ease); }
.to-top.show { opacity:1; visibility:visible; transform:translateY(0); }
.to-top:hover { background:var(--brand-600); color:#fff; }

/* ═══════════ Utilities ═══════════ */
.section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 20px; }
.section-title h2 { display:flex; align-items:center; gap:10px; font-size:22px; margin:0; font-family:'Kanit'; }
.section-title h2 .diamond { color:var(--brand-400); font-size:14px; }
.section-title .more { font-size:14px; color:var(--brand-400); display:inline-flex; align-items:center; gap:6px; }
.section-title .more:hover { gap:9px; }
.mt-section { margin-top:56px; }
.stars { color:var(--gold-400); }
.stars .off { color:var(--line-strong); }

/* ═══════════════════════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════════════════════ */
.home-hero { position:relative; overflow:hidden; padding:36px 0 30px; }
.home-hero-grid { display:grid; grid-template-columns:1.05fr .95fr; gap:30px; align-items:center; }
.home-hero-eyebrow { display:inline-flex; align-items:center; gap:8px; color:var(--brand-300); font-family:'Kanit';
  font-size:15px; font-weight:500; margin-bottom:14px; }
.home-hero-eyebrow i { font-size:12px; }
.home-hero h1 { font-size:clamp(34px,4.4vw,56px); line-height:1.12; margin:0 0 16px; font-weight:700; letter-spacing:-.5px; }
.home-hero h1 .grad { background:linear-gradient(120deg,var(--brand-400),var(--brand-200)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.home-hero .lead { font-size:17px; color:var(--ink-soft); font-style:italic; max-width:520px; margin:0 0 26px; line-height:1.6; }
.home-hero-cta { display:flex; flex-wrap:wrap; gap:14px; margin-bottom:34px; }
.home-hero-stats { display:flex; flex-wrap:wrap; gap:30px; }
.hstat { display:flex; align-items:center; gap:12px; }
.hstat .ic { width:44px; height:44px; border-radius:12px; display:grid; place-items:center; font-size:20px;
  color:var(--brand-300); background:rgba(37,99,235,.14); border:1px solid var(--line); }
.hstat b { font-family:'Kanit'; font-size:26px; display:block; line-height:1; color:var(--ink); }
.hstat span { font-size:12.5px; color:var(--ink-muted); }

/* ── Hero visual (right side): photo + network sphere + floating code cards ── */
.hero-visual { position:relative; aspect-ratio:1/.92; }
.hero-sphere { position:absolute; inset:0; z-index:0; display:grid; place-items:center; }
.hero-sphere-svg { width:100%; height:100%; animation:spin 60s linear infinite; transform-origin:50% 47%; }
@keyframes spin { from{ transform:rotate(0); } to{ transform:rotate(360deg); } }
.hero-sphere::after { content:""; position:absolute; width:70%; height:70%; border-radius:50%;
  background:radial-gradient(circle, rgba(37,99,235,.4), transparent 62%); filter:blur(40px); }

.hero-photo {
  position:absolute; z-index:2; left:50%; bottom:0; transform:translateX(-50%);
  width:74%; aspect-ratio:3/3.7; border-radius:26px 26px 22px 22px; overflow:hidden;
  background:linear-gradient(165deg,var(--brand-700),var(--brand-950));
  border:1px solid var(--line-strong); box-shadow:var(--shadow-lg);
  display:grid; place-items:center; -webkit-mask-image:linear-gradient(180deg,#000 88%,transparent);
          mask-image:linear-gradient(180deg,#000 88%,transparent);
}
.hero-photo img { width:100%; height:100%; object-fit:cover; object-position:top center; }
.hero-photo-ph { display:flex; flex-direction:column; align-items:center; gap:10px; color:rgba(255,255,255,.3); text-align:center; padding:20px; }
.hero-photo-ph i { font-size:104px; }
.hero-photo-ph small { font-size:12px; color:rgba(255,255,255,.5); }

/* floating code cards */
.hero-code { position:absolute; z-index:3; border-radius:14px; overflow:hidden; width:220px;
  background:rgba(9,17,33,.78); backdrop-filter:blur(10px); border:1px solid rgba(96,165,250,.35);
  box-shadow:0 16px 40px rgba(3,8,20,.55), 0 0 24px rgba(37,99,235,.25); animation:floaty 5s ease-in-out infinite; }
.hero-code-bar { display:flex; align-items:center; gap:5px; padding:8px 11px; background:rgba(255,255,255,.05); border-bottom:1px solid rgba(148,163,184,.14); }
.hero-code-bar span { width:8px; height:8px; border-radius:50%; background:#475569; }
.hero-code-bar span:first-child{ background:#f87171; } .hero-code-bar span:nth-child(2){ background:#fbbf24; } .hero-code-bar span:nth-child(3){ background:#34d399; }
.hero-code-bar em { margin-left:auto; font-style:normal; font-family:'Kanit'; font-size:11px; letter-spacing:1px; color:var(--brand-300); }
.hero-code pre { margin:0; padding:12px 13px; font-family:'SFMono-Regular',Consolas,monospace; font-size:11.5px; line-height:1.7; color:#c6d3e6; white-space:pre; overflow:hidden; }
.hero-code pre .k{ color:#c084fc; } .hero-code pre .f{ color:#60a5fa; } .hero-code pre .s{ color:#34d399; } .hero-code pre .t{ color:#f472b6; }
.hero-code-python { top:6%; left:-6%; }
.hero-code-html { bottom:12%; right:-8%; animation-delay:1.4s; }

.hero-chip { position:absolute; z-index:4; display:flex; flex-direction:column; align-items:center; justify-content:center;
  border-radius:16px; box-shadow:var(--shadow); animation:floaty 4.5s ease-in-out infinite; }
.hero-chip-js { top:58%; left:2%; width:56px; height:56px; background:linear-gradient(135deg,#facc15,#eab308); color:#422006; animation-delay:.5s; }
.hero-chip-js b { font-family:'Kanit'; font-size:16px; line-height:1; } .hero-chip-js span { font-size:10px; font-weight:600; }
.hero-chip-code { top:8%; right:2%; width:58px; height:58px; font-size:26px; color:#fff;
  background:linear-gradient(135deg,var(--brand-500),var(--brand-800)); animation-delay:.9s; }
.hero-chip-ai { bottom:4%; left:16%; width:50px; height:50px; font-size:22px; color:#fff;
  background:linear-gradient(135deg,var(--c-violet),#6d28d9); animation-delay:.3s; }

@keyframes floaty { 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-12px); } }
@media (max-width:900px){
  .home-hero-grid { grid-template-columns:1fr; }
  .hero-visual { max-width:440px; margin:0 auto; }
  .hero-code { width:180px; } .hero-code-python{ left:0; } .hero-code-html{ right:0; }
}

/* quick nav strip */
.quick-strip { display:flex; flex-wrap:wrap; gap:6px; padding:12px; margin-top:14px; border-radius:16px;
  background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-sm); }
.quick-strip a { flex:1; min-width:130px; display:flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 14px; border-radius:11px; font-size:13.5px; font-family:'Kanit'; color:var(--ink-soft);
  transition:all .2s var(--ease); }
.quick-strip a:hover { background:rgba(37,99,235,.12); color:var(--brand-300); }
.quick-strip a i { color:var(--brand-400); font-size:17px; }
.quick-strip a.is-active { background:var(--brand-600); color:#fff; }
.quick-strip a.is-active i { color:#fff; }

/* home achievement cards row */
.ach-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:16px; }
@media (max-width:1200px){ .ach-grid { grid-template-columns:repeat(3,1fr); } }
@media (max-width:640px){ .ach-grid { grid-template-columns:repeat(2,1fr); } }
.ach-card { position:relative; overflow:hidden; border-radius:16px; aspect-ratio:1/1.15; display:flex; flex-direction:column;
  justify-content:flex-end; padding:16px; color:#fff; border:1px solid var(--line); box-shadow:var(--shadow-sm);
  transition:transform .3s var(--ease); }
.ach-card:hover { transform:translateY(-4px); }
.ach-card::before { content:""; position:absolute; inset:0; z-index:1;
  background:linear-gradient(180deg, rgba(8,16,31,.15) 0%, transparent 32%, rgba(8,16,31,.55) 68%, rgba(8,16,31,.92) 100%); }
.ach-card .ach-bg { position:absolute; inset:0; z-index:0; display:grid; place-items:center; font-size:48px; color:rgba(255,255,255,.22);
  background:linear-gradient(135deg,var(--brand-700),var(--brand-950)); overflow:hidden; }
.ach-card .ach-bg img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:transform .5s var(--ease); }
.ach-card:hover .ach-bg img { transform:scale(1.06); }
/* color-tint เพื่อคงอัตลักษณ์สีของแต่ละหมวดบนภาพจริง */
.ach-card .ach-bg::after { content:""; position:absolute; inset:0;
  background:linear-gradient(150deg, color-mix(in srgb, var(--c,#3b82f6) 62%, transparent) 0%, color-mix(in srgb, var(--c,#3b82f6) 12%, transparent) 45%, transparent 72%); }
.ach-card h4 { position:relative; z-index:2; margin:0 0 3px; font-size:14.5px; text-shadow:0 1px 6px rgba(0,0,0,.5); }
.ach-card p { position:relative; z-index:2; margin:0; font-size:11.5px; color:rgba(255,255,255,.88); text-shadow:0 1px 6px rgba(0,0,0,.5); }
.ach-card .arrow { position:absolute; top:14px; right:14px; z-index:3; width:32px; height:32px; border-radius:50%;
  display:grid; place-items:center; background:rgba(8,16,31,.4); backdrop-filter:blur(4px); border:1px solid rgba(255,255,255,.2); }
.ach-ic-badge { position:absolute; top:14px; left:14px; z-index:3; width:34px; height:34px; border-radius:10px;
  display:grid; place-items:center; color:#fff; font-size:16px; box-shadow:0 4px 12px rgba(0,0,0,.35); border:1px solid rgba(255,255,255,.25); }

/* home 3-panel row */
.home-3col { display:grid; grid-template-columns:1fr 1.1fr 1fr; gap:20px; }
@media (max-width:960px){ .home-3col { grid-template-columns:1fr; } }
.news-item { display:flex; gap:14px; padding:13px 0; border-bottom:1px dashed var(--line); }
.news-item:last-child { border-bottom:none; }
.news-date { flex-shrink:0; width:52px; text-align:center; border-radius:11px; padding:8px 4px;
  background:linear-gradient(135deg,var(--brand-600),var(--brand-800)); color:#fff; }
.news-date b { font-family:'Kanit'; font-size:20px; display:block; line-height:1; }
.news-date span { font-size:11px; }
.news-body h4 { margin:0 0 4px; font-size:14.5px; font-family:'Kanit'; font-weight:500; line-height:1.4; }
.news-body h4 a:hover { color:var(--brand-300); }
.news-body p { margin:0; font-size:12.5px; color:var(--ink-muted); }
.mini-gallery { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.mini-gallery .mg { aspect-ratio:4/3; border-radius:10px; overflow:hidden; background:linear-gradient(135deg,var(--brand-700),var(--brand-950));
  display:grid; place-items:center; color:rgba(255,255,255,.3); font-size:28px; }
.mini-gallery .mg img { width:100%; height:100%; object-fit:cover; }
.mini-map { aspect-ratio:16/10; border-radius:12px; overflow:hidden; background:var(--surface-2);
  display:grid; place-items:center; color:var(--ink-muted); border:1px solid var(--line); margin-bottom:14px; position:relative; }
.mini-map i { font-size:40px; color:var(--brand-500); }

/* ═══════════════════════════════════════════════════════════════
   WORK DETAIL
   ═══════════════════════════════════════════════════════════════ */
.detail-grid { display:grid; grid-template-columns:1fr 340px; gap:26px; margin-top:24px; align-items:start; }
@media (max-width:1040px){ .detail-grid { grid-template-columns:1fr; } }
.detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:14px; }
.detail-head h1 { font-size:28px; margin:10px 0 12px; line-height:1.25; }
.detail-meta-row { display:flex; flex-wrap:wrap; gap:18px; color:var(--ink-muted); font-size:14px; }
.detail-meta-row span { display:inline-flex; align-items:center; gap:7px; }
.detail-meta-row i { color:var(--brand-400); }
.detail-actions { display:flex; gap:10px; flex-shrink:0; }

/* gallery viewer */
.viewer { border-radius:18px; overflow:hidden; border:1px solid var(--line); background:var(--surface); box-shadow:var(--shadow-sm); }
.viewer-main { position:relative; aspect-ratio:16/9; background:linear-gradient(135deg,var(--brand-800),var(--brand-950));
  display:grid; place-items:center; overflow:hidden; }
.viewer-main img { width:100%; height:100%; object-fit:cover; }
.viewer-main .ph { font-size:64px; color:rgba(255,255,255,.22); }
.viewer-nav { position:absolute; top:50%; transform:translateY(-50%); width:44px; height:44px; border-radius:50%;
  background:rgba(8,16,31,.55); backdrop-filter:blur(6px); color:#fff; border:1px solid rgba(255,255,255,.15);
  display:grid; place-items:center; font-size:20px; z-index:2; transition:background .2s; }
.viewer-nav:hover { background:var(--brand-600); }
.viewer-nav.prev { left:14px; } .viewer-nav.next { right:14px; }
.viewer-thumbs { display:flex; gap:8px; padding:12px; overflow-x:auto; }
.viewer-thumb { width:110px; height:68px; flex-shrink:0; border-radius:10px; overflow:hidden; cursor:pointer;
  background:linear-gradient(135deg,var(--brand-700),var(--brand-950)); display:grid; place-items:center;
  color:rgba(255,255,255,.4); border:2px solid transparent; transition:border .2s; }
.viewer-thumb.is-active { border-color:var(--brand-400); }
.viewer-thumb img { width:100%; height:100%; object-fit:cover; }

/* tabs */
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin:26px 0 20px; overflow-x:auto; }
.tab-btn { padding:12px 18px; border:none; background:transparent; color:var(--ink-muted); font-family:'Kanit';
  font-size:14.5px; font-weight:500; white-space:nowrap; position:relative; transition:color .2s; }
.tab-btn:hover { color:var(--ink); }
.tab-btn.is-active { color:var(--brand-300); }
.tab-btn.is-active::after { content:""; position:absolute; left:12px; right:12px; bottom:-1px; height:2px;
  background:var(--brand-400); border-radius:2px; }
.tab-pane { display:none; animation:fadeIn .3s var(--ease); }
.tab-pane.is-active { display:block; }
@keyframes fadeIn { from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none; } }

.topic-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px 20px; padding:18px; border-radius:14px;
  background:var(--surface-2); border:1px solid var(--line); }
@media (max-width:760px){ .topic-grid { grid-template-columns:1fr; } }
.topic-item { display:flex; align-items:center; gap:9px; font-size:14px; color:var(--ink-soft); }
.topic-item .chk { width:22px; height:22px; border-radius:7px; display:grid; place-items:center; flex-shrink:0;
  background:rgba(34,197,94,.16); color:var(--c-green); font-size:12px; }

/* file cards */
.file-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.file-card { display:flex; gap:12px; align-items:center; padding:14px; border-radius:14px;
  background:var(--surface-2); border:1px solid var(--line); transition:all .2s var(--ease); }
.file-card:hover { border-color:var(--brand-500); }
.file-ic { width:44px; height:52px; border-radius:9px; display:grid; place-items:center; font-size:12px; font-weight:700;
  color:#fff; flex-shrink:0; font-family:'Kanit'; }
.file-ic.pdf { background:linear-gradient(135deg,#ef4444,#b91c1c); }
.file-ic.pptx { background:linear-gradient(135deg,#f97316,#c2410c); }
.file-ic.docx { background:linear-gradient(135deg,#2563eb,#1e40af); }
.file-info { min-width:0; flex:1; }
.file-info h5 { margin:0 0 3px; font-size:13.5px; font-family:'Kanit'; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-info small { color:var(--ink-muted); font-size:12px; }
.file-dl { font-size:12.5px; color:var(--brand-400); display:inline-flex; align-items:center; gap:4px; margin-top:4px; }

/* satisfaction */
.sat-score { display:flex; align-items:center; gap:16px; margin-bottom:18px; }
.sat-num { font-family:'Kanit'; font-size:40px; font-weight:700; color:var(--ink); }
.sat-num small { font-size:18px; color:var(--ink-muted); font-weight:400; }
.sat-bars { display:flex; flex-direction:column; gap:8px; }
.sat-bar-row { display:flex; align-items:center; gap:10px; font-size:13px; }
.sat-bar-row .lbl { width:44px; color:var(--ink-muted); }
.sat-bar-track { flex:1; height:8px; border-radius:5px; background:var(--surface-2); overflow:hidden; }
.sat-bar-fill { height:100%; border-radius:5px; background:linear-gradient(90deg,var(--brand-500),var(--brand-300)); }
.sat-bar-row .pct { width:38px; text-align:right; color:var(--ink-soft); }

/* mini calendar */
.mini-cal { border-radius:14px; overflow:hidden; }
.mini-cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.mini-cal-head b { font-family:'Kanit'; font-size:15px; }
.mini-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; text-align:center; }
.mini-cal-grid .dow { font-size:11px; color:var(--ink-muted); padding:4px 0; font-weight:600; }
.mini-cal-grid .day { aspect-ratio:1; display:grid; place-items:center; font-size:12.5px; border-radius:8px; color:var(--ink-soft); }
.mini-cal-grid .day.other { color:var(--ink-muted); opacity:.4; }
.mini-cal-grid .day.today { background:var(--brand-600); color:#fff; font-weight:600; }

/* comments */
.comment { display:flex; gap:12px; padding:14px 0; border-bottom:1px dashed var(--line); }
.comment .cav { width:42px; height:42px; border-radius:50%; flex-shrink:0; display:grid; place-items:center; color:#fff;
  font-family:'Kanit'; background:linear-gradient(135deg,var(--brand-600),var(--brand-900)); }
.comment .cbody { flex:1; }
.comment .cbody .top { display:flex; align-items:center; gap:10px; margin-bottom:4px; }
.comment .cbody strong { font-size:14px; }
.comment .cbody .time { font-size:12px; color:var(--ink-muted); }

/* ═══════════════════════════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════════════════════════ */
.contact-grid { display:grid; grid-template-columns:1fr 1fr; gap:26px; margin-top:26px; align-items:start; }
@media (max-width:900px){ .contact-grid { grid-template-columns:1fr; } }
.contact-info-item { display:flex; gap:14px; padding:14px 0; }
.contact-info-item .ic { width:44px; height:44px; border-radius:12px; flex-shrink:0; display:grid; place-items:center;
  font-size:18px; color:var(--brand-300); background:rgba(37,99,235,.14); }
.contact-info-item h5 { margin:0 0 3px; font-size:13px; color:var(--ink-muted); font-weight:500; }
.contact-info-item p { margin:0; font-size:14.5px; color:var(--ink); }
.contact-map { aspect-ratio:16/10; border-radius:16px; overflow:hidden; position:relative;
  background:var(--surface-2); border:1px solid var(--line); display:grid; place-items:center; }
.contact-map iframe { width:100%; height:100%; border:0; }
.contact-map .map-ph { text-align:center; color:var(--ink-muted); }
.contact-map .map-ph i { font-size:44px; color:var(--brand-500); }
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13.5px; font-weight:500; margin-bottom:7px; color:var(--ink-soft); }
.form-group label .req { color:var(--c-red); }
textarea.field { resize:vertical; min-height:120px; }
.social-follow { display:flex; gap:12px; flex-wrap:wrap; margin-top:8px; }
.social-follow a { display:flex; flex-direction:column; align-items:center; gap:8px; }
.social-follow a small { font-size:12px; color:var(--ink-muted); }

/* ═══════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════ */
.login-stage { min-height:100dvh; display:grid; place-items:center; padding:24px; }
.login-card { width:min(1000px,100%); display:grid; grid-template-columns:1.1fr 1fr; overflow:hidden;
  border-radius:26px; background:var(--surface-solid); border:1px solid var(--line-strong); box-shadow:var(--shadow-lg); }
@media (max-width:820px){ .login-card { grid-template-columns:1fr; } .login-brand { display:none; } }
.login-brand { position:relative; padding:44px; color:#fff; overflow:hidden;
  background:linear-gradient(150deg,var(--brand-800),var(--brand-950)); }
.login-brand::before { content:""; position:absolute; inset:0;
  background:radial-gradient(500px 300px at 90% 10%, rgba(96,165,250,.4), transparent 60%); }
.login-brand-logo { position:relative; width:60px; height:60px; border-radius:16px; display:grid; place-items:center;
  font-size:30px; background:linear-gradient(135deg,var(--brand-500),var(--brand-700)); margin-bottom:22px;
  box-shadow:0 10px 26px rgba(37,99,235,.5); }
.login-brand h2 { position:relative; font-size:28px; margin:0 0 10px; line-height:1.25; }
.login-brand p { position:relative; color:rgba(255,255,255,.8); margin:0 0 28px; }
.login-features { position:relative; display:flex; flex-direction:column; gap:14px; }
.login-feature { display:flex; gap:12px; align-items:flex-start; }
.login-feature .ic { width:40px; height:40px; border-radius:11px; flex-shrink:0; display:grid; place-items:center; font-size:18px;
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.15); }
.login-feature h5 { margin:0 0 2px; font-size:14.5px; }
.login-feature p { margin:0; font-size:12.5px; }
.login-form { padding:44px; }
.login-form h3 { font-size:24px; margin:0 0 4px; }
.login-form .sub { color:var(--ink-muted); font-size:13.5px; margin:0 0 26px; }
.lf { display:flex; flex-direction:column; gap:16px; }
.lf.shake { animation:shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
.pw-wrap { position:relative; }
.pw-toggle { position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none;
  color:var(--ink-muted); font-size:17px; }
.lf-submit { position:relative; padding:14px; border-radius:12px; border:none; color:#fff; font-family:'Kanit'; font-size:15px;
  background:linear-gradient(135deg,var(--brand-500),var(--brand-700)); overflow:hidden;
  box-shadow:0 10px 24px rgba(37,99,235,.4); transition:transform .2s; }
.lf-submit[data-state]{ pointer-events:none; }
.lf-submit-state { display:none; align-items:center; justify-content:center; gap:8px; }
.lf-submit-state-default { display:flex; }
.lf-submit[data-state="loading"] .lf-submit-state-default,
.lf-submit[data-state="success"] .lf-submit-state-default,
.lf-submit[data-state="error"] .lf-submit-state-default { display:none; }
.lf-submit[data-state="loading"] { background:linear-gradient(135deg,#1e293b,#0f172a); }
.lf-submit[data-state="loading"] .lf-submit-state-loading { display:flex; }
.lf-submit[data-state="success"] { background:linear-gradient(135deg,#10b981,#059669); }
.lf-submit[data-state="success"] .lf-submit-state-success { display:flex; }
.lf-submit[data-state="error"] { background:linear-gradient(135deg,#f43f5e,#be123c); animation:shake .4s; }
.lf-submit[data-state="error"] .lf-submit-state-error { display:flex; }
.lf-droplets { display:inline-flex; gap:4px; }
.lf-droplets span { width:7px; height:7px; border-radius:50%; background:#fff; animation:bounce 1.2s infinite; }
.lf-droplets span:nth-child(2){ animation-delay:.2s; } .lf-droplets span:nth-child(3){ animation-delay:.4s; }
@keyframes bounce { 0%,80%,100%{ transform:translateY(0); opacity:.6 } 40%{ transform:translateY(-6px); opacity:1 } }
.demo-cards { margin-top:24px; padding-top:20px; border-top:1px dashed var(--line); }
.demo-cards-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; font-size:13px; color:var(--ink-muted); }
.demo-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.demo-card { display:flex; align-items:center; gap:10px; padding:11px 12px; border-radius:11px; text-align:left;
  background:var(--surface-2); border:1px solid var(--line); transition:all .2s; }
.demo-card:hover { border-color:var(--brand-500); transform:translateY(-1px); }
.demo-card .ic { width:34px; height:34px; border-radius:9px; display:grid; place-items:center; font-size:15px; color:#fff; flex-shrink:0; }
.demo-card b { font-size:13px; font-family:'Kanit'; display:block; }
.demo-card small { font-size:11px; color:var(--ink-muted); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE NAV / RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
.mobile-drawer { position:fixed; inset:0; z-index:200; pointer-events:none; }
.mobile-drawer.is-open { pointer-events:auto; }
.mobile-drawer-bg { position:absolute; inset:0; background:rgba(8,16,31,.6); backdrop-filter:blur(4px); opacity:0; transition:opacity .3s; }
.mobile-drawer.is-open .mobile-drawer-bg { opacity:1; }
.mobile-drawer-panel { position:absolute; top:0; right:0; bottom:0; width:min(320px,84vw); background:var(--surface-solid);
  border-left:1px solid var(--line); padding:20px; transform:translateX(100%); transition:transform .3s var(--ease); overflow-y:auto; }
.mobile-drawer.is-open .mobile-drawer-panel { transform:translateX(0); }
.mobile-drawer-panel a { display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:11px; color:var(--ink-soft);
  font-family:'Kanit'; font-size:15px; }
.mobile-drawer-panel a:hover, .mobile-drawer-panel a.is-active { background:rgba(37,99,235,.12); color:var(--brand-300); }
.mobile-drawer-panel a i { color:var(--brand-400); width:22px; }
.mobile-drawer-close { width:40px; height:40px; border-radius:11px; border:1px solid var(--line); background:var(--surface-2);
  color:var(--ink); font-size:18px; margin-bottom:16px; }

@media (max-width:1160px){ .main-nav { display:none; } .nav-toggle { display:grid; } }
@media (max-width:640px){
  .nav-brand-text span { display:none; }
  .btn-download span { display:none; }
  .btn-download { padding:11px 13px; }
  .home-hero-stats { gap:18px; }
  .side-social { display:none; }
}

/* ═══════════ Inline Edit Tags (admin/editor only) ═══════════ */
.edit-tag { display:inline-flex; align-items:center; gap:6px; margin-left:10px; padding:4px 11px; border-radius:999px;
  font-family:'Kanit'; font-size:12px; font-weight:500; vertical-align:middle;
  color:#78350f; background:linear-gradient(135deg,var(--gold-300),var(--gold-500));
  box-shadow:0 4px 12px rgba(251,191,36,.4); transition:all .2s var(--ease); }
.edit-tag i { font-size:12px; }
.edit-tag span { max-width:0; overflow:hidden; white-space:nowrap; transition:max-width .3s var(--ease); }
.edit-tag:hover { transform:translateY(-1px); box-shadow:0 6px 16px rgba(251,191,36,.55); }
.edit-tag:hover span { max-width:160px; }
.edit-tag-float { position:absolute; top:14px; right:14px; z-index:6; }
.edit-tag-float span { max-width:160px; }               /* floating = โชว์ label เลย (mobile-friendly) */
@media (max-width:768px){ .edit-tag span { max-width:160px; } }

/* ═══════════ Skeleton loader (AJAX list) ═══════════ */
.skel-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:22px; }
.skel-card { border-radius:var(--radius); overflow:hidden; background:var(--surface); border:1px solid var(--line); }
.skel-card .sk-cover { aspect-ratio:16/10; }
.skel-card .sk-line { height:13px; margin:12px 16px; border-radius:6px; }
.skel-card .sk-line.short { width:55%; }
.sk-cover, .sk-line { background:linear-gradient(90deg, var(--surface-2) 25%, rgba(148,163,184,.14) 37%, var(--surface-2) 63%);
  background-size:400% 100%; animation:shimmer 1.4s ease infinite; }
@keyframes shimmer { 0%{ background-position:100% 0; } 100%{ background-position:-100% 0; } }
[data-ajax-list].is-loading { pointer-events:none; }

/* ═══════════ Timeline (ประสบการณ์การทำงาน) ═══════════ */
.timeline { position:relative; padding-left:8px; }
.timeline-item { position:relative; display:flex; gap:14px; padding:0 0 18px 22px; border-left:2px solid var(--line); }
.timeline-item:last-child { border-left-color:transparent; padding-bottom:0; }
.timeline-dot { position:absolute; left:-15px; top:0; width:28px; height:28px; border-radius:50%; display:grid; place-items:center;
  font-size:13px; color:#fff; background:linear-gradient(135deg,var(--brand-500),var(--brand-800)); border:3px solid var(--surface-solid); }
.timeline-item.is-now .timeline-dot { background:linear-gradient(135deg,var(--gold-400),var(--gold-600)); color:#422006;
  box-shadow:0 0 0 4px rgba(251,191,36,.2); }
.timeline-body { padding-top:1px; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE APP-STYLE (≤768px) — §13/§20
   ═══════════════════════════════════════════════════════════════ */
.m-app { display:none; }
.m-bottom-nav { display:none; }

@media (max-width:768px) {
  /* ── CSS-only switch: ซ่อน desktop โชว์ app ── */
  body.m-mobile-mode .topbar,
  body.m-mobile-mode .dt-home,
  body.m-mobile-mode .site-footer,
  body.m-mobile-mode .side-social { display:none !important; }
  body.m-mobile-mode .m-app { display:block; }

  /* bottom nav ทุกหน้า (mobile) + เว้นที่ให้เนื้อหา */
  .m-bottom-nav { display:flex; }
  body { padding-bottom:calc(70px + env(safe-area-inset-bottom)); }
  .to-top { bottom:calc(80px + env(safe-area-inset-bottom)); }

  /* ── App container ── */
  .m-app { min-height:100dvh; }
  .m-section { padding:0 14px; margin-top:22px; }
  .m-sec-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
  .m-sec-head h3, .m-section > .m-sec-head h3 { margin:0; font-size:16px; display:flex; align-items:center; gap:8px; font-family:'Kanit'; }
  .m-sec-head h3 i { color:var(--brand-400); }
  .m-sec-head a { font-size:13px; color:var(--brand-400); display:inline-flex; align-items:center; gap:3px; }

  /* 1. Header */
  .m-header { position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:calc(12px + env(safe-area-inset-top)) 16px 12px;
    background:linear-gradient(135deg, var(--brand-900), var(--brand-950)); color:#fff;
    box-shadow:0 6px 18px rgba(3,8,20,.35); }
  .m-header-brand { display:flex; align-items:center; gap:11px; min-width:0; }
  .m-header-logo { width:42px; height:42px; border-radius:12px; flex-shrink:0; display:grid; place-items:center; font-size:22px;
    background:linear-gradient(135deg, var(--brand-500), var(--brand-700)); box-shadow:0 4px 12px rgba(37,99,235,.5); }
  .m-header-text { min-width:0; }
  .m-greet { font-size:11.5px; color:var(--brand-200); display:block; }
  .m-header-text strong { font-family:'Kanit'; font-size:15px; font-weight:600; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:52vw; }
  .m-header-actions { display:flex; gap:8px; flex-shrink:0; }
  .m-icon-btn { width:40px; height:40px; border-radius:12px; border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.1);
    color:#fff; display:grid; place-items:center; font-size:17px; }
  .m-icon-btn:active { transform:scale(.92); }

  /* 2. Hero card */
  .m-hero { padding:14px 14px 0; }
  .m-hero-card { position:relative; border-radius:20px; overflow:hidden; aspect-ratio:16/10; display:flex; align-items:flex-end;
    background:linear-gradient(135deg, var(--brand-700), var(--brand-950)); box-shadow:var(--shadow); }
  .m-hero-card img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
  .m-hero-overlay { position:absolute; inset:0; background:linear-gradient(180deg, rgba(8,16,31,.15) 0%, transparent 30%, rgba(8,16,31,.9) 100%); }
  .m-hero-body { position:relative; z-index:2; padding:18px; }
  .m-hero-eyebrow { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color:var(--brand-200); font-family:'Kanit'; margin-bottom:6px; }
  .m-hero-body h2 { font-size:20px; color:#fff; margin:0 0 12px; line-height:1.3; text-shadow:0 2px 8px rgba(0,0,0,.5); }
  .m-hero-cta { display:inline-flex; align-items:center; gap:7px; padding:10px 18px; border-radius:999px; font-family:'Kanit'; font-size:14px;
    background:linear-gradient(135deg, var(--gold-400), var(--gold-600)); color:#422006; font-weight:500; box-shadow:0 6px 16px rgba(251,191,36,.4); }
  .m-hero-cta:active { transform:scale(.96); }

  /* 3. Stats 2x2 */
  .m-stats { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:16px 14px 0; }
  .m-stat { display:flex; align-items:center; gap:11px; padding:13px; border-radius:15px; background:var(--surface); border:1px solid var(--line); }
  .m-stat .ic { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; color:#fff; font-size:18px; flex-shrink:0; }
  .m-stat b { font-family:'Kanit'; font-size:21px; display:block; line-height:1; }
  .m-stat span { font-size:11px; color:var(--ink-muted); }

  /* 4. App menu grid */
  .m-menu-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px 6px; }
  .m-menu-item { display:flex; flex-direction:column; align-items:center; gap:7px; padding:6px 2px; }
  .m-menu-icon { width:56px; height:56px; border-radius:17px; display:grid; place-items:center; font-size:24px; color:#fff;
    box-shadow:0 6px 14px rgba(3,8,20,.3); transition:transform .18s var(--ease); }
  .m-menu-item:active .m-menu-icon { transform:scale(.9) rotate(-4deg); }
  .m-menu-label { font-size:11.5px; text-align:center; color:var(--ink-soft); line-height:1.2; }

  /* 5. Horizontal scroll works */
  .m-hscroll { display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:6px; margin:0 -14px; padding-inline:14px;
    scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  .m-hscroll::-webkit-scrollbar { display:none; }
  .m-work-card { flex:0 0 72%; max-width:260px; scroll-snap-align:start; border-radius:16px; overflow:hidden;
    background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-sm); }
  .m-work-card:active { transform:scale(.98); }
  .m-work-cover { position:relative; aspect-ratio:16/10; display:grid; place-items:center; color:rgba(255,255,255,.4); font-size:36px; overflow:hidden; }
  .m-work-cover img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
  .m-work-badge { position:absolute; top:9px; left:9px; z-index:2; padding:3px 9px; border-radius:7px; font-size:10.5px; font-family:'Kanit'; color:#fff; }
  .m-work-body { padding:11px 13px; }
  .m-work-body strong { font-family:'Kanit'; font-size:13.5px; font-weight:500; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.35; }
  .m-work-body small { color:var(--ink-muted); font-size:11.5px; display:flex; align-items:center; gap:4px; margin-top:5px; }

  /* 6. Services */
  .m-service-list { display:flex; flex-direction:column; gap:8px; }
  .m-service { display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:14px; background:var(--surface); border:1px solid var(--line); min-height:52px; }
  .m-service:active { background:var(--surface-2); }
  .m-service-ic { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; font-size:17px; color:var(--brand-300); background:rgba(37,99,235,.14); flex-shrink:0; }
  .m-service-label { flex:1; font-size:14px; font-family:'Kanit'; font-weight:500; }
  .m-service-arrow { color:var(--ink-muted); font-size:14px; }

  /* 7. News */
  .m-news { display:flex; flex-direction:column; gap:8px; }
  .m-news-item { display:flex; gap:12px; padding:12px 14px; border-radius:14px; background:var(--surface); border:1px solid var(--line); }
  .m-news-date { flex-shrink:0; width:46px; text-align:center; border-radius:11px; padding:7px 4px; color:#fff;
    background:linear-gradient(135deg, var(--brand-600), var(--brand-800)); }
  .m-news-date b { font-family:'Kanit'; font-size:17px; display:block; line-height:1; }
  .m-news-date span { font-size:10px; }
  .m-news-body strong { font-size:13.5px; font-family:'Kanit'; font-weight:500; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.35; }
  .m-news-body small { color:var(--ink-muted); font-size:11.5px; display:block; margin-top:3px; }

  /* 8. Footer card */
  .m-foot { padding:22px 14px 8px; }
  .m-foot-card { text-align:center; padding:24px 18px; border-radius:20px; background:linear-gradient(160deg, var(--brand-900), var(--brand-950)); color:#fff; }
  .m-foot-logo { width:52px; height:52px; border-radius:15px; margin:0 auto 12px; display:grid; place-items:center; font-size:26px;
    background:linear-gradient(135deg, var(--brand-500), var(--brand-700)); }
  .m-foot-card strong { font-family:'Kanit'; font-size:16px; display:block; }
  .m-foot-card p { font-size:12px; color:var(--brand-200); margin:6px 0 16px; line-height:1.6; }
  .m-foot-actions { display:flex; gap:8px; justify-content:center; margin-bottom:16px; }
  .m-foot-actions a { flex:1; max-width:100px; display:flex; flex-direction:column; align-items:center; gap:5px; padding:11px 4px; border-radius:13px;
    background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.15); font-size:11.5px; color:#fff; }
  .m-foot-actions a i { font-size:17px; }
  .m-foot-actions a:active { background:rgba(255,255,255,.2); }
  .m-copy { color:var(--brand-300); font-size:11px; }

  /* Bottom navigation + center FAB */
  .m-bottom-nav { position:fixed; bottom:0; left:0; right:0; z-index:60;
    background:rgba(11,20,40,.94); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
    border-top:1px solid var(--line); display:flex; justify-content:space-around; align-items:center;
    padding:6px 4px calc(6px + env(safe-area-inset-bottom)); }
  [data-theme="light"] .m-bottom-nav { background:rgba(255,255,255,.96); }
  .m-nav-item { position:relative; display:flex; flex-direction:column; align-items:center; gap:2px; padding:6px 8px;
    min-width:58px; min-height:46px; color:var(--ink-muted); background:none; border:none; font-family:'Sarabun'; }
  .m-nav-item i { font-size:19px; } .m-nav-item span { font-size:10.5px; }
  .m-nav-item.is-active { color:var(--brand-400); }
  .m-nav-item.is-active::before { content:""; position:absolute; top:-6px; left:50%; transform:translateX(-50%); width:24px; height:3px;
    border-radius:0 0 4px 4px; background:var(--gold-400); }
  .m-nav-item:active { transform:scale(.9); }
  .m-nav-fab-item { margin-top:-24px; }
  .m-nav-fab { width:56px; height:56px; border-radius:50%; display:grid; place-items:center; font-size:24px; color:#fff;
    background:linear-gradient(135deg, var(--brand-500), var(--brand-800)); border:4px solid var(--bg);
    box-shadow:0 8px 20px rgba(37,99,235,.5); }
  .m-nav-fab-item.is-active .m-nav-fab { background:linear-gradient(135deg, var(--gold-400), var(--gold-600)); color:#422006; }
  .m-nav-fab-item.is-active::before { display:none; }
  .m-nav-fab-label { font-size:10.5px; margin-top:3px; color:var(--brand-400); font-weight:600; }

  /* App-style buttons ทุกหน้า (mobile) — เต็มความกว้าง แตะง่าย */
  .page-hero { padding:22px 18px; }
  .btn { min-height:46px; }
  .btn-lg { width:100%; }
}

/* Reduce-motion เคารพผู้ใช้ */
@media (prefers-reduced-motion: reduce) {
  .m-menu-item:active .m-menu-icon, .m-hero-cta:active, .m-work-card:active, .m-nav-item:active { transform:none !important; }
}

/* ═══════════ Bottom Sheet Menu (mobile) ═══════════ */
.m-sheet { position:fixed; inset:0; z-index:120; pointer-events:none; }
.m-sheet.is-open { pointer-events:auto; }
.m-sheet-backdrop { position:absolute; inset:0; opacity:0; background:rgba(3,8,20,.6); backdrop-filter:blur(4px);
  transition:opacity .3s var(--ease); }
.m-sheet.is-open .m-sheet-backdrop { opacity:1; }
.m-sheet-content { position:absolute; bottom:0; left:0; right:0; max-height:86dvh; display:flex; flex-direction:column;
  background:var(--surface-solid); border-radius:26px 26px 0 0; border-top:1px solid var(--line-strong);
  transform:translateY(100%); transition:transform .32s var(--ease); box-shadow:0 -12px 40px rgba(3,8,20,.5);
  padding-bottom:calc(16px + env(safe-area-inset-bottom)); }
.m-sheet.is-open .m-sheet-content { transform:translateY(0); }
.m-sheet-handle { width:46px; height:5px; border-radius:3px; background:var(--line-strong); margin:10px auto 4px; flex-shrink:0; cursor:grab; }
.m-sheet-head { display:flex; align-items:center; justify-content:space-between; padding:6px 20px 12px; flex-shrink:0; }
.m-sheet-head h3 { margin:0; font-size:18px; font-family:'Kanit'; display:flex; align-items:center; gap:9px; }
.m-sheet-x { width:36px; height:36px; border-radius:11px; border:1px solid var(--line); background:var(--surface-2); color:var(--ink); font-size:16px; display:grid; place-items:center; }
.m-sheet-scroll { overflow-y:auto; padding:0 16px 8px; -webkit-overflow-scrolling:touch; }
.m-sheet-group { margin-bottom:14px; }
.m-sheet-group h4 { margin:6px 6px 8px; font-size:12px; letter-spacing:1px; text-transform:uppercase; color:var(--ink-muted); font-weight:700; }
.m-sheet-links { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.m-sheet-link { display:flex; align-items:center; gap:10px; padding:12px; border-radius:14px; background:var(--surface-2);
  border:1px solid var(--line); font-size:13.5px; font-family:'Kanit'; min-height:48px; }
.m-sheet-link:active { transform:scale(.96); background:rgba(37,99,235,.12); }
.m-sheet-link.is-active { border-color:var(--brand-500); background:rgba(37,99,235,.14); color:var(--brand-300); }
.m-sheet-link > span:nth-child(2) { flex:1; }
.m-sheet-link .bi-chevron-right { font-size:12px; color:var(--ink-muted); }
.m-sheet-ic { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; font-size:16px; color:var(--brand-300); background:rgba(37,99,235,.14); flex-shrink:0; }
.m-sheet-cta { display:flex; align-items:center; justify-content:center; gap:9px; padding:14px; border-radius:14px; margin-top:8px;
  font-family:'Kanit'; font-size:14.5px; color:#fff; background:linear-gradient(135deg,var(--brand-500),var(--brand-700)); box-shadow:0 8px 20px rgba(37,99,235,.4); }
.m-sheet-cta.ghost { background:var(--surface-2); color:var(--ink); border:1px solid var(--line-strong); box-shadow:none; }
.m-sheet-cta:active { transform:scale(.98); }

/* ═══════════ Install banner (PWA) ═══════════ */
.install-banner { position:fixed; left:16px; right:16px; bottom:16px; z-index:110; display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-radius:18px; background:var(--surface-solid); border:1px solid var(--line-strong);
  box-shadow:var(--shadow-lg); opacity:0; transform:translateY(20px); transition:opacity .35s var(--ease), transform .35s var(--ease); }
.install-banner.show { opacity:1; transform:translateY(0); }
.install-ic { width:46px; height:46px; border-radius:13px; overflow:hidden; flex-shrink:0; box-shadow:0 4px 12px rgba(37,99,235,.4); }
.install-ic img { width:100%; height:100%; object-fit:cover; }
.install-text { flex:1; min-width:0; }
.install-text strong { display:block; font-family:'Kanit'; font-size:14.5px; }
.install-text small { color:var(--ink-muted); font-size:12px; }
.install-text small .bi { color:var(--brand-400); }
.install-btn { flex-shrink:0; padding:10px 18px; border-radius:12px; border:none; font-family:'Kanit'; font-size:14px; color:#fff;
  background:linear-gradient(135deg,var(--brand-500),var(--brand-700)); box-shadow:0 6px 16px rgba(37,99,235,.4); }
.install-btn:active { transform:scale(.95); }
.install-x { flex-shrink:0; width:32px; height:32px; border-radius:10px; border:1px solid var(--line); background:var(--surface-2);
  color:var(--ink-muted); font-size:13px; display:grid; place-items:center; }
@media (min-width:721px){ .install-banner { left:auto; right:22px; max-width:400px; } }
@media (max-width:768px){ .install-banner { bottom:calc(78px + env(safe-area-inset-bottom)); } } /* เหนือ bottom-nav */

/* ═══════════ Offline page ═══════════ */
.offline-wrap { min-height:70vh; display:grid; place-items:center; padding:40px 0; }
.offline-card { position:relative; overflow:hidden; max-width:520px; width:100%; text-align:center; padding:48px 32px; }
.offline-glow { position:absolute; top:-30%; left:50%; transform:translateX(-50%); width:280px; height:280px; border-radius:50%;
  background:radial-gradient(circle, rgba(37,99,235,.28), transparent 65%); filter:blur(30px); pointer-events:none; }
.offline-ic { position:relative; width:88px; height:88px; border-radius:26px; margin:0 auto 22px; display:grid; place-items:center; font-size:42px;
  color:#fff; background:linear-gradient(135deg,var(--brand-600),var(--brand-900)); box-shadow:0 14px 34px rgba(37,99,235,.4); }
.offline-card h2 { position:relative; font-size:24px; margin:0 0 10px; }
.offline-card > p { position:relative; color:var(--ink-muted); margin:0 0 24px; line-height:1.7; }
.offline-links { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:28px; }
.offline-links a { display:flex; align-items:center; gap:10px; padding:13px 14px; border-radius:14px; background:var(--surface-2);
  border:1px solid var(--line); font-family:'Kanit'; font-size:14px; text-align:left; }
.offline-links a:hover { border-color:var(--brand-500); color:var(--brand-300); }
.offline-links a span { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; color:var(--brand-300); background:rgba(37,99,235,.14); }
.offline-status { display:inline-flex; align-items:center; gap:8px; margin-top:22px; font-size:13px; color:var(--ink-muted); }
.offline-status .dot { width:9px; height:9px; border-radius:50%; background:var(--c-amber); animation:pulse 1.6s infinite; }
.offline-status.is-online .dot { background:var(--c-green); }
