/* ================================================================
   GalSol — GAL Studio  |  gal-studio.css
================================================================ */
:root {
  --gal-bg: #090b11;
  --gal-panel: #11141d;
  --gal-panel-2: #161a25;
  --gal-border: rgba(255, 255, 255, 0.07);
  --gal-border-2: rgba(255, 255, 255, 0.12);
  --gal-text: #ecf0f7;
  --gal-text-dim: #99a2b5;
  --gal-text-faint: #5e6678;
  --gal-cyan: #00d4ff;
  --gal-violet: #7c3aed;
  --gal-ok: #2ecc71;
  --gal-err: #ff5c6c;
  --gal-rail-w: 252px;
  --gal-rail-collapsed: 66px;
  --gal-docs-w: 372px;
  --gal-font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --gal-head: 'Syne', 'Plus Jakarta Sans', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--gal-bg); color: var(--gal-text); font-family: var(--gal-font); overflow: hidden; -webkit-font-smoothing: antialiased; }
img { display: block; }

/* ── Aurora background (idle only) ─────────────────────────────── */
.gal-aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1.4s ease; }
body.gal-idle .gal-aurora { opacity: 1; }
.gal-aurora-inner {
  position: absolute; inset: -10px; pointer-events: none;
  --aurora: repeating-linear-gradient(100deg, #00d4ff 10%, #7c3aed 15%, #38bdf8 20%, #c4b5fd 25%, #22d3ee 30%);
  --stripes: repeating-linear-gradient(100deg, var(--gal-bg) 0%, var(--gal-bg) 7%, transparent 10%, transparent 12%, var(--gal-bg) 16%);
  background-image: var(--stripes), var(--aurora);
  background-size: 300%, 200%;
  background-position: 50% 50%, 50% 50%;
  filter: blur(9px) saturate(1.15);
  opacity: 0.42;
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 8%, transparent 68%);
  mask-image: radial-gradient(ellipse at 100% 0%, #000 8%, transparent 68%);
}
.gal-aurora-inner::after {
  content: ''; position: absolute; inset: 0;
  background-image: var(--stripes), var(--aurora);
  background-size: 200%, 100%;
  background-attachment: fixed;
  mix-blend-mode: difference;
  animation: galAurora 55s linear infinite;
}
@keyframes galAurora { from { background-position: 50% 50%, 50% 50%; } to { background-position: 350% 50%, 350% 50%; } }
.gal-aurora::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(50% 50% at 50% 25%, rgba(0, 212, 255, .10), transparent 70%),
              radial-gradient(45% 45% at 75% 85%, rgba(124, 58, 237, .12), transparent 70%);
}

/* ── Shell ─────────────────────────────────────────────────────── */
.gal-shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--gal-rail-w) 1fr 0; height: 100vh; transition: grid-template-columns .42s cubic-bezier(.4, 0, .2, 1); }
body.gal-rail-collapsed .gal-shell { grid-template-columns: var(--gal-rail-collapsed) 1fr 0; }
body.gal-docs-open .gal-shell { grid-template-columns: var(--gal-rail-w) 1fr var(--gal-docs-w); }
body.gal-rail-collapsed.gal-docs-open .gal-shell { grid-template-columns: var(--gal-rail-collapsed) 1fr var(--gal-docs-w); }

/* ── Left rail ─────────────────────────────────────────────────── */
.gal-rail { border-right: 1px solid var(--gal-border); background: rgba(9, 11, 17, 0.74); backdrop-filter: blur(14px); display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: relative; }
body.gal-rail-collapsed .gal-rail { align-items: center; }

/* head */
.gal-rail-head { display: flex; align-items: center; gap: 9px; padding: 16px 14px 12px; min-height: 60px; }
body.gal-rail-collapsed .gal-rail-head { justify-content: center; padding: 16px 0 12px; }

/* logo wrap: collapsed → hovering shows expand icon */
.gal-rail-logo-wrap { position: relative; width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.gal-rail-logo { width: 26px; height: 26px; object-fit: contain; transition: opacity .18s; display: block; position: relative; left: -1px; }
.gal-rail-logo-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; color: var(--gal-cyan); transition: opacity .18s; pointer-events: none; }
.gal-rail-logo-icon i { width: 19px; height: 19px; }
body.gal-rail-collapsed .gal-rail-logo-wrap { cursor: pointer; }
body.gal-rail-collapsed .gal-rail-logo-wrap:hover { background: var(--gal-panel-2); }
body.gal-rail-collapsed .gal-rail-logo-wrap:hover .gal-rail-logo { opacity: 0; }
body.gal-rail-collapsed .gal-rail-logo-wrap:hover .gal-rail-logo-icon { opacity: 1; }

.gal-rail-brand { display: flex; align-items: center; flex: 1; min-width: 0; text-decoration: none; overflow: hidden; }
.gal-rail-brandtext { font-family: var(--gal-head); font-weight: 700; font-size: 17px; color: var(--gal-text); letter-spacing: .2px; white-space: nowrap; }

.gal-icon-btn { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; border: none; background: transparent; color: var(--gal-text-dim); cursor: pointer; display: grid; place-items: center; transition: .15s; }
.gal-icon-btn:hover { background: var(--gal-panel-2); color: var(--gal-text); }
.gal-icon-btn i { width: 16px; height: 16px; }

