@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-canvas: #0a0a0f;
  --bg-panel: #101018;
  --bg-card: #12121a;
  --bg-raised: #181824;
  --bg-sunken: #0d0d14;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text-main: #e4e4ea;
  --text-dim: #9a9aa8;
  --text-faint: #6a6a78;
  --text-bright: #f3f3f6;

  --accent: #8b85c7;
  --accent-strong: #7a74b8;
  --accent-soft: rgba(139, 133, 199, 0.12);
  --accent-soft-strong: rgba(139, 133, 199, 0.2);
  --accent-border: rgba(139, 133, 199, 0.32);
  --on-accent: #f3f3f6;
  --glow: none;

  --success: #7d9b8e;
  --success-soft: rgba(125, 155, 142, 0.14);
  --danger: #c47a7a;
  --danger-soft: rgba(196, 122, 122, 0.14);
  --warn: #c4a35a;
  --warn-soft: rgba(196, 163, 90, 0.14);

  --radius-box: 10px;
  --radius-inner: 8px;
  --radius-chip: 6px;

  --font-display: 'Inter', system-ui, sans-serif;
  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --tab-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg-canvas);
  font-family: var(--font-sans);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
}
.orb-a {
  width: 280px; height: 280px;
  left: -80px; top: -60px;
  background: #3d3a5c;
}
.orb-b {
  width: 240px; height: 240px;
  right: -70px; top: 18%;
  background: #2a2840;
  opacity: 0.12;
}
.orb-c {
  width: 320px; height: 320px;
  left: 20%; bottom: -120px;
  background: #252436;
  opacity: 0.12;
}

button, input, textarea {
  font: inherit;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}
button { cursor: pointer; touch-action: manipulation; }
svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.sprite { display: none; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 14px calc(var(--tab-height) + 28px + var(--safe-bottom));
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  padding: 12px 12px 10px;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 15, 0.96);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.brand > div {
  min-width: 0;
  overflow: hidden;
}
.brand-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.brand-icon svg { stroke-width: 1.8; width: 16px; height: 16px; }
.brand h1 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-bright);
  white-space: nowrap;
}
.brand span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.top-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.top-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(30, 16, 52, 0.7);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}
.top-btn-icon {
  width: 34px;
  padding: 0;
  justify-content: center;
}
.top-btn:hover { color: var(--text-main); border-color: var(--accent-border); background: var(--accent-soft); }
.top-btn svg { width: 14px; height: 14px; }

.tab-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + var(--safe-bottom));
  width: auto;
  max-width: 456px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 4px;
  background: rgba(14, 14, 20, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.tab-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  height: 52px;
  width: 0;
  border-radius: 8px;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: transform 0.22s ease, width 0.22s ease, opacity 0.2s ease;
}
.tab-bar.is-ready .tab-indicator { opacity: 1; }
@media (min-width: 520px) {
  .tab-bar {
    left: 50%;
    right: auto;
    width: 456px;
    transform: translateX(-50%);
  }
}
.tab-item {
  height: 52px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-faint);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
  padding: 2px 4px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.tab-item svg {
  width: 17px;
  height: 17px;
}
.tab-item.active {
  color: var(--text-bright);
  background: transparent;
  box-shadow: none;
}
.tab-bar:not(.is-ready) .tab-item.active {
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.tab-item.active svg { transform: none; }
.tab-item:active { transform: none; opacity: 0.85; }
.tab-item:not(.active):hover { color: var(--text-dim); }
.tab-item span {
  line-height: 1.15;
  font-size: 0.58rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel { display: none; }
.panel.active {
  display: block;
  animation: panel-fade 0.4s cubic-bezier(.22, 1, .36, 1);
}
.panel.active.slide-left { animation-name: panel-in-left; }
.panel.active.slide-right { animation-name: panel-in-right; }
@keyframes panel-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes panel-in-left {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes panel-in-right {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-box);
  padding: 16px 14px;
  margin-bottom: 10px;
}
.hero-card {
  background: var(--bg-card);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card-header .icon-wrap {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.card-header .icon-wrap svg { width: 16px; height: 16px; }
.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.2px;
  color: var(--text-bright);
}
.card-header p {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-bright);
}

.input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.input-group-vertical { flex-direction: column; }
.input-group input {
  flex: 1;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-inner);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  min-width: 0;
  width: 100%;
}
.input-group input::placeholder { color: var(--text-faint); }
.input-group input:focus {
  border-color: var(--accent-border);
  box-shadow: none;
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-inner);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
  touch-action: manipulation;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:active { opacity: 0.88; }
.btn-secondary {
  border-color: var(--border-strong);
  background: var(--bg-raised);
  color: var(--text-main);
}
.btn-secondary:active { background: #1e1e2c; }
.btn-full { width: 100%; justify-content: center; margin-top: 8px; }
.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.72rem;
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-dim);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px !important;
  gap: 8px;
}
.shop-privacy {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
}
.shop-privacy .btn {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  font-size: 0.78rem;
  padding: 0 10px;
}

