/* TNK App Store — "Aurora Glass" in blue / green / red */
:root {
  --brand: #2563EB; --brand2: #16A34A; --red: #DC2626; --amber: #D97706;
  --brand-dk: #1E40AF; --brand-lt: #EFF6FF;
  --ink: #0F172A; --ink-2: #475569; --ink-3: #94A3B8;
  --line: rgba(15,23,42,.09); --bg: #F3F6FC; --surface: #FFFFFF;
  --glass: rgba(255,255,255,.72); --glass-strong: rgba(255,255,255,.94); --glass-brd: rgba(255,255,255,.75);
  --field: rgba(255,255,255,.85); --field-brd: rgba(15,23,42,.12);
  --ok: #059669; --ok-lt: #ECFDF5; --warn-lt: #FFFBEB; --bad-lt: #FEF2F2; --info-lt: #EFF6FF;
  --r: 14px; --r-lg: 22px; --r-xl: 28px;
  --sh-card: 0 1px 1px rgba(15,23,42,.04), 0 10px 26px -10px rgba(15,23,42,.12), 0 26px 50px -24px rgba(37,99,235,.20);
  --sh-up: 0 2px 2px rgba(15,23,42,.05), 0 18px 36px -12px rgba(15,23,42,.18), 0 34px 60px -26px rgba(37,99,235,.32);
  --font: 'Inter', 'Noto Sans Thai', -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Noto Sans Thai', 'Inter', sans-serif;
  --aurora:
    radial-gradient(60vmax 50vmax at 4% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 62%),
    radial-gradient(54vmax 46vmax at 104% 0%, color-mix(in srgb, var(--brand2) 20%, transparent), transparent 62%),
    radial-gradient(48vmax 42vmax at 78% 112%, color-mix(in srgb, var(--red) 11%, transparent), transparent 62%);
}
:root[data-theme="dark"] {
  --brand: #60A5FA; --brand2: #4ADE80; --red: #F87171; --amber: #FBBF24; --brand-lt: rgba(96,165,250,.14);
  --ink: #E8EDF7; --ink-2: #A7B3C8; --ink-3: #6B7A93; --line: rgba(255,255,255,.09); --bg: #0A1020; --surface: #131B2E;
  --glass: rgba(24,33,54,.66); --glass-strong: rgba(19,27,46,.95); --glass-brd: rgba(255,255,255,.08);
  --field: rgba(10,16,32,.6); --field-brd: rgba(255,255,255,.14);
  --ok: #4ADE80; --ok-lt: rgba(74,222,128,.12); --warn-lt: rgba(251,191,36,.12); --bad-lt: rgba(248,113,113,.13); --info-lt: rgba(96,165,250,.14);
  --sh-card: 0 1px 1px rgba(0,0,0,.35), 0 14px 34px -12px rgba(0,0,0,.55);
  --sh-up: 0 18px 44px -14px rgba(0,0,0,.7);
  --aurora:
    radial-gradient(60vmax 50vmax at 4% -10%, rgba(37,99,235,.28), transparent 62%),
    radial-gradient(54vmax 46vmax at 104% 0%, rgba(22,163,74,.2), transparent 62%),
    radial-gradient(48vmax 42vmax at 78% 112%, rgba(220,38,38,.14), transparent 62%);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh; position: relative; overflow-x: hidden;
}
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--aurora); }
button { font-family: inherit; }
a { color: var(--brand); }
[hidden] { display: none !important; }
.i { width: 1.15em; height: 1.15em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--field-brd); background: var(--glass-strong); color: var(--ink); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s, border-color .2s; white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--brand) 40%, var(--field-brd)); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--brand2))); color: #fff; border-color: transparent; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--brand) 80%, transparent); }
:root[data-theme="dark"] .btn-primary { color: #06101F; }
.btn-primary:hover { box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--brand) 90%, transparent); }
.btn-ok { background: linear-gradient(135deg, var(--brand2), color-mix(in srgb, var(--brand2) 70%, var(--brand))); color: #fff; border-color: transparent; }
:root[data-theme="dark"] .btn-ok { color: #06140B; }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--bad-lt); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 14px; position: relative; }
.btn-icon .i { width: 19px; height: 19px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--glass); }
.dot-badge {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--red);
  color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); font-family: var(--font-display);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1280px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 10px) 18px 10px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: 0 0 auto; background: none; border: none; cursor: pointer; padding: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: conic-gradient(from 210deg at 50% 50%, var(--brand), var(--brand2), var(--red) 70%, var(--brand));
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.4);
  position: relative;
}
.brand-mark::after { content: ''; position: absolute; inset: 3px; border-radius: 11px; background: color-mix(in srgb, var(--brand-dk) 55%, #0b1026); opacity: .88; }
.brand-mark .i { position: relative; z-index: 1; width: 20px; height: 20px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -.4px; line-height: 1.1; text-align: left; }
.brand-name small { display: block; font-weight: 600; font-size: 10.5px; color: var(--ink-2); letter-spacing: 0; margin-top: 2px; }
.search {
  flex: 1 1 auto; max-width: 620px; margin: 0 auto; position: relative; display: flex; align-items: center;
}
.search .i { position: absolute; left: 15px; color: var(--ink-3); width: 18px; height: 18px; pointer-events: none; }
.search input {
  width: 100%; height: 44px; border-radius: 999px; border: 1px solid var(--field-brd); background: var(--field); color: var(--ink);
  padding: 0 52px 0 44px; font-size: 15px; font-family: inherit; transition: box-shadow .2s, border-color .2s; -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
.search kbd {
  position: absolute; right: 12px; font-family: var(--font); font-size: 11px; font-weight: 700; color: var(--ink-3); border: 1px solid var(--field-brd);
  border-radius: 7px; padding: 1px 7px; background: var(--glass);
}
.search .clear { position: absolute; right: 8px; width: 30px; height: 30px; border-radius: 99px; border: none; background: transparent; color: var(--ink-3); cursor: pointer; display: none; place-items: center; }
.search .clear .i { position: static; width: 16px; height: 16px; }
.search.has-text .clear { display: grid; }
.search.has-text kbd { display: none; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.avatar {
  width: 40px; height: 40px; border-radius: 14px; border: 0; cursor: pointer; font-family: var(--font-display); font-weight: 800; font-size: 15px;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand2)); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand) 80%, transparent);
}
:root[data-theme="dark"] .avatar { color: #06101F; }
.menu {
  position: absolute; right: 18px; top: calc(100% + 6px); width: 270px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--sh-up); padding: 8px; z-index: 60; animation: pop .16s ease-out;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; font-family: var(--font-display); font-size: 15px; }