/* primary nav — flat rows (New / Search / Library) */
.gal-rail-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 6px; }
body.gal-rail-collapsed .gal-rail-nav { padding: 4px 0 6px; align-items: center; }
.gal-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; border-radius: 9px; border: none; background: transparent; color: var(--gal-text); cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500; text-align: left; text-decoration: none; transition: background .14s; }
.gal-nav-item:hover { background: var(--gal-panel-2); }
.gal-nav-item.active { background: rgba(0, 212, 255, .1); color: #fff; }
.gal-nav-item > i, .gal-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--gal-text-dim); }
.gal-nav-item.active > i { color: var(--gal-cyan); }
.gal-nav-ic { width: 18px; height: 18px; flex-shrink: 0; object-fit: contain; display: block; }
.gal-nav-label { flex: 1; white-space: nowrap; }
.gal-nav-kbd { font-size: 10.5px; font-family: var(--gal-font); font-weight: 600; color: var(--gal-text-faint); letter-spacing: .03em; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.gal-nav-item:hover .gal-nav-kbd { opacity: 1; }
body.gal-rail-collapsed .gal-nav-item { width: 34px; height: 34px; padding: 0; justify-content: center; }

/* inline search field */
.gal-rail-search-row { padding: 0 10px 6px; }
.gal-rail-search { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(0,212,255,.3); border-radius: 10px; padding: 8px 10px; }
.gal-rail-search > i { width: 15px; height: 15px; color: var(--gal-text-faint); flex-shrink: 0; }
#galSearchInput { flex: 1; border: none; outline: none; background: transparent; color: var(--gal-text); font-family: inherit; font-size: 13.5px; min-width: 0; }
#galSearchInput::placeholder { color: var(--gal-text-faint); }
.gal-search-x { border: none; background: transparent; color: var(--gal-text-faint); cursor: pointer; display: grid; place-items: center; padding: 0; flex-shrink: 0; }
.gal-search-x:hover { color: var(--gal-text); }
.gal-search-x i { width: 14px; height: 14px; }

/* collapsed: hide text + reveal-only rows */
body.gal-rail-collapsed .gal-rail-text { display: none; }
body.gal-rail-collapsed .gal-rail-search-row { display: none; }

/* scroll area + expand hint */
.gal-rail-scroll { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
.gal-rail-expand-hint { display: none; }
body.gal-rail-collapsed .gal-rail-scroll { overflow: hidden; }
body.gal-rail-collapsed .gal-rail-expand-hint { display: flex; flex: 1; align-items: center; justify-content: center; cursor: pointer; color: rgba(255,255,255,.07); transition: color .22s; }
body.gal-rail-collapsed .gal-rail-expand-hint i { width: 20px; height: 20px; }
body.gal-rail-collapsed .gal-rail-expand-hint:hover { color: rgba(0,212,255,.5); }

.gal-rail-label { padding: 12px 16px 6px; font-size: 12px; font-weight: 600; color: #fff; }
/* recent-events loading skeleton */
.gal-hist-loading { display: flex; flex-direction: column; gap: 7px; padding: 4px 8px; }
.gal-hist-skel { height: 34px; border-radius: 9px; background: linear-gradient(90deg, rgba(255,255,255,.045) 25%, rgba(255,255,255,.1) 37%, rgba(255,255,255,.045) 63%); background-size: 400% 100%; animation: galSkel 1.4s ease infinite; }
.gal-hist-skel:nth-child(2) { width: 82%; } .gal-hist-skel:nth-child(4) { width: 68%; } .gal-hist-skel:nth-child(5) { width: 90%; } .gal-hist-skel:nth-child(6) { width: 74%; }
@keyframes galSkel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.gal-rail-list { display: flex; flex-direction: column; gap: 1px; padding: 0 8px 12px; }
.gal-hist-item { padding: 9px 12px; border-radius: 9px; cursor: pointer; color: var(--gal-text-dim); font-size: 13.5px; line-height: 1.35; transition: .14s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-hist-item:hover { background: var(--gal-panel-2); color: var(--gal-text); }
.gal-hist-item.active { background: var(--gal-panel-2); color: var(--gal-text); }
.gal-hist-empty { padding: 9px 16px; color: var(--gal-text-faint); font-size: 12.5px; }

/* quick tool links */
.gal-rail-tools { border-top: 1px solid var(--gal-border); padding: 8px; display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }
body.gal-rail-collapsed .gal-rail-tools { align-items: center; padding: 8px 0; }
.gal-tool-link { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; text-decoration: none; color: var(--gal-text-dim); font-size: 13px; font-weight: 500; transition: .14s; white-space: nowrap; overflow: hidden; }
.gal-tool-link:hover { background: var(--gal-panel-2); color: var(--gal-text); }
.gal-tool-link i, .gal-tool-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.gal-tool-ic { width: 19px; height: 19px; flex-shrink: 0; object-fit: contain; display: block; }
body.gal-rail-collapsed .gal-tool-link { justify-content: center; padding: 0; width: 34px; height: 34px; }

/* account */
.gal-account { border-top: 1px solid var(--gal-border); padding: 10px 8px; flex-shrink: 0; }
body.gal-rail-collapsed .gal-account { display: flex; justify-content: center; padding: 10px 0; }
.gal-account-info { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: inherit; transition: .14s; }
.gal-account-info:hover { background: var(--gal-panel-2); }
body.gal-rail-collapsed .gal-account-info { padding: 0; }
.gal-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--gal-cyan); overflow: hidden; background: linear-gradient(135deg, rgba(0, 212, 255, .18), rgba(124, 58, 237, .14)); border: 1.5px solid rgba(0, 212, 255, .25); }
.gal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gal-account-text { min-width: 0; }
.gal-account-name { font-size: 13.5px; font-weight: 600; color: var(--gal-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-account-plan { font-size: 12px; color: var(--gal-text-faint); }

/* ── Library page (main-area overlay) ──────────────────────────── */
.gal-library { position: absolute; inset: 0; z-index: 8; background: var(--gal-bg); overflow-y: auto; }
.gal-library[hidden] { display: none; }
.gal-library-inner { max-width: 1040px; margin: 0 auto; padding: 40px 32px 80px; }
.gal-library-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.gal-library-title { font-family: var(--gal-head); font-weight: 700; font-size: 30px; margin: 0; color: var(--gal-text); }
.gal-library-sub { margin: 6px 0 0; color: var(--gal-text-dim); font-size: 14.5px; }
.gal-library-body { display: flex; flex-direction: column; gap: 14px; }

.gal-lib-event { padding: 4px 0; }
.gal-lib-event + .gal-lib-event { border-top: 1px solid var(--gal-border); padding-top: 26px; margin-top: 12px; }
.gal-lib-event-title { font-family: var(--gal-head); font-weight: 600; font-size: 20px; margin: 0; color: var(--gal-text); }
.gal-lib-event-desc { margin: 6px 0 0; color: var(--gal-text-dim); font-size: 13.5px; line-height: 1.55; max-width: 720px; }
.gal-lib-event-meta { margin: 7px 0 0; color: #fff; font-size: 13px; font-weight: 500; letter-spacing: .01em; }
.gal-lib-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.gal-lib-card { display: flex; flex-direction: column; gap: 0; padding: 16px; border-radius: 16px; background: var(--gal-panel); border: 1px solid var(--gal-border); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, background .15s; }
.gal-lib-card:hover { border-color: var(--gal-border-2); transform: translateY(-2px); background: var(--gal-panel-2); }
.gal-lib-card-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; }
.gal-lib-card-ic i { width: 21px; height: 21px; }
.gal-lib-card-img { width: 26px; height: 26px; object-fit: contain; display: block; }
/* mail-tool.svg is landscape (115×80) so contain shrinks it — size it up to match the others */
.gal-lib-card.mail .gal-lib-card-img { width: 40px; height: 40px; }
.gal-lib-card.minisite .gal-lib-card-ic { background: rgba(0, 212, 255, .12); color: var(--gal-cyan); }
.gal-lib-card.gsform .gal-lib-card-ic { background: rgba(124, 58, 237, .16); color: #a78bfa; }
.gal-lib-card.dashboard .gal-lib-card-ic { background: rgba(46, 204, 113, .14); color: var(--gal-ok); }
.gal-lib-card.pass .gal-lib-card-ic { background: rgba(245, 158, 11, .16); color: #f59e0b; }
.gal-lib-card.mail .gal-lib-card-ic { background: rgba(236, 72, 153, .15); color: #ec4899; }
.gal-lib-card.budget .gal-lib-card-ic { background: rgba(34, 197, 94, .15); color: #22c55e; }
.gal-lib-card-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; color: var(--gal-text); }
.gal-lib-card-kind { font-size: 11.5px; color: var(--gal-text-faint); margin-top: 4px; }
.gal-library-empty { text-align: center; color: var(--gal-text-dim); padding: 60px 0; font-size: 14.5px; }
.gal-library-loading { text-align: center; color: var(--gal-text-faint); padding: 60px 0; font-size: 13.5px; }

/* ── Center ────────────────────────────────────────────────────── */
.gal-main { display: flex; flex-direction: column; min-height: 0; position: relative; }
body.gal-idle .gal-main { justify-content: center; }

.gal-welcome { text-align: center; max-width: min(94vw, 1100px); margin: 0 auto 28px; padding: 0 24px; }
body.gal-started .gal-welcome { display: none; }
.gal-welcome-mark { width: 56px; height: 56px; object-fit: contain; margin: 0 auto 12px; filter: drop-shadow(0 6px 24px rgba(0, 212, 255, .38)); animation: galFloat 5s ease-in-out infinite; position: relative; left: -1px; }
@keyframes galFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.gal-welcome-tag {
  font-family: var(--gal-head); font-weight: 800; font-size: 25px; letter-spacing: .01em; margin: 0 0 15px;
  background: linear-gradient(90deg, #00d4ff 0%, #38bdf8 25%, #a78bfa 60%, #7c3aed 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  animation: galTagShimmer 6s ease-in-out infinite;
}
@keyframes galTagShimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
/* Stable typewriter: a hidden measure span reserves the full width/height so the
   centered line never re-centers (no horizontal/vertical "warping"). */
.gal-greet { position: relative; display: inline-block; font-family: var(--gal-head); font-weight: 500; font-size: clamp(24px, 3.6vw, 42px); line-height: 1.15; margin: 0; letter-spacing: .2px; text-align: left; white-space: nowrap; }
.gal-greet-measure { visibility: hidden; white-space: nowrap; }
.gal-greet-type { position: absolute; inset: 0; white-space: nowrap; }
.gal-greet-caret { display: inline-block; width: 3px; height: 0.9em; background: var(--gal-cyan); margin-left: 3px; vertical-align: -2px; animation: galBlink 1s step-end infinite; }
@keyframes galBlink { 50% { opacity: 0; } }

/* chat thread (flex column like the mini-site AI history) */
.gal-chat { flex: 1; overflow-y: auto; padding: 26px 0 12px; display: flex; flex-direction: column; }
body.gal-idle .gal-chat { display: none; }
.gal-thread { max-width: 760px; width: 100%; margin: 0 auto; padding: 0 26px; display: flex; flex-direction: column; }

/* user message — glass blue gradient box, right aligned */
.gal-msg-user {
  align-self: flex-end; max-width: 86%; margin: 0 0 18px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(124, 58, 237, 0.18));
  border: 1px solid rgba(0, 212, 255, 0.22); color: rgba(255, 255, 255, 0.95);
  padding: 12px 16px; border-radius: 16px 16px 4px 16px; line-height: 1.5; font-size: 14.5px; white-space: pre-wrap; word-break: break-word;
}
.gal-msg-user .gal-msg-attach { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gal-msg-user .gal-msg-attach img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(255, 255, 255, .25); }
.gal-msg-user .gal-msg-doc { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 6px 10px; border-radius: 9px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); font-size: 12px; color: rgba(255,255,255,.9); }
.gal-msg-user .gal-msg-doc i { width: 14px; height: 14px; flex-shrink: 0; }

/* ── AI response timeline ───────────────────────────────────────
   Every AI sentence (status lines AND messages) is a node with a glowing dot.
   The connecting line is drawn per-node, from each dot DOWN to the next dot —
   so it only appears between dots and STOPS at the last dot (last node has no
   line). A lone dot (single node) shows no line. All text is bright/white. */
.gal-turn-ai { position: relative; align-self: stretch; width: 100%; padding-left: 28px; margin: 4px 0 18px; }
.gal-tl-node { position: relative; margin: 0 0 14px; }
.gal-tl-node:last-child { margin-bottom: 0; }
.gal-tl-dot {
  position: absolute; left: -23px; top: 6px; width: 10px; height: 10px; border-radius: 50%; z-index: 1;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  box-shadow: 0 0 0 3px var(--gal-bg), 0 0 9px rgba(0, 212, 255, .55);
}
/* connector: from this dot's centre down to the next node's dot centre */
.gal-tl-node::before {
  content: ''; position: absolute; left: -18.75px; top: 11px; bottom: -25px; width: 1.5px; border-radius: 2px;
  background: linear-gradient(to bottom, rgba(0, 212, 255, .7), rgba(124, 58, 237, .55));
}
.gal-tl-node:last-child::before { display: none; } /* line ends at the last dot */
.gal-tl-body { color: #fff; line-height: 1.6; font-size: 14.5px; word-break: break-word; }
.gal-tl-think { font-size: 13.5px; color: rgba(255, 255, 255, .95); }

/* Highlighted final completion summary node */
.gal-tl-node--summary .gal-tl-body {
  background: linear-gradient(135deg, rgba(0,212,255,0.07), rgba(124,58,237,0.07));
  border: 1px solid rgba(0,212,255,0.16);
  border-radius: 14px; padding: 14px 16px;
}
.gal-msg-aitext { color: #fff; }

/* Markdown rendered inside AI messages */
.gal-msg-aitext > :first-child { margin-top: 0; }
.gal-msg-aitext h2.gal-md-h2 { font-family: var(--gal-head); font-size: 17px; font-weight: 700; color: var(--gal-text); margin: 18px 0 6px; letter-spacing: .01em; }
.gal-msg-aitext h3.gal-md-h3 { font-family: var(--gal-head); font-size: 14.5px; font-weight: 600; color: rgba(255,255,255,0.85); margin: 14px 0 4px; }
.gal-msg-aitext p { margin: 0 0 10px; }
.gal-msg-aitext ul, .gal-msg-aitext ol { margin: 4px 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.gal-msg-aitext li { line-height: 1.55; }
.gal-msg-aitext strong { font-weight: 700; color: var(--gal-text); }
.gal-msg-aitext code.gal-md-code { background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.18); border-radius: 5px; padding: 1px 6px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: #00d4ff; }
.gal-msg-aitext hr.gal-md-hr { border: none; border-top: 1px solid var(--gal-border); margin: 14px 0; }
.gal-msg-aitext a.gal-md-link { color: var(--gal-cyan); text-decoration: none; border-bottom: 1px solid rgba(0,212,255,0.35); transition: border-color .15s; }
.gal-msg-aitext a.gal-md-link:hover { border-bottom-color: var(--gal-cyan); }

/* ── Purchasing store (budget → where to buy) ──────────────────── */
.gal-card-inner.gal-buy { padding: 16px 16px 18px; }
.gal-buy-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; padding: 0 2px; }
.gal-buy-title { font-family: var(--gal-head); font-weight: 700; font-size: 15px; color: var(--gal-text); }
.gal-buy-total { font-size: 13px; font-weight: 700; color: var(--gal-cyan); white-space: nowrap; }
.gal-buy-cat-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: rgba(255,255,255,.78); margin: 16px 0 9px; padding: 0 2px; }

/* horizontal slidable product row + side scroll arrows */
.gal-prod-rowwrap { position: relative; }
.gal-prod-row { display: flex; gap: 11px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(0,212,255,.3) transparent; }
.gal-prod-row::-webkit-scrollbar { height: 6px; }
.gal-prod-row::-webkit-scrollbar-thumb { background: linear-gradient(90deg, rgba(0,212,255,.5), rgba(124,58,237,.5)); border-radius: 8px; }
.gal-prod-row::-webkit-scrollbar-thumb:hover { background: linear-gradient(90deg, var(--gal-cyan), var(--gal-violet)); }
.gal-prod-row::-webkit-scrollbar-track { background: rgba(255,255,255,.04); border-radius: 8px; }
.gal-prod-nav {
  position: absolute; top: calc(50% - 6px); transform: translateY(-50%); z-index: 4;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(17,20,29,.92); border: 1px solid var(--gal-border-2); color: var(--gal-text);
  opacity: 0; transition: opacity .15s, border-color .15s, color .15s; box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.gal-prod-rowwrap:hover .gal-prod-nav { opacity: 1; }
.gal-prod-nav:hover { border-color: var(--gal-cyan); color: var(--gal-cyan); }
.gal-prod-nav svg { width: 15px; height: 15px; }
.gal-prod-nav.prev { left: -8px; }
.gal-prod-nav.next { right: -8px; }
@media (hover: none) { .gal-prod-nav { display: none; } } /* touch devices just swipe */

/* the whole store box eases in */
@keyframes galBuyIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.gal-card-inner.gal-buy { animation: galBuyIn .45s ease both; }

/* product card — fades/slides/scales in one-by-one (staggered animation-delay) */
@keyframes galProdIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.gal-prod-card {
  flex: 0 0 158px; width: 158px; scroll-snap-align: start;
  display: flex; flex-direction: column; background: var(--gal-panel-2);
  border: 1px solid var(--gal-border); border-radius: 14px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .12s; opacity: 0;
  animation: galProdIn .5s cubic-bezier(.22,.61,.36,1) both;
}
.gal-prod-card:hover { border-color: rgba(0,212,255,.4); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.gal-prod-img { width: 100%; height: 110px; background: linear-gradient(135deg, var(--gal-panel), var(--gal-panel-2)); overflow: hidden; }
.gal-prod-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-prod-noimg { display: grid; place-items: center; color: var(--gal-text-faint); }
.gal-prod-noimg svg { width: 28px; height: 28px; }
.gal-prod-noimg:empty::after { content: '🛍'; font-size: 26px; opacity: .5; } /* image failed to load */
.gal-prod-body { display: flex; flex-direction: column; gap: 5px; padding: 10px 11px 11px; flex: 1; }
.gal-prod-name { font-size: 12.8px; font-weight: 600; color: var(--gal-text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gal-prod-price { font-size: 14.5px; font-weight: 700; color: var(--gal-text); }
.gal-buy-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--gal-text-faint); line-height: 1.3; }
.gal-buy-note { font-size: 11px; color: var(--gal-text-dim); line-height: 1.4; }
.gal-buy-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.gal-buy-link { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 5px; text-decoration: none; border: 1px solid var(--gal-border-2); color: var(--gal-text); background: rgba(255,255,255,.03); transition: .15s; }
.gal-prod-qty { font-size: 10.5px; font-weight: 600; color: var(--gal-text-faint); }
.gal-buy-disclaimer { margin: 14px 2px 2px; padding: 10px 12px; border-radius: 9px; background: rgba(0,212,255,.06); border: 1px solid var(--gal-border); font-size: 12px; line-height: 1.5; color: var(--gal-text-dim); }
.gal-buy-link:hover { border-color: var(--gal-cyan); color: var(--gal-cyan); }
.gal-buy-link.buy { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--gal-cyan), var(--gal-violet)); }
.gal-buy-link.buy:hover { opacity: .92; color: #fff; }
.gal-buy-link.amazon { border-color: rgba(255,153,0,.5); color: #ff9900; }
.gal-buy-link.amazon:hover { background: rgba(255,153,0,.12); }
.gal-buy-link.flipkart { border-color: rgba(40,116,240,.5); color: #4f93ff; }
.gal-buy-link.flipkart:hover { background: rgba(40,116,240,.12); }
.gal-buy-link.muted { color: var(--gal-text-faint); cursor: default; }
.gal-buy-link.muted:hover { border-color: var(--gal-border-2); color: var(--gal-text-faint); }
.gal-prod-card.market { flex-basis: 200px; width: 200px; }

/* DM Sans for the conversation text + composer input (typing + sent) */
#galInput, .gal-msg-user, .gal-tl-body { font-family: 'DM Sans', var(--gal-font); }

/* ── Live orbital "thinking" indicator — single, always pinned to thread bottom ── */
@keyframes galOrbSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes galWordFade {
  0%   { opacity: 0; transform: translateY(4px); }
  15%  { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}
.gal-think-live { display: flex; align-items: center; gap: 12px; padding: 10px 0 6px; align-self: flex-start; transition: opacity .4s ease; }
.gal-think-live.fade { opacity: 0; pointer-events: none; }
.gal-think-orb { width: 40px; height: 40px; border-radius: 50%; background: var(--gal-bg); position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gal-think-orb::before {
  content: ''; position: absolute; inset: -2px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0%, #00d4ff 30%, #7c3aed 60%, transparent 80%);
  animation: galOrbSpin 1.4s linear infinite;
}
.gal-think-orb img { width: 24px; height: 24px; object-fit: contain; position: relative; z-index: 1; left: -1px; }
.gal-think-live.done .gal-think-orb::before { animation-play-state: paused; background: rgba(0, 212, 255, 0.25); }
.gal-think-label { font-size: 13px; color: var(--gal-text-dim); font-family: 'DM Sans', var(--gal-font); animation: galWordFade 2s ease-in-out infinite; }
.gal-think-live.done .gal-think-label { animation: none; opacity: .7; }
.gal-caret-i { display: inline-block; width: 7px; height: 14px; background: var(--gal-cyan); margin-left: 2px; vertical-align: -2px; animation: galBlink 1s step-end infinite; }

/* plan + agent + question cards */
.gal-card { align-self: stretch; margin: 0 0 18px; }
.gal-card-inner { background: var(--gal-panel); border: 1px solid var(--gal-border); border-radius: 16px; padding: 15px 17px; }
.gal-card-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.82); margin-bottom: 12px; }
.gal-agent { display: flex; align-items: center; gap: 11px; padding: 9px 2px; font-size: 14px; }
.gal-agent + .gal-agent { border-top: 1px solid var(--gal-border); }
.gal-agent-ic { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 22px; }
.gal-agent-ic i { width: 16px; height: 16px; }
.gal-agent-label { flex: 1; }
.gal-agent-detail { color: var(--gal-text-dim); font-size: 12.5px; font-weight: 500; }
.gal-agent[data-state="pending"] { color: var(--gal-text-dim); }
.gal-agent[data-state="running"] { color: var(--gal-text); }
.gal-agent[data-state="running"] .gal-agent-detail { color: var(--gal-cyan); }
.gal-agent[data-state="running"] .gal-agent-ic { color: var(--gal-cyan); }
.gal-agent[data-state="done"] { color: var(--gal-text); }
.gal-agent[data-state="done"] .gal-agent-detail { color: var(--gal-ok); }
.gal-agent[data-state="done"] .gal-agent-ic { color: var(--gal-ok); }
.gal-agent[data-state="failed"] .gal-agent-ic { color: var(--gal-err); }
.gal-agent[data-state="failed"] .gal-agent-detail { color: var(--gal-err); }
@keyframes galSpin { to { transform: rotate(360deg); } }
/* Smooth ring spinner for in-progress agents (replaces the wobbling lucide loader) */
.gal-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 212, 255, .22); border-top-color: var(--gal-cyan); animation: galSpin .7s linear infinite; box-sizing: border-box; }

.gal-q-label { font-size: 14.5px; font-weight: 600; margin: 12px 0 9px; }
.gal-q:first-child .gal-q-label { margin-top: 2px; }
.gal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gal-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gal-border-2); background: var(--gal-panel-2); color: var(--gal-text); cursor: pointer; font-size: 12.5px; transition: .15s; }
.gal-chip:hover { border-color: var(--gal-cyan); }
.gal-chip.sel { background: rgba(0, 212, 255, .15); border-color: var(--gal-cyan); color: #fff; }
.gal-q-text { width: 100%; margin-top: 8px; background: var(--gal-bg); border: 1px solid var(--gal-border-2); border-radius: 10px; color: var(--gal-text); padding: 9px 12px; font-family: inherit; font-size: 13.5px; }
.gal-q-continue { margin-top: 15px; padding: 9px 18px; border-radius: 10px; border: none; cursor: pointer; font-weight: 600; font-size: 14px; background: linear-gradient(135deg, var(--gal-cyan), var(--gal-violet)); color: #fff; }
.gal-q-continue:disabled { opacity: .45; cursor: not-allowed; }

/* composite: date-time-location question */
.gal-dtloc-wrap { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.gal-dtloc-row { display: flex; flex-direction: column; gap: 4px; }
.gal-dtloc-label { font-size: 11px; font-weight: 700; color: var(--gal-text-dim); text-transform: uppercase; letter-spacing: .06em; }
.gal-dtloc-inp { margin-top: 0 !important; }
input[type="date"].gal-dtloc-inp, input[type="time"].gal-dtloc-inp { color-scheme: dark; }

/* composite: page builder question */
.gal-opt-grid.gal-pgrid { grid-template-columns: repeat(3, 1fr); }
.gal-pnames-wrap { display: flex; flex-direction: column; gap: 9px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--gal-border); }

/* ── Composer ──────────────────────────────────────────────────── */
.gal-composer { padding: 10px 24px 22px; position: relative; z-index: 2; }
.gal-attach-row { max-width: 760px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.gal-attach-row:empty { display: none; }
.gal-attach-chip { display: flex; align-items: center; gap: 8px; padding: 5px 9px 5px 5px; border-radius: 10px; background: var(--gal-panel-2); border: 1px solid var(--gal-border-2); font-size: 12px; color: var(--gal-text-dim); }
.gal-attach-chip img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
.gal-attach-chip .gal-attach-ic { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: rgba(0, 212, 255, .12); color: var(--gal-cyan); }
.gal-attach-chip.uploading { opacity: .6; }
.gal-attach-x { cursor: pointer; color: var(--gal-text-faint); display: grid; place-items: center; }
.gal-attach-x:hover { color: var(--gal-err); }
.gal-attach-x svg { width: 13px; height: 13px; }

.gal-box {
  position: relative;
  max-width: 760px; margin: 0 auto;
  /* frosted-glass panel — slightly translucent, softly blurred */
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015)), rgba(16, 17, 27, .55);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 22px; padding: 15px 16px 11px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: border-color .2s, box-shadow .2s;
}
.gal-box:focus-within { border-color: rgba(0, 212, 255, .45); box-shadow: 0 18px 60px rgba(0, 212, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .08); }

/* ── Dotted ripple-wave canvas — a full-screen dot field that fades in, then a size
   wave ripples through it. z-index:0 keeps it behind .gal-shell (z-index:1) so the
   sidebar/docs sit on top and the frosted composer softly blurs it at the origin. */
#galDotWave { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#galInput { width: 100%; resize: none; border: none; outline: none; background: transparent; color: var(--gal-text); font-family: inherit; font-size: 16px; line-height: 1.5; max-height: 200px; padding: 2px 4px 4px; display: block; }
#galInput::placeholder { color: var(--gal-text-faint); }
.gal-box-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.gal-box-left, .gal-box-right { display: flex; align-items: center; gap: 9px; }

.gal-attach-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--gal-border-2); background: var(--gal-panel-2); color: var(--gal-text-dim); cursor: pointer; display: grid; place-items: center; padding: 0; transition: .15s; }
.gal-attach-btn:hover { border-color: var(--gal-cyan); color: var(--gal-cyan); }
.gal-attach-btn i { width: 18px; height: 18px; }

/* model selector — replicated from the mini-site AI panel */
.gal-model-dropdown { position: relative; }
.gal-model-select-btn { display: flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 600; cursor: pointer; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); color: rgba(255, 255, 255, .55); transition: all .15s; white-space: nowrap; }
.gal-model-select-btn:hover { border-color: rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .85); }
.gal-model-icon { display: flex; align-items: center; }
.gal-model-menu { display: none; position: absolute; bottom: calc(100% + 8px); right: 0; background: #13131f; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; padding: 4px; z-index: 50; min-width: 168px; box-shadow: 0 8px 32px rgba(0, 0, 0, .6); }
.gal-model-menu.open { display: block; }
.gal-model-option { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 12px; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: rgba(255, 255, 255, .6); transition: all .12s; }
.gal-model-option:hover:not(:disabled) { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .9); }
.gal-model-option.active { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .9); }
.gal-model-option:disabled { cursor: default; opacity: .55; }
.gal-model-opt-icon { display: flex; align-items: center; flex-shrink: 0; }
.gal-model-soon { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 99px; background: rgba(251, 191, 36, .15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, .3); }

.gal-send-btn { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--gal-cyan), var(--gal-violet)); border: 1px solid transparent; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; transition: opacity .15s, transform .1s, background .15s; }
.gal-send-btn:hover { opacity: .9; transform: translateY(-1px); }
.gal-send-btn:active { transform: scale(.94); }
.gal-send-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.gal-send-btn.stop { background: rgba(244, 63, 94, .18); border-color: rgba(244, 63, 94, .5); }
.gal-send-btn.stop:hover { opacity: 1; background: rgba(244, 63, 94, .26); }

