:root {
  --bg: #0a0a0c;
  --panel: #121216;
  --card: #1a1a20;
  --border: #2a2a34;
  --text: #f2f2f5;
  --muted: #8b8b9a;
  --accent: #ff5a36;
  --accent2: #00d4aa;
  --danger: #ff5c5c;
  --ok: #3dd68c;
  --warn: #ffc14d;
  --radius: 14px;
  --nav-h: 64px;
  --top-h: 52px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

#gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.gate-card {
  width: min(320px, 100%);
  text-align: center;
}
.gate-card h1 {
  margin: 0 0 1.4rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.gate-card input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c0c10;
  color: var(--text);
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 0.25em;
}
.gate-card button {
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.75rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.gate-err { color: var(--danger); font-size: 0.85rem; margin-top: 0.6rem; min-height: 1.2em; }

#app { min-height: 100dvh; }
.view { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  min-height: var(--top-h);
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}
.brand { font-weight: 700; letter-spacing: 0.02em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.vps-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.vs-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  color: var(--text);
}
.vs-k {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.vs-v {
  font-size: 0.74rem;
  font-weight: 650;
  font-style: normal;
}
.vs-item.warn .vs-v { color: var(--warn); }
.vs-item.crit .vs-v { color: var(--danger); }
@media (max-width: 980px) {
  .vs-k { display: none; }
  .vps-stats { gap: 10px; }
}
@media (max-width: 640px) {
  .vps-stats { gap: 8px; }
  .vs-v { font-size: 0.68rem; }
  .topbar .brand { font-size: 0.88rem; }
}
.brand .mark, .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ff8f5c);
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; color: #fff;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }
.topbar-actions a, .linkish {
  background: none; border: 0; color: var(--muted); font-size: 0.85rem; cursor: pointer;
}
.pill {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn {
  width: 36px; height: 36px;
  border: 0; border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
}
.pad { padding: 16px; }
.hint { color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.sub { color: var(--muted); font-size: 0.86rem; line-height: 1.45; margin: 0 0 1rem; }
.sub code { font-size: 0.78rem; }

.hub-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100dvh - var(--top-h));
  align-items: stretch;
}
@media (max-width: 860px) {
  .hub-layout { grid-template-columns: 1fr; }
  .hub-monitor {
    border-right: 0 !important;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
  .monitor-stack {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}
@media (max-width: 520px) {
  .monitor-stack { grid-template-columns: repeat(2, 1fr) !important; }
}

.hub-monitor {
  background: linear-gradient(180deg, #101016 0%, #0c0c10 100%);
  border-right: 1px solid var(--border);
  padding: 16px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: var(--top-h);
  align-self: start;
  max-height: calc(100dvh - var(--top-h));
  overflow-y: auto;
}
.monitor-head h2 { margin: 0; font-size: 0.95rem; }
.monitor-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.75rem; }
.monitor-stack { display: flex; flex-direction: column; gap: 8px; }
.monitor-models {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.model-card { cursor: pointer; }
.model-card.active {
  border-color: var(--accent2);
  box-shadow: 0 0 0 1px var(--accent2);
}
.model-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.model-chip {
  border: 1px solid var(--border);
  background: #14141a;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}
.model-chip.active {
  background: var(--accent2);
  color: #06281f;
  border-color: var(--accent2);
  font-weight: 600;
}
.create-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.create-head h2 { margin: 0 !important; }
.create-head .sub { margin: 6px 0 0; }
select#create-model,
.create-model-quiet {
  flex: 0 0 auto;
  width: auto;
  max-width: 200px;
  margin: 2px 0 0;
  padding: 4px 22px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%238b8b9a' d='M0 0l5 6 5-6z'/></svg>") no-repeat right 2px center;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: right;
}
.create-model-quiet:hover,
.create-model-quiet:focus {
  color: var(--text);
  outline: none;
}
.mon-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 56px;
}
.mon-k {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.mon-v { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.mon-v.ok { color: var(--ok); }
.mon-v.danger { color: var(--danger); }
.mon-v.accent { color: var(--accent); }
.ops-360 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0e0e14;
}
.ops-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}
.ops-row b {
  color: var(--text);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.monitor-actions { margin-top: auto; padding-top: 8px; }

.hub-pool { padding: 16px 18px 40px; min-width: 0; }
.pool-title { margin: 0; font-size: 1.05rem; }
.pool-hint { margin: 4px 0 0; font-size: 0.75rem; color: var(--muted); line-height: 1.35; }
.hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.hub-toolbar-left .hint { margin: 4px 0 0; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sm-check { font-size: 0.82rem; color: var(--muted); gap: 6px; display: flex; align-items: center; cursor: pointer; }
.danger-btn { color: #ffb4b4 !important; border-color: rgba(255,92,92,0.45) !important; }
.btn-ghost.sm {
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.btn-ghost.sm.block { width: 100%; text-align: center; }
.btn-ghost.sm:hover { border-color: var(--accent); }
.btn-ghost.sm:disabled { opacity: 0.45; cursor: not-allowed; }

.account-grid { display: grid; gap: 10px; margin-top: 8px; }
.account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.account-card:hover { border-color: var(--accent); }
.account-card:active { transform: scale(0.99); }
.account-card.selected { border-color: var(--accent2); box-shadow: 0 0 0 1px rgba(0,212,170,0.25); }
.account-card.is-live {
  border-color: rgba(0, 212, 170, 0.45);
  background: linear-gradient(145deg, rgba(0, 212, 170, 0.07), var(--card));
}
.account-card.is-offline { border-color: rgba(255, 193, 77, 0.28); }
.account-card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.account-card .em {
  font-weight: 600;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-card .card-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.account-card .sel { width: 16px; height: 16px; accent-color: var(--accent2); cursor: pointer; }
.account-card .btn-del {
  border: 0; background: transparent; color: var(--muted);
  font-size: 0.95rem; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.account-card .btn-del:hover { color: var(--danger); background: rgba(255,92,92,0.12); }
.account-card .meta { color: var(--muted); font-size: 0.75rem; margin-top: 4px; word-break: break-all; }
.account-card .loc-line { margin-top: 8px; font-size: 0.82rem; color: var(--accent2); }
.account-card .profile-marks {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px;
}
.pmark {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}
.pmark.done { color: #04120c; background: var(--accent2); }
.pmark.miss { color: #1a1a12; background: #ffc14d; }
.pmark.owl { color: #e8f0ff; background: #1a1a2e; border: 1px solid rgba(120,160,255,.55); }
.pmark.muted { color: var(--muted); background: #0c0c12; border: 1px solid var(--border); }
.pmark.jail { color: #fff; background: var(--danger); }
.pmark.okg { color: #04120c; background: var(--ok); }
.pmark.warn { color: #1a1a12; background: var(--warn); }
.account-card.is-jail { border-color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; line-height: 1.45; }

.settings-shell { display: flex; flex: 1; min-height: 0; }
.settings-shell-simple { display: block; }
.settings-shell-simple .settings-pad { padding: 16px; }
.settings-nav {
  width: 160px;
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.set-tab {
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.set-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.set-tab.active { background: var(--card); color: var(--text); border-color: var(--border); }
.settings-pad { flex: 1; overflow: auto; }
.settings-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px 22px;
  max-width: 720px;
}
.settings-card .field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}
.settings-card .row-en {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.inline-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.ar-fixed-info {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #0c0c12;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
}
.ar-fixed-info .k {
  color: var(--muted);
  display: inline-block;
  min-width: 72px;
}
.ar-fixed-info .v {
  color: var(--accent2);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}
.settings-card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.settings-card h3 { margin: 1.2rem 0 .4rem; font-size: 0.92rem; }
.field { display: block; font-size: 0.78rem; color: var(--muted); margin: .7rem 0 .3rem; }
.field input, .field select, .field textarea,
.settings-card input[type="text"],
.settings-card input[type="email"],
.settings-card input[type="password"],
.settings-card input[type="number"],
.settings-card input[type="date"],
.settings-card select,
.settings-card textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: .7rem .8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c0c10;
}
textarea { min-height: 80px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
@media (max-width: 560px) {
  .row2 { grid-template-columns: 1fr; }
  .settings-shell { flex-direction: column; }
  .settings-nav { width: auto; flex-direction: row; overflow: auto; border-right: 0; border-bottom: 1px solid var(--border); }
}
.check { display: flex; align-items: center; gap: .5rem; margin: .55rem 0; font-size: .88rem; cursor: pointer; }
.check input { width: auto; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }
.create-result {
  text-align: center;
  padding: 6px 2px 2px;
}
.create-result-icon {
  width: 64px;
  height: 64px;
  margin: 6px auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
.create-result.is-ok .create-result-icon {
  background: rgba(61, 214, 140, 0.14);
  color: var(--ok);
  border: 1px solid rgba(61, 214, 140, 0.38);
}
.create-result.is-err .create-result-icon {
  background: rgba(255, 92, 92, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 92, 92, 0.38);
}
.create-result h2 { margin: 0 0 8px; font-size: 1.2rem; }
.create-result .sub {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.create-result .kv { text-align: left; margin-top: 1.15rem; }
.create-result .settings-actions { justify-content: center; }

.halt-banner {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 92, 92, 0.45);
  background: rgba(255, 92, 92, 0.1);
  border-radius: 12px;
  color: #ffd4d4;
}
.halt-banner strong {
  display: block;
  color: var(--danger);
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}
.halt-banner p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}
.halt-banner .btn-ghost {
  margin-top: 0.7rem;
}

.create-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}
@media (max-width: 640px) {
  .create-modes { grid-template-columns: 1fr; }
}
.queue-card {
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.queue-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}
.queue-card .sub {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.queue-card .settings-actions { margin-top: auto; }
.queue-progress {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 650;
}
.queue-card .hint {
  min-height: 1.1em;
  margin: 0 0 0.55rem;
}
.cq-count-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.queue-play-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.queue-play-row input[type="number"] {
  width: 5.2rem;
  flex: 0 0 auto;
  margin-top: 0;
  text-align: center;
  font-weight: 650;
  font-size: 1.05rem;
}
.queue-play-row .btn-primary {
  flex: 1;
}

.create-name-live {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.captcha-box {
  margin-top: 1rem; padding: 1rem;
  border: 1px solid var(--warn); border-radius: 12px; background: #0a0e14;
}
.captcha-shot-wrap {
  margin: .75rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  max-width: 400px;
  min-height: 240px;
}
#c-shot {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  user-select: none;
  background: #fff;
}
#c-shot-ph, .c-shot-ph {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.85rem;
  background: #f3f3f3;
}
#c-shot-ph.hidden { display: none; }
.captcha-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0.75rem 0;
  max-width: 400px;
}
.captcha-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111;
  overflow: hidden;
}
.captcha-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem 0.25rem;
  font-size: 0.78rem;
}
.captcha-card header strong { color: #e8eef6; }
.captcha-card header span { color: var(--muted); }
.captcha-card .shot-crop {
  background: #fff;
}
.captcha-card img {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  user-select: none;
  background: #fff;
}
.captcha-card .c-shot-ph {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.8rem;
  background: #f3f3f3;
}
.captcha-card img.c-shot-batch {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
}
.captcha-card .hint {
  padding: 0.35rem 0.55rem 0.5rem;
  margin: 0;
}
.captcha-card.is-ok { border-color: rgba(80, 200, 120, 0.55); }
.captcha-card.is-err { border-color: rgba(255, 92, 92, 0.5); }
.captcha-card.is-wait { border-color: var(--warn); }
.hint { color: var(--muted); font-size: .8rem; word-break: break-all; }
.adv { margin-top: .6rem; }
.adv summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.kv { display: grid; gap: .35rem; margin: .5rem 0 1rem; }
.kv div {
  display: flex; justify-content: space-between; gap: .75rem;
  font-size: .84rem; border-bottom: 1px dashed #1a2433; padding: .25rem 0;
}
.kv span:first-child { color: var(--muted); }
.kv code { font-size: .78rem; word-break: break-all; text-align: right; }
pre.out {
  margin: .75rem 0 0; padding: .85rem; border-radius: 10px;
  background: #080c12; border: 1px solid var(--border);
  font-size: .74rem; line-height: 1.4;
  max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  color: #b7c5d8;
}

.btn-primary {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-ghost {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-primary:disabled, .btn-ghost:disabled { opacity: 0.5; }

#view-main { padding-bottom: var(--nav-h); }
.main-body { flex: 1; min-height: 0; }
.tab-pane { min-height: calc(100dvh - var(--top-h) - var(--nav-h)); }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(12, 12, 16, 0.96);
  border-top: 1px solid var(--border);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  border: 0;
  background: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  cursor: pointer;
}
.nav-item.active { color: var(--accent); }
.nav-ico { font-size: 1.15rem; }

.toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  position: sticky;
  top: var(--top-h);
  background: rgba(10, 10, 12, 0.9);
  z-index: 10;
  overflow-x: auto;
}
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-select {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
}
.grid-status { margin: 0; padding: 0 12px 8px; color: var(--muted); font-size: 0.78rem; }

.cascade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 0 2px 16px;
}
@media (min-width: 720px) {
  .cascade-grid { grid-template-columns: repeat(4, 1fr); max-width: 900px; margin: 0 auto; }
}
.cascade-cell {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.cascade-cell.stack-h {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 8px 4px;
  text-align: left;
  cursor: default;
}
.cascade-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block; background: #1a1a22;
}
.cascade-cell .ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--muted); font-size: 1.6rem;
  background: linear-gradient(160deg, #1e1e28, #121218);
}
.cascade-cell .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 6px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 0.72rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #fff; text-align: left;
}
.cascade-cell .online {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}
.load-more { display: flex; justify-content: center; padding: 8px 12px 20px; }

.inbox-list { display: flex; flex-direction: column; }
.inbox-item {
  display: flex; gap: .7rem; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; background: none; width: 100%; text-align: left;
}
.inbox-item:hover { background: #14141a; }
.inbox-item img, .av {
  width: 48px; height: 48px; border-radius: 12px; object-fit: cover;
  background: #1a1a22; display: grid; place-items: center; font-weight: 800; flex: 0 0 auto;
}
.inbox-item .nm { font-weight: 700; font-size: .95rem; }
.inbox-item .preview { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-thread {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  z-index: 5;
}
#tab-chat { position: relative; }
.chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.chat-head-info { flex: 1; min-width: 0; }
.chat-name { font-weight: 700; }
.chat-sub { color: var(--muted); font-size: .75rem; }
.chat-messages {
  flex: 1; overflow: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.bubble {
  max-width: 78%; padding: .55rem .75rem; border-radius: 12px;
  font-size: .9rem; line-height: 1.4;
}
.bubble.out { margin-left: auto; background: rgba(255,90,54,.18); border: 1px solid rgba(255,90,54,.3); }
.bubble.in { background: var(--card); border: 1px solid var(--border); }
.bubble .when { display: block; color: var(--muted); font-size: .68rem; margin-top: .2rem; }
.chat-compose {
  display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--border);
}
.chat-compose input { flex: 1; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border); background: var(--card); }
.send-btn {
  width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; cursor: pointer;
}

.me-scroll { padding: 12px 14px 32px; max-width: 640px; margin: 0 auto; }
.me-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.me-photos .shot {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--card);
}
.me-photos img { width: 100%; height: 100%; object-fit: cover; }
.me-photos .x {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; cursor: pointer;
}
.photo-upload-btn { display: block; text-align: center; margin: 8px 0; }
.me-form h3 { margin: 1.2rem 0 .5rem; font-size: .95rem; }
.me-form label { display: block; font-size: .8rem; color: var(--muted); margin: .55rem 0; }
.me-form input, .me-form select, .me-form textarea {
  display: block; width: 100%; margin-top: 4px;
  padding: .7rem .8rem; border-radius: 10px;
  border: 1px solid var(--border); background: #0c0c10;
}
#btn-save-profile { width: 100%; margin-top: 1.4rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.opt-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}
.opt-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.sheet {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--border);
  padding: 12px 14px 20px;
  z-index: 1;
}
.sheet-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--card); color: var(--text); font-size: 1.2rem; cursor: pointer; z-index: 2;
}
.profile-body .hero {
  width: 100%; aspect-ratio: 3/4; max-height: 360px;
  object-fit: cover; border-radius: 12px; background: var(--card);
}
.profile-body .thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.profile-body .thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.profile-body .title { margin: 12px 0 4px; font-size: 1.25rem; font-weight: 700; }
.profile-body .meta { color: var(--muted); font-size: .85rem; }
.profile-body .bio { color: var(--muted); font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; margin-top: 8px; }
.profile-actions {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.profile-actions .btn-primary, .profile-actions .btn-ghost { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px);
  transform: translateX(-50%);
  z-index: 80;
  background: #1c1c24;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
  max-width: min(420px, 92vw);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.toast.ok { border-color: rgba(61,214,140,.4); color: var(--ok); }
.toast.err { border-color: rgba(255,92,92,.45); color: var(--danger); }
.toast.warn { border-color: rgba(255,193,77,.4); color: var(--warn); }