.segmented {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  background: var(--bg-sunken);
  padding: 3px;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border);
}
.segment {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-chip);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  flex: 1;
  text-align: center;
  line-height: 2;
}
.segment.active {
  color: var(--text-bright);
  background: var(--accent);
}
.cmt-field {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border-radius: var(--radius-inner);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.85rem;
  resize: vertical;
}
.cmt-mode { margin: 10px 0 0; }

.shop-grid {
  display: grid;
  gap: 8px;
}
.shop-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-raised);
  border-radius: var(--radius-inner);
  border: 1px solid var(--border);
  gap: 8px;
}
.shop-item .label { font-weight: 700; font-size: 0.88rem; color: var(--text-main); }
.shop-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.shop-actions button {
  flex: 1;
  min-width: 65px;
}

.pay-stars, .pay-crypto {
  flex: 1;
  min-height: 40px;
  padding: 0 8px;
  border-radius: var(--radius-chip);
  font-weight: 650;
  font-size: 0.8rem;
  border: 1px solid var(--border-strong);
}
.pay-stars { background: var(--bg-raised); border-color: rgba(196, 163, 90, 0.28); color: var(--warn); }
.pay-stars:active { opacity: 0.88; }
.pay-crypto { background: var(--bg-raised); border-color: var(--accent-border); color: var(--accent); }
.pay-crypto:active { opacity: 0.88; }

.tab-bar:has(#tab-admin:not(.hidden)) { grid-template-columns: repeat(5, 1fr); }

.profile-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.profile-hero-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.profile-hero-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-hero-info h3 {
  font-size: 0.98rem;
  font-weight: 650;
  word-break: break-word;
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-nick {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.privacy-status {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: var(--success-soft);
  color: var(--success);
  display: grid;
  place-items: center;
  padding: 0;
}
.privacy-status.is-private {
  background: var(--warn-soft);
  color: var(--warn);
}
.privacy-status svg { width: 13px; height: 13px; }
.profile-hero-info .profile-name {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  line-height: 1.2;
}
.profile-hero-info .profile-id {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  line-height: 1.2;
}
.profile-link-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.profile-link-btn:active { background: var(--bg-sunken); color: var(--accent); }
.profile-link-btn svg { width: 18px; height: 18px; }

.action-strip-rows { display: grid; gap: 10px; margin-top: 12px; }
.action-strip-row {
  display: grid;
  gap: 6px;
}
.action-strip-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.action-strip-row.cols-1 { grid-template-columns: 1fr; }
.action-react {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  overflow: hidden;
}
.action-square {
  width: auto;
  min-height: 55px;
  height: 55px;
  padding: 8px 6px 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.action-square + .action-square::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--border);
}
.action-square svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  overflow: visible;
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
  display: block;
}
.action-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: inherit;
}
.action-square[data-action="like"] { color: var(--success); }
.action-square[data-action="comments"] { color: var(--accent); }
.action-square[data-action="dislike"] { color: var(--danger); }
.action-square:hover svg { transform: none; }
.action-square:active svg { transform: none; }
.action-square[data-action="like"]:hover { background: var(--success-soft); }
.action-square[data-action="comments"]:hover { background: var(--accent-soft); }
.action-square[data-action="dislike"]:hover { background: var(--danger-soft); }
.action-strip-rows .active-like {
  color: var(--success);
  background: var(--success-soft);
}
.action-strip-rows .active-dislike {
  color: var(--danger);
  background: var(--danger-soft);
}
.action-who {
  min-height: 44px;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  transition: background 0.15s, color 0.15s;
}
.action-who svg {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}
.action-who:hover {
  background: #1e1e2c;
  color: var(--text-bright);
}
.action-who:hover svg { transform: none; color: var(--accent); }
.action-who:active { transform: none; opacity: 0.9; }

.block-type-btn {
  flex: 1;
  min-height: 40px;
  min-width: 80px;
  padding: 0 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-dim);
  font-weight: 700;
}
.block-type-btn.active { border-color: var(--accent); color: var(--accent); }

.help-text {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 0.86rem;
  color: var(--text-dim);
}