/* ── Inline question drawer — floats upward from the input box, visually merged ── */
/* .gal-box must be the positioning parent */
.gal-box { position: relative; }

.gal-idrawer {
  display: none;
  position: absolute;
  left: -1px; right: -1px;
  bottom: calc(100% - 1px);
  background: var(--gal-panel);
  border: 1px solid var(--gal-border-2);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 14px 16px 12px;
  z-index: 5;
  max-height: 66vh;
  overflow-y: auto;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, .55);
}
.gal-box.drawer-open .gal-idrawer { display: block; }
/* When drawer is open: square the top of the input box so it connects cleanly */
.gal-box.drawer-open {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-color: rgba(0, 212, 255, .4);
}
.gal-box.drawer-open .gal-idrawer { border-color: rgba(0, 212, 255, .4); }
.gal-box.drawer-open #galInput { display: none; }

.gal-idrawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.gal-drawer-title { font-family: var(--gal-head); font-weight: 600; font-size: 13.5px; color: var(--gal-text); }
.gal-idrawer-nav { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--gal-text-dim); flex-shrink: 0; }
.gal-drawer-arrow { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--gal-border-2); background: rgba(255,255,255,.04); color: var(--gal-text-dim); cursor: pointer; display: grid; place-items: center; transition: .15s; }
.gal-drawer-arrow:hover:not(:disabled) { color: var(--gal-cyan); border-color: var(--gal-cyan); }
.gal-drawer-arrow:disabled { opacity: .35; cursor: default; }
.gal-drawer-arrow i { width: 14px; height: 14px; }
.gal-drawer-body { min-height: 44px; }
.gal-drawer-qtext { font-family: 'DM Sans', var(--gal-font); font-size: 13px; font-weight: 600; color: var(--gal-text); margin-bottom: 10px; line-height: 1.4; }