.menu .who span { display: block; font-size: 12px; color: var(--ink-2); word-break: break-all; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; border-radius: 12px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--info-lt); }
.menu button .i { color: var(--brand); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- layout ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 18px 80px; }
.hero {
  margin: 18px 0 8px; padding: 30px 30px 26px; border-radius: 32px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #1D4ED8 0%, #2563EB 38%, #0E9F6E 100%); box-shadow: 0 30px 60px -28px color-mix(in srgb, var(--brand) 80%, transparent);
}
.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 260px at 92% -10%, rgba(255,255,255,.34), transparent 70%), radial-gradient(rgba(255,255,255,.2) 1px, transparent 1.6px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,.35), #000); mask-image: linear-gradient(100deg, rgba(0,0,0,.35), #000); }
.hero::after { content: ''; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(220,38,38,.55), transparent 68%); filter: blur(10px); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-family: var(--font-display); font-size: clamp(24px, 4.6vw, 38px); font-weight: 800; letter-spacing: -1px; line-height: 1.12; margin: 0 0 8px; max-width: 640px; }
.hero p { margin: 0 0 18px; font-size: 15px; opacity: .92; max-width: 560px; }
.hero-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.34);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-size: 13px; font-weight: 600;
}
.hero-chip b { font-family: var(--font-display); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero .btn { background: #fff; color: #1D4ED8; border-color: transparent; }
.hero .btn:hover { box-shadow: 0 12px 26px -10px rgba(0,0,0,.45); }

.sec-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 2px 12px; }
.sec-hd h2 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -.3px; display: flex; align-items: center; gap: 9px; }
.sec-hd h2 .i { color: var(--brand); }
.sec-hd .muted { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }

