/* ===== lab/ui/mallang.css ===== */
/* 말랑 랩 공통 스타일 — 핑크 파스텔, 젤리 캔디 질감. */

:root {
  /* 색 토큰 */
  --pink-25: #fffafc;
  --pink-50: #fff3f7;
  --pink-100: #ffe5ee;
  --pink-200: #ffd0df;
  --pink-300: #ffb4ca;
  --pink-400: #ff92b2;
  --pink-500: #f46d98;
  --pink-600: #d94f7e;
  --pink-700: #b23a64;
  --ink: #5b3546;
  --ink-soft: #94707f;
  --ink-faint: #c4a6b2;
  --paper: #fffafc;
  --mint-100: #dcf7ec;
  --mint-300: #9fe3c7;
  --mint-600: #3a9d78;
  --butter-100: #fff4cf;
  --butter-300: #ffe08a;
  --butter-600: #b38a1c;
  --lilac-100: #efe7ff;
  --lilac-300: #cdb9ff;
  --lilac-600: #7a5cc9;
  --ash-100: #f1e9ec;
  --ash-300: #d6c6cc;
  --ash-600: #8d7680;

  --bg: radial-gradient(1200px 700px at 12% -10%, #ffe1ec 0%, transparent 60%),
        radial-gradient(900px 600px at 100% 0%, #f3e6ff 0%, transparent 55%),
        radial-gradient(900px 700px at 60% 110%, #ffe9dc 0%, transparent 60%),
        #fff4f8;

  /* 형태 토큰 */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;
  --gap: 16px;

  /* 젤리 그림자: 아래가 도톰한 두께 + 부드러운 확산 */
  --jelly-depth: 0 5px 0 -1px var(--pink-200), 0 14px 22px -12px rgba(178, 58, 100, 0.45);
  --jelly-depth-sm: 0 3px 0 -1px var(--pink-200), 0 8px 14px -8px rgba(178, 58, 100, 0.4);
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.0) 100%);

  /* 글꼴 */
  --font-title: 'Jua', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --font-body: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* 움직임 */
  --spring: cubic-bezier(0.34, 1.7, 0.5, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}
button, input, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }
.title { font-family: var(--font-title); font-weight: 400; letter-spacing: -0.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 젤리 캔디 기본기 ---------- */
@keyframes jelly-squish {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.07, 0.9); }
  55% { transform: scale(0.97, 1.05); }
  78% { transform: scale(1.03, 0.97); }
  100% { transform: scale(1.03, 0.96); }
}
@keyframes jelly-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.18, 0.86); }
  65% { transform: scale(0.94, 1.08); }
  100% { transform: scale(1); }
}

.jelly {
  --c: var(--pink-100);
  --c-top: #fff;
  --c-edge: var(--pink-200);
  --c-ink: var(--ink);
  position: relative;
  border: 0;
  cursor: pointer;
  color: var(--c-ink);
  background: linear-gradient(180deg, var(--c-top) -30%, var(--c) 70%);
  border-radius: var(--r-pill);
  box-shadow: inset 0 -3px 0 var(--c-edge), 0 3px 0 -1px var(--c-edge), 0 7px 12px -8px rgba(178, 58, 100, 0.45);
  transform-origin: 50% 100%;
  isolation: isolate; /* 광택(::before)을 글자 뒤로 */
  transition: transform 0.45s var(--spring), box-shadow 0.2s ease, background 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}
.jelly::before {
  content: '';
  position: absolute;
  left: 16%; right: 16%; top: 2px; height: 42%;
  border-radius: var(--r-pill);
  background: var(--gloss);
  opacity: 0.85;
  pointer-events: none;
  z-index: -1;
}
.jelly:hover { animation: jelly-squish 0.5s var(--ease-out) forwards; }
.jelly:active { transform: scale(1.08, 0.86); animation: none; box-shadow: inset 0 -1px 0 var(--c-edge), 0 1px 0 -1px var(--c-edge), 0 3px 6px -4px rgba(178, 58, 100, 0.4); }
.jelly:focus-visible { outline: 3px solid var(--pink-300); outline-offset: 2px; }
.jelly.pop { animation: jelly-pop 0.45s var(--ease-out); }

