/* GummyGram — dark only, soft glass (recipe after glass3d.dev) */
:root {
  color-scheme: dark;
  --bg: #0a0e11;
  --text: #e9eef2;
  --text-2: hsl(205 12% 64%);
  --text-3: hsl(205 10% 46%);
  --accent: hsl(199 82% 64%);
  --accent-strong: hsl(199 72% 52%);
  --accent-soft: hsl(199 80% 60% / .16);
  --danger: hsl(2 78% 66%);
  --danger-soft: hsl(2 78% 60% / .12);
  --ok: hsl(150 52% 58%);
  --star: hsl(42 96% 62%);
  --line: hsl(205 30% 90% / .07);
  --hover: hsl(205 30% 90% / .05);
  --field: hsl(205 30% 90% / .05);
  --bubble-in: hsl(206 24% 15% / .82);
  --bubble-out: hsl(199 52% 28% / .86);
  --meta-in: hsl(205 12% 58%);
  --meta-out: hsl(199 60% 80% / .75);
  --radius: 18px;
  --sidebar-w: 380px;

  /* glass3d */
  --glass-filter: blur(32px) brightness(.85) saturate(2.5);
  --glass-color: hsl(189 80% 10% / .2);
  --glass-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  --glass-shadow:
    0 0 .75px hsl(205 20% 10% / .2),
    .7px .8px 1.2px -.4px hsl(205 20% 10% / .1),
    1.3px 1.5px 2.2px -.8px hsl(205 20% 10% / .1),
    2.3px 2.6px 3.9px -1.2px hsl(205 20% 10% / .1),
    3.9px 4.4px 6.6px -1.7px hsl(205 20% 10% / .1),
    6.5px 7.2px 10.9px -2.1px hsl(205 20% 10% / .1),
    8px 9px 14px -2.5px hsl(205 20% 10% / .2);
  --glass-edge:
    inset 2px 2px 1px -3px hsl(205 20% 90% / .8),
    inset 4px 4px 2px -6px hsl(205 20% 90% / .3),
    inset 1.5px 1.5px 1.5px -.75px hsl(205 20% 90% / .15),
    inset 1.5px 1.5px .25px hsl(205 20% 90% / .03),
    inset 0 0 .25px .5px hsl(205 20% 90% / .03);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
/* soft aurora behind the glass */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 42% at 18% 22%, hsl(189 70% 28% / .55), transparent 70%),
    radial-gradient(34% 38% at 82% 18%, hsl(222 60% 30% / .45), transparent 70%),
    radial-gradient(40% 46% at 70% 86%, hsl(262 38% 28% / .38), transparent 70%),
    radial-gradient(30% 34% at 22% 88%, hsl(170 50% 22% / .35), transparent 70%);
  filter: blur(40px);
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
.hidden { display: none !important; }
#app { position: relative; z-index: 1; height: 100dvh; }
::selection { background: hsl(199 80% 60% / .35); }

/* ---------- glass ---------- */
.glass { position: relative; box-shadow: var(--glass-shadow); }
.glass::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; overflow: hidden; z-index: 0;
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  background-color: var(--glass-color); background-image: var(--glass-noise); background-size: 120px;
}
.glass::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 3;
  box-shadow: var(--glass-edge);
}
.glass > * { position: relative; z-index: 2; }

/* ---------- icons ---------- */
.i { width: 24px; height: 24px; flex-shrink: 0; display: block; }
.i-sm { width: 18px; height: 18px; }
.i-xs { width: 15px; height: 15px; }