/* checkbox (multi-select) questions */
.gal-checks { display: flex; flex-direction: column; gap: 5px; }
.gal-check { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--gal-border-2); background: var(--gal-panel-2); color: var(--gal-text); cursor: pointer; font-family: inherit; transition: border-color .14s, background .14s; }
.gal-check:hover { border-color: rgba(0, 212, 255, .4); }
.gal-check.sel { border-color: var(--gal-cyan); background: rgba(0, 212, 255, .1); }
.gal-check-box { width: 16px; height: 16px; flex-shrink: 0; border-radius: 4px; border: 1.5px solid var(--gal-border-2); display: grid; place-items: center; transition: .14s; }
.gal-check.sel .gal-check-box { background: linear-gradient(135deg, var(--gal-cyan), var(--gal-violet)); border-color: transparent; }
.gal-check-box i { width: 10px; height: 10px; color: #fff; }
.gal-check-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gal-check-label { font-size: 12.5px; font-weight: 500; }
.gal-check-desc { font-size: 11px; color: var(--gal-text-faint); }
.gal-check-all { background: transparent; border-style: dashed; }
.gal-check-all .gal-check-label { color: var(--gal-text-dim); }
.gal-check-all.sel { background: rgba(0, 212, 255, .07); }

/* option toggle-card grid (multi + single select) — custom, no native checkbox */
.gal-opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.gal-opt-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 13px 14px 12px; background: var(--gal-panel); border: 1.5px solid var(--gal-border);
  border-radius: 13px; cursor: pointer; transition: border-color .18s, background .18s;
}
.gal-opt-card:hover { border-color: rgba(0, 212, 255, 0.4); background: var(--gal-panel-2); }
.gal-opt-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.gal-opt-icon { font-size: 20px; line-height: 1; }
.gal-opt-label { font-size: 13.5px; font-weight: 500; color: var(--gal-text); line-height: 1.35; }
.gal-opt-desc { font-size: 11.5px; color: var(--gal-text-faint); line-height: 1.4; }
/* No checkmark dot — selection is shown purely by the card's glow. */
.gal-opt-check { display: none; }
.gal-opt-card:has(input:checked) {
  border-color: var(--gal-cyan);
  background: linear-gradient(135deg, rgba(0,212,255,0.14), rgba(124,58,237,0.12));
  box-shadow: 0 0 0 1px rgba(0,212,255,.4), 0 0 14px rgba(0,212,255,.25);
}
.gal-opt-all { border-style: dashed; }
/* colour-palette swatches inside option cards */
.gal-opt-swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.gal-swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* ── Branding cards (image source · palette · font pairing) ───────── */
.gal-q-hint { margin-top: 6px; font-size: 12px; color: var(--gal-text-faint); font-style: italic; }
.gal-q-note { margin-top: 12px; }