.jelly.is-on { --c: var(--pink-400); --c-top: #ffd3e1; --c-edge: var(--pink-600); --c-ink: #fff; text-shadow: 0 1px 0 rgba(178, 58, 100, 0.45); }
.jelly.tone-keep.is-on, .jelly.tone-mutate.is-on, .jelly.tone-kill.is-on { text-shadow: none; }
.jelly.tone-keep.is-on { --c: var(--mint-300); --c-top: #effff8; --c-edge: var(--mint-600); --c-ink: #1f5c46; }
.jelly.tone-mutate.is-on { --c: var(--butter-300); --c-top: #fffbea; --c-edge: var(--butter-600); --c-ink: #6b4f00; }
.jelly.tone-kill.is-on { --c: var(--ash-300); --c-top: #fbf7f8; --c-edge: var(--ash-600); --c-ink: #4b3a41; }

.chip {
  padding: 6px 13px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.chip.small { padding: 3px 9px; font-size: 12px; }

.heart {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--pink-300);
}
.heart.is-on { color: #fff; }
.heart svg { width: 19px; height: 19px; position: relative; }

/* 카드/패널 공통 표면 */
.surface {
  position: relative;
  background: linear-gradient(180deg, #fff 0%, var(--pink-25) 60%, var(--pink-50) 100%);
  border-radius: var(--r-lg);
  box-shadow: inset 0 -4px 0 rgba(255, 180, 202, 0.35), var(--jelly-depth);
}
.surface::before {
  content: '';
  position: absolute;
  left: 8%; right: 8%; top: 4px; height: 26px;
  border-radius: var(--r-pill);
  background: var(--gloss);
  opacity: 0.9;
  pointer-events: none;
  z-index: 1;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--ink-faint); }

/* 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: var(--pink-200) transparent; }

@media (prefers-reduced-motion: reduce) {
  .jelly:hover, .jelly.pop { animation: none; }
  .jelly { transition: none; }
}

/* ---------- 변이 종류 표시(variantInfo.kind) ---------- */
.kind-dot {
  display: inline-block; flex: none;
  width: 8px; height: 8px; border-radius: 50%;
  vertical-align: 1px; margin-right: 5px;
  background: var(--ash-300);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}
.kind-dot[data-kind='color'] { background: conic-gradient(#ff7aa2, #ffd25e, #6fd6a8, #7fb2ff, #b98cff, #ff7aa2); }
.kind-dot[data-kind='feel'] { background: var(--pink-500); }
.kind-dot[data-kind='shape'] { background: var(--mint-600); }
.kind-dot[data-kind='type'] { background: var(--lilac-600); }
.kind-chip {
  display: inline-flex; align-items: center;
  font-size: 11.5px; line-height: 1.2; padding: 2px 9px 2px 7px; border-radius: var(--r-pill);
  background: var(--ash-100); color: var(--ash-600); white-space: nowrap;
}
.kind-chip .kind-dot { margin-right: 4px; vertical-align: 0; }
.kind-chip[data-kind='color'] { background: var(--butter-100); color: var(--butter-600); }
.kind-chip[data-kind='feel'] { background: var(--pink-100); color: var(--pink-700); }
.kind-chip[data-kind='shape'] { background: var(--mint-100); color: var(--mint-600); }
.kind-chip[data-kind='type'] { background: var(--lilac-100); color: var(--lilac-600); }

/* ===== lab/ui/viewer.css ===== */
/* 단일 뷰어 + 평가 패널 */

html, body { overflow: hidden; }
.app {
  --panel-w: 352px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  height: 100vh;
  transition: grid-template-columns 0.5s var(--spring);
}
.app.panel-closed { grid-template-columns: minmax(0, 1fr) 0px; }

/* ---------- 무대 ---------- */
.stage { position: relative; min-width: 0; overflow: hidden; }
.canvas-wrap { position: absolute; inset: 0; }
#view, .canvas-wrap canvas { display: block; width: 100%; height: 100%; outline: none; cursor: grab; }
.canvas-wrap canvas:active { cursor: grabbing; }

.hud { position: absolute; z-index: 2; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { left: 18px; right: 18px; top: 16px; display: flex; align-items: flex-start; gap: 12px; }
.hud-bottom { left: 18px; right: 18px; bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }

.back, .nav-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; padding: 0;
  --c: #fff; --c-top: #fff; --c-edge: var(--pink-200);
  color: var(--pink-600);
  text-decoration: none;
}
.back svg, .nav-btn svg { width: 20px; height: 20px; position: relative; }
.nav-btn:disabled { opacity: 0.35; pointer-events: none; }

.who { min-width: 0; flex: 1; }
.who-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.name {
  margin: 0; font-size: 26px; line-height: 1.15; color: var(--pink-700);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9), 0 0 18px rgba(255, 255, 255, 0.8);
}
.sp-id { font-size: 12px; color: var(--ink-soft); background: rgba(255, 255, 255, 0.7); padding: 2px 8px; border-radius: var(--r-pill); }
.variants { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.variants:empty { display: none; }
.variants .chip { --c: rgba(255, 255, 255, 0.92); --c-top: #fff; padding: 4px 12px; font-size: 12.5px; }
.variants .chip.is-on { --c: var(--pink-500); --c-top: var(--pink-400); --c-edge: var(--pink-700); --c-ink: #fff; }
.nav-arrows { display: flex; gap: 8px; flex: none; }

.hint {
  margin: 0; font-size: 12px; color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  padding: 5px 12px; border-radius: var(--r-pill);
  transition: opacity 0.8s ease;
}
.hint.faded { opacity: 0; }
.engine-badge {
  font-size: 11px; padding: 4px 10px; border-radius: var(--r-pill);
  color: var(--butter-600); background: var(--butter-100);
  box-shadow: inset 0 -2px 0 rgba(179, 138, 28, 0.25);
  margin-left: auto;
}

.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; padding: 24px; }
.stage-msg[hidden] { display: none; }
.msg-card { max-width: 440px; padding: 28px 30px 26px; text-align: center; }
.msg-card h2 { margin: 6px 0 8px; font-size: 22px; color: var(--pink-700); position: relative; z-index: 2; }
.msg-card p { margin: 0; color: var(--ink-soft); white-space: pre-wrap; position: relative; z-index: 2; }
.msg-blob {
  width: 64px; height: 52px; margin: 0 auto;
  border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, transparent 13%), linear-gradient(180deg, var(--pink-200), var(--pink-400));
  box-shadow: inset 0 -5px 0 rgba(178, 58, 100, 0.25);
  animation: blob-breathe 1.6s ease-in-out infinite;
}
.stage-msg.error .msg-blob { filter: grayscale(0.5); animation: none; }
@keyframes blob-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.08, 0.92); } }

.panel-tab {
  position: absolute; z-index: 2; right: 10px; top: 50%;
  width: 30px; height: 64px; margin-top: -32px; padding: 0;
  border-radius: 16px;
  display: grid; place-items: center;
  --c: rgba(255, 255, 255, 0.95); --c-top: #fff;
  color: var(--pink-500);
}
.panel-tab svg { width: 18px; height: 18px; transition: transform 0.4s var(--spring); position: relative; }
.app.panel-closed .panel-tab svg { transform: rotate(180deg); }

/* ---------- 평가 패널 ---------- */
.panel { min-width: 0; overflow: hidden; position: relative; }
.panel-inner {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: calc(var(--panel-w) - 12px);
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 18px 14px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 246, 250, 0.96));
  box-shadow: inset 0 -4px 0 rgba(255, 180, 202, 0.35), var(--jelly-depth);
  transition: transform 0.5s var(--spring), opacity 0.3s ease;
}
.panel-inner::before {
  content: ''; position: absolute; left: 10%; right: 10%; top: 5px; height: 22px;
  border-radius: var(--r-pill); background: var(--gloss); pointer-events: none;
}
.app.panel-closed .panel-inner { transform: translateX(40px) scale(0.96); opacity: 0; pointer-events: none; }

.panel-head { display: flex; align-items: center; gap: 8px; position: relative; }
.panel-head h2 { margin: 0; font-size: 20px; color: var(--pink-700); }
.target-chip {
  font-size: 12px; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--pink-100); color: var(--pink-600);
}
.save-state { margin-left: auto; font-size: 12px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.save-state[data-s='saved'] .status-dot { background: var(--mint-600); }
.save-state[data-s='pending'] .status-dot,
.save-state[data-s='saving'] .status-dot { background: var(--butter-300); animation: blink 0.8s ease-in-out infinite; }
.save-state[data-s='error'] { color: var(--pink-700); }
.save-state[data-s='error'] .status-dot { background: var(--pink-600); }
@keyframes blink { 50% { opacity: 0.3; } }

.block { position: relative; }
.row-top { display: flex; align-items: center; gap: 12px; }
.heart.big { width: 48px; height: 48px; flex: none; }
.heart.big svg { width: 24px; height: 24px; }
.verdicts { display: flex; gap: 6px; flex: 1; }
.verdicts .chip { flex: 1; padding: 9px 4px; font-family: var(--font-title); font-size: 15px; }

/* 점수 */
.scores { display: flex; flex-direction: column; gap: 8px; }
.axis { display: grid; grid-template-columns: 52px 1fr 22px; align-items: center; gap: 8px; }
.axis-label { font-size: 13px; color: var(--ink-soft); }
.axis-val { font-size: 12px; color: var(--ink-faint); text-align: right; }
.dots { display: flex; gap: 6px; }
.dot {
  flex: 1; height: 22px; padding: 0;
  border-radius: 11px;
  --c: var(--pink-50); --c-top: #fff; --c-edge: var(--pink-100);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
}
.dot.is-on { --c: var(--pink-400); --c-top: #ffd0de; --c-edge: var(--pink-600); color: #fff; }

.axis.hero {
  grid-template-columns: 1fr; gap: 8px;
  padding: 12px 12px 12px;
  margin-bottom: 4px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #ffe9f1, #ffd9e6);
  box-shadow: inset 0 -3px 0 rgba(217, 79, 126, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.9);
}
.axis.hero .axis-head { display: flex; align-items: baseline; gap: 8px; }
.axis.hero .axis-label { font-family: var(--font-title); font-size: 18px; color: var(--pink-700); }
.axis.hero .axis-sub { font-size: 11px; color: var(--pink-500); }
.axis.hero .axis-val { margin-left: auto; font-size: 22px; color: var(--pink-600); }
.axis.hero .dot { height: 38px; border-radius: 16px; font-size: 14px; --c: #fff; }
.axis.hero .dot.is-on { --c: var(--pink-500); --c-top: #ff9ec0; --c-edge: var(--pink-700); }

/* 메모 */
.notes-block { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.notes-head { display: flex; align-items: baseline; gap: 8px; }
.notes-head h3 { margin: 0; font-size: 16px; color: var(--pink-700); }
.notes-count { font-size: 11px; color: var(--ink-faint); }
.notes {
  list-style: none; margin: 0; padding: 4px 2px 4px 0;
  flex: 1; min-height: 60px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.notes:empty::after {
  content: '아직 메모가 없어요. 느낀 걸 한 줄씩 남겨 주세요.';
  color: var(--ink-faint); font-size: 12px; text-align: center; margin: auto 0;
}
.note { display: flex; flex-direction: column; gap: 4px; }
.note-bubble {
  align-self: stretch;
  padding: 8px 11px 9px;
  border-radius: 16px 16px 16px 6px;
  background: var(--pink-50);
  box-shadow: inset 0 -2px 0 rgba(255, 180, 202, 0.45);
  white-space: pre-wrap; word-break: break-word;
}
.note.other-variant .note-bubble { opacity: 0.62; }
.note-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-faint); }
.note-meta .v { padding: 0 6px; border-radius: var(--r-pill); background: var(--lilac-100); color: var(--lilac-600); }
.pm-reply {
  margin-left: 18px;
  padding: 7px 11px 8px;
  border-radius: 6px 16px 16px 16px;
  background: var(--lilac-100);
  box-shadow: inset 0 -2px 0 rgba(122, 92, 201, 0.15);
  color: #4b3a7a; font-size: 13px; white-space: pre-wrap;
}
.pm-reply b { font-family: var(--font-title); font-weight: 400; color: var(--lilac-600); margin-right: 4px; }
.note.fresh .note-bubble { animation: jelly-pop 0.5s var(--ease-out); }

.memo { display: flex; gap: 8px; align-items: flex-end; }
.memo textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  padding: 10px 13px;
  border: 2px solid var(--pink-100);
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(217, 79, 126, 0.08);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.memo textarea:focus { border-color: var(--pink-300); box-shadow: 0 0 0 4px rgba(255, 146, 178, 0.18); }
.memo textarea::placeholder { color: var(--ink-faint); font-size: 12.5px; }
.memo-send {
  width: 44px; height: 44px; flex: none; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  --c: var(--pink-400); --c-top: #ffc6d8; --c-edge: var(--pink-600); color: #fff;
}
.memo-send svg { width: 20px; height: 20px; position: relative; }

.keys { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--ink-faint); }
kbd {
  font-family: var(--font-mono); font-size: 10px;
  display: inline-block; min-width: 16px; padding: 0 4px; text-align: center;
  border-radius: 5px; background: var(--pink-50); color: var(--ink-soft);
  box-shadow: inset 0 -1.5px 0 var(--pink-200);
}

/* 드래그 힘 3단계 */
.drag-seg {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  padding: 3px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 -2px 0 rgba(255, 180, 202, 0.35), 0 6px 14px -10px rgba(178, 58, 100, 0.5);
}
.drag-label { font-size: 11.5px; color: var(--ink-soft); padding: 0 6px 0 8px; white-space: nowrap; }
.drag-seg button {
  border: 0; cursor: pointer; white-space: nowrap;
  font-size: 12px; line-height: 1.2; padding: 5px 11px; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease, transform 0.4s var(--spring);
}
.drag-seg button:hover { background: var(--pink-50); color: var(--pink-600); }
.drag-seg button:focus-visible { outline: 3px solid var(--pink-300); outline-offset: 1px; }
.drag-seg button.is-on {
  background: linear-gradient(180deg, #ffc6d8 -30%, var(--pink-400) 70%); color: #fff;
  box-shadow: inset 0 -2px 0 var(--pink-600);
  text-shadow: 0 1px 0 rgba(178, 58, 100, 0.45);
}
.drag-seg button.pop { animation: jelly-pop 0.45s var(--ease-out); }
.drag-seg.is-off { opacity: 0.55; }
.drag-seg.is-off button { cursor: not-allowed; }
.drag-seg.is-off button:hover { background: transparent; color: var(--ink-soft); }
.drag-seg.is-off button.is-on { background: var(--ash-100); color: var(--ash-600); box-shadow: none; text-shadow: none; }
/* 종 동작 버튼(v2.5 S5b, handle.actions) — 드래그 힘 스위치와 같은 알약 */
.actions button:disabled { opacity: 0.45; cursor: default; }
.actions button:disabled:hover { background: transparent; color: var(--ink-soft); }
.hud-bottom .hint { margin-right: auto; }

/* 세부 정보(variantInfo) */
.info-block {
  flex: none;
  border-radius: var(--r-md);
  background: var(--pink-25);
  box-shadow: inset 0 0 0 1.5px var(--pink-100);
}
.info-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 0; background: none; cursor: pointer; text-align: left;
  border-radius: var(--r-md);
}
.info-head:focus-visible { outline: 3px solid var(--pink-300); outline-offset: 0; }
.info-head h3 { margin: 0; font-size: 15px; color: var(--pink-700); }
.info-caret { width: 16px; height: 16px; margin-left: auto; color: var(--pink-400); transition: transform 0.35s var(--spring); }
.info-block.collapsed .info-caret { transform: rotate(-90deg); }
.info-block.collapsed .info-body { display: none; }
.info-body {
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 12px 10px;
  max-height: 168px; overflow-y: auto;
}
.info-row { display: flex; flex-direction: column; gap: 2px; }
.info-row[hidden] { display: none; }
.info-label { font-size: 11px; color: var(--ink-faint); }
.info-feel { margin: 0; font-size: 13px; line-height: 1.5; }
.info-changes { margin: 0; padding: 0 0 0 16px; font-size: 13px; line-height: 1.5; }
.info-changes li::marker { color: var(--pink-400); }
.info-empty { margin: 0; font-size: 12px; color: var(--ink-faint); }

/* ---------- 좁은 화면: 평가 패널을 아래 시트로(비교 모드 iframe=embed는 제외) ---------- */
@media (max-width: 720px) {
  html:not(.embed) .app { --sheet-h: 56vh; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) var(--sheet-h); transition: grid-template-rows 0.5s var(--spring); }
  html:not(.embed) .app.panel-closed { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 0px; }
  html:not(.embed) .panel-inner { top: 0; left: 8px; right: 8px; bottom: 8px; width: auto; padding: 14px 14px 10px; gap: 12px; overflow-y: auto; }
  html:not(.embed) .app.panel-closed .panel-inner { transform: translateY(40px) scale(0.98); }
  html:not(.embed) .notes-block { flex: none; }
  html:not(.embed) .notes { flex: none; max-height: 200px; }
  html:not(.embed) .panel-tab { top: auto; right: 12px; bottom: 10px; margin-top: 0; width: 56px; height: 30px; }
  html:not(.embed) .panel-tab svg { transform: rotate(90deg); }
  html:not(.embed) .app.panel-closed .panel-tab svg { transform: rotate(-90deg); }
  html:not(.embed) .hud-bottom { right: 80px; bottom: 10px; flex-wrap: wrap; }
  html:not(.embed) .app:not(.panel-closed) .hint { display: none; }
  html:not(.embed) .hud-top { left: 12px; right: 12px; top: 12px; gap: 8px; }
  html:not(.embed) .name { font-size: 21px; }
  html:not(.embed) .info-body { max-height: none; }
  html:not(.embed) .keys { display: none; }
  html:not(.embed) .verdicts .chip { font-size: 14px; padding: 8px 4px; }
}
}
html.embed .drag-label { display: none; }

/* ---------- 모드 ---------- */
html.mode-thumb body { background: #fff4f8; }
html.mode-thumb .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
html.mode-thumb .panel,
html.mode-thumb .hud,
html.mode-thumb .panel-tab,
html.mode-thumb .stage-msg:not(.error) { display: none; }

html.embed .back, html.embed .nav-arrows, html.embed .keys { display: none; }
html.embed .name { font-size: 18px; }
html.embed .hud-top { left: 12px; right: 12px; top: 10px; }
html.embed .hint { display: none; }
html.embed .app { --panel-w: 300px; }
html.embed .variants .chip { padding: 3px 9px; font-size: 12px; }

/* hud=0: 하네스 제스처 검사용(캔버스 위 UI 없음, 패널은 panel=0으로 닫음) */
html.no-hud .hud, html.no-hud .panel-tab { display: none; }

/* ===== tools/share-src/share.css ===== */
/* 말랑 놀이터 — 랩에 없는 요소만. 앞에 lab/ui/mallang.css · gallery.css · viewer.css 가 그대로 붙는다(빌드).
   토큰·컴포넌트(.jelly/.chip/.surface/.status-dot …)는 랩 것을 그대로 쓴다. */

/* ---------- 테마: 랩과 같은 라이트 단일 테마로 고정 ----------
   랩은 color-scheme: light 전용이다. 놀이터도 랩과 똑같이 보이도록 다크 선호·data-theme="dark"에서도
   같은 밝은 배경·글자색을 명시한다(아티팩트 골격이 어두운 기본값을 주더라도 덮어쓴다). */
:root {
  --page-bg: #fff4f8;
  --page-ink: #5b3546;
  --sheet-dim: rgba(91, 53, 70, 0.32);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --page-bg: #fff4f8; --page-ink: #5b3546; color-scheme: light; }
}
:root[data-theme="dark"] { --page-bg: #fff4f8; --page-ink: #5b3546; color-scheme: light; }
html { background-color: var(--page-bg); -webkit-text-size-adjust: 100%; }
body { background-color: var(--page-bg); color: var(--page-ink); }

/* ---------- 한 페이지 앱 보정 ---------- */
[hidden] { display: none !important; }
/* viewer.css 의 html, body { overflow: hidden } 은 뷰어 전용 페이지 기준 → 갤러리에선 풀고, 뷰어를 열었을 때만 잠근다 */
html, body { overflow: visible; }
html { overflow-x: hidden; }
html.viewing, html.viewing body { overflow: hidden; }

/* 뷰어(.app)는 갤러리 위 전체 화면 레이어. 배경은 랩 body 배경(--bg) 그대로 */
.share-viewer { position: fixed; inset: 0; z-index: 20; height: 100vh; height: 100dvh; background: var(--bg); }
.share-viewer .back { font: inherit; }

/* 3D를 못 켤 때 보여 주는 정지 사진 */
.still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: radial-gradient(circle at 50% 38%, #fff 0%, #ffeef4 55%, #ffe1eb 100%); }
.no3d .drag-seg, .no3d .reset-btn, .no3d .hint { display: none; }
.stage-msg.over-still { place-items: end center; padding-bottom: 72px; pointer-events: none; }
.stage-msg.over-still .msg-card { pointer-events: auto; }
.canvas-wrap canvas { touch-action: none; }

/* 처음 모양: 랩 hud-bottom 의 오른쪽 배지 자리 */
.reset-btn { --c: #fff; flex: none; margin-left: auto; }
.hud-bottom .hint { margin-right: 0; }

/* ---------- 갤러리 상단: 닉네임 · 저장 상태 ---------- */
.controls > .chip { --c: #fff; }
.nick-field { display: flex; align-items: center; gap: 8px; }
.nick-field input {
  width: 150px; min-width: 0;
  padding: 6px 14px; font-size: 13px; line-height: 1.2;
  border: 2px solid var(--pink-100); border-radius: var(--r-pill);
  background: #fff; color: var(--ink);
  box-shadow: inset 0 2px 4px rgba(217, 79, 126, 0.08);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nick-field input:focus { border-color: var(--pink-300); box-shadow: 0 0 0 4px rgba(255, 146, 178, 0.18); }
.nick-field input::placeholder { color: var(--ink-faint); }
.nick-field.wide input { flex: 1; width: auto; padding: 9px 14px; font-size: 14px; }
.field-label { flex: none; font-family: var(--font-title); color: var(--pink-700); }

.save-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-soft); white-space: nowrap;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 2px 4px rgba(217, 79, 126, 0.08);
}
.save-pill[data-mode='db'] .status-dot { background: var(--mint-600); }
.save-pill[data-mode='local'] .status-dot, .save-pill[data-mode='denied'] .status-dot { background: var(--butter-300); }
.save-pill[data-mode='connecting'] .status-dot { animation: blink 0.8s ease-in-out infinite; }

/* 갤러리 안내 한 줄(랩 .compare-hint 자리) */
.share-hint { margin: 0 0 16px; font-size: 13px; color: var(--ink-soft); }
.share-hint .save-note { color: var(--ink-faint); }
.share-hint .save-note:not(:empty)::before { content: '· '; }
.save-note[data-mode='local'], .save-note[data-mode='denied'] { color: var(--butter-600); }
.gpu-line {
  margin: -4px 0 18px; font-size: 13px; line-height: 1.5;
  padding: 8px 14px; border-radius: var(--r-sm);
  background: var(--butter-100); color: var(--butter-600);
  box-shadow: inset 0 -2px 0 rgba(179, 138, 28, 0.2);
}

/* ---------- 카드: 랩 카드 그대로, 판정 줄 대신 별점 줄 ---------- */
.verdict-row.stars-row .chip { display: inline-grid; place-items: center; padding: 5px 2px; color: var(--pink-300); }
.verdict-row.stars-row .chip.is-on { color: #fff; }
.star-svg { width: 15px; height: 15px; position: relative; display: block; }

/* ---------- 평가 패널: 랩 판정 칩(.verdicts) 자리에 별점 ---------- */
.verdicts.stars .chip { display: inline-grid; place-items: center; padding: 8px 2px; color: var(--pink-300); }
.verdicts.stars .chip.is-on { color: #fff; }
.verdicts.stars .star-svg { width: 20px; height: 20px; }
.verdicts.stars.preview .chip:not(.is-on).pv { color: var(--pink-400); }
.save-state[data-s='local'] .status-dot { background: var(--butter-300); }
.memo-count { margin-left: auto; }
.note-meta .rate { color: var(--pink-500); letter-spacing: 0.5px; }
.note-bubble.empty-memo { color: var(--ink-faint); }
.note.current .note-bubble { box-shadow: inset 0 -2px 0 rgba(255, 180, 202, 0.45), 0 0 0 2px var(--pink-200); }

/* ---------- 내 평가 보내기 ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 16px;
  background: var(--sheet-dim);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}
.sheet { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px 22px 18px; display: grid; gap: 12px; }
.sheet > * { position: relative; z-index: 2; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font-size: 22px; color: var(--pink-600); }
.sheet-text { margin: 0; font-size: 13px; color: var(--ink-soft); }
.export-sum { margin: 0; font-size: 13px; color: var(--ink); }
.sheet textarea {
  width: 100%; resize: vertical; min-height: 140px;
  padding: 12px 14px;
  border: 2px solid var(--pink-100); border-radius: 18px;
  font: 12px/1.5 var(--font-mono);
  color: var(--ink); background: #fff;
  box-shadow: inset 0 2px 4px rgba(217, 79, 126, 0.08); outline: none;
}
.sheet textarea:focus { border-color: var(--pink-300); }
.sheet-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.copy-msg { font-size: 13px; color: var(--mint-600); margin-right: auto; }
.copy-msg.warn { color: var(--pink-700); }

/* ---------- 분류 보기(바로가기 · 손맛 이모지 칩 · 필터 · 정렬 · 분류별 묶음) ----------
   랩 .jelly.chip / .chip.small / .toggle 을 그대로 쓰고 배치만 더한다. */
main { --gutter: clamp(16px, 4vw, 44px); }

/* 머리(.top)는 스크롤과 함께 지나가고 바로가기 줄만 화면 위에 붙는다.
   (랩 .top 은 sticky지만 html,body{height:100%} 때문에 놀이터에선 첫 화면 뒤 풀려 버렸다 — 둘 다 붙이면 PC 화면 1/5을 먹는다) */
.top { position: relative; top: 0; }
/* 바로가기 줄: --top-h 는 share.js가 잰다(머리가 붙지 않으니 0) */
.jump-bar {
  position: sticky; top: var(--top-h, 0px); z-index: 4;
  margin: 0 calc(-1 * var(--gutter)) 12px; padding: 7px var(--gutter);
  background: rgba(255, 244, 248, 0.93);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 12px -12px rgba(178, 58, 100, 0.45);
}
.jump-scroll { min-width: 0; }
.jump-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 5px; padding: 2px 0 4px; }
.jump-bar .chip { display: inline-flex; align-items: baseline; gap: 5px; --c: #fff; }
.jump-top { padding: 5px 11px; font-family: var(--font-title); font-size: 14.5px; }
.jump-top:not(:first-child) { margin-left: 8px; }
.jump-sub.chip.small { padding: 3px 8px; }
.jump-bar .chip .n { font-size: 10.5px; color: var(--ink-faint); text-shadow: none; }
.jump-top.is-here { --c: var(--pink-500); --c-top: var(--pink-400); --c-edge: var(--pink-700); --c-ink: #fff; text-shadow: 0 1px 0 rgba(178, 58, 100, 0.45); }
.jump-top.is-here::before { opacity: 0.35; }
.jump-sub.is-here { --c: var(--pink-100); --c-top: #fff; --c-edge: var(--pink-300); --c-ink: var(--pink-700); }
.jump-bar .chip.is-here .n { color: inherit; opacity: 0.8; }
.jump-top.is-zero { opacity: 0.45; cursor: default; }

.browse { display: grid; gap: 10px; margin: 0 0 26px; min-width: 0; }
.browse-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.browse-label { flex: none; font-size: 14px; color: var(--pink-600); }
.browse-scroll { min-width: 0; max-width: 100%; }
.chip-line { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 5px; }
.browse .chip.small { display: inline-flex; align-items: baseline; gap: 5px; --c: #fff; }
.browse .chip.toggle.is-on { --c: var(--pink-100); --c-top: #fff; --c-edge: var(--pink-300); --c-ink: var(--pink-700); text-shadow: none; }
/* 손맛: 이모지만 담은 동그란 칩 */
.feel-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 5px; }
.feel-chip {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  display: inline-grid; place-items: center; --c: #fff;
  -webkit-touch-callout: none;
}
.feel-chip .emo { position: relative; font-size: 18px; line-height: 1; }
.browse .feel-chip.is-on { --c: var(--pink-300); --c-top: #ffe5ee; --c-edge: var(--pink-600); }
.browse .feel-chip.is-on .emo { transform: scale(1.08); }
.browse .chip.is-zero { opacity: 0.4; }
.feel-info { --c: #fff; width: 30px; height: 30px; padding: 0; border-radius: 50%; display: inline-grid !important; place-items: center; font-size: 14px; color: var(--pink-600); }
.browse .feel-info.is-on { --c: var(--pink-100); --c-top: #fff; --c-edge: var(--pink-300); --c-ink: var(--pink-700); }
.feel-legend {
  margin: -4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 12px; color: var(--ink-soft);
}
.feel-legend .lg i { font-style: normal; margin-right: 4px; }
.feel-tip {
  position: fixed; z-index: 50; pointer-events: none;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; font-size: 13px; white-space: nowrap;
  box-shadow: 0 6px 14px -6px rgba(91, 53, 70, 0.6);
  animation: fade-in 0.15s ease;
}
.sort-field { display: inline-flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.sort-field select.chip {
  -webkit-appearance: none; appearance: none;
  font: inherit; font-size: 13px; line-height: 1.2;
  padding: 6px 30px 6px 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9.5l6 6 6-6' fill='none' stroke='%23d94f7e' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(180deg, #fff -30%, #fff 70%);
  background-repeat: no-repeat; background-position: right 10px center, 0 0; background-size: 14px 14px, 100% 100%;
}
.result-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 34px; font-size: 13px; color: var(--ink-soft); }
.result-count { font-family: var(--font-title); font-size: 15px; color: var(--pink-700); }
.result-feel { color: var(--pink-600); }
.result-feel:empty { display: none; }
.reset-filters { --c: #fff; }
.empty-reset { --c: #fff; margin-top: 16px; }

/* 분류별 묶음: 큰 제목 > 작은 제목 > 카드 그리드 */
.groups { display: grid; gap: 40px; }
.group { display: grid; gap: 22px; }
.subgroup { display: grid; gap: 14px; }
.group-title, .sub-title { scroll-margin-top: calc(var(--top-h, 0px) + var(--jump-h, 0px) + 10px); }
.group-title {
  display: flex; align-items: baseline; gap: 8px; margin: 0;
  font-size: 28px; line-height: 1.2; color: var(--pink-600); text-shadow: 0 3px 0 #fff;
}
.group-title .emo { font-size: 24px; text-shadow: none; }
.sub-title {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 18px; line-height: 1.2; color: var(--ink);
}
.sub-title::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--pink-300); box-shadow: 0 0 0 3px var(--pink-100); flex: none; }
.group-title .n, .sub-title .n { font-size: 12px; color: var(--ink-faint); text-shadow: none; }

/* 놀이터 카드엔 랩의 오른쪽 아래 막대(.bars)가 없으니 배지가 썸네일 폭을 다 쓴다(배지 세 개가 한 글자씩 줄바꿈되지 않게) */
.badges { max-width: calc(100% - 20px); }
/* 카드 손맛 이모지(+🔊): 제목 줄 오른쪽 끝에 작게 */
.card-title .feel-tag { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 13px; line-height: 1; }
.card-title .feel-tag i { font-style: normal; }
.card-title .feel-tag .snd { font-size: 11px; margin-left: 2px; opacity: 0.8; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 720px) {
  .wide-only { display: none; }
  .nick-field input { width: 132px; }
  .share-viewer .hud-bottom { flex-wrap: nowrap; }
  .share-viewer .drag-label { display: none; }
}
@media (max-width: 420px) {
  .controls { gap: 8px; }
}

/* =====================================================================
   모바일·터치 — 데스크톱(마우스, 넓은 화면)에서는 아래 규칙이 아무것도 바꾸지 않는다.
   (env(safe-area-*)는 데스크톱에서 0, touch-action·tap-highlight는 터치에만 작용)
   ===================================================================== */

/* 탭 하이라이트 없음 · 더블탭 확대 없음(핀치 확대는 갤러리에서 그대로 가능) */
html { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* 뷰어는 페이지가 밀리거나 확대되지 않게: 무대 전체는 제스처를 막고(캔버스는 엔진이 none),
   평가 패널은 세로 스크롤만, 변이 줄은 가로 스크롤만 허용 */
.share-viewer { touch-action: none; overscroll-behavior: none; }
.share-viewer .panel-inner, .share-viewer .notes, .share-viewer .info-body, .share-viewer textarea { touch-action: pan-y; overscroll-behavior: contain; }
.share-viewer .variants { touch-action: pan-x; }
.share-viewer .stage { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* 노치·홈 인디케이터(고정 레이어는 아티팩트 :root 패딩을 받지 않으므로 직접 더한다) */
.top { top: env(safe-area-inset-top, 0px); }
.share-viewer .hud-top { top: calc(16px + env(safe-area-inset-top, 0px)); left: max(18px, env(safe-area-inset-left, 0px)); right: max(18px, env(safe-area-inset-right, 0px)); }
.share-viewer .hud-bottom { left: max(18px, env(safe-area-inset-left, 0px)); }
.share-viewer.panel-closed .hud-bottom { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.sheet-back {
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
           max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

/* 마우스용/터치용 안내 문구 */
.touch-only { display: none; }

/* 터치 기기: 탭한 뒤 :hover 가 붙어 버튼·카드가 찌그러진 채 남지 않게 */
@media (hover: none) {
  .jelly:hover:not(.pop), .card:hover { animation: none; }
  .card:hover .thumb img { transform: none; }
}

/* 손가락 조작(휴대폰·태블릿) */
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: inline; }
  .mouse-only { display: none; }
  .keys { display: none !important; }
  /* iOS는 글자 16px 미만 입력란에 포커스하면 화면을 확대해 버린다 */
  .nick-field input, .nick-field.wide input, .memo textarea, .sheet textarea { font-size: 16px; }
  .memo textarea::placeholder { font-size: 14px; }
  /* 터치 영역 ≥ 40px(무대 위 칩은 무대를 덜 가리도록 36px) */
  .top .chip, .sheet .chip, .reset-btn, .browse .chip.small, .empty-reset { min-height: 40px; }
  .browse .chip.small, .jump-bar .chip { align-items: center; }
  .jump-bar .chip { min-height: 36px; }
  .feel-info { width: 36px; height: 36px; min-height: 36px; }
  .nick-field input { min-height: 40px; }
  .card .heart { width: 40px; height: 40px; }
  .verdict-row.stars-row .chip { min-height: 36px; }
  .verdicts.stars .chip { min-height: 44px; }
  .drag-seg button { min-height: 36px; padding-left: 13px; padding-right: 13px; }
  .variants .chip { min-height: 36px; }
  .info-head { min-height: 40px; }
  html:not(.embed) .share-viewer .panel-tab { width: 60px; height: 40px; }
}

/* 휴대폰 세로: 무대와 평가 시트 */
@media (max-width: 720px) {
  /* 시트는 화면의 절반 남짓만(별점·메모까지 바로 보이는 높이), 동적 뷰포트 기준 */
  html:not(.embed) .app.share-viewer { --sheet-h: clamp(270px, 46dvh, 440px); }
  /* 시트 안 순서: 별점 → 메모 → 이 말랑이는(설명은 아래로) */
  .share-viewer .panel-head { order: 0; }
  .share-viewer .row-top { order: 1; }
  .share-viewer .notes-block { order: 2; }
  .share-viewer .info-block { order: 3; }
  html:not(.embed) .share-viewer .panel-inner { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  html:not(.embed) .share-viewer .hud-top {
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  }
  html:not(.embed) .share-viewer .hud-bottom { left: max(18px, env(safe-area-inset-left, 0px)); }
  html:not(.embed) .share-viewer.panel-closed .hud-bottom,
  html:not(.embed) .share-viewer.panel-closed .panel-tab { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  /* 변이 칩: 줄바꿈해 무대를 가리는 대신 한 줄 가로 스크롤 */
  .share-viewer .variants {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; padding: 2px 2px 7px; margin: 6px -2px -7px;
  }
  .share-viewer .variants::-webkit-scrollbar { display: none; }
  .share-viewer .variants .chip { flex: none; }
  .share-viewer .variants { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); }
  /* 빈 메모 목록 안내는 입력란 안내와 겹치므로 시트에서는 생략 */
  html:not(.embed) .share-viewer .notes:empty { display: none; }
  /* 조작 안내: 시트가 열려 있어도 무대 아래쪽에 띄워 두고(첫 터치 뒤 사라짐), 손가락을 가로막지 않는다 */
  html:not(.embed) .app.share-viewer .hud-bottom .hint {
    display: block; position: absolute; left: 0; bottom: calc(100% + 8px);
    width: max-content; max-width: min(340px, calc(100vw - 30px));
    pointer-events: none; line-height: 1.5; border-radius: 14px;
  }
}

/* 휴대폰: 바로가기·필터 칩은 줄바꿈 대신 한 줄 가로 스크롤(오른쪽 끝을 흐려 더 있다는 걸 알린다). 페이지 자체는 가로로 밀리지 않는다 */
@media (max-width: 720px) {
  .jump-bar { padding-top: 5px; padding-bottom: 5px; margin-bottom: 10px; }
  .jump-scroll, .browse-scroll {
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    margin: -4px calc(-1 * var(--gutter)); padding: 4px var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 26px), transparent);
  }
  .jump-scroll::-webkit-scrollbar, .browse-scroll::-webkit-scrollbar { display: none; }
  .browse-scroll { flex: 1; }
  .jump-line, .chip-line { flex-wrap: nowrap; width: max-content; }
  .jump-line > .chip, .chip-line > .chip { flex: none; }
  .jump-top { font-size: 14px; padding: 5px 12px; }
  .jump-top:not(:first-child) { margin-left: 8px; }
  .browse { gap: 8px; margin-bottom: 20px; }
  .browse-label { font-size: 13px; }
  .feel-chips { gap: 5px; flex-wrap: nowrap; }
  .result-line { gap: 8px; }
  .result-line .sort-field .browse-label { display: none; }
  .groups { gap: 32px; }
  .group { gap: 16px; }
  .group-title { font-size: 24px; }
  .group-title .emo { font-size: 21px; }
  .sub-title { font-size: 16px; }
}
@media (max-width: 380px) {
  .feel-chip { width: 36px; height: 36px; }
  .feel-chip .emo { font-size: 17px; }
}

/* 휴대폰 갤러리: 카드 2열, 머리는 스크롤과 함께 지나가게(고정하면 화면 1/4을 가린다) */
@media (max-width: 560px) {
  .top { position: relative; top: 0; }
  .controls .nick-field { flex: 1 1 130px; min-width: 0; }
  .controls .nick-field input { width: 100%; }
  /* 좁은 카드: '변이 N'과 '색·손맛' 배지가 두 줄로 쌓이지 않게 종류 배지만 */
  .badges:has(.kinds) > .badge:not(.kinds) { display: none; }
  .badge.kinds { white-space: nowrap; font-size: 10.5px; gap: 3px; }
  /* 머리 한 줄 접기: 닉네임 칸(가득) + 저장 상태 점만 + 작은 보내기 버튼 */
  .controls { flex-wrap: nowrap; gap: 8px; width: 100%; }
  .controls .save-pill { flex: none; padding: 0; background: none; border: 0; box-shadow: none; }
  .controls .save-pill #savePillText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #exportOpen { flex: none; white-space: nowrap; padding-inline: 12px; }
  #exportOpen .lg { display: none; }
  /* 종류 배지는 점+숫자만(글자는 길어서 잘림) */
  .badge.kinds .kl { display: none; }
  .badge.kinds b { display: none; }
  .badge.kinds > span { display: inline-flex; align-items: center; gap: 2px; }
  .brand h1 { font-size: 26px; }
  .card-title .feel-tag { font-size: 12px; gap: 1px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .card { padding: 7px 7px 11px; }
  .thumb { border-radius: 16px; }
  .card .heart { top: 6px; right: 6px; }
  .unrated-dot { top: 10px; left: 10px; }
  .badges { left: 7px; bottom: 7px; max-width: calc(100% - 14px); }
  .card-body { padding: 9px 2px 0; gap: 7px; }
  .card-title .title { font-size: 16px; }
  .verdict-row.stars-row { gap: 3px; }
  .last-note { padding: 5px 8px; }
  .last-note.none { padding: 3px 2px; }
  /* 보내기 시트: JSON 칸은 짧게, 복사 버튼은 엄지로 누르기 쉽게 넓게 */
  .sheet { padding: 18px 16px 16px; }
  .sheet textarea { min-height: 96px; height: 22dvh; }
  .sheet-actions { flex-wrap: wrap; }
  .sheet-actions .copy-msg { flex-basis: 100%; order: 2; text-align: center; margin-right: 0; }
  .sheet-actions #copyBtn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .save-pill .status-dot { animation: none !important; }
}

/* 원탭 반응(😍 최고 / 🙂 좋아 / 😐 그냥) */
.react-row { display: flex; gap: 5px; }
.react-row .react { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 4px; min-height: 32px; font-size: 12px; white-space: nowrap; }
.react-row .react span { font-size: 15px; line-height: 1; }
.react-row .react b { font-weight: 500; }
.react-row .react[aria-pressed='true'] { background: var(--pink-100); box-shadow: 0 0 0 2px var(--pink-300) inset; color: var(--ink); }
.row-top .react-row { flex-basis: 100%; }
.row-top { flex-wrap: wrap; }
@media (max-width: 560px) {
  .react-row { gap: 3px; }
  .card .react-row .react b { display: none; }
  .card .react-row .react { min-height: 34px; }
}

/* 썸네일 점(변이 수). PC는 호버 중에만, 터치는 늘 작게 */
.thumb-dots { position: absolute; left: 50%; transform: translateX(-50%); top: 12px; display: flex; gap: 3px; padding: 3px 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.7); pointer-events: none; }
.thumb-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--pink-200, #ffc2d4); }
.thumb-dots i.on { background: var(--pink-500, #e8557f); }
@media (hover: hover) and (pointer: fine) { .thumb-dots { opacity: 0; transition: opacity 0.15s; } .thumb.cycling .thumb-dots { opacity: 1; } }
@media (max-width: 560px) { .thumb-dots { top: 10px; } }

/* 곁에 두기: 말랑이만 */
.share-viewer.calm .hud, .share-viewer.calm .panel-tab, .share-viewer.calm .panel, .share-viewer.calm .stage-msg { display: none !important; }
.share-viewer.calm .stage { background: radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.55), transparent 70%); }
.calm-exit { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 5; width: 34px; height: 34px; padding: 0; opacity: 0.45; font-size: 15px; }
.calm-exit:hover, .calm-exit:focus-visible { opacity: 1; }
.calm-resume { margin: 0 0 12px; }