/* ---------- buttons / fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 14px; font-weight: 600; font-size: 15px;
  background: var(--accent-strong); color: #fff; transition: filter .15s, background .15s, opacity .15s;
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / .18), 0 4px 14px -6px hsl(199 80% 50% / .6);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: hsl(205 30% 90% / .09); filter: none; }
.btn.link { background: none; box-shadow: none; color: var(--accent); }
.btn.link:hover { background: var(--accent-soft); filter: none; }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.danger:hover { background: hsl(2 78% 60% / .18); filter: none; }
.btn .i { width: 20px; height: 20px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); flex-shrink: 0; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:focus-visible, .btn:focus-visible, .row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 6px 4px; }
.input {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 14px; outline: none;
  background: var(--field); border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
textarea.input { height: auto; min-height: 48px; padding: 13px 16px; resize: none; display: block; }
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: hsl(199 80% 64% / .7); background: hsl(205 30% 90% / .07); }
.hint { font-size: 13px; color: var(--text-3); margin: 6px 4px 0; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 0 4px 10px; }
.err:empty { min-height: 0; margin: 0; }

.switch-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; cursor: pointer; user-select: none; }
.switch-row .t { flex: 1; font-size: 15px; }
.switch-row .t small { display: block; color: var(--text-3); font-size: 13px; margin-top: 2px; }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 11px; background: hsl(205 20% 90% / .14); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent-strong); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------- login ---------- */
.login { height: 100%; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; border-radius: 28px; padding: 36px 28px 28px; text-align: center; }
.login-art { width: 112px; height: 112px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; }
.login-art img { width: 112px; height: 112px; }
.login-lock {
  width: 88px; height: 88px; margin: 6px auto 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.login-lock .i { width: 40px; height: 40px; }
.login h1 { font-size: 26px; margin: 0 0 8px; font-weight: 600; letter-spacing: -.01em; }
.login .sub { color: var(--text-2); margin: 0 0 24px; font-size: 15px; }
.login .field { text-align: left; }
.steps { list-style: none; margin: 0 0 22px; padding: 0; text-align: left; counter-reset: s; }
.steps li { position: relative; padding: 2px 0 0 36px; margin: 0 0 12px; color: var(--text-2); font-size: 14px; counter-increment: s; line-height: 1.45; min-height: 24px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; text-align: center;
}
.code-input { text-align: center; letter-spacing: .6em; font-size: 22px; font-weight: 600; padding-left: calc(16px + .6em); }

/* ---------- layout ---------- */
.layout { display: flex; height: 100%; padding: 12px; gap: 12px; }
.sidebar { width: var(--sidebar-w); min-width: 300px; flex-shrink: 0; display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; }
.sidebar-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px 8px; flex-shrink: 0; }
.search {
  flex: 1; height: 42px; border-radius: 21px; background: var(--field); border: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 12px; gap: 8px; color: var(--text-3); transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: hsl(199 80% 64% / .6); color: var(--accent); }
.search input { flex: 1; border: 0; outline: none; background: transparent; height: 100%; min-width: 0; color: var(--text); }
.search input::placeholder { color: var(--text-3); }
.search .clear { color: var(--text-3); display: flex; }
.search .clear:hover { color: var(--text); }
.list { flex: 1; overflow-y: auto; padding: 2px 8px 10px; }
.list-title { font-size: 13px; color: var(--text-3); font-weight: 500; padding: 12px 12px 6px; text-transform: none; }
.empty-note { text-align: center; color: var(--text-3); padding: 28px 20px; font-size: 14px; line-height: 1.5; }

.row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; cursor: pointer; user-select: none; outline: none; }
.row:hover { background: var(--hover); }
.row.active { background: var(--accent-soft); }
.row-body { flex: 1; min-width: 0; }
.row-top, .row-bottom { display: flex; align-items: center; gap: 6px; }
.row-name { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { font-size: 12px; color: var(--text-3); flex-shrink: 0; display: flex; align-items: center; gap: 3px; }
.row-time .tk { color: var(--accent); display: flex; }
.row-sub { flex: 1; min-width: 0; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; margin-top: 3px; }
.row-sub .you { color: var(--text); }
.row-sub .gift-mark { color: var(--accent); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-strong); color: #fff;
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 3px;
}

