/* 📱 Чесний — the Mini App's one stylesheet. Colours come from Telegram's theme (--tg-theme-*,
   set by telegram-web-app.js), with light / dark fallbacks for a plain browser. */

:root {
  --bg: var(--tg-theme-secondary-bg-color, #f1f1f4);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #16181d);
  --hint: var(--tg-theme-hint-color, #8a8f98);
  --link: var(--tg-theme-link-color, #2a7ae2);
  --accent: var(--tg-theme-button-color, #2f80ed);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --title: var(--tg-theme-accent-text-color, var(--accent));
  --danger: var(--tg-theme-destructive-text-color, #e5484d);
  --sep: var(--tg-theme-section-separator-color, rgba(127, 127, 127, .18));
  --good: #2fb36d;
  --warn: #e6a23c;
  --gold: #e7b928;
  --love: #ef5a8f;
  --soft: rgba(127, 127, 127, .12);
  --radius: 14px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  color-scheme: light;
}
:root[data-scheme="dark"] {
  --bg: var(--tg-theme-secondary-bg-color, #0f1419);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #1b232c));
  --text: var(--tg-theme-text-color, #f2f4f7);
  --hint: var(--tg-theme-hint-color, #7d8894);
  --soft: rgba(255, 255, 255, .08);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Color Emoji", sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
input { font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h2, h3 { margin: 0; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-top)) 14px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--sep);
}
.top-title { font-weight: 700; font-size: 17px; }
.chat-switch {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer;
}
.chat-switch:disabled { cursor: default; }
.chat-name { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-caret { color: var(--hint); }
.balance {
  flex: none; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

/* ---------------------------------------------------------------- tabs */
.view { flex: 1; padding: 0 0 calc(76px + var(--safe-bottom)); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + var(--safe-bottom));
  background: var(--card); border-top: 1px solid var(--sep);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: none; border: 0; padding: 4px 0; color: var(--hint); cursor: pointer; border-radius: 10px;
}
.tab-icon { font-size: 21px; line-height: 1.1; filter: grayscale(.6); opacity: .8; }
.tab-label { font-size: 11px; font-weight: 600; }
.tab.on { color: var(--title); }
.tab.on .tab-icon { filter: none; opacity: 1; transform: scale(1.06); }

/* ---------------------------------------------------------------- page bits */
.page { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 12px; }
.banner {
  position: relative; height: 128px; border-radius: var(--radius); overflow: hidden;
  background: var(--soft) center / cover no-repeat;
}
.banner-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.62)); }
.banner-text { position: absolute; left: 14px; right: 14px; bottom: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.banner-title { font-size: 21px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-sub { font-size: 13px; opacity: .92; }
.section { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--hint); margin: 6px 2px -4px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.muted { color: var(--hint); }
.small { font-size: 13px; }
.center { text-align: center; }
.big { font-size: 22px; font-weight: 800; }
.good { color: var(--good); }
.bad { color: var(--danger); }
.grow { flex: 1; min-width: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.span { grid-column: 1 / -1; margin: 0; }

.btn {
  border: 0; border-radius: 11px; padding: 10px 14px; cursor: pointer; font-weight: 600;
  background: var(--soft); color: var(--text); transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 7px 11px; font-size: 14px; }
.btn.wide { width: 100%; padding: 13px; font-size: 16px; }
.btn.busy { opacity: .6; }
.icon-btn { background: none; border: 0; padding: 0 4px; cursor: pointer; font-size: 14px; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); white-space: nowrap; }
.pill.done, .pill.good { color: var(--good); background: rgba(47, 179, 109, .14); }
.pill.warn, .pill.wait { color: var(--warn); background: rgba(230, 162, 60, .15); }
.pill.bad, .pill.off { color: var(--hint); }

.bar { height: 7px; border-radius: 99px; background: var(--soft); overflow: hidden; flex: 1; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s ease; }
.bar.good .bar-fill { background: var(--good); }
.bar.warn .bar-fill { background: var(--warn); }
.bar.bad .bar-fill { background: var(--danger); }
.bar.gold .bar-fill { background: var(--gold); }
.bar.love .bar-fill { background: var(--love); }

.facts { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.fact { display: flex; align-items: baseline; gap: 8px; }
.fact-icon { width: 20px; text-align: center; flex: none; }
.fact-label { color: var(--hint); flex: none; }
.fact-value { margin-left: auto; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.sticky { position: sticky; top: 52px; z-index: 3; background: var(--bg); padding: 6px 0; }
.chip {
  flex: none; border: 0; border-radius: 999px; padding: 7px 13px; cursor: pointer; font-weight: 600; font-size: 14px;
  background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.chip.on { background: var(--accent); color: var(--accent-text); }

.list { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 0; background: none; text-align: left;
  border-bottom: 1px solid var(--sep); width: 100%;
}
.list-row:last-child { border-bottom: 0; }
.list-row.choice { cursor: pointer; }
.list-row.choice.on, .list-row.choice:active { background: var(--soft); }
.price { font-weight: 700; white-space: nowrap; }
.row-photo { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; gap: 3px; padding: 0 0 10px; border: 0; border-radius: var(--radius);
  background: var(--card); overflow: hidden; text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: transform .08s ease;
}
.tile:active { transform: scale(.98); }
.tile.on { outline: 2px solid var(--accent); }
.tile.owned { opacity: .75; }
.tile-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--soft); margin-bottom: 4px; }
.tile-title, .tile-price, .tile-sub { padding: 0 10px; }
.tile-title { font-weight: 700; font-size: 14px; }
.tile-price { font-weight: 700; color: var(--title); font-size: 14px; }
.tile-sub { color: var(--hint); font-size: 12px; }

.empty { text-align: center; padding: 26px 18px; color: var(--hint); }
.empty-icon { font-size: 40px; margin-bottom: 6px; }
.empty-text { color: var(--text); font-weight: 600; }
.how p { text-align: left; color: var(--hint); }

.error-block { margin: 40px 18px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.error-icon { font-size: 44px; }

/* ---------------------------------------------------------------- 🏠 */
.wallet { display: flex; align-items: baseline; justify-content: space-between; background: var(--card); border-radius: var(--radius); padding: 14px; }
.wallet-label { color: var(--hint); }
.wallet-sum { font-size: 26px; font-weight: 800; }
.wallet-row { padding: 0 2px; }
.happy { padding: 10px 14px; border-radius: var(--radius); background: rgba(230, 162, 60, .14); font-weight: 600; }
.happy.on { background: linear-gradient(90deg, #ffcf4a, #ff9f43); color: #3b2500; }
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 12px 12px 12px 14px; }
.task.link { cursor: pointer; }
.task-icon { font-size: 26px; width: 34px; text-align: center; flex: none; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 700; }
.task-note { color: var(--hint); font-size: 13px; }
.task-left { color: var(--hint); font-size: 12px; }
.task.st-done .task-icon, .task.st-off .task-icon, .task.st-none .task-icon { filter: grayscale(.7); opacity: .7; }
.task.st-off { opacity: .6; }

/* ---------------------------------------------------------------- 👤 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.stat-value { font-size: 20px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--hint); }
.achievements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ach { background: var(--card); border-radius: 12px; padding: 10px; opacity: .55; filter: grayscale(.9); }
.ach.done { opacity: 1; filter: none; }
.ach-title { font-weight: 700; font-size: 14px; }
.ach-about { font-size: 12px; color: var(--hint); }

/* ---------------------------------------------------------------- 💞 */
.couple { display: flex; flex-direction: column; gap: 12px; }
.couple-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: var(--soft); }
.couple-level { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.wedding { margin-top: 10px; padding: 9px 12px; border-radius: 11px; background: var(--soft); font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 30%; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.preview { border-radius: 12px; overflow: hidden; background: var(--soft); min-height: 120px; }
.card-img { width: 100%; }
.skin-info { margin: 10px 2px; }
.skin-name { font-weight: 800; font-size: 17px; }
.skins { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 6px; }
.swatch { position: relative; border: 0; padding: 0; border-radius: 12px; aspect-ratio: 1 / 1; cursor: pointer; background: none; }
.swatch-colors { position: absolute; inset: 0; border-radius: 12px; }
.swatch-icon { position: relative; font-size: 20px; }
.swatch.on { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- 💼 */
.asset { display: flex; flex-direction: column; gap: 12px; }
.asset-head { display: flex; gap: 12px; }
.asset-photo { width: 104px; height: 104px; border-radius: 12px; object-fit: cover; flex: none; background: var(--soft); }
.asset-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.asset-main .facts { margin-top: 2px; gap: 3px; font-size: 14px; }
.asset-main .pill { align-self: flex-start; }
.asset-title { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 4px; }
.asset-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.asset-actions .btn { flex: 1 1 auto; }
.meter { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.meter-value { width: 38px; text-align: right; color: var(--hint); }
.toggle { display: flex; align-items: center; gap: 6px; margin: 4px 2px 10px; color: var(--hint); }
.detail-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.trip { text-align: center; }
.trip-icon { font-size: 54px; }

/* ---------------------------------------------------------------- 🛒 */
.stars-row {
  display: flex; align-items: center; gap: 12px; border: 0; border-radius: var(--radius); padding: 10px 14px;
  background: linear-gradient(90deg, rgba(231, 185, 40, .22), rgba(231, 185, 40, .06)), var(--card); cursor: pointer; text-align: left;
}
.stars-img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; }
.hint { padding: 12px; border-radius: 12px; background: var(--soft); }
.tag-preview { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--soft); }
.tag-name { font-weight: 700; color: var(--link); }
.tag-badge { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--card); color: var(--hint); }
.tag-badge.empty { opacity: .6; font-style: italic; }

/* ---------------------------------------------------------------- forms, people */
.form { display: flex; flex-direction: column; gap: 12px; }
.form p, .form h2 { margin: 0; }
.search, .text, .amount {
  width: 100%; border: 1px solid var(--sep); border-radius: 12px; padding: 12px 14px;
  background: var(--card); color: var(--text); outline: none;
}
.search:focus, .text:focus, .amount:focus { border-color: var(--accent); }
.amount { font-size: 22px; font-weight: 700; }
.quote { padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.picker { display: flex; flex-direction: column; gap: 10px; }
.people { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; background: var(--card); border-radius: var(--radius); }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid var(--sep); }
.person:active { background: var(--soft); }
.chat-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px; border: 0; border-radius: var(--radius);
  background: var(--card); text-align: left; cursor: pointer; margin-bottom: 8px;
}
.chat-row.on { outline: 2px solid var(--accent); }
.chat-row-name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-balance { font-weight: 700; color: var(--title); }

/* ---------------------------------------------------------------- sheet, toast */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .42); animation: fade .18s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto;
  background: var(--bg); border-radius: 18px 18px 0 0; padding: 8px 14px calc(16px + var(--safe-bottom));
  animation: rise .22s cubic-bezier(.2, .9, .3, 1);
}
.sheet-grip { width: 38px; height: 5px; border-radius: 9px; background: var(--sep); margin: 2px auto 10px; }
.sheet-title { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.sheet-actions:empty { display: none; }
.sheet-actions { position: sticky; bottom: 0; padding-top: 12px; background: var(--bg); }
.toast {
  position: fixed; left: 14px; right: 14px; bottom: calc(84px + var(--safe-bottom)); z-index: 30;
  padding: 12px 14px; border-radius: 14px; background: rgba(30, 30, 34, .94); color: #fff; font-weight: 600;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .25); animation: rise .2s ease; white-space: pre-line;
}
.toast.good { background: rgba(28, 120, 74, .96); }
.toast.bad { background: rgba(170, 45, 50, .96); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- skeletons */
.skeleton { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.sk { border-radius: var(--radius); background: linear-gradient(90deg, var(--soft) 25%, rgba(127,127,127,.2) 50%, var(--soft) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.sk-banner { height: 128px; }
.sk-row { height: 62px; margin-bottom: 8px; }
.sk-card { height: 200px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (min-width: 560px) {
  .page { max-width: 560px; margin: 0 auto; width: 100%; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- r30: 🏆 tops */
.tabs .tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chip.small { padding: 5px 11px; font-size: 13px; }
.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--soft); }
.seg {
  flex: 1 1 0; min-width: 0; border: 0; border-radius: 9px; padding: 7px 4px; background: none; cursor: pointer;
  font-weight: 600; font-size: 13px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.segmented.small .seg { padding: 6px 3px; font-size: 12.5px; }
.board, .board-body { display: flex; flex-direction: column; gap: 10px; }
.mine { display: flex; flex-direction: column; gap: 2px; border-left: 4px solid var(--accent); }
.mine.none { border-left-color: var(--sep); }
.mine-place { font-size: 18px; font-weight: 800; }
.fastest { font-weight: 600; }
.rank-row { padding: 10px 12px; gap: 10px; }
.rank-row.me { background: rgba(47, 128, 237, .1); }
:root[data-scheme="dark"] .rank-row.me { background: rgba(106, 179, 243, .14); }
.rank-medal { width: 26px; text-align: center; font-size: 20px; flex: none; }
.rank-num { width: 26px; text-align: center; font-weight: 700; color: var(--hint); flex: none; }
.avatars { display: flex; flex: none; }
.avatars .avatar + .avatar { margin-left: -10px; box-shadow: 0 0 0 2px var(--card); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 700; font-size: 15px;
  position: relative; overflow: hidden; line-height: 1; user-select: none;
}
/* r32: 👤 the photo covers the initials once it has loaded (fixed size: nothing moves). */
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; opacity: 0; transition: opacity .2s ease; }
.avatar.photo .avatar-img { opacity: 1; }
.avatar.tiny { width: 20px; height: 20px; font-size: 10px; }
.avatar.small { width: 28px; height: 28px; font-size: 12px; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.me-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.with-face { display: inline-flex; align-items: center; gap: 6px; }
.couple-art { position: relative; }
.couple-faces { position: absolute; left: 12px; bottom: -14px; display: flex; }
.couple-faces .avatar { box-shadow: 0 0 0 3px #fff; }
.couple-faces .avatar + .avatar { margin-left: -12px; }
.couple-art + .couple-main { margin-top: 8px; }
.rank-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-value { font-weight: 700; white-space: nowrap; text-align: right; flex: none; max-width: 42%; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- r30: ⚙️ settings */
.lead { margin: -2px 2px 0; }
.page-head { display: flex; align-items: center; gap: 8px; }
.back-btn {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--card); cursor: pointer; flex: none;
  font-size: 24px; line-height: 1; color: var(--title); box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.crumbs { font-size: 12px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title { font-size: 20px; font-weight: 800; }
.nav-row { cursor: pointer; }
.nav-icon { font-size: 22px; width: 30px; text-align: center; flex: none; }
.nav-name { font-weight: 600; }
.chev { color: var(--hint); font-size: 20px; flex: none; }
.setup-card { display: flex; align-items: center; gap: 12px; border: 0; text-align: left; cursor: pointer; width: 100%; }
.setup-icon { font-size: 28px; }
.setup-title { font-weight: 700; }
.setting { cursor: default; }
.setting.col { flex-direction: column; align-items: stretch; gap: 8px; }
.setting.locked { opacity: .6; }
.setting-head { display: flex; align-items: center; gap: 10px; width: 100%; }
.setting-name { font-weight: 500; overflow-wrap: anywhere; }
.setting-value { color: var(--hint); text-align: right; max-width: 55%; overflow-wrap: anywhere; }
.text-preview { overflow-wrap: anywhere; }
.info-row { flex-wrap: wrap; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 99px;
  background: var(--soft); position: relative; cursor: pointer; transition: background .15s;
  box-shadow: inset 0 0 0 1px var(--sep);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch:checked { background: var(--good); box-shadow: none; }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: default; }
.stepper { display: flex; align-items: center; gap: 8px; }
.step {
  width: 40px; height: 36px; border: 0; border-radius: 10px; background: var(--soft); cursor: pointer;
  font-size: 20px; font-weight: 700; color: var(--title); flex: none;
}
.step:disabled { opacity: .35; cursor: default; }
.step-value { flex: 1; text-align: center; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.details summary { cursor: pointer; font-weight: 600; }
.details p { margin: 8px 0 0; color: var(--hint); font-size: 14px; }
.welcome { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--soft); }
.welcome-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.area { resize: vertical; min-height: 110px; font: inherit; }
.right { text-align: right; }
.settings .btn.danger.wide { margin-top: 4px; }
/* r31: ⚙️ 👮 🚨 🕰 🚫 edited in the app, 💬 what stays in the chat */
.staff-row, .post { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--soft); }
.staff-row .segmented { background: var(--card); }
.post-text { font-size: 14px; max-height: 4.4em; overflow: hidden; }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.list-row.inner { padding: 8px 0; background: none; box-shadow: none; }
.chat-only { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 380px) {
  .tab-label { font-size: 10px; }
  .tab-icon { font-size: 19px; }
}

/* ---------------------------------------------------------------- r33 🌟 tiers (services/rarity.py's colours) */
.tier { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; white-space: nowrap; align-self: flex-start; }
.tier-common { background: linear-gradient(135deg, #B8C0CC, #7D8794); }
.tier-uncommon { background: linear-gradient(135deg, #63D98A, #1F9D55); }
.tier-rare { background: linear-gradient(135deg, #5AB0FF, #1F5FD6); }
.tier-epic { background: linear-gradient(135deg, #C18BFF, #7434E0); }
.tier-legendary { background: linear-gradient(135deg, #FFE07A, #E59410); color: #4A2A00; }
.tier-mythic { background: linear-gradient(135deg, #FF5C7A, #FF7AD9); }
.framed { position: relative; overflow: hidden; border-radius: 12px; flex: none; }
.framed > img { display: block; }
.framed::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 3px solid transparent; pointer-events: none; }
.fr-uncommon::after { border-color: #1F9D55; } .fr-rare::after { border-color: #1F5FD6; } .fr-epic::after { border-color: #7434E0; }
.fr-legendary::after { border-color: #E59410; } .fr-mythic::after { border-color: #FF5C7A; }
.framed .sash { position: absolute; top: 16px; right: -38px; width: 140px; transform: rotate(45deg); text-align: center; font-size: 9px; font-weight: 800; letter-spacing: .04em; padding: 3px 0; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.framed .sash.tier-legendary { color: #4A2A00; }
.tile .framed { border-radius: 0; margin-bottom: 4px; }
.tile .framed .tile-img { margin-bottom: 0; }
.tile.locked { opacity: .7; }
.tile-stock { padding: 0 10px; font-size: 12px; font-weight: 700; color: var(--accent); }
.tile.locked .tile-stock { color: var(--hint); }
.asset-head .framed { width: 104px; height: 104px; }
.asset-head .framed .sash { top: 10px; right: -44px; font-size: 8px; }
.ring-row { display: flex; align-items: center; gap: 10px; }
.ring-row.off { opacity: .55; }
.ring-photo { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.couple-ring { position: absolute; top: 10px; right: 10px; width: 64px; height: 64px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); object-fit: cover; }
.couple-ring.ring-uncommon { border-color: #1F9D55; } .couple-ring.ring-rare { border-color: #1F5FD6; } .couple-ring.ring-epic { border-color: #7434E0; }
.couple-ring.ring-legendary { border-color: #E59410; } .couple-ring.ring-mythic { border-color: #FF5C7A; }