.purchase-list { display: grid; gap: 0; margin-top: 8px; }
.purchase-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}
.purchase-item:last-child { border-bottom: none; }
.purchase-item .purchase-desc { color: var(--text-main); flex: 1; }
.purchase-item .purchase-meta { text-align: right; color: var(--text-dim); font-family: var(--font-mono); font-size: 0.64rem; white-space: nowrap; }

.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar .fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-dim); }

.metric-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 14px;
}
.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 14px;
}
.metric-stack .metric-strip { margin: 0; }
.metric-multi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  overflow: hidden;
  min-height: 72px;
}
.metric-cell {
  padding: 10px 4px 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  min-width: 0;
}
.metric-cell + .metric-cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--border);
}
.metric-ico {
  width: 16px;
  height: 16px;
  color: var(--accent);
  display: grid;
  place-items: center;
}
.metric-ico svg {
  width: 18px;
  height: 18px;
}
.metric-cell b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  line-height: 1.15;
}
.metric-cell span {
  font-size: 0.5rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.28px;
  line-height: 1.2;
  max-width: 100%;
}
.metric {
  padding: 11px 8px 10px;
  text-align: center;
  background: var(--bg-raised);
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-strong);
  line-height: 1.15;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.metric b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}
.metric span {
  font-size: 0.56rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.32px;
  line-height: 1.25;
  max-width: 100%;
}

.metric-strip.cols-2 { grid-template-columns: repeat(2, 1fr); }

.metric-geo { padding-top: 10px; padding-bottom: 9px; min-height: 92px; }
.metric-flag {
  width: 40px;
  height: 27px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(8, 2, 22, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
  flex-shrink: 0;
}
.metric-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.metric-geo b {
  font-size: 0.78rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}
.metric-date b {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.metric-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.metric b.metric-unknown {
  color: var(--text-faint);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.15;
}
.metric-date b.metric-unknown {
  font-size: 0.74rem;
}
.metric-locked {
  opacity: 0.7;
  background: var(--bg-sunken);
}

.info-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-dim); flex-shrink: 0; }
.info-row .value { font-weight: 600; text-align: right; word-break: break-word; color: var(--text-main); }
.info-row.locked .locked-value {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.action-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.action-strip button {
  min-height: 34px;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-dim);
  font-size: 0.64rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
}
.action-strip button:active { background: var(--border); }
.action-strip .active-like { border-color: rgba(94, 234, 212, 0.3); color: var(--success); background: var(--success-soft); }
.action-strip .active-dislike { border-color: rgba(244, 114, 182, 0.3); color: var(--danger); background: var(--danger-soft); }

.quota-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--tab-height) + 24px + var(--safe-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 999;
  padding: 10px 14px;
  border-radius: 8px;
  background: #16161f;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.8rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(92%, 360px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.22s ease;
}
.modal-sheet {
  width: min(480px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: #12121a;
  border: 1px solid var(--border-strong);
  border-radius: 12px 12px 0 0;
  padding: 14px 16px 22px;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.34s cubic-bezier(.22, 1, .36, 1);
}
.modal-overlay.is-leaving { animation: fadeOut 0.2s ease forwards; }
.modal-overlay.is-leaving .modal-sheet { animation: slideDown 0.22s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(36px); } to { transform: translateY(0); } }
@keyframes slideDown { to { transform: translateY(28px); } }
.sheet-handle { width: 36px; height: 4px; margin: 0 auto 14px; border-radius: 99px; background: var(--border-strong); }
.sheet-title { font-family: var(--font-display); font-size: 0.98rem; font-weight: 650; text-align: center; margin-bottom: 18px; color: var(--text-bright); }
.sheet-body { margin-bottom: 22px; }
.modal-overlay.no-actions .sheet-body { margin-bottom: 8px; }
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sheet-actions.hidden { display: none !important; }
.sheet-actions .btn {
  flex: 1;
  min-width: 80px;
}

.subscribe-banner {
  background: var(--warn-soft);
  border: 1px solid rgba(196, 163, 90, 0.24);
  border-radius: var(--radius-inner);
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--text-main);
}
.subscribe-banner a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--bg-raised);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.7rem;
  margin: 6px 4px 0 0;
  border: 1px solid var(--accent-border);
}

.promo-banner {
  display: block;
  width: 100%;
  max-width: 360px;
  height: 55px;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--bg-raised);
  text-decoration: none;
}
.promo-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.promo-banner:active { filter: brightness(0.9); }

