html { scrollbar-gutter: stable; overflow-y: scroll; scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; }
html.chat-lock, html.chat-lock body { overflow: hidden; height: 100%; }
html.chat-lock #view-chat > .eng-line,
html.chat-lock #inbox-thread > .eng-line { display: none; }
html.chat-lock #view-chat,
html.chat-lock #view-inbox {
  position: fixed;
  top: var(--top-h, 54px);
  right: 0;
  bottom: var(--bottom-h, 72px);
  left: 0;
  height: auto;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 16px;
  overflow: hidden;
}
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 8px; }
html, body, body * { touch-action: manipulation; }
.studio-page { --bottom-h: 200px; --col: 720px; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Gate and login */
#login-bot { width: 100%; margin-top: 24px; }
.gate-leave { display: inline-block; margin-top: 18px; padding: 10px 0; color: var(--dim); font-size: 0.9rem; }
.login-word { font-size: 1.1rem; }
.or { margin-top: 22px; text-align: center; font-size: 0.8rem; color: var(--dim) !important; }
.tg-widget { min-height: 48px; margin-top: 10px; display: flex; justify-content: center; }
.err { margin-top: 12px; color: #ff5a52 !important; font-size: 0.9rem; }
.linkish[hidden], .gate-mail[hidden], #account-clear[hidden] { display: none; }
.gate-mail, .linkish {
  display: inline-block;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#login-email { display: grid; gap: 8px; margin-top: 8px; }
#login-email[hidden] { display: none; }
#login-email input, .account-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: #fff;
  font: inherit;
  font-size: 16px;
}
.account-form { display: grid; gap: 8px; margin-top: 16px; }
#account-current[hidden] { display: none; }

/* Top bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.94);
  border-bottom: 1px solid var(--line);
}
#app { padding-top: var(--top-h, 54px); }
.in-tg #back { display: none; }
.in-tg.stacked #back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.icon-btn.ghost { background: transparent; color: var(--soft); flex: none; }
.icon-btn.ghost:hover { background: var(--panel-2); color: #fff; }
.brand { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 1.1rem; }
html.chat-named .brand {
  position: absolute;
  left: 50%;
  max-width: 70%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
html.chat-lock #coins,
html.chat-lock #out { display: none; }
@media (max-width: 419px) { .brand span { display: none; } }
.in-tg #back, .in-tg #out { display: none; }
.in-tg .topbar { padding-left: 16px; padding-right: 12px; }
.coins {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 4px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.coins b { font-weight: 600; }
.coins .buy {
  margin-left: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Page */
.flow {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 4px 16px calc(var(--bottom-h) + 24px);
}
.flow[hidden] { display: none; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock, var(--bottom-h, 120px)) + 12px);
  z-index: 45;
  width: max-content;
  max-width: min(calc(100vw - 32px), 420px);
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #1a1a1a;
  box-shadow: inset 0 0 0 1px var(--line-2), 0 8px 24px rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  animation: toast-in 260ms cubic-bezier(.2, 1.2, .4, 1) backwards;
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast[hidden] { display: none; }
.toast.is-err { box-shadow: inset 3px 0 0 var(--red), inset 0 0 0 1px var(--line-2), 0 8px 24px rgba(0, 0, 0, 0.55); }
.toast.out { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.92); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.9); } to { opacity: 1; transform: translateX(-50%); } }