/* spotlight (featured) */
.spots { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 18px; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.spots::-webkit-scrollbar { display: none; }
.spot {
  --c: #2563EB; flex: 0 0 min(340px, 84vw); scroll-snap-align: start; border-radius: 26px; padding: 20px; color: #fff; cursor: pointer; position: relative; overflow: hidden; text-align: left; border: 0;
  background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); box-shadow: 0 22px 40px -22px color-mix(in srgb, var(--c) 90%, transparent);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; display: flex; flex-direction: column; gap: 6px; min-height: 176px;
}
.spot::before { content: ''; position: absolute; inset: 0; background: radial-gradient(220px 160px at 90% -10%, rgba(255,255,255,.3), transparent 70%); pointer-events: none; }
.spot:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 30px 50px -22px color-mix(in srgb, var(--c) 95%, transparent); }
.spot .ico { width: 54px; height: 54px; border-radius: 18px; font-size: 28px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.4); display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.spot .ico img { width: 100%; height: 100%; object-fit: cover; }
.spot h3 { margin: 6px 0 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.spot p { margin: 0; font-size: 13px; opacity: .9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spot .go { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; padding-top: 8px; }
.spot .go span { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,.2); padding: 5px 11px; border-radius: 99px; }
.spot .tag-top { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.22); padding: 3px 10px; border-radius: 99px; display: flex; align-items: center; gap: 5px; }

/* recents */
.recents { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.recents::-webkit-scrollbar { display: none; }
.rchip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 99px; background: var(--glass); border: 1px solid var(--glass-brd); box-shadow: var(--sh-card); cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; transition: transform .15s; }
.rchip:hover { transform: translateY(-2px); }
.rchip .ico { width: 30px; height: 30px; border-radius: 10px; font-size: 16px; }