.loading-stage {
  padding: 32px 12px 28px;
  text-align: center;
}
.loading-orbit {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  position: relative;
  display: grid;
  place-items: center;
}
.loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-sizing: border-box;
  background: none;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: loading-spin 0.7s linear infinite;
}
.loading-pulse { display: none; }
.loading-core {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  z-index: 1;
}
.loading-core svg { width: 14px; height: 14px; animation: none; }
.loading-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-bright);
  font-size: 0.88rem;
  letter-spacing: 0;
}
.loading-sub {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
@keyframes loading-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@keyframes loading-icon {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.comment-item { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.comment-item:last-child { border-bottom: none; }
.comment-meta { font-size: 0.66rem; color: var(--text-dim); margin-top: 3px; font-family: var(--font-mono); }

.comments-sheet { display: grid; gap: 12px; }
.comments-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
}
.comments-nick {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comments-total {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}
.comments-list { display: grid; gap: 8px; }
.comment-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
}
.comment-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  display: grid;
  place-items: center;
}
.comment-main { min-width: 0; flex: 1; }
.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-author {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-bright);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comment-date {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.comment-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}
.comments-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-inner);
}
.comments-empty svg {
  width: 22px;
  height: 22px;
  margin: 0 auto 8px;
  color: var(--text-faint);
  fill: currentColor;
  stroke: none;
}
.comments-empty p { margin: 0; font-size: 0.82rem; }
.comments-add {
  min-height: 42px;
  width: 100%;
  border-radius: var(--radius-inner);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.comments-add svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}
.comments-add:active { opacity: 0.85; }

.hint { font-size: 0.72rem; color: var(--text-faint); margin-top: 10px; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .orb, .brand-icon, .subscribe-banner, .promo-banner,
  .appear .profile-hero, .appear .metric-stack > *,
  .appear .info-grid, .appear .action-strip-rows, .appear .card, .shop-item,
  .panel.active #profile-content > .card, .panel.active #purchase-history-content > .card,
  body.ready .topbar, body.ready #app, body.ready .tab-bar, .appear .profile-avatar img {
    animation: none !important;
  }
  .tab-indicator, .toast, .btn, .tab-item, .tab-item svg { transition: none !important; }
}
.btn:focus-visible, .top-btn:focus-visible, .tab-item:focus-visible,
.segment:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.results { margin-top: 16px; }
.comments-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.comments-pagination > :last-child { justify-self: end; }
.comments-pagination .badge { justify-self: center; }
.comment-page-arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}
.comment-page-arrow svg { width: 16px; height: 16px; }
.comment-page-arrow.prev svg { transform: rotate(180deg); }

body.booting .ambient,
body.booting .topbar,
body.booting #app,
body.booting .tab-bar {
  opacity: 0;
}
body.ready .topbar { animation: fadeIn 0.4s ease; }
body.ready #app { animation: fadeIn 0.45s ease; }
body.ready .tab-bar { animation: fadeIn 0.45s 0.08s ease both; }

.appear .profile-hero { animation: rise 0.42s cubic-bezier(.22, 1, .36, 1) both; }
.appear .metric-stack > *:nth-child(1) { animation: rise 0.42s 0.05s cubic-bezier(.22, 1, .36, 1) both; }
.appear .metric-stack > *:nth-child(2) { animation: rise 0.42s 0.1s cubic-bezier(.22, 1, .36, 1) both; }
.appear .metric-stack > *:nth-child(3) { animation: rise 0.42s 0.15s cubic-bezier(.22, 1, .36, 1) both; }
.appear .metric-strip { animation: rise 0.42s 0.08s cubic-bezier(.22, 1, .36, 1) both; }
.appear .info-grid { animation: rise 0.42s 0.18s cubic-bezier(.22, 1, .36, 1) both; }
.appear .action-strip-rows { animation: rise 0.42s 0.22s cubic-bezier(.22, 1, .36, 1) both; }
.appear .card { animation: rise 0.4s cubic-bezier(.22, 1, .36, 1) both; }
.appear .action-row { animation: rise 0.42s 0.16s cubic-bezier(.22, 1, .36, 1) both; }

.panel.active #profile-content > .card,
.panel.active #purchase-history-content > .card {
  animation: rise 0.42s cubic-bezier(.22, 1, .36, 1);
}
.shop-item {
  animation: rise 0.4s cubic-bezier(.22, 1, .36, 1) both;
}
.shop-item:nth-child(1) { animation-delay: 0.04s; }
.shop-item:nth-child(2) { animation-delay: 0.1s; }
.shop-item:nth-child(3) { animation-delay: 0.16s; }

.top-btn:active { transform: scale(0.94); }
.appear .profile-avatar img { animation: avatar-in 0.45s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes avatar-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