.eng-switch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 10px 0 0; }
.eng-switch button {
  min-width: 0;
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--dim);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.eng-switch button[aria-pressed="true"] { background: var(--red-lit); box-shadow: none; color: #fff; }
.eng-switch button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.eng-line { display: flex; align-items: baseline; gap: 10px; padding: 12px 0 2px; min-width: 0; }
.eng-line h1 { flex: none; font-size: 1.1rem; letter-spacing: 0.06em; line-height: 1.2; }
.eng-line span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.78rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.step { padding: 14px 0 2px; }
.step[hidden] { display: none; }
.step + .step { border-top: 1px solid var(--line); margin-top: 12px; }
.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.step-head h2 { flex: none; font-size: 0.95rem; letter-spacing: 0.06em; white-space: nowrap; }
.step-head .hint { margin: 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: right; }
#step-clip .drop { margin-top: 0; }

/* Photo shelf */
.shelf {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 2px 16px 4px;
}
.shelf::-webkit-scrollbar { display: none; }
.shot {
  position: relative;
  flex: none;
  width: 78px;
  height: 104px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.shot-wrap { position: relative; flex: none; }
.shot-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #ddd;
  cursor: pointer;
}
.shot-x::after { content: ""; position: absolute; inset: -8px; }
.shot-x svg { width: 12px; height: 12px; stroke-width: 2.6; }
.shot-x.sure { background: var(--red); color: #fff; }
.shot-x:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.shot img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.shot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--red); }
.shot[aria-pressed="true"] img { opacity: 1; }
.shot[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.shot.add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  outline: 1px dashed #3a3a3a;
  outline-offset: -1px;
  color: var(--soft);
  font-size: 0.74rem;
}
.shot.add:hover { color: #fff; outline-color: var(--soft); }
.shot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.spin {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Clip tile */
.source { display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: center; }
button.source-now { padding: 0; border: 0; color: inherit; font: inherit; cursor: zoom-in; }
.source-now {
  width: 78px;
  height: 104px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.source-now img { width: 100%; height: 100%; object-fit: cover; }
.source-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 6px;
  color: var(--dim);
  font-size: 0.68rem;
  text-align: center;
}
.source-actions { display: grid; gap: 8px; }
.source-actions button, .drop-actions button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.source-actions button:focus-visible, .drop-actions button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.drop {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.drop[hidden] { display: none; }
.drop:hover { box-shadow: inset 0 0 0 1px var(--soft); }
.drop-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--dim);
}
.drop-thumb video, .drop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drop-text { display: grid; gap: 2px; flex: 1; min-width: 0; line-height: 1.3; }
.drop-text b { font-weight: 600; font-size: 0.98rem; }
.drop-text span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.8rem; color: var(--dim); }
.drop-actions { display: grid; gap: 6px; flex: none; }