.avatar {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 18px; position: relative; user-select: none; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / .18);
}
.avatar.sm { width: 40px; height: 40px; font-size: 15px; }
.avatar.xl { width: 104px; height: 104px; font-size: 38px; }
.avatar .i { width: 52%; height: 52%; }
.avatar.online::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%;
  background: var(--ok); border: 2.5px solid hsl(205 25% 9%);
}
.c0 { background: linear-gradient(160deg, hsl(12 70% 62%), hsl(350 60% 52%)); }
.c1 { background: linear-gradient(160deg, hsl(38 80% 62%), hsl(22 70% 54%)); }
.c2 { background: linear-gradient(160deg, hsl(250 60% 70%), hsl(258 46% 54%)); }
.c3 { background: linear-gradient(160deg, hsl(140 42% 56%), hsl(158 46% 42%)); }
.c4 { background: linear-gradient(160deg, hsl(176 50% 52%), hsl(186 56% 40%)); }
.c5 { background: linear-gradient(160deg, hsl(200 74% 62%), hsl(210 62% 50%)); }
.c6 { background: linear-gradient(160deg, hsl(300 40% 66%), hsl(286 38% 52%)); }
.c-saved { background: linear-gradient(160deg, hsl(199 76% 62%), hsl(205 64% 48%)); }