/* filters */
.filters { position: sticky; top: 64px; z-index: 30; margin: 0 -18px; padding: 10px 18px 6px; background: linear-gradient(var(--bg) 70%, transparent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--field-brd); background: var(--glass-strong); color: var(--ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .18s;
}
.chip:hover { border-color: var(--brand); }
.chip .n { font-size: 11px; font-weight: 800; color: var(--ink-2); background: var(--info-lt); padding: 1px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.chip.on { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--brand2))); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand) 90%, transparent); }
:root[data-theme="dark"] .chip.on { color: #06101F; }
.chip.on .n { background: rgba(255,255,255,.26); color: inherit; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 2px 6px; }
.seg { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.seg button .n { font-size: 10.5px; background: var(--red); color: #fff; border-radius: 99px; padding: 0 6px; font-weight: 800; }
.tools { display: flex; gap: 8px; align-items: center; }
select.sel, .field select {
  border: 1px solid var(--field-brd); background: var(--field); color: var(--ink); border-radius: 99px; padding: 8px 14px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--brand); width: 16px; height: 16px; }
.count { font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 6px 4px 0; }

/* ---------- app cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; padding-top: 6px; }
.ico {
  --c: #2563EB; width: 56px; height: 56px; border-radius: 18px; flex: 0 0 auto; display: grid; place-items: center; font-size: 28px; color: #fff; overflow: hidden; line-height: 1;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 58%, #000)); box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--c) 90%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  font-family: var(--font-display); font-weight: 800;
}
.ico img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.ico.txt { font-size: 24px; }
.card {
  background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); border: 1px solid var(--glass-brd); border-radius: 24px;
  padding: 16px; box-shadow: var(--sh-card); display: flex; flex-direction: column; gap: 10px; cursor: pointer; position: relative; text-align: left;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; animation: cardIn .45s both; animation-delay: calc(var(--i, 0) * 28ms); content-visibility: auto; contain-intrinsic-size: 190px;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-up); }
.card .row1 { display: flex; gap: 12px; align-items: flex-start; }
.card .meta { min-width: 0; flex: 1; padding-top: 1px; }
.card h3 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: -.25px; line-height: 1.25; overflow-wrap: anywhere; }
.card .team { font-size: 12px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .tag { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.card .stats { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.card .stats .i { width: 13px; height: 13px; }
.star-c { color: #F59E0B; }
.fav {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; transition: all .15s;
}
.fav:hover { background: var(--bad-lt); color: var(--red); }
.fav.on { color: var(--red); } .fav.on .i { fill: currentColor; }
.fav.pop { animation: heart .35s; }
@keyframes heart { 40% { transform: scale(1.35); } }
.card .row1 .meta { padding-right: 30px; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--info-lt); color: var(--brand); white-space: nowrap; }
.badge.ok { background: var(--ok-lt); color: var(--ok); }
.badge.warn { background: var(--warn-lt); color: var(--amber); }
.badge.bad { background: var(--bad-lt); color: var(--red); }
.badge.gray { background: color-mix(in srgb, var(--ink-3) 18%, transparent); color: var(--ink-2); }
.badge .i { width: 11px; height: 11px; }
.new-ribbon { background: linear-gradient(135deg, var(--red), #F97316); color: #fff; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 56px 16px; color: var(--ink-2); }
.empty .big { font-size: 54px; margin-bottom: 8px; filter: drop-shadow(0 10px 14px rgba(37,99,235,.25)); animation: bob 3.4s ease-in-out infinite; }
.empty h3 { margin: 0 0 6px; font-family: var(--font-display); color: var(--ink); font-size: 18px; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.skel { background: linear-gradient(100deg, var(--glass) 30%, color-mix(in srgb, var(--brand) 12%, var(--glass)) 50%, var(--glass) 70%) 0 0 / 220% 100%; animation: shimmer 1.3s linear infinite; border-radius: 22px; min-height: 164px; border: 1px solid var(--glass-brd); }
@keyframes shimmer { to { background-position: -120% 0; } }
.more { display: flex; justify-content: center; padding: 22px 0 4px; }

/* ---------- drawer ---------- */
.back { position: fixed; inset: 0; z-index: 80; background: rgba(8,13,28,.5); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity .22s; }
.back.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 90; right: 0; top: 0; bottom: 0; width: min(560px, 100vw); background: var(--glass-strong); border-left: 1px solid var(--line);
  box-shadow: -30px 0 70px -30px rgba(0,0,0,.45); transform: translateX(104%); transition: transform .32s cubic-bezier(.2,.85,.25,1); display: flex; flex-direction: column;
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.drawer.show { transform: none; }
.dr-hd { --c: #2563EB; padding: calc(env(safe-area-inset-top) + 18px) 20px 18px; position: relative; color: #fff; background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 52%, #000)); overflow: hidden; flex: 0 0 auto; }
.dr-hd::before { content: ''; position: absolute; inset: 0; background: radial-gradient(260px 180px at 95% -20%, rgba(255,255,255,.34), transparent 70%), radial-gradient(rgba(255,255,255,.18) 1px, transparent 1.6px) 0 0 / 20px 20px; -webkit-mask-image: linear-gradient(180deg, #000, rgba(0,0,0,.2)); mask-image: linear-gradient(180deg, #000, rgba(0,0,0,.2)); pointer-events: none; }
.dr-hd > * { position: relative; }
.dr-top { display: flex; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.dr-top .btn-icon { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dr-top .btn-icon.on { color: #fff; background: var(--red); border-color: transparent; } .dr-top .btn-icon.on .i { fill: currentColor; }
.dr-id { display: flex; gap: 14px; align-items: center; }
.dr-id .ico { width: 72px; height: 72px; border-radius: 24px; font-size: 38px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45); }
.dr-id h2 { margin: 0; font-family: var(--font-display); font-size: 23px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; overflow-wrap: anywhere; }
.dr-id p { margin: 3px 0 0; font-size: 13.5px; opacity: .92; }
.dr-badges { margin-top: 12px; }
.dr-badges .badge { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.dr-bd { flex: 1; overflow-y: auto; padding: 18px 20px 28px; -webkit-overflow-scrolling: touch; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cta .btn-lg { flex: 1 1 200px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 18px; }
.fact { background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.fact b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fact span { font-size: 11.5px; color: var(--ink-2); }
.dr-bd h4 { margin: 20px 0 8px; font-family: var(--font-display); font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.dr-bd h4 .i { color: var(--brand); }
.about { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); font-size: 14.5px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tagrow span { font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 99px; background: var(--info-lt); color: var(--brand); cursor: pointer; }
.owner-row { display: flex; flex-wrap: wrap; gap: 8px; }
.owner { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.owner i { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.note { padding: 12px 14px; border-radius: 16px; font-size: 13.5px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.note .i { margin-top: 2px; }
.note.info { background: var(--info-lt); color: var(--brand-dk); } :root[data-theme="dark"] .note.info { color: var(--brand); }
.note.warn { background: var(--warn-lt); color: #92400E; } :root[data-theme="dark"] .note.warn { color: var(--amber); }
.note.bad { background: var(--bad-lt); color: #991B1B; } :root[data-theme="dark"] .note.bad { color: var(--red); }
.note.ok { background: var(--ok-lt); color: #065F46; } :root[data-theme="dark"] .note.ok { color: var(--ok); }
.reqbox { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 14px; margin-bottom: 16px; }
.reqbox h4 { margin-top: 0 !important; }

.stars { display: inline-flex; gap: 2px; }
.stars .i { width: 15px; height: 15px; color: #CBD5E1; }
.stars .i.f { color: #F59E0B; fill: currentColor; }
.rate-pick { display: inline-flex; gap: 4px; }
.rate-pick button { border: 0; background: transparent; cursor: pointer; padding: 2px; color: #CBD5E1; }
.rate-pick button .i { width: 28px; height: 28px; transition: transform .12s; }
.rate-pick button:hover .i { transform: scale(1.18); }
.rate-pick button.f { color: #F59E0B; } .rate-pick button.f .i { fill: currentColor; }
.review { padding: 12px 0; border-top: 1px solid var(--line); }
.review:first-child { border-top: 0; }
.review .rh { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.review .rh span { color: var(--ink-3); font-weight: 500; font-size: 11.5px; }
.review p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.review.mine { background: var(--info-lt); border-radius: 14px; padding: 10px 12px; border-top: 0; margin: 4px 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 95; display: none; align-items: center; justify-content: center; padding: 18px; }
.modal.show { display: flex; }
.modal-card { width: 100%; max-width: 640px; max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); background: var(--glass-strong); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--sh-up); display: flex; flex-direction: column; animation: pop .22s ease-out; overflow: hidden; -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.modal-card.wide { max-width: 1020px; }
.modal-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-hd h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; }
.modal-hd h3 .i { color: var(--brand); width: 22px; height: 22px; }
.modal-bd { padding: 6px 20px 18px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal-ft { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 900px) { .editor.with-preview { grid-template-columns: minmax(0, 1fr) 300px; } }
.preview-col { position: sticky; top: 0; align-self: start; }
.preview-col .card { cursor: default; animation: none; } .preview-col .card:hover { transform: none; }
.preview-col small { display: block; margin-bottom: 8px; color: var(--ink-2); font-weight: 700; font-size: 12px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fgrid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin: 0 0 5px 2px; }
.field label em { font-style: normal; color: var(--red); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--field-brd); background: var(--field); color: var(--ink); border-radius: 14px; padding: 10px 13px; font-size: 14.5px; font-family: inherit; -webkit-appearance: none; appearance: none;
}
.field select { padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; border-radius: 14px; }
.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin: 4px 2px 0; }
.field .cc { text-align: right; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 26px; height: 26px; border-radius: 99px; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--field-brd); cursor: pointer; padding: 0; }
.swatches button.on { box-shadow: 0 0 0 2.5px var(--brand); }
.swatches input[type=color] { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; border-radius: 99px; cursor: pointer; }
.err { color: var(--red); font-size: 13px; font-weight: 600; min-height: 18px; padding: 8px 2px 0; }

/* inbox rows */
.irow { padding: 14px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); margin-bottom: 10px; }
.irow .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.irow .who { font-weight: 800; font-size: 14.5px; font-family: var(--font-display); }
.irow .who small { font-weight: 600; font-size: 12px; color: var(--ink-2); font-family: var(--font); }
.irow .app { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--brand); margin: 4px 0; cursor: pointer; background: none; border: 0; padding: 0; }
.irow .reason { font-size: 14px; color: var(--ink-2); background: var(--info-lt); border-radius: 14px; padding: 9px 12px; margin: 6px 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.irow .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.irow .acts input { flex: 1 1 200px; border: 1px solid var(--field-brd); background: var(--field); color: var(--ink); border-radius: 99px; padding: 8px 14px; font-size: 13.5px; font-family: inherit; }
.irow time { font-size: 11.5px; color: var(--ink-3); }

/* admin */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.kpi b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.kpi.alert b { color: var(--red); }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
.panel h5 { margin: 0 0 10px; font-size: 13.5px; font-family: var(--font-display); font-weight: 800; }
.bar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 34px; gap: 8px; align-items: center; font-size: 12.5px; margin: 7px 0; }
.bar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar .tr { height: 9px; border-radius: 99px; background: color-mix(in srgb, var(--ink-3) 18%, transparent); overflow: hidden; }
.bar .tr i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand2)); transform-origin: left; animation: grow .7s cubic-bezier(.2,.8,.2,1) both; }
.bar .v { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
@keyframes grow { from { transform: scaleX(0); } }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 84px; }
.spark i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--brand), var(--brand2)); min-height: 3px; animation: up .6s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; position: relative; }
.spark i.z { background: color-mix(in srgb, var(--ink-3) 30%, transparent); }
@keyframes up { from { transform: scaleY(0); } }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-size: 11px; color: var(--ink-2); padding: 6px 8px; position: sticky; top: 0; background: var(--glass-strong); }
.tbl td { padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.tbl td:first-child { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tbl-wrap { max-height: 52vh; overflow: auto; border-radius: 14px; border: 1px solid var(--line); }
.catrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; }
.catrow .e { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: var(--c, #64748B); color: #fff; }
.catrow b { flex: 1; font-size: 14px; }
.catrow small { color: var(--ink-3); font-weight: 700; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 24px); z-index: 200; background: #0F172A; color: #fff; padding: 12px 18px; border-radius: 99px;
  font-size: 14px; font-weight: 600; box-shadow: 0 20px 40px -12px rgba(0,0,0,.5); opacity: 0; transition: all .28s cubic-bezier(.2,.85,.25,1); pointer-events: none; max-width: min(92vw, 520px);
  display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #991B1B; } .toast.ok .i { color: #4ADE80; }

/* ---------- login + loader ---------- */
.login { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); overflow: hidden; }
.login::before { content: ''; position: absolute; inset: 0; background: var(--aurora); }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; pointer-events: none; }
.orb.a { width: 46vmax; height: 46vmax; background: var(--brand); left: -14vmax; top: -14vmax; animation: drift1 20s ease-in-out infinite alternate; }
.orb.b { width: 40vmax; height: 40vmax; background: var(--brand2); right: -12vmax; bottom: -12vmax; animation: drift2 24s ease-in-out infinite alternate; }
.orb.c { width: 26vmax; height: 26vmax; background: var(--red); right: 18vmax; top: 8vmax; opacity: .22; animation: drift1 28s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(18vmax, 14vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vmax, -12vmax) scale(1.1); } }
.login-card { position: relative; width: 100%; max-width: 400px; padding: 34px 26px 26px; text-align: center; background: var(--glass-strong); border: 1px solid var(--glass-brd); border-radius: 34px; box-shadow: var(--sh-up); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.login-card .brand-mark { margin: 0 auto 14px; width: 62px; height: 62px; border-radius: 22px; }
.login-card .brand-mark::after { inset: 4px; border-radius: 18px; }
.login-card .brand-mark .i { width: 30px; height: 30px; }
.login-card h1 { font-family: var(--font-display); font-size: 25px; letter-spacing: -.7px; font-weight: 800; margin: 0 0 4px; }
.login-card p { margin: 0 0 20px; font-size: 13.5px; color: var(--ink-2); }
.gsi-slot { display: flex; justify-content: center; min-height: 44px; }
.login-msg { margin-top: 14px; font-size: 13px; color: var(--ink-2); min-height: 18px; }
.login-msg.err { color: var(--red); font-weight: 700; }
.loader { display: none; }
.login-card.loading .loader { display: block; }
.login-card.loading .brand-mark, .login-card.loading h1, .login-card.loading > p, .login-card.loading .login-msg { display: none; }
.login-card.loading .gsi-slot { position: absolute; visibility: hidden; height: 0; min-height: 0; overflow: hidden; }
.ld-ring { position: relative; width: 92px; height: 92px; margin: 0 auto 14px; }
.ld-ring i { position: absolute; border-radius: 50%; border: 4px solid transparent; }
.ld-ring .r1 { inset: 0; border-top-color: #2563EB; border-right-color: #60A5FA; animation: ldSpin 1.15s cubic-bezier(.55,.2,.35,.8) infinite; }
.ld-ring .r2 { inset: 11px; border-bottom-color: #16A34A; border-left-color: #4ADE80; animation: ldSpin .9s linear infinite reverse; }
.ld-ring .r3 { inset: 22px; border: 3px solid #FEE2E2; border-top-color: #DC2626; animation: ldSpin 1.6s linear infinite; opacity: .85; }
.ld-ring .ld-ico { position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); animation: ldBob 2s ease-in-out infinite; }
.ld-ring .ld-ico .i { width: 26px; height: 26px; }
@keyframes ldSpin { to { transform: rotate(360deg); } }
@keyframes ldBob { 50% { transform: translateY(-3px) scale(1.06); } }
.ld-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.ld-hint { font-size: 12.5px; color: var(--ink-2); min-height: 18px; margin-top: 4px; }
.ld-bar { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--ink-3) 22%, transparent); margin: 14px auto 0; max-width: 200px; overflow: hidden; }
.ld-bar i { display: block; width: 40%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2563EB, #16A34A, #DC2626); animation: ldSlide 1.3s ease-in-out infinite; }
@keyframes ldSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .topbar-in { flex-wrap: wrap; gap: 8px 10px; padding-bottom: 8px; }
  .brand-name small { display: none; }
  .search { order: 3; flex: 1 0 100%; max-width: none; }
  .top-actions { margin-left: auto; }
  .top-actions .btn-label { display: none; }
  .hero { padding: 22px 18px 20px; border-radius: 26px; }
  .filters { position: static; background: none; padding-top: 4px; }
  .grid { grid-template-columns: 1fr; }
  .drawer { top: auto; height: 92vh; height: 92dvh; width: 100vw; border-radius: 28px 28px 0 0; transform: translateY(104%); border-left: 0; }
  .drawer.show { transform: none; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card { max-width: none; border-radius: 28px 28px 0 0; max-height: 94vh; max-height: 94dvh; }
  .menu { right: 10px; }
  .toolbar .tools { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* in-app browser screen (LINE etc.) */
.iab-screen { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; background: #0B1026; overflow-y: auto; }
.iab-card { width: 100%; max-width: 380px; background: #fff; color: #111827; border-radius: 28px; padding: 28px 22px 22px; text-align: center; box-shadow: 0 40px 80px -24px rgba(0,0,0,.6); font-family: var(--font); }
.iab-card .iab-ic { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2563EB, #16A34A); }
.iab-card .iab-ic .i { width: 30px; height: 30px; }
.iab-card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.iab-card p { margin: 0 0 14px; font-size: 13.5px; color: #4B5563; line-height: 1.55; }
.iab-card ol { text-align: left; margin: 0 0 16px; padding: 12px 14px 12px 32px; background: #F3F4F6; border-radius: 14px; font-size: 13px; color: #374151; line-height: 1.7; }
.iab-btn { display: block; width: 100%; padding: 13px 16px; margin-top: 8px; border: none; border-radius: 999px; font-family: var(--font); font-size: 14.5px; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.iab-btn.main { background: linear-gradient(135deg, #2563EB, #16A34A); color: #fff; box-shadow: 0 12px 24px -10px rgba(37,99,235,.7); }
.iab-btn.alt { background: #F3F4F6; color: #111827; }
.iab-skip { display: block; margin: 14px auto 0; background: none; border: none; color: #6B7280; font-size: 12px; text-decoration: underline; cursor: pointer; font-family: var(--font); }
.iab-ok { color: #16A34A; font-size: 12px; font-weight: 700; min-height: 16px; margin-top: 6px; }