/* Styles */
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px 12px;
  padding: 0 16px;
}
.chips:empty, .chips[hidden] { display: none; }
#gal-filter { margin-bottom: 10px; }
.tile.is-kept .tile-days { color: #7fd48a; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--soft);
  font-size: 0.86rem;
  white-space: nowrap;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: #fff; color: #000; box-shadow: none; font-weight: 600; }
.chip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.swipe-hint { margin: -4px 0 10px; font-size: 0.78rem; color: var(--soft); }
.swipe-hint[hidden] { display: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.seg[hidden] { display: none; }
.seg-btn {
  position: relative;
  min-height: 46px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(155deg, #262626 0%, #151515 60%, #0d0d0d 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px var(--line-2);
  color: var(--dim);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seg .seg-btn[aria-pressed="true"] {
  background: var(--red-lit);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.34), inset -10px -12px 16px rgba(0, 0, 0, 0.28);
  color: #fff;
}
.seg .seg-btn[data-pick="custom"][aria-pressed="true"] {
  background: linear-gradient(155deg, #e6e6e6 0%, #a9a9a9 45%, #6f6f6f 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.7), inset -8px -10px 14px rgba(0, 0, 0, 0.22);
  color: #0a0a0a;
}
.seg-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.key {
  position: relative;
  min-height: 48px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.key:hover { background: rgba(255, 255, 255, 0.12); }
.key[aria-pressed="true"] { background: var(--red-lit); color: #fff; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.3); }
.key:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.key.own { grid-column: 1 / -1; background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.key.own[aria-pressed="true"] { background: var(--red-lit); box-shadow: none; }
.key .has-prev { position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; color: var(--dim); fill: currentColor; stroke: none; }
.key[aria-pressed="true"] .has-prev { color: #fff; }

.custom { margin-top: 12px; }
.custom-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.custom-tools .hint { margin: 0; }
#clear-prompt { border: 0; background: transparent; color: var(--dim); font: inherit; font-size: 0.8rem; cursor: pointer; padding: 6px 0; }
.custom[hidden] { display: none; }
.custom textarea {
  display: block;
  width: 100%;
  min-height: 88px;
  max-height: 42dvh;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: none;
  overflow: auto;
  outline: none;
}
.custom textarea:focus { box-shadow: inset 0 0 0 1px var(--soft); }
.custom textarea::placeholder { color: #6f6f6f; }
.hint { margin-top: 6px; font-size: 0.78rem; color: var(--dim); }

/* Bottom: generate bar + tabs */
.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  background: #0a0a0a;
  border-top: 1px solid var(--line);
}
.tab-pop {
  position: fixed;
  z-index: 28;
  width: 180px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: #1a1a1a;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  transform-origin: 50% 100%;
  animation: tab-pop-in 280ms cubic-bezier(.2, 1.3, .4, 1) both;
}
.tab-pop.is-out { animation: tab-pop-out 320ms ease-in forwards; }
.tab-pop[hidden] { display: none; }
@keyframes tab-pop-in { from { transform: translateY(16px) scale(0.15); } to { transform: none; } }
@keyframes tab-pop-out { to { transform: translateY(18px) scale(0.08); } }
.balance { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.balance-main { min-width: 0; }
.balance-main b { display: block; font-family: var(--display); font-size: 2.4rem; font-weight: 600; line-height: 0.95; }
.balance-main span { color: var(--dim); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.balance .btn { width: auto; margin: 0; min-height: 44px; padding: 0 16px; }
.vip-card {
  display: grid;
  gap: 2px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: #1a1010;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: #fff;
  font: inherit;
  text-align: left;
}
.vip-card b { font-family: var(--display); letter-spacing: 0.08em; }
.vip-card span { font-weight: 600; }
.vip-card em { color: var(--dim); font-style: normal; font-size: 0.78rem; }
.vip-card.is-off { background: #141414; }
body.in-chat .bottom { display: block; }
.gobar { position: relative; width: calc(100% - 32px); max-width: calc(var(--col) - 32px); margin: 0 auto; }
.set-pop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.set-pop[hidden] { display: none; }
.set-pop .set-row > span { margin-bottom: 6px; }
.set-pop .keys { display: flex; flex-wrap: wrap; gap: 6px; }
.set-pop .key { min-height: 32px; padding: 0 10px; }
.key-play {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent currentColor;
  vertical-align: 1px;
}
.login-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.login-split .btn { width: 100%; }
#login-email .seg { margin: 8px 0; }
.tx-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; justify-content: flex-end; }
.tx-filter button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 0.72rem;
}
.tx-filter button[aria-pressed="true"] { background: #1c1c1c; color: #fff; }
.tx-log { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tx-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
}
.tx-row.is-ok { background: #16331f; color: #e7ffe9; }
.tx-row.is-expired { background: #3a1414; color: #ffd6d6; }
.tx-row.is-open { background: #1c1c1c; color: #8a8a8a; }
.tx-row b { font-weight: 600; }
.tx-row strong { font-variant-numeric: tabular-nums; }
.tx-row small { grid-column: 1 / -1; font-size: 0.75rem; opacity: 0.85; }
.tx-pages { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.agree-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 16px 0; }
.agree-links a { color: #fff; text-underline-offset: 3px; }
.agree-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 0 16px;
  text-align: left;
  cursor: pointer;
}
.agree-check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--red); }

.btn-tg {  background: #2AABEE;
  color: #fff;
  width: 100%;
}
.btn-tg:hover, .btn-tg:focus-visible { background: #229ed9; color: #fff; }
#account-tg { margin-top: 12px; }
.auth-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: 999px;
  background: #141414;
}
.auth-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: #fff;
  transition: transform 240ms ease;
}
.auth-switch.is-up .auth-thumb { transform: translateX(100%); }
.auth-switch button {
  position: relative;
  z-index: 1;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9a9a9a;
  font: inherit;
  font-weight: 600;
}
.auth-switch button[aria-pressed="true"] { color: #111; }
#login-submit-label { display: inline-block; transition: opacity 160ms ease; }
#login-submit.is-swap #login-submit-label { opacity: 0; }
.login-wait {
  min-height: 2.6em;
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 0.82rem;
  opacity: 0;
}
.login-wait.is-on { opacity: 1; }
.flow.is-over, #inbox-thread.is-over,
#inbox-list-wrap.is-under, .flow.is-under {
  background: #000;
  overflow: hidden;
}
#login-email input,
.account-form input,
.pass-row input {
  background: #141414;
  color: #fff;
  -webkit-text-fill-color: #fff;
}
#login-email input:-webkit-autofill,
.account-form input:-webkit-autofill,
.pass-row input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  box-shadow: 0 0 0 1000px #141414 inset;
}
.tx-pages button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: #141414; color: #fff; font: inherit; }
.tx-pages button:disabled { opacity: 0.4; }
#account-tg { width: 100%; margin-top: 12px; }
.gobar[hidden] { display: none; }
.glimpse {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 220px;
  height: 44px;
  margin: 0 0 8px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #141414;
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.glimpse[hidden] { display: none; }
.glimpse video { width: 72px; height: 44px; object-fit: cover; flex: none; background: #000; pointer-events: none; }
.glimpse span { padding-right: 10px; }
.gorow { display: flex; align-items: center; gap: 8px; height: 56px; }
.gorow .sum-name { flex: 1 1 auto; min-width: 0; font-size: 0.86rem; }
.gorow .pill { flex: none; height: 40px; min-height: 40px; }
.gorow #set-btn { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.gorow .go { flex: none; width: auto; min-width: 128px; height: 48px; min-height: 48px; padding: 0 18px; margin: 0; }
#prev-btn svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
@media (max-width: 560px) {
  .gorow .sum-name { display: none; }
  .gorow { justify-content: flex-end; }
  #prev-btn span { display: none; }
  #prev-btn { width: 40px; padding: 0; }
  .gorow .go { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
}
.buybar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: calc(var(--col) - 32px);
  margin: 0 auto;
  padding: 10px 0 8px;
  background: #0a0a0a;
  border-top: 1px solid var(--line);
}
.buybar[hidden] { display: none; }
#buybar-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 0.92rem;
}
#shop-buy { flex: none; width: auto; min-width: 148px; min-height: 48px; }
.summary { display: flex; align-items: center; gap: 8px; min-height: 34px; margin-bottom: 8px; }
.sum-name {
  flex: 1 1 34%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 0.92rem;
}
.sum-name.is-empty { font-weight: 400; color: var(--dim); }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--soft);
  font: inherit;
  font-size: 0.8rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.pill[hidden] { display: none; }
.pill.red { background: var(--red); box-shadow: none; color: #fff; font-weight: 600; }
#set-btn {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(155deg, #e6e6e6 0%, #b4b4b4 50%, #8a8a8a 100%);
  color: #0a0a0a;
  font-weight: 600;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.7);
}
#prev-btn { background: var(--red); box-shadow: none; color: #fff; font-weight: 600; }
.pill svg { width: 14px; height: 14px; }
#prev-btn svg { fill: currentColor; stroke: none; }
.pill:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--soft); }
.go { width: 100%; min-height: 52px; }
.go.is-next {
  background: linear-gradient(155deg, #5c5c5c 0%, #3a3a3a 36%, #222 100%);
  color: #e4e4e4;
}
.go.is-next:hover, .go.is-next:focus-visible { background: linear-gradient(155deg, #6a6a6a 0%, #444 38%, #2a2a2a 100%); }
.go:disabled { opacity: 0.6; cursor: progress; }
.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: var(--col);
  margin: 8px auto 0;
  padding: 0 max(2px, env(safe-area-inset-right)) env(safe-area-inset-bottom, 0px) max(2px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
}
.tabs button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  padding: 8px 2px 6px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 0.64rem;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tabs button > span:not(.badge) { display: block; max-width: 100%; overflow-wrap: anywhere; }
.tabs button svg { width: 21px; height: 21px; flex: none; }
.tabs button[aria-current="page"] { color: #fff; }
.tabs button[aria-current="page"] svg { color: var(--red); }
.app-ico .badge { top: 10px; right: 18px; }
.row.needs-account b { color: #ff2a22; }
.tabs button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.tabs .badge { top: 4px; right: calc(50% - 22px); }
.badge {
  position: absolute;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.badge[hidden] { display: none; }
.picker { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Gallery */
#view-gallery { padding-top: 0; }
@media (min-width: 900px) {
  #view-gallery { max-width: none; }
}
.gal-tools {
  position: sticky;
  top: var(--top-h, 54px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -16px 8px;
  padding: 10px 16px 8px;
  background: rgba(10, 10, 10, 0.94);
  border-bottom: 1px solid var(--line);
}
.gal-tools .chips { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; }
#gal-filter { margin-bottom: 0; }
.gal-tools .chip { min-height: 32px; padding: 0 11px; font-size: 0.76rem; }
.gal-cta {
  flex: none;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--red-lit);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.gal-cta.is-on { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--soft); cursor: default; }
.gal-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.size {
  flex: none;
  width: 78px;
  height: 32px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.size::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #8a1a16 var(--fill, 50%), #2a2a2a var(--fill, 50%));
}
.size::-moz-range-track { height: 4px; border-radius: 2px; background: #2a2a2a; }
.size::-moz-range-progress { height: 4px; border-radius: 2px; background: #8a1a16; }
.size::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.18);
  -webkit-appearance: none;
  appearance: none;
}
.size::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--red); }
.size:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.gal-when {
  position: sticky;
  top: calc(var(--top-h, 54px) + var(--tools-h, 50px));
  z-index: 4;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px #000;
  opacity: 0;
  pointer-events: none;
}
.gal-when.show { opacity: 1; }
.gal-when:empty { display: none; }
.gal-foot { margin: 14px 0 8px; text-align: center; }
.grid { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; overflow-anchor: none; }
.grid > .dim { flex: 1 1 100%; padding: 28px 0; text-align: center; font-size: 0.88rem; }
.tile {
  position: relative;
  flex: none;
  width: 120px;
  height: 150px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: var(--panel-2);
  cursor: pointer;
}
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile-blank { display: block; width: 100%; height: 100%; }
.tile.is-pending { cursor: default; background: #141414; box-shadow: inset 0 0 0 1px var(--line-2); }
.pend-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: sheen 1.6s linear infinite;
}
.pend-meta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--soft);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}
.tile.is-pending .tile-days, .tile.is-failed .tile-days { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile.is-failed { background: #1a1212; box-shadow: inset 0 0 0 1px #5c2a28; }
.tile.is-failed .pend-meta b { color: #ffb4ae; font-weight: 600; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.pend-x {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 26px;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: #3a1816;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.pend-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.tile-play {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  color: #fff;
  fill: currentColor;
  stroke: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}
.tile-days {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 6px 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #ddd;
  font-size: 0.66rem;
  text-align: left;
}
.tile:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.jobs { margin: 0; padding: 0; list-style: none; }
.jobs li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.jobs .job-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.92rem; }
.jobs .job-state { flex: none; font-size: 0.8rem; color: var(--soft); }
.running { margin-top: 12px; }
.run-hint { margin-bottom: 4px; }

/* Shop and profile */
.wallet {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 4px 0 14px;
  font-variant-numeric: tabular-nums;
}
.wallet p { margin: 0; color: var(--soft); }
.wallet b { color: #fff; font-weight: 600; }
.compare { display: grid; gap: 8px; }
.compare article {
  padding: 12px 14px;
  border-radius: 8px;
  background: #101010;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.compare h2 { margin: 0 0 4px; font-size: 0.95rem; letter-spacing: 0.04em; }
.compare p { margin: 0; font-size: 0.8rem; line-height: 1.4; color: var(--dim); }
.shop-block { margin-top: 22px; }
.shop-block h2 { margin: 0 0 10px; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pack-list { display: grid; gap: 8px; }
.sku {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: #101010;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pack-grid .sku { flex-direction: column; align-items: flex-start; justify-content: space-between; min-height: 92px; gap: 8px; }
.sku div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sku b { font-weight: 600; font-size: 0.98rem; }
.pack-grid .sku b { font-family: var(--display); font-size: 1.35rem; letter-spacing: 0.02em; }
.sku span, .sku small { font-size: 0.75rem; color: var(--dim); }
.sku em {
  flex: none;
  font-style: normal;
  font-weight: 600;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.sku[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--red); }
.sku.is-owned, .sku:disabled { opacity: 0.45; cursor: default; }
.shop-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.shop-switch button { min-height: 48px; border: 0; border-radius: 8px; background: #141414; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--dim); font: inherit; font-weight: 600; cursor: pointer; }
.shop-switch button[aria-pressed="true"] { background: var(--red); box-shadow: none; color: #fff; }
.custom-card.is-on { box-shadow: inset 0 0 0 2px var(--red); }
.key-prev { margin-left: 8px; color: #fff; font-size: 0.72rem; font-weight: 600; }
#shop-buy.is-wait { background: #1c1c1c; color: #fff; }
.apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.app-ico {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 108px;
  padding: 14px 8px;
  border: 0;
  border-radius: 16px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.app-ico svg { width: 28px; height: 28px; }
.app-ico span { font-size: 0.78rem; font-weight: 600; }
.app-ico em { font-style: normal; font-size: 0.7rem; color: var(--dim); font-weight: 500; }
.app-ico .dot { position: absolute; top: 10px; right: 10px; }
.act-total { margin: 8px 0 0; font-size: 1.05rem; }
.act-total b { font-family: var(--display); font-size: 2rem; font-weight: 600; }
.act-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.act-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.act-grid button { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #141414; cursor: pointer; }
.act-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
@media (min-width: 560px) {
  .apps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.faces { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; }
.face { flex: none; width: 72px; height: 96px; padding: 0; overflow: hidden; border: 0; border-radius: 8px; background: #141414; cursor: pointer; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.sku:focus-visible, .tile-link:focus-visible, .send:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.custom-card { display: grid; gap: 10px; margin-top: 8px; padding: 12px; border-radius: 8px; background: #101010; box-shadow: inset 0 0 0 1px var(--line-2); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  font: inherit;
  font-size: 1.3rem;
  cursor: pointer;
}
.stepper input {
  width: 72px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.stepper b { margin-left: auto; font-variant-numeric: tabular-nums; }
.custom-card .btn { width: 100%; }
.custom-card .btn:disabled { background: #1a1a1a; color: var(--dim); }
.more-packs { margin-top: 10px; }
.more-packs summary { min-height: 44px; padding: 12px 0; color: var(--soft); cursor: pointer; }
.more-packs .pack-list { margin-bottom: 4px; }
.shop-foot { margin: 18px 0 8px; }
.who-coins { margin: 6px 0 0; color: var(--soft); }
.who-coins b { display: block; font-family: var(--display); font-size: 3rem; font-weight: 600; line-height: 0.95; color: #fff; }
.who-vip { margin: 8px 0 0; color: var(--soft); }
.who-actions { display: flex; gap: 16px; margin: 4px 0 0; }
.linkish {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.who-line { margin: 10px 0 0; color: var(--dim); font-size: 0.9rem; }
.who .meter { margin-top: 8px; max-width: 180px; }
.rows { margin-top: 22px; border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.row { cursor: pointer; }
.row b { flex: none; font-weight: 600; }
.row span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--dim); font-size: 0.82rem; text-align: right; }
.row .row-copy { display: grid; gap: 3px; overflow: visible; white-space: normal; text-align: left; }
.row-copy b { color: var(--ink); }
.row-copy small { color: var(--dim); line-height: 1.35; }
.row .check { margin-left: auto; }
.row .dot { position: static; flex: none; }
.referral-card { margin-top: 24px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.referral-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.referral-head h2, .referral-card h3 { margin: 0; font-family: var(--display); }
.referral-head h2 { font-size: 1.2rem; }
.referral-head p { margin: 3px 0 0; color: var(--dim); font-size: 0.82rem; }
.referral-card h3 { margin-top: 20px; font-size: 0.9rem; }
.referral-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.referral-numbers p { display: grid; gap: 3px; margin: 0; }
.referral-numbers b { font-size: 1.2rem; }
.referral-numbers span, .referral-list small { color: var(--dim); font-size: 0.75rem; line-height: 1.35; }
.referral-list { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.referral-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.82rem; }
.referral-list small { text-align: right; }
@media (max-width: 520px) {
  .referral-numbers { grid-template-columns: 1fr; }
  .referral-numbers p { grid-template-columns: 74px 1fr; align-items: baseline; }
}
.chat-head { align-items: center; }
.typing { margin: 0 16px 4px; min-height: 1.2em; color: var(--dim); font-size: 0.82rem; }
.typing[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .typing span { display: inline-block; animation: typeblink 1s steps(1) infinite; }
}
@keyframes typeblink { 50% { opacity: 0.35; } }
.chat-leave {
  flex: none;
  min-height: 44px;
  padding: 0 12px 0 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.home { display: grid; gap: 12px; margin-top: 8px; }
.hero-row { display: grid; gap: 8px; }
.hero {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 14px;
  border-radius: 8px;
  background: #101010;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.hero span { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.hero b { font-family: var(--display); font-size: 1.8rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.1; }
.hero p { margin: 0; font-size: 0.82rem; color: var(--dim); }
.hero .btn { width: 100%; margin-top: 8px; }
.hero button:not(.btn) {
  justify-self: start;
  min-height: 36px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.today { display: grid; gap: 8px; padding: 14px; border-radius: 8px; background: #101010; box-shadow: inset 0 0 0 1px var(--line-2); }
.today-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.today-top span { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.today-top b, .today p { font-size: 0.86rem; font-weight: 500; }
.today p { margin: 0; color: var(--soft); }
.meter { height: 6px; border-radius: 99px; background: #1c1c1c; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--red); }
.tiles { display: grid; gap: 8px; }
.tile-link {
  position: relative;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: #101010;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tile-link b { font-weight: 600; }
.tile-link span { font-size: 0.8rem; color: var(--dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile-link .dot { position: absolute; top: 14px; right: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.addon {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #101010;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.addon div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.addon b { font-weight: 600; }
.addon span { font-size: 0.78rem; color: var(--dim); }
.addon .btn { flex: none; width: auto; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.86rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.profile-foot { margin: 4px 0 8px; font-size: 0.78rem; color: var(--dim); }
#view-chat {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: calc(100dvh - var(--top-h, 54px) - var(--bottom-h, 120px));
  padding-bottom: 8px;
}
#view-chat[hidden] { display: none; }
#view-inbox {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: calc(100dvh - var(--top-h, 54px) - var(--bottom-h, 120px));
  padding-bottom: 8px;
}
#view-inbox[hidden] { display: none; }
#inbox-list-wrap, #inbox-thread { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#inbox-list-wrap[hidden], #inbox-thread[hidden] { display: none; }
.inbox-find {
  width: 100%;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: #fff;
  font: inherit;
  font-size: 16px;
}
.inbox-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.inbox-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 64px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.inbox-row b { font-weight: 600; }
.inbox-name { display: flex; align-items: center; gap: 8px; width: 100%; }
.unread-n {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.inbox-row span { color: var(--dim); font-size: 0.82rem; }
.inbox-name b { color: #fff; }
#view-chat .chat-log { flex: 1; min-height: 0; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 6px; overflow: auto; overscroll-behavior: contain; margin: 0; padding: 12px 0; }
.chat-log::before { content: ""; flex: 1 0 auto; }
.bubble { max-width: 78%; padding: 8px 10px 4px; border-radius: 14px; }
.bubble.fresh { animation: bubble-in 280ms cubic-bezier(.2, 1.15, .35, 1) both; }
.bubble.mine.fresh { transform-origin: 100% 100%; }
.bubble.theirs.fresh { transform-origin: 0 100%; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(14px) scale(0.86); } to { opacity: 1; transform: none; } }
.bubble p { margin: 0; font-size: 0.92rem; line-height: 1.35; white-space: pre-wrap; }
.bubble time { display: block; margin-top: 2px; font-size: 0.64rem; color: #bdbdbd; text-align: right; }
.bubble-img { display: block; max-width: 220px; border-radius: 8px; margin-bottom: 4px; }
.ticks { margin-left: 4px; letter-spacing: -0.14em; color: #ccc; }
.ticks.read { color: #8fd0ff; }
.chat-pic {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
}
.chat-pic svg { width: 18px; height: 18px; }
.notice {
  position: absolute;
  top: calc(100% + 8px);
  left: 12px;
  right: 12px;
  z-index: 28;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #161616;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  animation: pop 180ms ease-out;
}
.notice[hidden] { display: none; }
.notice b { flex: none; }
.notice span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--dim); font-weight: 400; }
.bubble.mine { align-self: flex-end; background: #6d1612; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: #1c1c1c; border-bottom-left-radius: 4px; }
.bubble.sending { opacity: 0.72; }
.bubble.failed { background: #3a1a18; cursor: pointer; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea {
  flex: 1;
  width: auto;
  min-height: 44px;
  max-height: 40vh;
  padding: 10px 14px;
  border: 0;
  border-radius: 18px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  resize: none;
  outline: none;
}
.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  cursor: pointer;
}
.send svg { width: 18px; height: 18px; }
.up-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #2a2a2a; }
.up-bar i { display: block; height: 100%; background: var(--red); }
.source-now { position: relative; }
.skel { display: grid; gap: 8px; }
.skel i { display: block; height: 64px; border-radius: 8px; background: #161616; }
.prompt-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #1a1a1a;
  color: var(--soft);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.prompt-box { margin-top: 8px; padding: 10px; border-radius: 8px; background: #141414; }
.prompt-box p { margin: 0 0 8px; font-size: 0.82rem; line-height: 1.4; white-space: pre-wrap; }
.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 88px;
  background: #000;
}
.viewer[hidden] { display: none; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-x {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: 8px;
  width: 44px;
  height: 44px;
}
#viewer-use { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); width: min(100% - 32px, 360px); }
#viewer-use[hidden] { display: none; }
button, .sku, .app-ico, .inbox-row, .chip, .send, .eng-switch button, .linkish, .tile {
  transition: transform 120ms ease;
}
.btn:active, .sku:active, .pay-method:active, .tile-link:active, .send:active, .source-actions button:active, .app-ico:active, .pend-x:active, .inbox-row:active, .chip:active, .eng-switch button:active, .linkish:active, .tile:active {
  transform: scale(0.96);
}
.order { display: grid; gap: 4px; padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.order-name { margin: 0; font-weight: 600; font-size: 1.05rem; }
.order-get, .order-bonus { margin: 0; font-size: 0.82rem; color: var(--dim); }
.order-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.order-total span { color: var(--dim); font-size: 0.82rem; }
.order-total b { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.pay-methods { display: grid; gap: 8px; margin: 12px 0; }
.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: #141414;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pay-method img { flex: none; width: 36px; height: 36px; }
.pay-method span { display: grid; gap: 2px; min-width: 0; }
.pay-method b { font-weight: 600; font-size: 0.95rem; }
.pay-method small { color: var(--dim); font-size: 0.75rem; }
.pay-method:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pay-wait { margin: 8px 0 0; font-weight: 600; }
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lib-cell { position: relative; }
.lib-item {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #141414;
  color: inherit;
  cursor: pointer;
}
.lib-item img { width: 100%; height: 100%; object-fit: cover; }
.lib-dur {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}
.lib-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #ddd;
  cursor: pointer;
}
.lib-x::after { content: ""; position: absolute; inset: -8px; }
.lib-x.sure { background: var(--red); color: #fff; }
.lib-empty { display: grid; gap: 12px; }
.pay-qr { display: block; width: min(100%, 240px); height: auto; margin: 8px auto; background: #fff; border-radius: 8px; }
.pay-amount { margin: 8px 0; font-family: var(--display); font-size: 1.5rem; }
.pay-address { display: block; width: 100%; padding: 10px; border: 0; border-radius: 8px; background: #141414; color: #fff; font: inherit; font-size: 0.78rem; line-height: 1.4; word-break: break-all; text-align: left; cursor: pointer; }
.pay-recent-title { margin: 18px 0 6px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.tx { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.82rem; }
.tx span { color: var(--dim); text-align: right; }
.tx-day { margin: 18px 0 0; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.tx-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tx-card div { min-width: 0; display: grid; gap: 2px; }
.tx-card b { font-weight: 600; }
.tx-card small { color: var(--dim); font-size: 0.75rem; }
.tx-card strong { flex: none; font-variant-numeric: tabular-nums; }
.account-mail { margin: 8px 0 0; font-size: 1.05rem; font-weight: 600; word-break: break-all; }
.field-label { display: grid; gap: 6px; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.pass-row { display: flex; gap: 8px; align-items: center; }
.pass-row input { flex: 1; width: auto; min-width: 0; }
.pass-row button { flex: none; min-height: 48px; padding: 0 12px; border: 0; border-radius: 8px; background: #141414; color: #fff; font: inherit; font-size: 0.82rem; letter-spacing: 0; text-transform: none; }
input[data-secret="1"] { -webkit-text-security: disc; }
body.stacked .flow:not([hidden]) { animation: stack-in 180ms ease-out; }
@keyframes stack-in { from { transform: translateX(28px); } to { transform: none; } }

/* Sheets */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}
.overlay[hidden] { display: none; }
.overlay.is-up {
  align-items: flex-end;
  padding: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 260ms ease-out;
}
.overlay.is-up.is-in { background: rgba(0, 0, 0, 0.72); }
.overlay.is-up .panel-sheet {
  max-width: 560px;
  margin: 0 auto;
  border-radius: 16px 16px 0 0;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  opacity: 0;
  transition: transform 260ms ease-out, opacity 260ms ease-out;
}
.overlay.is-up.is-in .panel-sheet { transform: none; opacity: 1; }
.panel-sheet {
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 8px 16px 18px;
  border-radius: 16px;
  background: #0d0d0d;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.sheet-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; background: #0d0d0d; }
.sheet-bar h2 { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 1.15rem; letter-spacing: 0.05em; }
.view-frame {
  width: min(100%, calc(var(--r) * min(52dvh, calc(100dvh - 280px))));
  aspect-ratio: var(--r);
  max-height: min(52dvh, calc(100dvh - 280px));
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}
.view-frame .full, .sheet-body video.full {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.sheet-body .hint { text-align: center; }
.sheet-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.sheet-pair .btn { width: 100%; min-height: 48px; margin: 0; background: #141414; color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.sheet-pair .btn-red { background: var(--red-lit); color: #fff; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.34), inset -10px -12px 16px rgba(0, 0, 0, 0.28); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.sheet-actions .btn:first-child { grid-column: 1 / -1; }
.sheet-actions .btn { width: 100%; margin: 0; background: #141414; color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.sheet-actions .btn-red { background: var(--red-lit); color: #fff; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.34), inset -10px -12px 16px rgba(0, 0, 0, 0.28); }
.ghost-btn { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--soft); }
.ghost-btn::before { display: none; }
.set-row + .set-row { margin-top: 16px; }
.set-row > span {
  display: block;
  margin-bottom: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}
.set-row .keys { grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); }
.sheet-body > .btn { width: 100%; margin-top: 22px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (min-width: 640px) {
  .compare, .hero-row { grid-template-columns: 1fr 1fr; }
  .flow { padding-left: 24px; padding-right: 24px; }
  .keys { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gal-tools { margin: 0 -24px 8px; padding: 10px 24px 8px; }
  .chips { margin: 0 0 12px; padding: 0; flex-wrap: wrap; overflow: visible; }
  .shelf { margin: 0; padding: 2px 0 4px; }
  .panel-sheet { max-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
  .pend-sheen { animation: none; }
  body.stacked .flow:not([hidden]) { animation: none; }
  .tab-pop, .toast { animation: none; }
  .bottom { transition: none; }
  button, .sku, .app-ico, .inbox-row, .chip, .send, .eng-switch button, .linkish, .tile { transition: none; }
  .tile img, .toast { transition: none; }
  .bubble.fresh { animation: none; }
  .btn:active, .sku:active, .pay-method:active, .tile-link:active, .send:active, .source-actions button:active, .app-ico:active, .pend-x:active, .inbox-row:active, .chip:active, .eng-switch button:active, .linkish:active, .tile:active { transform: none; }
  .overlay.is-up, .overlay.is-up .panel-sheet { transition: none; }
  .overlay.is-up .panel-sheet { transform: none; opacity: 1; }
}