/* image source */
.gal-imgsrc-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gal-imgup { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.gal-imgup-thumb { max-width: 220px; max-height: 130px; border-radius: 10px; border: 1px solid var(--gal-border-2); object-fit: cover; }
.gal-imgup-btn { padding: 8px 14px; border-radius: 9px; border: 1px dashed var(--gal-border-2); background: var(--gal-bg); color: var(--gal-text); cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; transition: .15s; }
.gal-imgup-btn:hover { border-color: var(--gal-cyan); color: var(--gal-cyan); }
.gal-imgup-stat { font-size: 11.5px; color: var(--gal-text-faint); }

/* color palette */
.gal-pal-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gal-pal-card .gal-opt-swatches { margin-bottom: 2px; }
.gal-custompal { margin-top: 14px; padding: 13px; border: 1px solid var(--gal-border); border-radius: 12px; background: var(--gal-bg); }
.gal-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--gal-panel); border: 1px solid var(--gal-border); }
.gal-seg-btn { padding: 6px 14px; border-radius: 8px; border: none; background: transparent; color: var(--gal-text-dim); cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; transition: .15s; }
.gal-seg-btn.on { background: linear-gradient(135deg, var(--gal-cyan), var(--gal-violet)); color: #fff; }
.gal-color-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.gal-color-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gal-color-cell input[type=color] { width: 52px; height: 52px; padding: 0; border: 1px solid var(--gal-border-2); border-radius: 12px; background: none; cursor: pointer; }
.gal-color-cell input[type=color].gal-color-empty { opacity: .4; }
.gal-color-lab { font-size: 11px; color: var(--gal-text-faint); }

/* font pairing */
.gal-font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.gal-font-card { position: relative; display: block; padding: 14px 15px; background: var(--gal-panel); border: 1.5px solid var(--gal-border); border-radius: 13px; cursor: pointer; transition: border-color .18s, background .18s; }
.gal-font-card:hover { border-color: rgba(0, 212, 255, 0.4); }
.gal-font-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.gal-font-card.on, .gal-font-card:has(input:checked) { border-color: var(--gal-cyan); background: linear-gradient(135deg, rgba(0,212,255,0.12), rgba(124,58,237,0.10)); box-shadow: 0 0 0 1px rgba(0,212,255,.4), 0 0 14px rgba(0,212,255,.22); }
.gal-font-title { font-size: 21px; font-weight: 700; color: var(--gal-text); line-height: 1.15; }
.gal-font-body { margin-top: 5px; font-size: 13px; color: var(--gal-text-dim); line-height: 1.45; }
.gal-font-meta { margin-top: 9px; font-size: 11px; color: var(--gal-text-faint); }
.gal-customfont { margin-top: 14px; padding: 13px; border: 1px solid var(--gal-border); border-radius: 12px; background: var(--gal-bg); display: flex; flex-direction: column; gap: 12px; }
.gal-fontsel-cell { display: flex; flex-direction: column; gap: 5px; }
.gal-fontsel { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--gal-border-2); background: var(--gal-panel); color: var(--gal-text); font-size: 14px; cursor: pointer; }
.gal-font-livprev { padding: 12px; border-radius: 10px; background: var(--gal-panel); border: 1px solid var(--gal-border); }

