:root {
  --bg: #000;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --text: #f5f5f7;
  --muted: #8e8e93;
  --gold: #e5a568;
  --gold-2: #ffd09a;
  --gold-deep: #bc7c41;
  --line: rgba(255, 255, 255, 0.08);
  --ok: #34c759;
  --warn: #ff9f0a;
  --tab-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; display: block; }

#app {
  height: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-t)) 18px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
}
#main:has(#page-ticket:not([hidden])),
#main:has(#page-tickets:not([hidden])),
#main:has(#page-invoices:not([hidden])),
#main:has(#page-knowledge:not([hidden])),
#main:has(#page-market:not([hidden])) {
  overflow: hidden;
}
#page-ticket:not([hidden]),
#page-tickets:not([hidden]),
#page-invoices:not([hidden]),
#page-knowledge:not([hidden]),
#page-market:not([hidden]) {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 8px;
}
.topbar[hidden] { display: none; }
.topbar h1 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  text-align: center;
}
.back-btn, .topbar-spacer, .search-btn { width: 36px; height: 36px; display: grid; place-items: center; color: var(--gold); }
.search-btn[hidden], .topbar-spacer[hidden] { display: none; }

.page[hidden] { display: none; }

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 0 28px;
}
.brand img { width: 148px; height: auto; }
.brand #home-place {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tile {
  position: relative;
  aspect-ratio: 1 / 1.02;
  border-radius: 28px;
  padding: 18px 16px;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  color: var(--text);
}
.tile span {
  display: block;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}
