/* Stik live demo — same darkroom palette as the LP / extension side panel. */
:root {
  --bg: #0e1612; --bg-sunken: #0a0f0c;
  --surface: #122019; --surface-2: #16271f; --surface-hi: #1c3327;
  --line: #1f3a2d; --line-soft: #182c22;
  --ink: #e8f1ec; --ink-soft: #9db3a8; --ink-mute: #6f897c; --ink-faint: #5f786d80;
  --accent: #4ade9a; --accent-hi: #6ee9b0; --accent-deep: #2f9d6e;
  --accent-glow: #4ade9a40; --accent-faint: #4ade9a1f; --on-accent: #08130d;
  --err: #e2685f;
  --font-display: ui-serif, 'Hiragino Mincho ProN', 'Yu Mincho', Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-1: 6px; --r-2: 10px; --r-3: 14px; --r-pill: 999px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* keep hidden overlays truly gone even when a class sets display (same fix as the extension) */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% 0%, var(--bg) 0%, var(--bg-sunken) 60%), var(--bg-sunken);
  color: var(--ink); font-family: var(--font-body); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: var(--r-1); }

.demo { display: flex; gap: 12px; height: 100vh; padding: 12px; }

/* ===== fake webpage (left) ===== */
.page-col { flex: 1 1 auto; min-width: 0; display: flex; }
.browser {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  overflow: hidden; box-shadow: 0 8px 24px #000a;
}
.browser-tabs {
  display: flex; gap: 4px; padding: 6px 8px 0;
  background: var(--bg-sunken); border-bottom: 1px solid var(--line-soft);
}
.btab {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; padding: 6px 14px; border: 1px solid transparent; border-bottom: none;
  border-radius: 8px 8px 0 0; background: transparent; color: var(--ink-mute); max-width: 190px;
}
.btab.on { background: var(--surface-2); border-color: var(--line-soft); color: var(--ink); }
.btab.pulse { color: var(--ink); animation: tab-pulse 1.4s ease-in-out infinite; }
@keyframes tab-pulse { 0%,100% { box-shadow: inset 0 -2px 0 var(--accent), 0 0 0 0 #4ade9a00; } 50% { box-shadow: inset 0 -2px 0 var(--accent), 0 0 12px 2px var(--accent-glow); } }
.btab-fav { width: 14px; height: 14px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 9px; }
.btab-fav.g4 { background: conic-gradient(#4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75%); }
.btab-fav.xf { background: #000; color: #fff; border: 1px solid #333; font-weight: 700; }
.browser-bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  background: var(--surface-2); border-bottom: 1px solid var(--line-soft);
}
.tl-dot { width: 10px; height: 10px; border-radius: 50%; }
.tl-dot.r { background: #e2685f; } .tl-dot.y { background: #d8a24a; } .tl-dot.g { background: #4ade9a; }
.urlbar {
  flex: 1; margin-left: 6px; padding: 3px 12px; font-size: 11px; color: var(--ink-mute);
  background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: var(--r-pill);
}
.page { position: relative; flex: 1; overflow: hidden; background: #fff; }
.site { position: absolute; inset: 0; overflow: hidden; }
.page-live-hint { margin: 12px 20px; font-size: 11px; color: #9aa0a6; }

/* --- Google SERP (light, faithful) --- */
.site-google { background: #fff; color: #202124; font-family: arial, sans-serif; padding: 14px 20px; }
.g-top { display: flex; align-items: center; gap: 22px; margin-bottom: 10px; }
.g-logo { font-family: arial, sans-serif; font-size: 24px; font-weight: 500; letter-spacing: -1px; user-select: none; }
.g-logo .gb { color: #4285f4; } .g-logo .gr { color: #ea4335; } .g-logo .gy { color: #fbbc05; } .g-logo .gg { color: #34a853; }
.g-box {
  display: flex; align-items: center; flex: 1; max-width: 480px;
  border: 1px solid #dfe1e5; border-radius: 999px; padding: 7px 16px; box-shadow: 0 1px 4px #2015;
}
.g-input { flex: 1; border: none; outline: none; font-size: 13.5px; color: #202124; background: transparent; font-family: arial, sans-serif; }
.g-ico { font-size: 12px; filter: grayscale(1) opacity(.6); }
.g-tabs { display: flex; gap: 20px; font-size: 12px; color: #5f6368; border-bottom: 1px solid #ebebeb; padding: 4px 0 8px 2px; }
.g-tabs .on { color: #1a73e8; font-weight: 500; box-shadow: 0 10px 0 -7px #1a73e8; }
.g-stats { font-size: 11.5px; color: #70757a; margin: 8px 0 4px 2px; }
.g-result { padding: 9px 2px; max-width: 560px; }
.g-cite { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #202124; }
.g-fav { width: 18px; height: 18px; border-radius: 50%; background: #f1f3f4; display: grid; place-items: center; font-size: 10px; flex: none; }
.g-cite .g-url { color: #4d5156; }
.g-title { font-size: 16px; color: #1a0dab; margin: 3px 0 2px; cursor: pointer; }
.g-title:hover { text-decoration: underline; }
.g-snippet { font-size: 12.5px; color: #4d5156; line-height: 1.45; }
.g-snippet em { font-style: normal; font-weight: 700; }

/* --- X timeline (dark, faithful) --- */
.site-x { background: #000; color: #e7e9ea; font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; display: flex; }
.x-rail { width: 56px; border-right: 1px solid #2f3336; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; }
.x-glyph { font-size: 22px; margin-bottom: 10px; }
.x-ric { width: 36px; height: 36px; display: grid; place-items: center; font-size: 15px; color: #e7e9ea; border-radius: 50%; opacity: .85; }
.x-main { flex: 1; min-width: 0; overflow: hidden; }
.x-head { font-size: 14.5px; font-weight: 800; padding: 10px 16px; border-bottom: 1px solid #2f3336; }
.x-compose { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #2f3336; }
.x-av { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.x-av.me { background: linear-gradient(135deg, #1d9bf0, #7856ff); }
.x-cbody { flex: 1; min-width: 0; }
.x-crow { display: flex; align-items: center; gap: 10px; }
.x-attach { display: flex; gap: 6px; margin-top: 8px; }
.x-att { position: relative; width: 72px; height: 52px; border-radius: 10px; overflow: hidden; border: 1px solid #2f3336; }
.x-att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-att-x {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; padding: 0;
  display: grid; place-items: center; font-size: 11px; line-height: 1;
  background: #000c; color: #fff; border: none; border-radius: 50%;
}
.x-media { display: flex; gap: 6px; margin-top: 8px; max-width: 480px; }
.x-media img {
  border-radius: 12px; border: 1px solid #2f3336; height: 150px; max-width: 100%;
  object-fit: cover; cursor: zoom-in; transition: filter .12s ease;
}
.x-media img:hover { filter: brightness(1.12); }
.x-media.multi img { flex: 1; min-width: 0; height: 110px; }
.x-paste-hint {
  display: inline-flex; align-items: center; margin-top: 8px;
  font-size: 11.5px; font-weight: 600; color: #1d9bf0;
  border: 1.5px dashed #1d9bf0; border-radius: 999px; padding: 4px 12px;
  animation: hint-pop .25s ease;
}
@keyframes hint-pop { 0% { transform: scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
.x-input { flex: 1; background: transparent; border: none; outline: none; color: #e7e9ea; font-size: 14px; }
.x-input::placeholder { color: #71767b; }
.x-post { font-size: 12.5px; font-weight: 700; padding: 6px 16px; border-radius: 999px; background: #eff3f4; color: #0f1419; border: none; }
.x-post:hover { background: #d7dbdc; }
.x-post.pulse { animation: x-pulse 1.4s ease-in-out infinite; }
@keyframes x-pulse { 0%,100% { box-shadow: 0 0 0 0 #1d9bf000; } 50% { box-shadow: 0 0 0 6px #1d9bf055; } }
.x-tweet { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #2f3336; }
.x-tweet .x-body { flex: 1; min-width: 0; }
.x-meta { font-size: 13px; }
.x-meta b { font-weight: 700; }
.x-meta span { color: #71767b; font-weight: 400; }
.x-text { font-size: 13.5px; line-height: 1.4; margin-top: 1px; word-wrap: break-word; }
.x-acts { display: flex; gap: 42px; margin-top: 7px; font-size: 12px; color: #71767b; }
.x-act { display: flex; align-items: center; gap: 5px; background: none; border: none; color: #71767b; font-size: 12px; }
.x-act:hover { color: #1d9bf0; }
.x-act.like.on { color: #f91880; }

/* selection overlay */
.select-overlay { position: absolute; inset: 0; cursor: crosshair; background: #0008; z-index: 5; }
.select-rect { position: absolute; border: 1.5px dashed var(--accent); background: var(--accent-faint); display: none; }
.select-tip {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: var(--r-pill); pointer-events: none;
}
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 6; }
.flash.go { animation: flash .28s ease-out; }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }

/* ===== stik side panel (right) ===== */
.panel {
  flex: 0 0 232px; display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: 12px; box-shadow: 0 8px 24px #000a;
}
.panel-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.p-logo { width: 20px; height: 20px; display: block; }
.p-logo svg { width: 100%; height: 100%; display: block; }
.p-name { font-family: var(--font-display); font-size: 16px; }
.p-tag { margin-left: auto; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }

.mode-row { display: flex; gap: 4px; background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: var(--r-2); padding: 3px; margin-bottom: 10px; }
.mode-btn {
  flex: 1; font-size: 10.5px; font-weight: 600; padding: 5px 0; border: none; border-radius: var(--r-1);
  background: transparent; color: var(--ink-mute);
}
.mode-btn.on { background: var(--surface-hi); color: var(--accent); }
.mode-btn.locked { color: var(--ink-faint); cursor: not-allowed; }

.capture-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; font-size: 13px; font-weight: 700;
  background: var(--accent); color: var(--on-accent); border: none; border-radius: var(--r-2);
  box-shadow: 0 0 0 1px var(--accent-deep), 0 6px 20px var(--accent-glow);
  transition: transform .1s ease, background .15s ease;
}
.capture-btn:hover { background: var(--accent-hi); }
.capture-btn:active { transform: scale(.97); }
.capture-btn svg { width: 17px; height: 17px; }
.capture-btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 1px var(--accent-deep), 0 6px 20px var(--accent-glow); } 50% { box-shadow: 0 0 0 1px var(--accent-deep), 0 0 0 7px #4ade9a22; } }

.tray-head, .groups-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 6px; }
.tray-title, .groups-head { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); font-weight: 700; }
.group-btn {
  font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-hi); color: var(--accent); border: 1px solid var(--line);
}
.group-btn:disabled { color: var(--ink-faint); background: transparent; cursor: default; }
.group-btn.pulse { animation: pulse 1.6s ease-in-out infinite; }

.tray { display: flex; flex-wrap: wrap; gap: 6px; min-height: 58px; align-content: flex-start; }
.tray-empty, .groups-empty { font-size: 11px; color: var(--ink-mute); padding: 8px 4px; }
.step-n {
  display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 3px;
  font-size: 9px; font-weight: 800; color: var(--on-accent); background: var(--accent); border-radius: 50%;
}
.thumb {
  position: relative; width: 62px; height: 44px; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; background: var(--bg-sunken); padding: 0;
  animation: drop .28s cubic-bezier(.2,.9,.3,1.2);
}
.thumb canvas, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: var(--accent-deep); }
.thumb .edit-tip {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 700;
  color: var(--ink); background: #0a0f0ccc; opacity: 0; transition: opacity .12s ease;
}
.thumb:hover .edit-tip { opacity: 1; }
.chip-copy {
  position: absolute; top: 3px; left: 3px; z-index: 2;
  width: 18px; height: 18px; display: grid; place-items: center; padding: 0;
  background: #0a0f0cd9; color: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  opacity: 0; transition: opacity .12s ease;
}
.chip-copy svg { width: 11px; height: 11px; }
.thumb:hover .chip-copy, .chip-copy:focus-visible { opacity: 1; }
.chip-copy:hover { color: var(--accent); border-color: var(--accent-deep); }
@keyframes drop { 0% { transform: translateY(-14px) scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }

.groups { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.group-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 8px; animation: drop .3s ease; }
.group-name { font-size: 11.5px; font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.group-count { font-size: 10px; color: var(--ink-mute); font-weight: 500; }
.group-thumbs { display: flex; gap: 4px; margin-bottom: 8px; }
.group-thumbs .thumb { width: 44px; height: 32px; animation: none; }
.share-btn {
  width: 100%; font-size: 11px; font-weight: 700; padding: 6px; border-radius: var(--r-1);
  background: var(--surface-hi); color: var(--accent); border: 1px solid var(--accent-deep);
}
.share-btn:hover { background: var(--accent); color: var(--on-accent); }
.share-btn.pulse { animation: pulse 1.6s ease-in-out infinite; }

/* ===== mock OS share sheet ===== */
.sharesheet { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: #0008; }
.sheet {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(340px, calc(100% - 24px));
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 8px 12px 12px; box-shadow: 0 24px 64px #000d; animation: sheet-up .22s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes sheet-up { 0% { transform: translate(-50%, 24px); opacity: 0; } 100% { transform: translateX(-50%); opacity: 1; } }
.sheet-grab { width: 34px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 8px; }
.sheet-head { font-size: 12px; margin-bottom: 8px; }
.sheet-head .sheet-src { color: var(--ink-mute); }
.sheet-previews { display: flex; gap: 5px; margin-bottom: 10px; }
.sheet-previews canvas { width: 58px; height: 42px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-sunken); }
.sheet-row { display: flex; gap: 6px; margin-bottom: 10px; }
.sheet-app {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 9.5px; color: var(--ink-soft); padding: 8px 2px; border: none; border-radius: var(--r-2);
  background: var(--surface-hi);
}
.sheet-app:hover { color: var(--ink); }
.sheet-ico { font-size: 17px; }
.sheet-list { display: flex; flex-direction: column; gap: 6px; }
.sheet-item {
  width: 100%; font-size: 12.5px; font-weight: 600; padding: 9px; border-radius: var(--r-2);
  background: var(--surface-hi); color: var(--ink); border: 1px solid var(--line);
}
.sheet-item.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent-deep); font-weight: 700; }
.sheet-item.accent:hover { background: var(--accent-hi); }
.sheet-item:not(.accent):hover { background: var(--surface-hi); border-color: var(--accent-deep); }

.panel-foot { margin-top: 10px; font-size: 9.5px; color: var(--ink-faint); display: flex; gap: 6px; align-items: center; }
.foot-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px 1px var(--accent-glow); flex: none; }

/* ===== editor overlay ===== */
.editor { position: fixed; inset: 0; z-index: 20; background: #0a0f0cf2; display: flex; flex-direction: column; }
.ed-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft); background: var(--surface);
}
.ed-title { font-family: var(--font-display); font-size: 14px; color: var(--ink-soft); }
.ed-top-right { display: flex; gap: 8px; }
.ed-btn { font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); }
.ed-btn.ghost { background: var(--surface-2); color: var(--ink); }
.ed-btn.ghost:hover { background: var(--surface-hi); }
.ed-btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent-deep); }
.ed-btn.accent:hover { background: var(--accent-hi); }
.ed-body { flex: 1; display: flex; min-height: 0; }
.ed-dock { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; border-right: 1px solid var(--line-soft); background: var(--surface); }
.tool {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; color: var(--ink-soft); border: 1px solid transparent; border-radius: var(--r-2);
}
.tool svg { width: 19px; height: 19px; }
.tool:hover { background: var(--surface-hi); color: var(--ink); }
.tool.on { background: var(--accent-faint); color: var(--accent); border-color: var(--accent-deep); }
.tool .pro {
  position: absolute; top: -4px; right: -6px; font-size: 7px; font-weight: 800; letter-spacing: .05em;
  padding: 1px 4px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
}
.ed-stage { position: relative; flex: 1; display: grid; place-items: center; padding: 16px; min-width: 0; }
#ed-canvas { max-width: 100%; max-height: 100%; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 24px 64px #000c; cursor: crosshair; touch-action: none; }
.ed-textinput {
  position: absolute; z-index: 5; font-family: var(--font-body); font-size: 14px; font-weight: 700;
  color: var(--err); background: #fff; border: 1.5px solid var(--err); border-radius: 4px; padding: 2px 6px; outline: none;
}
.ed-hint { text-align: center; font-size: 11px; color: var(--ink-mute); padding: 8px; border-top: 1px solid var(--line-soft); background: var(--surface); }

/* ===== lightbox ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 35; background: #000d;
  display: grid; place-items: center; cursor: zoom-out; animation: lb-in .15s ease;
}
@keyframes lb-in { 0% { opacity: 0; } 100% { opacity: 1; } }
.lightbox img {
  max-width: 92%; max-height: 92%; border-radius: 10px;
  border: 1px solid #2f3336; box-shadow: 0 24px 80px #000;
  animation: lb-img .18s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes lb-img { 0% { transform: scale(.92); } 100% { transform: none; } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40;
  max-width: 90%; font-size: 12px; font-weight: 600; color: var(--ink); text-align: center;
  background: var(--surface-hi); border: 1px solid var(--accent-deep); border-radius: var(--r-2);
  padding: 10px 18px; box-shadow: 0 8px 24px #000c; animation: drop .25s ease;
}
.toast b { color: var(--accent); }

/* small screens: stack, shrink panel */
@media (max-width: 640px) {
  body { overflow: auto; }
  .demo { flex-direction: column; height: auto; min-height: 100vh; }
  .panel { flex: none; }
  .page { min-height: 300px; }
}
