/* ============================================
   haziman.com/kahwin/galeri — Guest Gallery
   Mobile-first. Palette follows kahwin.css
   ============================================ */

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

:root {
    --bg: #faf6f0;
    --bg-2: #f0e8dc;
    --card: #fffdf9;
    --ink: #2d2018;
    --muted: #7a6555;
    --faint: #b8a898;
    --gold: #b8954a;
    --gold-lt: #d4b070;
    --line: rgba(184, 149, 74, 0.22);
    --danger: #b3412e;
    --font-d: 'Cormorant Garamond', Georgia, serif;
    --font-b: 'Inter', system-ui, -apple-system, sans-serif;
    --r: 14px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-b); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.is-locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.gl-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); }

/* ---------- Buttons ---------- */
.gl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .15s, opacity .15s, background .15s; }
.gl-btn:active { transform: scale(.97); }
.gl-btn:disabled { opacity: .45; cursor: default; }
.gl-btn--primary { background: var(--ink); color: #fff; }
.gl-btn--ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.gl-btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.gl-btn--block { width: 100%; }
.gl-linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: inherit; padding: 0; cursor: pointer; }
.gl-icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: var(--muted); }
.gl-icon-btn--light { color: #fff; font-size: 24px; }
.gl-alert { background: #fbeee9; border: 1px solid #efc9bd; color: #8a3423; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 16px 0; text-align: left; }

/* ---------- Avatars ---------- */
.gl-av, .gl-avatar-fallback { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-2); }
.gl-avatar-fallback { display: grid; place-items: center; font-weight: 600; font-size: 14px; color: var(--gold); border: 1px solid var(--line); }

/* =====================================================
   AUTH / LANDING
   ===================================================== */
.gl-auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b)); background: radial-gradient(120% 70% at 50% 0%, #fff 0%, var(--bg) 45%, var(--bg-2) 100%); }
.gl-auth__card { width: 100%; max-width: 420px; text-align: center; }
.gl-auth__bismillah { font-size: 20px; color: var(--gold); margin-bottom: 22px; }
.gl-auth__photos { position: relative; height: 190px; margin: 0 auto 26px; max-width: 300px; }
.gl-auth__photos img { position: absolute; width: 118px; height: 150px; object-fit: cover; border-radius: 12px; border: 4px solid #fff; box-shadow: 0 10px 30px rgba(45,32,24,.16); }
.gl-auth__photos img:nth-child(1) { left: 6px; top: 26px; transform: rotate(-8deg); }
.gl-auth__photos img:nth-child(2) { left: 50%; top: 0; transform: translateX(-50%); z-index: 2; width: 128px; height: 168px; }
.gl-auth__photos img:nth-child(3) { right: 6px; top: 26px; transform: rotate(8deg); }
.gl-auth__names { font-family: var(--font-d); font-size: clamp(40px, 12vw, 54px); font-weight: 600; line-height: 1.05; margin: 8px 0 14px; letter-spacing: -.01em; }
.gl-auth__names span { color: var(--gold); font-style: italic; font-weight: 500; }
.gl-auth__lead { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.gl-google { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 54px; border-radius: 999px; background: #fff; border: 1px solid #dadce0; color: #1f1f1f; font-weight: 600; font-size: 16px; text-decoration: none; box-shadow: 0 2px 10px rgba(45,32,24,.08); transition: transform .15s, box-shadow .15s; }
.gl-google:active { transform: scale(.98); }
.gl-auth__fine { font-size: 12px; color: var(--faint); margin: 18px 0 26px; }
.gl-auth__back { font-size: 13px; color: var(--gold); text-decoration: none; }
.gl-inapp { display: flex; flex-direction: column; gap: 10px; align-items: center; background: #fff7e6; border: 1px solid #f0d9a8; border-radius: 12px; padding: 14px; font-size: 13px; color: #6b4e17; margin-bottom: 16px; }
.gl-code { display: grid; gap: 12px; margin-bottom: 20px; }
.gl-code input { min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: #fff; text-align: center; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font-b); color: var(--ink); }
.gl-code input:focus { outline: 2px solid var(--gold-lt); }
.gl-code .gl-alert { margin: 0; }

/* =====================================================
   APP
   ===================================================== */
.gl-app { padding-bottom: calc(110px + var(--safe-b)); }

.gl-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(250,246,240,.88); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.gl-top__brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.gl-top__names { font-family: var(--font-d); font-size: 26px; font-weight: 600; line-height: 1; }
.gl-top__names i { color: var(--gold); }
.gl-top__sub { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.gl-avatar-btn { width: 36px; height: 36px; border-radius: 50%; padding: 0; border: 2px solid var(--gold-lt); overflow: hidden; display: grid; place-items: center; }
.gl-avatar-btn .gl-av, .gl-avatar-btn .gl-avatar-fallback { width: 100%; height: 100%; border: 0; }

.gl-menu { position: absolute; right: 12px; top: calc(56px + var(--safe-t)); width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px rgba(45,32,24,.16); padding: 8px; }
.gl-menu__name { font-weight: 600; padding: 8px 10px 0; }
.gl-menu__email { font-size: 12px; color: var(--muted); padding: 0 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
.gl-menu__item { display: block; width: 100%; text-align: left; padding: 11px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; }
.gl-menu__item:hover { background: var(--bg-2); }
.gl-menu__item--danger { color: var(--danger); }

.gl-intro { text-align: center; padding: 22px 16px 6px; }
.gl-intro h1 { font-family: var(--font-d); font-size: 34px; font-weight: 600; line-height: 1.1; }
.gl-intro p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.gl-chips { position: sticky; top: calc(57px + var(--safe-t)); z-index: 20; display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; background: var(--bg); scrollbar-width: none; }
.gl-chips::-webkit-scrollbar { display: none; }
.gl-chip { flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.gl-chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.gl-newpill { position: fixed; top: calc(118px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 25; background: var(--gold); color: #fff; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 999px; box-shadow: 0 8px 20px rgba(184,149,74,.4); animation: gl-drop .3s ease; }
@keyframes gl-drop { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ---------- Grid ---------- */
.gl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px; max-width: 960px; margin: 0 auto; }
.gl-tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg-2); padding: 0; }
.gl-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s, opacity .3s; }
.gl-tile:active img { transform: scale(.97); opacity: .9; }
.gl-tile__noposter { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #3a2c22, #1f1611); color: var(--gold-lt); font-size: 26px; }
.gl-tile__badge { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 3px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 6px; }
.gl-tile__likes { position: absolute; left: 6px; bottom: 6px; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

.gl-empty { text-align: center; padding: 50px 24px; color: var(--muted); }
.gl-empty__icon { font-size: 44px; margin-bottom: 10px; }
.gl-empty__title { font-family: var(--font-d); font-size: 24px; color: var(--ink); font-weight: 600; }
.gl-empty .gl-btn { margin-top: 20px; }

.gl-loader { display: flex; justify-content: center; gap: 6px; padding: 26px; }
.gl-loader span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: gl-dot 1s infinite ease-in-out; }
.gl-loader span:nth-child(2) { animation-delay: .15s; }
.gl-loader span:nth-child(3) { animation-delay: .3s; }
@keyframes gl-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ---------- FAB ---------- */
.gl-fab { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 26px 0 22px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; box-shadow: 0 14px 34px rgba(45,32,24,.35), 0 0 0 4px rgba(250,246,240,.9); transition: transform .15s; white-space: nowrap; }
.gl-fab:active { transform: translateX(-50%) scale(.96); }
.gl-fab svg { color: var(--gold-lt); }

/* ---------- Bottom sheet (upload) ---------- */
.gl-sheet { position: fixed; inset: 0; z-index: 60; }
.gl-sheet__backdrop { position: absolute; inset: 0; background: rgba(30,20,14,.45); animation: gl-fade .2s; }
.gl-sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + var(--safe-b)); animation: gl-up .28s cubic-bezier(.2,.9,.3,1); }
.gl-sheet__grab { width: 40px; height: 4px; background: var(--faint); opacity: .5; border-radius: 4px; margin: 4px auto 8px; }
.gl-sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.gl-sheet__head h2 { font-family: var(--font-d); font-size: 28px; font-weight: 600; }
@keyframes gl-up { from { transform: translateY(100%); } }
@keyframes gl-fade { from { opacity: 0; } }

.gl-up-list { display: grid; gap: 8px; }
.gl-up { display: flex; align-items: center; gap: 12px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.gl-up__thumb { width: 52px; height: 52px; flex: none; border-radius: 8px; overflow: hidden; background: var(--bg-2); display: grid; place-items: center; font-size: 22px; }
.gl-up__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gl-up__meta { flex: 1; min-width: 0; display: grid; gap: 5px; }
.gl-up__name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-up__bar { height: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.gl-up__bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.gl-up__status { font-size: 12px; color: var(--muted); }
.gl-up__rm { width: 32px; height: 32px; border-radius: 50%; color: var(--faint); }
.gl-up.is-error { border-color: #efc9bd; background: #fdf3f0; }
.gl-up.is-error .gl-up__status { color: var(--danger); }
.gl-up.is-done .gl-up__bar i { background: #5a8f5a; }
.gl-up.is-uploading .gl-up__rm, .gl-up.is-done .gl-up__rm { visibility: hidden; }
.gl-up-more { margin: 10px 0 4px; }

.gl-label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 18px 0 8px; }
.gl-label span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
.gl-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gl-seg__btn { display: grid; gap: 1px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: center; }
.gl-seg__btn strong { font-size: 14px; }
.gl-seg__btn small { font-size: 11px; color: var(--muted); }
.gl-seg__btn.is-active { border-color: var(--gold); background: #fbf3e2; box-shadow: inset 0 0 0 1px var(--gold); }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink); resize: none; }
textarea:focus { outline: 2px solid var(--gold-lt); border-color: transparent; }
.gl-up-note { font-size: 12px; color: var(--muted); text-align: center; min-height: 18px; margin: 12px 0 10px; }

/* ---------- Source chooser ---------- */
.gl-source { display: grid; gap: 10px; }
.gl-source__title { font-family: var(--font-d); font-size: 24px; font-weight: 600; text-align: center; margin: 2px 0 6px; }
.gl-source__opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-align: left; transition: transform .12s, background .15s; }
.gl-source__opt:active { transform: scale(.98); background: #fbf3e2; }
.gl-source__opt strong { display: block; font-size: 16px; }
.gl-source__opt small { display: block; font-size: 12px; color: var(--muted); }
.gl-source__ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 22px; border-radius: 50%; background: rgba(184,149,74,.12); }
.gl-source .gl-btn--ghost { margin-top: 4px; }

/* ---------- Frame studio ---------- */
.gl-studio { margin-top: 4px; }
.gl-styles { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; scroll-snap-type: x proximity; }
.gl-styles::-webkit-scrollbar { display: none; }
.gl-style { flex: none; width: 78px; display: grid; justify-items: center; gap: 5px; scroll-snap-align: start; }
.gl-style__thumb { width: 66px; height: 88px; border-radius: 10px; overflow: hidden; background: var(--bg-2); display: grid; place-items: center; border: 2px solid transparent; box-shadow: 0 2px 8px rgba(45,32,24,.12); transition: border-color .15s, transform .15s; }
.gl-style__thumb canvas { width: 100%; height: 100%; object-fit: contain; background: #e9e1d4; }
.gl-style__name { font-size: 12px; font-weight: 500; color: var(--muted); }
.gl-style small { font-size: 10px; color: var(--faint); margin-top: -4px; }
.gl-style.is-active .gl-style__thumb { border-color: var(--gold); transform: translateY(-2px); }
.gl-style.is-active .gl-style__name { color: var(--ink); font-weight: 600; }
.gl-style.is-disabled { opacity: .45; }

.gl-preview { position: relative; display: flex; align-items: center; justify-content: center; margin-top: 6px; padding: 16px 10px; border-radius: 16px; background: repeating-linear-gradient(45deg, #efe7da 0 10px, #f3ece1 10px 20px); min-height: 200px; }
.gl-preview__frame { width: min(78vw, 320px); display: grid; place-items: center; transition: opacity .2s; }
.gl-preview__frame.is-loading { opacity: .55; }
.gl-preview__frame canvas { width: 100%; height: auto; max-height: 52dvh; object-fit: contain; border-radius: 3px; box-shadow: 0 14px 30px rgba(45,32,24,.25); }
.gl-preview__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: 22px; line-height: 1; color: var(--ink); }
#pvPrev { left: 8px; }
#pvNext { right: 8px; }
.gl-preview__bar { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.gl-preview__bar small { color: var(--muted); font-size: 12px; }

/* ---------- Cassette (shared) ---------- */
.cs { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgba(45,32,24,.28)); }
.cs .cs-reel { transform-box: fill-box; transform-origin: center; }
.cs.is-spinning .cs-reel { animation: cs-spin 1.6s linear infinite; }
@keyframes cs-spin { to { transform: rotate(-360deg); } }
.cs circle[class^="cs-spool"] { transition: r .25s linear; }

/* ---------- Voice recorder ---------- */
.gl-voice { text-align: center; background: radial-gradient(120% 60% at 50% 0%, #fffaf2 0%, var(--bg) 60%); }
.gl-voice__lead { font-size: 13px; color: var(--muted); margin: -4px 0 16px; }
.gl-voice__deck { width: min(84vw, 340px); margin: 0 auto 14px; transform: rotate(-1.5deg); }
.gl-voice__meter { width: 180px; height: 5px; margin: 0 auto 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.gl-voice__meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fae6d, #e0a33a 70%, #d4492f); transition: width .08s linear; }
.gl-voice__time { font-family: var(--font-d); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 14px; }
.gl-voice__max { color: var(--faint); font-size: 22px; }
.gl-voice__controls { display: grid; justify-items: center; gap: 10px; padding-bottom: 6px; }
.gl-rec { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 3px solid var(--ink); box-shadow: 0 8px 22px rgba(45,32,24,.18); transition: transform .12s; }
.gl-rec:active { transform: scale(.94); }
.gl-rec span { width: 58px; height: 58px; border-radius: 50%; background: #d4412b; transition: all .2s ease; }
.gl-rec.is-recording span { width: 30px; height: 30px; border-radius: 7px; }
.gl-rec.is-recording { animation: gl-recpulse 1.4s ease-in-out infinite; }
@keyframes gl-recpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(212,65,43,.45), 0 8px 22px rgba(45,32,24,.18); } 50% { box-shadow: 0 0 0 14px rgba(212,65,43,0), 0 8px 22px rgba(45,32,24,.18); } }
.gl-voice__hint { font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--muted); }
.gl-voice__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gl-voice #vcAfter { text-align: left; }
.gl-voice__progress { margin: 14px 0 4px; height: 6px; }
.gl-voice #vcSend { margin-top: 14px; }

/* ---------- Audio tiles ---------- */
.gl-tile--audio { background: radial-gradient(circle at 30% 20%, #fbf3e4, #ead9bf); display: grid; place-items: center; }
.gl-tile__tape { width: 86%; transform: rotate(-4deg); }
.gl-tile__tape .cs { filter: drop-shadow(0 4px 6px rgba(45,32,24,.3)); }
.gl-tile--audio .gl-tile__likes { color: var(--ink); text-shadow: none; }

/* ---------- Audio player in viewer ---------- */
.gl-tapeplayer { width: min(88vw, 440px); display: grid; gap: 22px; padding: 10px; }
.gl-tapeplayer__deck { transform: rotate(-1.5deg); }
.gl-tapeplayer__ctrl { display: flex; align-items: center; gap: 14px; }
.gl-tapeplayer__btn { width: 56px; height: 56px; flex: none; border-radius: 50%; background: #f3e9d6; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.gl-tapeplayer__icon { width: 0; height: 0; border-left: 17px solid #2b2522; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.gl-tapeplayer.is-playing .gl-tapeplayer__icon { width: 16px; height: 20px; border: 0; margin: 0; border-left: 5px solid #2b2522; border-right: 5px solid #2b2522; }
.gl-tapeplayer__track { flex: 1; display: grid; gap: 4px; }
.gl-tapeplayer__seek { width: 100%; accent-color: #e46b34; }
.gl-tapeplayer__time { font-size: 12px; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }

/* =====================================================
   VIEWER
   ===================================================== */
.gl-viewer { position: fixed; inset: 0; z-index: 50; background: #0d0907; color: #fff; display: flex; flex-direction: column; animation: gl-fade .18s; }
.gl-viewer__top { display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) 8px 8px; position: relative; z-index: 3; }
.gl-viewer__who { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.gl-viewer__who div { display: grid; min-width: 0; }
.gl-viewer__who .gl-av, .gl-viewer__who .gl-avatar-fallback { width: 34px; height: 34px; }
.gl-viewer__who strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-viewer__who span { font-size: 12px; color: rgba(255,255,255,.6); }
.gl-viewer__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gl-viewer__stage img, .gl-viewer__stage video { max-width: 100%; max-height: 100%; object-fit: contain; background-size: contain; background-position: center; background-repeat: no-repeat; }
.gl-viewer__stage video { width: 100%; }
.gl-viewer__nav { display: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 30px; line-height: 1; }
.gl-viewer__nav--prev { left: 16px; }
.gl-viewer__nav--next { right: 16px; }
.gl-viewer__bottom { padding: 10px 16px calc(12px + var(--safe-b)); background: linear-gradient(0deg, rgba(0,0,0,.6), transparent); position: relative; z-index: 2; }
.gl-viewer__caption { font-size: 14px; margin-bottom: 8px; white-space: pre-wrap; max-height: 5.2em; overflow-y: auto; }
.gl-actions { display: flex; justify-content: space-between; max-width: 480px; margin: 0 auto; }
.gl-act { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 6px 0; color: #fff; text-decoration: none; font-size: 11px; }
.gl-act span { min-height: 14px; font-weight: 500; }
#vLike svg path { fill: none; stroke: currentColor; stroke-width: 1.8; transition: fill .15s; }
#vLike.is-liked { color: #ff4d67; }
#vLike.is-liked svg path { fill: currentColor; }
#vLike.is-liked svg { animation: gl-pop .3s; }
@keyframes gl-pop { 50% { transform: scale(1.3); } }

.gl-heart-burst { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(0); font-size: 110px; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.35); pointer-events: none; z-index: 4; opacity: 0; }
.gl-heart-burst.is-on { animation: gl-burst .8s ease; }
@keyframes gl-burst { 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 30% { transform: translate(-50%, -50%) scale(.95); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }

/* Comments drawer */
.gl-comments { position: absolute; left: 0; right: 0; bottom: 0; height: 68dvh; z-index: 5; background: var(--bg); color: var(--ink); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: gl-up .25s cubic-bezier(.2,.9,.3,1); box-shadow: 0 -10px 40px rgba(0,0,0,.4); }
.gl-comments__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 6px 18px; border-bottom: 1px solid var(--line); }
.gl-comments__list { flex: 1; overflow-y: auto; padding: 12px 16px; display: grid; align-content: start; gap: 14px; }
.gl-comments__empty { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 0; }
.gl-comment { display: flex; gap: 10px; }
.gl-comment__body p { font-size: 14px; word-break: break-word; }
.gl-comment__body small { display: flex; gap: 12px; font-size: 12px; color: var(--faint); margin-top: 2px; }
.gl-comments__form { display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--card); }
.gl-comments__form input { flex: 1; min-width: 0; height: 42px; border-radius: 999px; border: 1px solid var(--line); padding: 0 16px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.gl-comments__form input:focus { outline: 2px solid var(--gold-lt); border-color: transparent; }
.gl-comments__form button { color: var(--gold); font-weight: 600; padding: 0 6px; }

/* Share / more mini sheet */
.gl-mini { position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 6; display: grid; gap: 1px; background: rgba(0,0,0,.08); border-radius: 16px; overflow: hidden; animation: gl-up .22s; max-width: 460px; margin: 0 auto; }
.gl-mini button { background: var(--card); color: var(--ink); padding: 16px; font-size: 15px; }
.gl-mini button:last-child { margin-top: 8px; font-weight: 600; border-radius: 0 0 16px 16px; }
.gl-mini__danger { color: var(--danger) !important; }

/* Toast */
.gl-toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 90; background: var(--ink); color: #fff; font-size: 14px; padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; }
.gl-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================
   LARGER SCREENS
   ===================================================== */
@media (min-width: 700px) {
    .gl-grid { gap: 6px; padding: 0 16px; }
    .gl-tile { border-radius: 6px; }
    .gl-intro h1 { font-size: 44px; }
    .gl-chips { justify-content: center; }
    .gl-viewer__nav { display: block; }
    .gl-sheet__panel { left: 50%; right: auto; bottom: 50%; width: 480px; transform: translate(-50%, 50%); border-radius: 22px; animation: gl-fade .2s; }
    .gl-comments { left: auto; top: 0; width: 380px; height: auto; border-radius: 0; animation: none; }
}
@media (min-width: 1000px) {
    .gl-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- BM | EN switch ---------- */
.lang-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255,255,255,.75); border: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.lang-switch a { padding: 5px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; line-height: 1; }
.lang-switch a.is-on { background: var(--ink); color: #fff; }
.lang-switch--top { margin-left: auto; margin-right: 10px; }
.lang-switch--corner { position: absolute; top: calc(14px + var(--safe-t)); right: 14px; z-index: 5; }
.gl-auth { position: relative; }
.gl-auth { padding-top: calc(64px + var(--safe-t)); }