.tile-kb {
  background: #161618;
  box-shadow: inset 0 0 0 1px var(--line);
}
.tile-glow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 12%;
  height: 46%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 165, 104, 0.28), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.tile-create {
  background: linear-gradient(160deg, #f0c08a 0%, #e5a568 42%, #8a5a2b 100%);
  color: #1a1208;
}
.tile-create b {
  position: absolute;
  right: 18px;
  bottom: 10px;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
}

.market-row {
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  background: #1c1c1e;
  text-align: left;
}
.market-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.market-text { flex: 1; min-width: 0; }
.market-text strong { display: block; font-size: 16px; font-weight: 650; }
.market-text small { color: var(--muted); font-size: 13px; }
.market-arrow { color: #d8d8dc; flex: 0 0 auto; }

.tabbar {
  position: relative;
  z-index: 50;
  flex-shrink: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px calc(8px + var(--safe-b));
  background: #000;
}
.tabbar[hidden] { display: none; }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #636366;
  font-size: 10px;
  font-weight: 500;
}
.tab.active { color: #fff; }
.tab svg { display: block; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 12px;
  flex-shrink: 0;
}
.page-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}
.tickets-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 76px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tickets-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
.add-btn {
  position: absolute;
  right: 2px;
  bottom: 12px;
  z-index: 6;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 45%, var(--gold-deep));
  color: #1a1208;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}
.add-btn svg { display: block; }
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  width: 100%;
}
.card h3, .card h2 { margin: 0 0 6px; font-size: 16px; font-weight: 650; line-height: 1.25; }
.row h3, .row h2 { flex: 1; min-width: 0; }
.card p, .muted { color: var(--muted); margin: 0; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.badge {
  font-size: 12px;
  font-weight: 650;
  padding: 4px 8px;
  border-radius: 999px;
  background: #2c2c2e;
  color: #eee;
  white-space: nowrap;
}
.badge.open { background: rgba(255, 159, 10, 0.18); color: var(--warn); }
.badge.new { background: rgba(229, 165, 104, 0.18); color: var(--gold); }
.badge.work { background: rgba(229, 165, 104, 0.18); color: var(--gold); }
.badge.done, .badge.paid { background: rgba(52, 199, 89, 0.16); color: var(--ok); }
.badge.wait, .badge.unpaid { background: rgba(255, 159, 10, 0.18); color: var(--warn); }
.badge.overdue { background: rgba(255, 69, 58, 0.16); color: #ff453a; }
.invoice-kind {
  margin: 6px 2px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.invoice-card .price { margin: 8px 0 0; }
.invoice-main { width: 100%; text-align: left; color: inherit; }
.inv-dl {
  margin-top: 12px;
  width: 100%;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 650;
  background: rgba(229, 165, 104, 0.14);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(229, 165, 104, 0.28);
}
.inv-dl:disabled { opacity: 0.5; }
.invoice-meta { margin-top: 8px; font-size: 13px; }
.invoice-meta b { color: var(--text); font-weight: 600; }

.search {
  width: 100%;
  border: 0;
  outline: none;
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 13px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  border: 0;
  outline: none;
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
}
.field textarea { min-height: 120px; resize: vertical; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 700;
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 45%, var(--gold-deep));
  color: #1a1208;
}
.btn:disabled { opacity: 0.5; }
.btn-ghost {
  background: var(--card);
  color: var(--text);
}

.article { line-height: 1.5; font-size: 15px; color: #d7d7dc; }
.article h3 { color: #fff; margin: 18px 0 8px; }
.article p { margin: 0 0 10px; }
.price { font-size: 18px; font-weight: 700; color: var(--gold); }

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.profile-label {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-note, .profile-meta {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}
.person-row + .person-row {
  margin-top: 10px;
  padding-top: 10px;
  box-shadow: inset 0 1px 0 var(--line);
}
.person-name { color: var(--text); font-weight: 650; margin: 0 0 2px; }
.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
  background: linear-gradient(160deg, var(--gold-2), var(--gold-deep));
  color: #1a1208;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { display: none; }
.avatar.stub span, .avatar.stub { display: grid; place-items: center; }
#page-profile { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 10px;
}
.empty.soon {
  padding-top: 80px;
  font-size: 16px;
}
.soon-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 12px;
}
.soon-wrap .page-head {
  margin-bottom: 4px;
  align-self: stretch;
}
.soon-art {
  width: min(86%, 340px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 28px;
  margin: 28px 0 8px;
  box-shadow: 0 0 72px rgba(229, 165, 104, 0.2), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.soon-poster {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 18px;
  margin: 0;
  box-shadow: none;
}
.soon-wrap:has(.soon-poster) {
  justify-content: center;
  overflow: hidden;
}
.soon-wrap:not(:has(.page-head)) {
  justify-content: center;
}
.soon-wrap .empty.soon {
  padding: 14px 10px 0;
}
.ticket-head { flex-shrink: 0; }
.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 10px 0 8px;
  padding: 2px 2px 8px;
  border-radius: 18px;
  background-color: #0e0c0b;
  background-image:
    url("../assets/chat-pattern.svg?v=3"),
    linear-gradient(180deg, #12100e 0%, #0c0a09 52%, #080706 100%);
  background-repeat: repeat, no-repeat;
  background-position: 0 0, center;
  background-size: 128px 128px, auto;
}
.chat::-webkit-scrollbar { width: 0; height: 0; display: none; }
.msg {
  position: relative;
  display: flex;
  align-items: flex-end;
  align-self: stretch;
  max-width: 100%;
  margin-top: 2px;
  touch-action: pan-y;
}
.msg.lead { margin-top: 8px; }
.msg-body {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
  transition: transform 0.28s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.msg.me .msg-body { margin-left: auto; flex-direction: row-reverse; }
.msg.swiping .msg-body { transition: none; }
.msg-reply-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 50%;
  background: rgba(229, 165, 104, 0.2);
  color: var(--gold);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}
.msg.search-miss { opacity: 0.28; }
.msg.search-current .bubble { box-shadow: inset 0 0 0 1px var(--gold); }
.msg-ava {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-height: 32px;
  flex: 0 0 32px;
  align-self: flex-end;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  display: grid;
  place-items: center;
}
.msg-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.msg-ava span { display: none; }
.msg-ava.stub,
.msg-ava.stub span {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(160deg, var(--gold-2), var(--gold-deep));
  color: #1a1208;
}
.msg-ava.tp {
  background: #1c1814;
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 5px;
}
.msg-ava.tp img { object-fit: contain; }
.msg-ava.spacer {
  background: transparent;
  box-shadow: none;
}
.bubble {
  position: relative;
  width: fit-content;
  max-width: calc(100% - 40px);
  padding: 6px 8px 5px 10px;
  border-radius: 16px 16px 16px 4px;
  background: var(--card);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.32;
  word-break: break-word;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
  transform-origin: center bottom;
  transition: transform 0.16s ease, filter 0.16s ease;
}
.bubble.me {
  background: #2c261b;
  border-radius: 16px 16px 4px 16px;
  transform-origin: center bottom;
}
.bubble.holding {
  z-index: 3;
  transform: scale(1.02);
  filter: brightness(1.12);
}
.bubble.holding::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--gold);
  animation: hold-ring 0.48s ease forwards;
}
.bubble.copied {
  z-index: 3;
  animation: bubble-copied 0.55s ease;
}
@keyframes hold-ring {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes bubble-copied {
  0% { transform: scale(1.02); filter: brightness(1.18); box-shadow: inset 0 0 0 1px var(--gold); }
  100% { transform: scale(1); filter: brightness(1); box-shadow: inset 0 0 0 0 transparent; }
}
.bubble-name {
  font-size: 13px;
  line-height: 1.2;
  color: var(--gold);
  font-weight: 650;
  margin: 0 0 3px;
}
.bubble-text {
  white-space: pre-wrap;
}
.bubble-time {
  display: block;
  margin-top: 2px;
  text-align: right;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bubble.me .bubble-time { color: var(--muted); }
.bubble.media-only {
  padding: 3px;
  min-width: 120px;
}
.bubble.media-only .bubble-time {
  position: absolute;
  right: 8px;
  bottom: 6px;
  margin: 0;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}
.bubble .attach-list { margin: 2px 0 4px; }
.bubble .attach-img {
  width: min(100%, 228px);
  border-radius: 12px;
}

.composer {
  flex-shrink: 0;
  background: #000;
  padding: 4px 0 6px;
}
.composer[hidden],
.ticket-closed[hidden] {
  display: none !important;
}
.ticket-closed {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  background: #000;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
.ticket-closed-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.ticket-reopen {
  min-width: 168px;
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  font-weight: 650;
  color: #1a1208;
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 45%, var(--gold-deep));
}
.ticket-reopen:disabled {
  opacity: 0.6;
}
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.composer-icon, .composer-send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: var(--card);
}
.composer-send {
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 45%, var(--gold-deep));
  color: #1a1208;
}
.composer-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: var(--card);
  border-radius: 22px;
  padding: 11px 14px;
  color: var(--text);
}
.composer .file-chips { margin-bottom: 8px; }
.composer .chip { background: #2c2c2e; }

.file-input { display: none; }
.file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
}
.file-field small { font-size: 12px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--card);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
}
.attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.attach-img {
  display: block;
  width: min(100%, 220px);
  min-height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: #14110f;
  text-decoration: none;
}
.attach-img img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}
.attach-img .attach-file { display: none; }
.attach-img.broken img { display: none; }
.attach-img.broken .attach-file { display: inline-flex; margin: 8px; }
.attach-file {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  background: #1c1c1e;
  color: var(--gold);
  font-size: 13px;
  text-decoration: none;
  word-break: break-all;
}