.gal-idrawer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--gal-border); }
.gal-drawer-back { padding: 7px 14px; border-radius: 9px; border: 1px solid var(--gal-border-2); background: transparent; color: var(--gal-text-dim); cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; transition: .15s; }
.gal-drawer-back:hover:not(:disabled) { color: var(--gal-text); }
.gal-drawer-back:disabled { opacity: .35; cursor: default; }
.gal-drawer-submit { padding: 7px 18px; border-radius: 9px; border: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; background: linear-gradient(135deg, var(--gal-cyan), var(--gal-violet)); color: #fff; transition: opacity .15s; }
.gal-drawer-submit:disabled { opacity: .4; cursor: not-allowed; }

.gal-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; max-width: 760px; margin: 16px auto 0; }
body.gal-started .gal-pills { display: none; }
.gal-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 11px; border: 1px solid var(--gal-border-2); background: rgba(255, 255, 255, .03); color: var(--gal-text); cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 500; transition: .15s; }
.gal-pill:hover { border-color: var(--gal-cyan); background: rgba(0, 212, 255, .08); }
.gal-pill i { width: 15px; height: 15px; color: var(--gal-text-dim); }
.gal-pill:hover i { color: var(--gal-cyan); }
.gal-composer-hint { max-width: 760px; margin: 12px auto 0; text-align: center; font-size: 11.5px; color: var(--gal-text-faint); }
body.gal-idle .gal-composer-hint { display: none; }