/* menu */
.menu { position: fixed; z-index: 150; min-width: 230px; border-radius: 16px; padding: 6px; animation: rise .14s ease-out; transform-origin: top left; }
.menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 9px 12px; border-radius: 10px; font-size: 14.5px; text-align: left; color: var(--text); }
.menu button:hover { background: hsl(205 30% 90% / .07); }
.menu button .i { width: 20px; height: 20px; color: var(--text-2); }
.menu button.danger, .menu button.danger .i { color: var(--danger); }
.menu .extra { margin-left: auto; color: var(--text-2); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.menu .sep { height: 1px; background: var(--line); margin: 5px 8px; }

/* ---------- chat ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; border-radius: 24px; overflow: hidden; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 14px; font-size: 13.5px; font-weight: 500; color: var(--text); background: hsl(205 30% 8% / .55); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.chat-head { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; z-index: 5; border-radius: 24px 24px 0 0; }
.chat-head .back { display: none; }
.chat-head .who { flex: 1; min-width: 0; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 4px 6px; border-radius: 12px; }
.chat-head .who .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15.5px; }
.chat-head .who .s { font-size: 13px; color: var(--text-2); }
.chat-head .who .s.on { color: var(--accent); }
.messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0 6px; overscroll-behavior: contain; }
.messages-inner { max-width: 760px; min-height: 100%; margin: 0 auto; padding: 0 18px; display: flex; flex-direction: column; justify-content: flex-end; }
.date-sep { align-self: center; margin: 12px 0 8px; }
.chat-hint { margin: auto; text-align: center; max-width: 300px; padding: 22px 20px; border-radius: 20px; color: var(--text-2); font-size: 14px; }
.chat-hint .ttl { color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.chat-hint img { width: 96px; height: 96px; margin: 0 auto 10px; }

.msg { display: flex; margin: 1.5px 0; }
.msg.out { justify-content: flex-end; }
.msg.tail { margin-bottom: 7px; }
.bubble {
  max-width: min(520px, 82%); background: var(--bubble-in); border-radius: 18px; padding: 7px 11px 7px 12px;
  position: relative; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.38;
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / .05), 0 1px 2px hsl(205 30% 4% / .35);
  -webkit-user-select: text; user-select: text;
}
.msg.out .bubble { background: var(--bubble-out); box-shadow: inset 0 1px 0 hsl(0 0% 100% / .09), 0 1px 2px hsl(205 30% 4% / .35); }
.msg.tail .bubble { border-bottom-left-radius: 6px; }
.msg.out.tail .bubble { border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.meta { float: right; margin: 7px -3px -3px 10px; font-size: 11.5px; color: var(--meta-in); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; user-select: none; line-height: 1; }
.msg.out .meta { color: var(--meta-out); }
.ticks { width: 17px; height: 11px; }
.bubble.sel { box-shadow: 0 0 0 2px var(--accent); }

/* gift in chat */
.gift-msg { align-self: center; margin: 10px 0 12px; width: 268px; max-width: 92%; }
.gift-card { border-radius: 22px; padding: 18px 18px 14px; text-align: center; cursor: pointer; transition: transform .15s; }
.gift-card:hover { transform: translateY(-1px); }
.gift-card .art { width: 112px; height: 112px; margin: 0 auto 6px; }
.gift-card .ttl { font-weight: 600; font-size: 16px; margin-bottom: 3px; }
.gift-card .sub { font-size: 13.5px; color: var(--text-2); }
.gift-card .note { font-size: 14px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: hsl(205 30% 90% / .06); white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; color: var(--text); }
.gift-card .foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.gift-card .view { padding: 7px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13.5px; }
.gift-card .tm { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }

/* gift art */
.art { object-fit: contain; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.art-emoji { display: flex; align-items: center; justify-content: center; line-height: 1; }

/* composer */
.composer { flex-shrink: 0; padding: 6px 14px 14px; z-index: 5; }
.composer-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; }
.input-wrap { flex: 1; min-width: 0; border-radius: 22px; display: flex; flex-direction: column; }
.input-row { display: flex; align-items: flex-end; padding: 0 4px; }
.input-row .icon-btn { margin: 4px 0; }
.input-row textarea {
  flex: 1; border: 0; outline: none; resize: none; background: transparent; padding: 13px 8px 13px 4px;
  max-height: 200px; line-height: 1.38; min-width: 0; display: block; color: var(--text);
}
.input-row textarea::placeholder { color: var(--text-3); }
.edit-bar { display: flex; align-items: center; gap: 10px; padding: 8px 6px 0 14px; font-size: 13.5px; }
.edit-bar .i { color: var(--accent); width: 20px; height: 20px; }
.edit-bar .what { flex: 1; min-width: 0; border-left: 2px solid var(--accent); padding-left: 10px; }
.edit-bar .what b { display: block; color: var(--accent); font-weight: 600; font-size: 13px; }
.edit-bar .what span { display: block; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send-btn {
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent-strong); color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: filter .15s, transform .15s, opacity .15s;
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / .2), 0 6px 16px -6px hsl(199 80% 50% / .7);
}
.send-btn:hover { filter: brightness(1.08); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { opacity: .45; cursor: default; filter: none; transform: none; }
.send-btn .i { width: 22px; height: 22px; margin-left: 2px; }

/* ---------- modal ---------- */
/* NB: no opacity/filter/backdrop-filter on overlay or modal itself — that would make them a
   "backdrop root" and the modal's glass would stop blurring the page behind it. */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: hsl(205 40% 3% / .6); animation: dim .15s ease-out;
}
@keyframes dim { from { background-color: hsl(205 40% 3% / 0); } }
.modal { width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: 24px; animation: rise .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(8px) scale(.98); } }
/* floating surfaces over busy content need a denser tint than the big panels */
.modal, .menu, .toast { --glass-color: hsl(205 32% 9% / .78); }
.modal.wide { max-width: 500px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 4px 22px; flex-shrink: 0; }
.modal-head h2 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; }
.modal-body { padding: 6px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
.confirm-text { color: var(--text-2); margin: 2px 0 20px; line-height: 1.5; }
.btn-pair { display: flex; gap: 8px; }
.btn-pair .btn { flex: 1; }

.profile-top { text-align: center; padding: 6px 0 16px; }
.profile-top .avatar { margin: 0 auto 12px; }
.profile-top .nm { font-size: 20px; font-weight: 600; }
.profile-top .st { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.profile-top .st.on { color: var(--accent); }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 14px;
  background: var(--hover); color: var(--accent); font-size: 13px; font-weight: 500; transition: background .15s;
}
.action:hover { background: hsl(205 30% 90% / .09); }
.action .i { width: 22px; height: 22px; }
.info-list { border-radius: 16px; background: var(--hover); padding: 4px; margin-bottom: 6px; }
.info-item { display: flex; gap: 16px; padding: 10px 12px; align-items: flex-start; }
.info-item .i { color: var(--text-3); margin-top: 1px; }
.info-item .v { overflow-wrap: anywhere; white-space: pre-wrap; }
.info-item .k { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.section-title { font-weight: 600; color: var(--text-2); font-size: 13px; margin: 20px 4px 10px; display: flex; align-items: center; gap: 8px; }
.section-title .cnt { color: var(--text-3); font-weight: 500; }

.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gift-tile {
  position: relative; border-radius: 16px; padding: 12px 6px 10px; text-align: center; cursor: pointer; background: var(--hover);
  border: 1px solid var(--line); transition: background .15s, transform .15s; display: flex; flex-direction: column; align-items: center; min-width: 0;
}
.gift-tile:hover { background: hsl(205 30% 90% / .08); transform: translateY(-1px); }
.gift-tile .art { width: 72px; height: 72px; }
.gift-tile .nm { font-size: 12.5px; color: var(--text-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.price {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 12px;
  background: hsl(42 96% 62% / .12); color: var(--star); font-weight: 600; font-size: 13px;
}
.price .i { width: 14px; height: 14px; }
.tag { position: absolute; top: 7px; right: 7px; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.tag.left { right: auto; left: 7px; background: hsl(205 30% 90% / .08); color: var(--text-2); }
.gift-tile.soldout { opacity: .45; cursor: default; transform: none; }

.gift-hero { text-align: center; padding: 6px 0 4px; }
.gift-hero .art { width: 150px; height: 150px; margin: 0 auto; }
.gift-hero .ttl { font-size: 21px; font-weight: 600; margin-top: 6px; }
.gift-hero .sub { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.rows { border-radius: 16px; background: var(--hover); margin: 16px 0; overflow: hidden; }
.rows > div { display: flex; gap: 12px; padding: 11px 14px; font-size: 14px; border-bottom: 1px solid var(--line); }
.rows > div:last-child { border-bottom: 0; }
.rows .k { color: var(--text-2); width: 40%; flex-shrink: 0; }
.rows .v { flex: 1; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.quote { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: var(--hover); border-left: 3px solid var(--accent); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.star-ic { color: var(--star); display: inline-flex; }
.balance { text-align: center; padding: 4px 0 14px; }
.balance .n { font-size: 34px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.balance .n .i { width: 30px; height: 30px; color: var(--star); }
.balance .l { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.tx { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tx:last-child { border-bottom: 0; }
.tx .d { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.tx .p { color: var(--ok); font-weight: 600; white-space: nowrap; }
.tx .m { color: var(--text-2); font-weight: 600; white-space: nowrap; }
.tx.click { cursor: pointer; border-radius: 10px; padding: 10px 8px; }
.tx.click:hover { background: var(--hover); }
.credit { color: var(--text-3); font-size: 12px; text-align: center; margin-top: 18px; line-height: 1.5; }
.credit a { color: var(--text-2); }

/* toast */
#toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 11px 16px; border-radius: 14px; font-size: 14px; animation: rise .15s ease-out; display: flex; align-items: center; gap: 10px; }
.toast .i { width: 20px; height: 20px; color: var(--accent); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: hsl(205 20% 90% / .14) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: hsl(205 20% 90% / .14); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .layout { padding: 0; gap: 0; }
  .sidebar { width: 100%; min-width: 0; border-radius: 0; }
  .chat {
    position: fixed; inset: 0; border-radius: 0; transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); z-index: 10;
    background:
      radial-gradient(60% 40% at 15% 15%, hsl(189 70% 24% / .5), transparent 70%),
      radial-gradient(60% 45% at 85% 90%, hsl(262 38% 24% / .4), transparent 70%),
      var(--bg);
  }
  .sidebar { box-shadow: none; }
  .layout.chat-open .chat { transform: none; }
  .chat-head { border-radius: 0; padding-left: 4px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .chat-head .back { display: inline-flex; }
  .messages-inner { padding: 0 10px; }
  .composer { padding: 6px 8px max(8px, env(safe-area-inset-bottom)); }
  .overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: none !important; border-radius: 24px 24px 0 0; max-height: 92dvh; }
  .modal-body { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .bubble { max-width: 86%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