.bubble-text mark, .quote-text mark {
  background: rgba(229, 165, 104, 0.45);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.quote-card {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.quote-card.static {
  cursor: default;
  pointer-events: none;
}
.quote-author {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--gold);
}
.quote-main {
  display: flex;
  align-items: stretch;
  gap: 7px;
  margin-top: 2px;
  min-width: 0;
  border-left: 2px solid var(--gold);
  padding-left: 7px;
}
.quote-line { display: none; }
.quote-text {
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 8px 8px 10px;
  border-radius: 14px;
  background: var(--card);
}
.reply-bar[hidden] { display: none; }
.reply-bar-line { display: none; }
.reply-bar-body { flex: 1; min-width: 0; }
.reply-bar-body strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--gold);
}
.reply-bar .quote-main {
  display: flex;
  align-items: stretch;
  margin-top: 2px;
  border-left: 2px solid var(--gold);
  padding-left: 7px;
}
.reply-bar #reply-preview {
  display: block;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-bar-close {
  width: 28px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.chat-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin: 0 0 8px;
}
.chat-search[hidden] { display: none; }
.chat-search-field {
  flex: 1;
  min-width: 0;
  position: relative;
}
.chat-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: var(--card);
  border-radius: 12px;
  padding: 8px 32px 8px 12px;
}
.chat-search input[type="search"]::-webkit-search-decoration,
.chat-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.chat-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: var(--gold);
  display: grid;
  place-items: center;
}
.chat-search-clear[hidden] { display: none; }
.chat-search-count {
  font-size: 12px;
  color: var(--muted);
  min-width: 36px;
  text-align: center;
}
.chat-search-nav {
  width: 32px;
  height: 32px;
  color: var(--gold);
  display: grid;
  place-items: center;
}
.chat-link { color: var(--gold); text-decoration: none; }
.day-sep {
  align-self: center;
  margin: 10px 0 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(28, 24, 20, 0.88);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.send-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}
.send-status[hidden] { display: none; }
.spin {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(229, 165, 104, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.composer.sending { opacity: 0.72; pointer-events: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  transform: translateX(-50%);
  background: #2c2c2e;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 70;
  max-width: 86%;
}
.toast[hidden] { display: none; }

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 28px calc(48px + var(--safe-b));
  background: #000;
  overflow: hidden;
}
.splash.out {
  animation: splash-out 0.55s ease forwards;
  pointer-events: none;
}
.splash[hidden] { display: none; }
.splash-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 165, 104, 0.32), transparent 68%);
  animation: splash-pulse 2.4s ease-in-out infinite;
}
.splash-logo {
  position: relative;
  width: min(240px, 68vw);
  overflow: hidden;
  animation: splash-logo-in 1.15s cubic-bezier(.16, .84, .32, 1) both;
}
.splash-logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(229, 165, 104, 0.28));
}
.splash-shine {
  position: absolute;
  inset: -10%;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 208, 154, 0.5) 50%, transparent 64%);
  background-size: 240% 100%;
  animation: splash-shine 1.45s 0.4s ease both;
  pointer-events: none;
}
.splash-hello {
  margin: 28px 0 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-align: center;
  animation: splash-text-in 0.7s 0.55s ease both;
}
.splash-sub {
  margin: 8px 0 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  animation: splash-text-in 0.7s 0.78s ease both;
}
@keyframes splash-logo-in {
  0% { opacity: 0; transform: scale(0.78) translateY(18px); }
  62% { opacity: 1; transform: scale(1.05) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes splash-text-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes splash-shine {
  0% { transform: translateX(-80%); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateX(80%); opacity: 0; }
}
@keyframes splash-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes splash-out {
  to { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .splash-logo, .splash-hello, .splash-sub, .splash-glow, .splash-shine { animation: none; opacity: 1; transform: none; }
}

@media (hover: hover) {
  .tile:hover, .market-row:hover, .card:hover { filter: brightness(1.06); }
}