/* ── Right: documents panel ────────────────────────────────────── */
.gal-docs { border-left: 1px solid var(--gal-border); background: rgba(9, 11, 17, 0.85); backdrop-filter: blur(14px); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.gal-docs-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; }
.gal-docs-title { font-family: var(--gal-head); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.gal-docs-title i { width: 17px; height: 17px; color: var(--gal-cyan); }
.gal-docs-list { flex: 1; overflow-y: auto; padding: 6px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.gal-doc { background: var(--gal-panel); border: 1px solid var(--gal-border); border-radius: 16px; padding: 15px; opacity: 0; transform: translateY(8px); animation: galPop .42s ease forwards; }
/* Small live preview thumbnail for the GS Form / Mini-site files. */
.gal-doc-prev { position: relative; height: 152px; border-radius: 11px; overflow: hidden; border: 1px solid var(--gal-border); margin-bottom: 13px; background: var(--gal-bg); }
.gal-doc-prev iframe { position: absolute; top: 0; left: 0; width: 250%; height: 250%; border: 0; transform: scale(.4); transform-origin: top left; pointer-events: none; }
.gal-doc-prev-open { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.gal-doc-prev::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); border-radius: 11px; pointer-events: none; }
@keyframes galPop { to { opacity: 1; transform: translateY(0); } }
.gal-doc-top { display: flex; align-items: center; gap: 12px; }
.gal-doc-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 40px; }
.gal-doc-ic i { width: 20px; height: 20px; }
.gal-doc.minisite .gal-doc-ic { background: rgba(0, 212, 255, .12); color: var(--gal-cyan); }
.gal-doc.gsform .gal-doc-ic { background: rgba(124, 58, 237, .16); color: #a78bfa; }
.gal-doc.dashboard .gal-doc-ic { background: rgba(46, 204, 113, .14); color: var(--gal-ok); }
.gal-doc.pass .gal-doc-ic { background: rgba(245, 158, 11, .16); color: #f59e0b; }
.gal-doc.mail .gal-doc-ic { background: rgba(236, 72, 153, .15); color: #ec4899; }
.gal-doc.budget .gal-doc-ic { background: rgba(34, 197, 94, .15); color: #22c55e; }
.gal-doc-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.gal-doc-kind { font-size: 11px; color: var(--gal-text-faint); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.gal-doc-meta { font-size: 12.5px; color: var(--gal-text-dim); margin: 11px 0 0; line-height: 1.45; }
.gal-doc-actions { display: flex; gap: 8px; margin-top: 13px; }
.gal-doc-btn { flex: 1; text-align: center; padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid var(--gal-border-2); color: var(--gal-text); background: var(--gal-panel-2); transition: .15s; }
.gal-doc-btn:hover { border-color: var(--gal-cyan); color: var(--gal-cyan); }
.gal-doc-btn.primary { background: linear-gradient(135deg, var(--gal-cyan), var(--gal-violet)); color: #fff; border: none; }
.gal-doc.failed { border-color: rgba(255, 92, 108, .4); }
.gal-doc.failed .gal-doc-ic { background: rgba(255, 92, 108, .14); color: var(--gal-err); }

/* Persistent docs-panel toggle — visible when docs exist but panel is closed */
.gal-docs-toggle { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--gal-border-2); background: var(--gal-panel); color: var(--gal-text-dim); cursor: pointer; display: none; place-items: center; transition: .15s; z-index: 5; }
.gal-docs-toggle i { width: 16px; height: 16px; }
.gal-docs-toggle:hover { border-color: var(--gal-cyan); color: var(--gal-cyan); background: rgba(0,212,255,.06); }
body.gal-has-docs:not(.gal-docs-open) .gal-docs-toggle { display: grid; }

/* scrollbars */
.gal-rail-scroll::-webkit-scrollbar, .gal-chat::-webkit-scrollbar, .gal-docs-list::-webkit-scrollbar, .gal-library::-webkit-scrollbar { width: 8px; }
.gal-rail-scroll::-webkit-scrollbar-thumb, .gal-chat::-webkit-scrollbar-thumb, .gal-docs-list::-webkit-scrollbar-thumb, .gal-library::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 8px; }
.gal-rail-scroll::-webkit-scrollbar-thumb:hover, .gal-chat::-webkit-scrollbar-thumb:hover, .gal-docs-list::-webkit-scrollbar-thumb:hover, .gal-library::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .18); }
.gal-rail-scroll::-webkit-scrollbar-track, .gal-chat::-webkit-scrollbar-track, .gal-docs-list::-webkit-scrollbar-track, .gal-library::-webkit-scrollbar-track { background: transparent; }
.gal-library { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }

/* ── Lucide icon sizing fix ────────────────────────────────────────
   Lucide replaces each <i data-lucide> placeholder with an <svg>, so the
   `i { width }` rules above don't size the rendered icon (it defaults to
   24px). Mirror every icon size onto the svg so they actually shrink. */
.gal-rail-logo-icon svg { width: 19px; height: 19px; }
.gal-icon-btn svg { width: 16px; height: 16px; }
.gal-rail-search > svg { width: 15px; height: 15px; }
.gal-search-x svg { width: 14px; height: 14px; }
.gal-rail-expand-hint svg { width: 20px; height: 20px; }
.gal-lib-card-ic svg { width: 21px; height: 21px; }
.gal-agent-ic svg { width: 16px; height: 16px; }
.gal-attach-btn svg { width: 18px; height: 18px; }
.gal-attach-chip .gal-attach-ic svg { width: 15px; height: 15px; }
.gal-drawer-arrow svg { width: 14px; height: 14px; }
.gal-pill svg { width: 15px; height: 15px; }
.gal-docs-title svg { width: 17px; height: 17px; }
.gal-doc-ic svg { width: 20px; height: 20px; }
.gal-doc-img { width: 30px; height: 30px; object-fit: contain; display: block; }
.gal-doc.mail .gal-doc-img { width: 40px; height: 40px; }
.gal-docs-toggle svg { width: 16px; height: 16px; }
.gal-msg-user .gal-msg-doc svg { width: 14px; height: 14px; }

/* responsive */
@media (max-width: 1024px) {
  .gal-shell, body.gal-rail-collapsed .gal-shell { grid-template-columns: var(--gal-rail-collapsed) 1fr 0; }
  body.gal-docs-open .gal-shell, body.gal-rail-collapsed.gal-docs-open .gal-shell { grid-template-columns: var(--gal-rail-collapsed) 1fr 0; }
  .gal-docs { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 92vw); transform: translateX(100%); transition: transform .3s; z-index: 30; }
  body.gal-docs-open .gal-docs { transform: translateX(0); }
  .gal-greet { font-size: 34px; }
}

/* ── Light Theme ──────────────────────────────────────────────── */
[data-theme="light"] {
  --gal-bg:         #f0f4f8;
  --gal-panel:      #ffffff;
  --gal-panel-2:    #f4f7fb;
  --gal-border:     rgba(0, 0, 0, 0.08);
  --gal-border-2:   rgba(0, 0, 0, 0.13);
  --gal-text:       #0f172a;
  --gal-text-dim:   #475569;
  --gal-text-faint: #94a3b8;
}

[data-theme="light"] body { background: var(--gal-bg); color: var(--gal-text); }
[data-theme="light"] .gal-aurora { opacity: 0 !important; }
